Bugzilla – Attachment 317 Details for
Bug 241
When I kill scp, the underlying ssh child process remains alive
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
diff -u for the bug, as requested by djm
xbug (text/plain), 1.09 KB, created by
edo biagioni
on 2003-06-03 11:55:08 AEST
(
hide
)
Description:
diff -u for the bug, as requested by djm
Filename:
MIME Type:
Creator:
edo biagioni
Created:
2003-06-03 11:55:08 AEST
Size:
1.09 KB
patch
obsolete
>--- openssh-3.1p1/scp.c Tue Mar 5 08:59:45 2002 >+++ openssh-3.1p1x/scp.c Sat May 4 15:42:50 2002 >@@ -133,6 +133,10 @@ > /* This is the program to execute for the secured connection. ("ssh" or -S) */ > char *ssh_program = _PATH_SSH_PROGRAM; > >+/* esb: added the child PID so we can kill it if we get killed */ >+pid_t childpid; >+static void killchild(int signo); >+ > /* > * This function executes the given command as the specified user on the > * given host. This returns < 0 if execution fails, and >= 0 otherwise. This >@@ -167,7 +171,8 @@ > close(reserved[1]); > > /* For a child to execute the command on the remote host using ssh. */ >- if (fork() == 0) { >+ /* esb */ >+ if ((childpid = fork()) == 0) { > /* Child. */ > close(pin[1]); > close(pout[0]); >@@ -191,6 +196,8 @@ > *fdout = pin[1]; > close(pout[1]); > *fdin = pout[0]; >+ /* esb */ >+ (void) signal(SIGTERM, killchild); > return 0; > } > >@@ -1086,6 +1093,13 @@ > signal(SIGALRM, updateprogressmeter); > alarm(PROGRESSTIME); > errno = save_errno; >+} >+ >+static void >+killchild(int signo) >+{ >+ kill (childpid, signo); >+ _exit(1); > } > > static int
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 241
: 317