projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Warn if we cannot reload the tincd when creating an invitation.
[tinc]
/
src
/
invitation.c
diff --git
a/src/invitation.c
b/src/invitation.c
index
d6f00a5
..
c059ca3
100644
(file)
--- a/
src/invitation.c
+++ b/
src/invitation.c
@@
-414,8
+414,10
@@
int cmd_invite(int argc, char *argv[]) {
fclose(f);
fclose(f);
- if(connect_tincd(
fals
e)) {
+ if(connect_tincd(
tru
e)) {
sendline(fd, "%d %d", CONTROL, REQ_RELOAD);
sendline(fd, "%d %d", CONTROL, REQ_RELOAD);
+ } else {
+ fprintf(stderr, "Could not signal the tinc daemon. Please restart or reload it manually.\n");
}
} else {
key = ecdsa_read_pem_private_key(f);
}
} else {
key = ecdsa_read_pem_private_key(f);
@@
-769,13
+771,19
@@
make_names:
l[len] = 0;
l[len] = 0;
+ // Ignore lines with empty variable names
+ if(!*l) {
+ continue;
+ }
+
// Is it a Name?
// Is it a Name?
- if(!strcasecmp(l, "Name"))
+ if(!strcasecmp(l, "Name"))
{
if(strcmp(value, name)) {
break;
} else {
continue;
if(strcmp(value, name)) {
break;
} else {
continue;
- } else if(!strcasecmp(l, "NetName")) {
+ }
+ } else if(!strcasecmp(l, "NetName")) {
continue;
}
continue;
}
@@
-1059,7
+1067,7
@@
static bool invitation_receive(void *handle, uint8_t type, const void *msg, uint
return finalize_join();
case 2:
return finalize_join();
case 2:
- fprintf(stderr, "Invitation succesfully accepted.\n");
+ fprintf(stderr, "Invitation succes
s
fully accepted.\n");
shutdown(sock, SHUT_RDWR);
success = true;
break;
shutdown(sock, SHUT_RDWR);
success = true;
break;
@@
-1195,6
+1203,7
@@
next:
aip = aip->ai_next;
if(!aip) {
aip = aip->ai_next;
if(!aip) {
+ freeaddrinfo(ai);
return 1;
}
}
return 1;
}
}
@@
-1240,6
+1249,8
@@
next:
goto next;
}
goto next;
}
+ freeaddrinfo(ai);
+
// Check if the hash of the key he gave us matches the hash in the URL.
char *fingerprint = line + 2;
char hishash[64];
// Check if the hash of the key he gave us matches the hash in the URL.
char *fingerprint = line + 2;
char hishash[64];