When exporting configuration files, don't copy Name variables.

These interfere with tincctl import. Besides, host configuration files should
not contain Name at all.
This commit is contained in:
Guus Sliepen 2012-07-16 18:49:39 +02:00
parent c52c46f871
commit 68de7b481e

View file

@ -1383,8 +1383,10 @@ static int export(const char *name, FILE *out) {
fprintf(out, "Name = %s\n", name); fprintf(out, "Name = %s\n", name);
char buf[4096]; char buf[4096];
while(fgets(buf, sizeof buf, in)) while(fgets(buf, sizeof buf, in)) {
fputs(buf, out); if(strcspn(buf, "\t =") != 4 || strncasecmp(buf, "Name", 4))
fputs(buf, out);
}
if(ferror(in)) { if(ferror(in)) {
fprintf(stderr, "Error while reading configuration file %s: %s\n", filename, strerror(errno)); fprintf(stderr, "Error while reading configuration file %s: %s\n", filename, strerror(errno));