X-Git-Url: http://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Ftincctl.c;h=676ecec6976cded284496ad3214e3c100dee5438;hb=e994222a4370621a9ac69c13ed23531c1eaa6809;hp=5144b793265e08ebde34af6975d691b733238f30;hpb=c5373d9fc0c8e3dfb6529b35bf44efe58410e0c7;p=tinc diff --git a/src/tincctl.c b/src/tincctl.c index 5144b793..676ecec6 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -44,6 +44,7 @@ #include "sandbox.h" #include "pidfile.h" #include "console.h" +#include "fs.h" #ifndef MSG_NOSIGNAL #define MSG_NOSIGNAL 0 @@ -1676,7 +1677,7 @@ const var_t variables[] = { {"DeviceType", VAR_SERVER}, {"DirectOnly", VAR_SERVER | VAR_SAFE}, {"Ed25519PrivateKeyFile", VAR_SERVER}, - {"ExperimentalProtocol", VAR_SERVER}, + {"ExperimentalProtocol", VAR_SERVER | VAR_OBSOLETE}, {"Forwarding", VAR_SERVER}, {"FWMark", VAR_SERVER}, {"GraphDumpFile", VAR_SERVER | VAR_OBSOLETE}, @@ -2234,19 +2235,8 @@ static int cmd_init(int argc, char *argv[]) { return 1; } - if(!confbase_given && mkdir(confdir, 0755) && errno != EEXIST) { - fprintf(stderr, "Could not create directory %s: %s\n", confdir, strerror(errno)); - return 1; - } - - if(mkdir(confbase, 0777) && errno != EEXIST) { - fprintf(stderr, "Could not create directory %s: %s\n", confbase, strerror(errno)); - return 1; - } - - if(mkdir(hosts_dir, 0777) && errno != EEXIST) { - fprintf(stderr, "Could not create directory %s: %s\n", hosts_dir, strerror(errno)); - return 1; + if(!makedirs(DIR_HOSTS | DIR_CONFBASE | DIR_CONFDIR | DIR_CACHE)) { + return false; } FILE *f = fopen(tinc_conf, "w"); @@ -2545,7 +2535,7 @@ static int cmd_export_all(int argc, char *argv[]) { if(first) { first = false; } else { - printf("#---------------------------------------------------------------#\n"); + printf("\n#---------------------------------------------------------------#\n"); } result |= export(ent->d_name, stdout);