|
Lines 38-43
Link Here
|
| 38 |
|
38 |
|
| 39 |
extern Options options; |
39 |
extern Options options; |
| 40 |
extern char *__progname; |
40 |
extern char *__progname; |
|
|
41 |
extern pid_t proxy_command_pid; |
| 41 |
|
42 |
|
| 42 |
#ifndef INET6_ADDRSTRLEN /* for non IPv6 machines */ |
43 |
#ifndef INET6_ADDRSTRLEN /* for non IPv6 machines */ |
| 43 |
#define INET6_ADDRSTRLEN 46 |
44 |
#define INET6_ADDRSTRLEN 46 |
|
Lines 84-89
Link Here
|
| 84 |
/* Build the final command string in the buffer by making the |
85 |
/* Build the final command string in the buffer by making the |
| 85 |
appropriate substitutions to the given proxy command. */ |
86 |
appropriate substitutions to the given proxy command. */ |
| 86 |
buffer_init(&command); |
87 |
buffer_init(&command); |
|
|
88 |
|
| 89 |
/* have shell exec proxy command to prevent extra sh -c processes |
| 90 |
on some platforms (eg Solaris) */ |
| 91 |
buffer_append(&command, "exec ", 5); |
| 92 |
|
| 87 |
for (cp = proxy_command; *cp; cp++) { |
93 |
for (cp = proxy_command; *cp; cp++) { |
| 88 |
if (cp[0] == '%' && cp[1] == '%') { |
94 |
if (cp[0] == '%' && cp[1] == '%') { |
| 89 |
buffer_append(&command, "%", 1); |
95 |
buffer_append(&command, "%", 1); |
|
Lines 150-155
Link Here
|
| 150 |
/* Parent. */ |
156 |
/* Parent. */ |
| 151 |
if (pid < 0) |
157 |
if (pid < 0) |
| 152 |
fatal("fork failed: %.100s", strerror(errno)); |
158 |
fatal("fork failed: %.100s", strerror(errno)); |
|
|
159 |
else |
| 160 |
proxy_command_pid = pid; /* save pid to clean up later */ |
| 153 |
|
161 |
|
| 154 |
/* Close child side of the descriptors. */ |
162 |
/* Close child side of the descriptors. */ |
| 155 |
close(pin[0]); |
163 |
close(pin[0]); |