X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/660c6fbdaa31605abedddeea5fa5109d2734f2dc..e1bd49d6f3f7a5793cc9cd06d57498ce976f81e0:/socket.c diff --git a/socket.c b/socket.c index dd6613ae..ad208ef5 100644 --- a/socket.c +++ b/socket.c @@ -32,7 +32,7 @@ static int establish_proxy_connection(int fd, char *host, int port) char buffer[1024]; char *cp; - slprintf(buffer, sizeof(buffer), "CONNECT %s:%d HTTP/1.0\r\n\r\n", host, port); + snprintf(buffer, sizeof(buffer), "CONNECT %s:%d HTTP/1.0\r\n\r\n", host, port); if (write(fd, buffer, strlen(buffer)) != strlen(buffer)) { rprintf(FERROR, "failed to write to proxy: %s\n", strerror(errno)); @@ -210,6 +210,10 @@ static int open_socket_in(int type, int port, struct in_addr *address) if (bind(res, (struct sockaddr * ) &sock,sizeof(sock)) == -1) { rprintf(FERROR,"bind failed on port %d: %s\n", port, strerror(errno)); + if (errno == EACCES && port < 1024) { + rprintf(FERROR, "Note: you must be root to bind " + "to low-numbered ports"); + } close(res); return -1; }