version 1.178, 2006/03/20 18:42:27 |
version 1.179, 2006/03/25 00:05:41 |
|
|
int pin[2], pout[2]; |
int pin[2], pout[2]; |
pid_t pid; |
pid_t pid; |
char strport[NI_MAXSERV]; |
char strport[NI_MAXSERV]; |
size_t len; |
|
|
|
/* Convert the port number into a string. */ |
/* Convert the port number into a string. */ |
snprintf(strport, sizeof strport, "%hu", port); |
snprintf(strport, sizeof strport, "%hu", port); |
|
|
* Use "exec" to avoid "sh -c" processes on some platforms |
* Use "exec" to avoid "sh -c" processes on some platforms |
* (e.g. Solaris) |
* (e.g. Solaris) |
*/ |
*/ |
len = strlen(proxy_command) + 6; |
xasprintf(&tmp, "exec %s", proxy_command); |
tmp = xmalloc(len); |
|
strlcpy(tmp, "exec ", len); |
|
strlcat(tmp, proxy_command, len); |
|
command_string = percent_expand(tmp, "h", host, |
command_string = percent_expand(tmp, "h", host, |
"p", strport, (char *)NULL); |
"p", strport, (char *)NULL); |
xfree(tmp); |
xfree(tmp); |
|
|
fd_set *fdset; |
fd_set *fdset; |
struct timeval tv; |
struct timeval tv; |
socklen_t optlen; |
socklen_t optlen; |
int fdsetsz, optval, rc, result = -1; |
int optval, rc, result = -1; |
|
|
if (timeout <= 0) |
if (timeout <= 0) |
return (connect(sockfd, serv_addr, addrlen)); |
return (connect(sockfd, serv_addr, addrlen)); |
|
|
if (errno != EINPROGRESS) |
if (errno != EINPROGRESS) |
return (-1); |
return (-1); |
|
|
fdsetsz = howmany(sockfd + 1, NFDBITS) * sizeof(fd_mask); |
fdset = (fd_set *)xcalloc(howmany(sockfd + 1, NFDBITS), |
fdset = (fd_set *)xmalloc(fdsetsz); |
sizeof(fd_mask)); |
|
|
memset(fdset, 0, fdsetsz); |
|
FD_SET(sockfd, fdset); |
FD_SET(sockfd, fdset); |
tv.tv_sec = timeout; |
tv.tv_sec = timeout; |
tv.tv_usec = 0; |
tv.tv_usec = 0; |
|
|
return; |
return; |
} |
} |
size = roundup(strlen(password) + 1, 32); |
size = roundup(strlen(password) + 1, 32); |
padded = xmalloc(size); |
padded = xcalloc(1, size); |
memset(padded, 0, size); |
|
strlcpy(padded, password, size); |
strlcpy(padded, password, size); |
packet_put_string(padded, size); |
packet_put_string(padded, size); |
memset(padded, 0, size); |
memset(padded, 0, size); |