From: Guus Sliepen Date: Tue, 20 Jul 2021 20:23:52 +0000 (+0200) Subject: Make tinc --batch --force join enable the tinc-up script. X-Git-Url: https://tinc-vpn.org/git/browse?a=commitdiff_plain;h=210aaecc8bf2cf300921a99e1e7bd9bd61cf8ecf;p=tinc 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. --- 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.