From 210aaecc8bf2cf300921a99e1e7bd9bd61cf8ecf Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Tue, 20 Jul 2021 22:23:52 +0200 Subject: [PATCH] Make tinc --batch --force join enable the tinc-up script. The expected behavior of --batch --force is that all parameters in the invitation are accepted, whether unsafe or not. Unsafe variables were already accepted with --force in commit 061362d2f, this commit ensures the generated tinc-up script is enabled as well. Fixes #196 on GitHub. --- src/invitation.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/invitation.c b/src/invitation.c index 30d100d9..2f28aef4 100644 --- a/src/invitation.c +++ b/src/invitation.c @@ -1054,7 +1054,13 @@ ask_netname: } } } else { - fprintf(stderr, "A tinc-up script was generated, but has been left disabled.\n"); + if(force) { + rename(filename, filename2); + chmod(filename2, 0755); + fprintf(stderr, "tinc-up enabled.\n"); + } else { + fprintf(stderr, "A tinc-up script was generated, but has been left disabled.\n"); + } } } else { // A placeholder was generated. -- 2.20.1