From: Guus Sliepen Date: Mon, 16 Jul 2012 16:49:39 +0000 (+0200) Subject: When exporting configuration files, don't copy Name variables. X-Git-Tag: import-tinc-1.1~352 X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=68de7b481e54d6a7c573d9a2d61f76d4d3a6b2f9;p=meshlink When exporting configuration files, don't copy Name variables. These interfere with tincctl import. Besides, host configuration files should not contain Name at all. --- diff --git a/src/tincctl.c b/src/tincctl.c index 057ff7c9..b977d137 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -1383,8 +1383,10 @@ static int export(const char *name, FILE *out) { fprintf(out, "Name = %s\n", name); char buf[4096]; - while(fgets(buf, sizeof buf, in)) - fputs(buf, out); + while(fgets(buf, sizeof buf, in)) { + if(strcspn(buf, "\t =") != 4 || strncasecmp(buf, "Name", 4)) + fputs(buf, out); + } if(ferror(in)) { fprintf(stderr, "Error while reading configuration file %s: %s\n", filename, strerror(errno));