|
Lines 41-46
Link Here
|
| 41 |
extern char *__progname; |
41 |
extern char *__progname; |
| 42 |
extern uid_t original_real_uid; |
42 |
extern uid_t original_real_uid; |
| 43 |
extern uid_t original_effective_uid; |
43 |
extern uid_t original_effective_uid; |
|
|
44 |
extern pid_t proxy_command_pid; |
| 44 |
|
45 |
|
| 45 |
#ifndef INET6_ADDRSTRLEN /* for non IPv6 machines */ |
46 |
#ifndef INET6_ADDRSTRLEN /* for non IPv6 machines */ |
| 46 |
#define INET6_ADDRSTRLEN 46 |
47 |
#define INET6_ADDRSTRLEN 46 |
|
Lines 67-72
Link Here
|
| 67 |
/* Build the final command string in the buffer by making the |
68 |
/* Build the final command string in the buffer by making the |
| 68 |
appropriate substitutions to the given proxy command. */ |
69 |
appropriate substitutions to the given proxy command. */ |
| 69 |
buffer_init(&command); |
70 |
buffer_init(&command); |
|
|
71 |
|
| 72 |
/* have shell exec proxy command to prevent extra sh -c processes |
| 73 |
on some platforms (eg Solaris) */ |
| 74 |
buffer_append(&command, "exec ", 5); |
| 75 |
|
| 70 |
for (cp = proxy_command; *cp; cp++) { |
76 |
for (cp = proxy_command; *cp; cp++) { |
| 71 |
if (cp[0] == '%' && cp[1] == '%') { |
77 |
if (cp[0] == '%' && cp[1] == '%') { |
| 72 |
buffer_append(&command, "%", 1); |
78 |
buffer_append(&command, "%", 1); |
|
Lines 134-139
Link Here
|
| 134 |
/* Parent. */ |
140 |
/* Parent. */ |
| 135 |
if (pid < 0) |
141 |
if (pid < 0) |
| 136 |
fatal("fork failed: %.100s", strerror(errno)); |
142 |
fatal("fork failed: %.100s", strerror(errno)); |
|
|
143 |
else |
| 144 |
proxy_command_pid = pid; /* save pid to clean up later */ |
| 137 |
|
145 |
|
| 138 |
/* Close child side of the descriptors. */ |
146 |
/* Close child side of the descriptors. */ |
| 139 |
close(pin[0]); |
147 |
close(pin[0]); |