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:
parent
c52c46f871
commit
68de7b481e
1 changed files with 4 additions and 2 deletions
|
@ -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));
|
||||||
|
|
Loading…
Reference in a new issue