Bugzilla – Attachment 146 Details for
Bug 223
ProxyCommand commands don't exit
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Send HUP to proxycommand on exit.
proxycommand.patch (text/plain), 1.96 KB, created by
Darren Tucker
on 2002-09-13 15:38:34 AEST
(
hide
)
Description:
Send HUP to proxycommand on exit.
Filename:
MIME Type:
Creator:
Darren Tucker
Created:
2002-09-13 15:38:34 AEST
Size:
1.96 KB
patch
obsolete
>Index: ssh.c >=================================================================== >RCS file: /cvs/openssh/ssh.c,v >retrieving revision 1.161 >diff -u -r1.161 ssh.c >--- ssh.c 11 Sep 2002 23:52:47 -0000 1.161 >+++ ssh.c 13 Sep 2002 01:16:13 -0000 >@@ -146,6 +146,9 @@ > /* # of replies received for global requests */ > static int client_global_request_id = 0; > >+/* pid of proxycommand child process */ >+pid_t proxy_command_pid = 0; >+ > /* Prints a help message to the user. This function never returns. */ > > static void >@@ -722,6 +725,12 @@ > > exit_status = compat20 ? ssh_session2() : ssh_session(); > packet_close(); >+ >+ /* Send SIGHUP to proxy command if used. We don't wait() in case it hangs >+ * and instead rely on init to reap the child */ >+ if (proxy_command_pid) >+ kill(proxy_command_pid, SIGHUP); >+ > return exit_status; > } > >Index: sshconnect.c >=================================================================== >RCS file: /cvs/openssh/sshconnect.c,v >retrieving revision 1.99 >diff -u -r1.99 sshconnect.c >--- sshconnect.c 1 Aug 2002 01:26:30 -0000 1.99 >+++ sshconnect.c 13 Sep 2002 01:16:14 -0000 >@@ -41,6 +41,7 @@ > extern char *__progname; > extern uid_t original_real_uid; > extern uid_t original_effective_uid; >+extern pid_t proxy_command_pid; > > #ifndef INET6_ADDRSTRLEN /* for non IPv6 machines */ > #define INET6_ADDRSTRLEN 46 >@@ -67,6 +68,11 @@ > /* Build the final command string in the buffer by making the > appropriate substitutions to the given proxy command. */ > buffer_init(&command); >+ >+ /* have shell exec proxy command to prevent extra sh -c processes >+ on some platforms (eg Solaris) */ >+ buffer_append(&command, "exec ", 5); >+ > for (cp = proxy_command; *cp; cp++) { > if (cp[0] == '%' && cp[1] == '%') { > buffer_append(&command, "%", 1); >@@ -134,6 +140,8 @@ > /* Parent. */ > if (pid < 0) > fatal("fork failed: %.100s", strerror(errno)); >+ else >+ proxy_command_pid = pid; /* save pid to clean up later */ > > /* Close child side of the descriptors. */ > close(pin[0]);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 223
:
103
|
104
| 146