Bugzilla – Attachment 103 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]
Kill ProxyCommand child process
openssh-proxycommand.patch (text/plain), 1.96 KB, created by
Darren Tucker
on 2002-05-23 20:02:42 AEST
(
hide
)
Description:
Kill ProxyCommand child process
Filename:
MIME Type:
Creator:
Darren Tucker
Created:
2002-05-23 20:02:42 AEST
Size:
1.96 KB
patch
obsolete
>Index: ssh.c >=================================================================== >RCS file: /cvs/openssh/ssh.c,v >retrieving revision 1.145 >diff -u -r1.145 ssh.c >--- ssh.c 23 Apr 2002 11:09:46 -0000 1.145 >+++ ssh.c 23 May 2002 09:51:17 -0000 >@@ -149,6 +149,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 >@@ -786,6 +789,14 @@ > > exit_status = compat20 ? ssh_session2() : ssh_session(); > packet_close(); >+ >+ /* Send TERM signal proxy command if used */ >+ if (proxy_command_pid) { >+ debug("Killing ProxyCommand pid:%d", (int)proxy_command_pid); >+ if (kill(proxy_command_pid, SIGTERM)) >+ waitpid(proxy_command_pid, &i, WNOHANG); >+ } >+ > return exit_status; > } > >Index: sshconnect.c >=================================================================== >RCS file: /cvs/openssh/sshconnect.c,v >retrieving revision 1.85 >diff -u -r1.85 sshconnect.c >--- sshconnect.c 5 Mar 2002 18:59:46 -0000 1.85 >+++ sshconnect.c 23 May 2002 09:51:19 -0000 >@@ -38,6 +38,7 @@ > > extern Options options; > extern char *__progname; >+extern pid_t proxy_command_pid; > > #ifndef INET6_ADDRSTRLEN /* for non IPv6 machines */ > #define INET6_ADDRSTRLEN 46 >@@ -84,6 +85,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); >@@ -150,6 +156,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