extern char *bind_address;
extern int default_af_hint;
-#if defined HAVE_SIGACTION && defined HAVE_SIGPROCMASK
+#ifdef HAVE_SIGACTION
static struct sigaction sigact;
#endif
proxy_user, ":", proxy_pass, NULL);
len = strlen(buffer);
- if ((len*8 + 5) / 6 >= (int)sizeof authbuf) {
+ if ((len*8 + 5) / 6 >= (int)sizeof authbuf - 3) {
rprintf(FERROR,
"authentication information is too long\n");
return -1;
}
- base64_encode(buffer, len, authbuf);
+ base64_encode(buffer, len, authbuf, 1);
authhdr = "\r\nProxy-Authorization: Basic ";
} else {
*authbuf = '\0';
#ifdef WNOHANG
while (waitpid(-1, NULL, WNOHANG) > 0) {}
#endif
-#if !defined HAVE_SIGACTION && !defined HAVE_SIGPROCMASK
+#ifndef HAVE_SIGACTION
signal(SIGCHLD, sigchld_handler);
#endif
}
fd_set deffds;
int *sp, maxfd, i;
-#if defined HAVE_SIGACTION && defined HAVE_SIGPROCMASK
+#ifdef HAVE_SIGACTION
sigact.sa_flags = SA_NOCLDSTOP;
#endif