if (*cp == '\r')
*cp = '\0';
if (strncmp(buffer, "HTTP/", 5) != 0) {
- rprintf(FERROR, "bad response from proxy - %s\n",
+ rprintf(FERROR, "bad response from proxy -- %s\n",
buffer);
return -1;
}
while (*cp == ' ')
cp++;
if (*cp != '2') {
- rprintf(FERROR, "bad response from proxy - %s\n",
+ rprintf(FERROR, "bad response from proxy -- %s\n",
buffer);
return -1;
}
strlcpy(buffer, h, sizeof buffer);
/* Is the USER:PASS@ prefix present? */
- if ((cp = strchr(buffer, '@')) != NULL) {
+ if ((cp = strrchr(buffer, '@')) != NULL) {
*cp++ = '\0';
/* The remainder is the HOST:PORT part. */
h = cp;
int ret;
for (i = 0; sp[i] >= 0; i++)
close(sp[i]);
- /* open log file in child before possibly giving
- * up privileges */
+ /* Re-open log file in child before possibly giving
+ * up privileges (see log_close() above). */
log_open();
ret = fn(fd, fd);
close_all();
close(fd);
}
}
- free(sp);
}
case OPT_ON:
if (got_value)
- rprintf(FERROR,"syntax error - %s does not take a value\n",tok);
+ rprintf(FERROR,"syntax error -- %s does not take a value\n",tok);
{
int on = socket_options[i].value;
/* detach from the terminal */
#ifdef HAVE_SETSID
setsid();
-#else
-#ifdef TIOCNOTTY
+#elif defined TIOCNOTTY
i = open("/dev/tty", O_RDWR);
if (i >= 0) {
ioctl(i, (int)TIOCNOTTY, (char *)0);
close(i);
}
-#endif /* TIOCNOTTY */
#endif
/* make sure that stdin, stdout an stderr don't stuff things
* up (library functions, for example) */
goto failed;
memset(&sock2, 0, sizeof sock2);
-#if HAVE_SOCKADDR_IN_LEN
+#ifdef HAVE_SOCKADDR_IN_LEN
sock2.sin_len = sizeof sock2;
#endif
sock2.sin_family = PF_INET;