From 68de7b481e54d6a7c573d9a2d61f76d4d3a6b2f9 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Mon, 16 Jul 2012 18:49:39 +0200 Subject: [PATCH] When exporting configuration files, don't copy Name variables. These interfere with tincctl import. Besides, host configuration files should not contain Name at all. --- src/tincctl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tincctl.c b/src/tincctl.c index 057ff7c..b977d13 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)); -- 2.25.1