X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fprotocol.c;h=3b81d7a24be6798cde4451de0d2e32a1a5a61698;hp=cdf5a31c0852047af84d3b5cebe6618a19a3cedb;hb=de09916eadd4c558937d1a6367f5319ca26ed07c;hpb=9d023b1f2e7750f4a0e506c0f61498a44c0b95a8 diff --git a/src/protocol.c b/src/protocol.c index cdf5a31c..3b81d7a2 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -70,9 +70,10 @@ cp buflen = snprintf(buffer, MAXBUFSIZE, "%d %lx\n", TERMREQ, myself->vpn_ip); - if((write(cl->meta_socket, buffer, buflen)) < 0) + if(write(cl->meta_socket, buffer, buflen) < 0) { - syslog(LOG_ERR, "send failed: %s:%d: %m", __FILE__, __LINE__); + if(debug_lvl > 1) + syslog(LOG_ERR, "send failed: %s:%d: %m", __FILE__, __LINE__); return -1; } cp @@ -400,7 +401,8 @@ cp int passphrase_h(conn_list_t *cl) { cp - cl->pp=xmalloc(sizeof(*(cl->pp))); + cl->pp = xmalloc(sizeof(*(cl->pp))); + if(sscanf(cl->buffer, "%*d %as", &(cl->pp->phrase)) != 1) { syslog(LOG_ERR, "got bad PASSPHRASE request: %s", cl->buffer);