Bugzilla – Attachment 2045 Details for
Bug 1905
check_parent_exists() logic does not cover all cases
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for check_parent_exists which assumes orphaned processes get reparented to PID 1
check_parent_exists.diff (text/plain), 565 bytes, created by
Daniel Kahn Gillmor
on 2011-05-13 05:33:09 AEST
(
hide
)
Description:
patch for check_parent_exists which assumes orphaned processes get reparented to PID 1
Filename:
MIME Type:
Creator:
Daniel Kahn Gillmor
Created:
2011-05-13 05:33:09 AEST
Size:
565 bytes
patch
obsolete
>Index: ssh-agent.c >--- ssh-agent.c >+++ ssh-agent.c >@@ -964,7 +964,13 @@ > { > int save_errno = errno; > >- if (parent_pid != -1 && kill(parent_pid, 0) < 0) { >+ /* >+ * Don't just test whether kill(parent_pid,0) is successful, >+ * because it may fail with EPERM even if the process exists. >+ * If our parent has exited then getppid() will return (pid_t)1, >+ * so testing for that should be safe. >+ */ >+ if (parent_pid != -1 && getppid() != parent_pid) { > /* printf("Parent has died - Authentication agent exiting.\n"); */ > cleanup_handler(sig); /* safe */ > }
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
Flags:
djm
:
ok+
Actions:
View
|
Diff
Attachments on
bug 1905
: 2045