}
// If a daemon is running, ensure no other nodes know about this name
- bool found = false;
if(connect_tincd(false)) {
+ bool found = false;
sendline(fd, "%d %d", CONTROL, REQ_DUMP_NODES);
while(recvline(fd, line, sizeof line)) {
return false;
}
+ snprintf(filename, sizeof filename, "%s" SLASH "invitation-data", confbase);
+ FILE *finv = fopen(filename, "w");
+ if(!finv || fwrite(data, datalen, 1, finv) != 1) {
+ fprintf(stderr, "Could not create file %s: %s\n", filename, strerror(errno));
+ fclose(fh);
+ fclose(f);
+ fclose(finv);
+ return false;
+ }
+ fclose(finv);
+
snprintf(filename, sizeof filename, "%s" SLASH "tinc-up.invitation", confbase);
FILE *fup = fopen(filename, "w");
if(!fup) {
}
// Copy the safe variable to the right config file
- fprintf(variables[i].type & VAR_HOST ? fh : f, "%s = %s\n", l, value);
+ fprintf((variables[i].type & VAR_HOST) ? fh : f, "%s = %s\n", l, value);
}
fclose(f);