diff options
author | Huie-Ying Lee <Huie-Ying.Lee@Sun.COM> | 2009-09-14 16:58:01 -0700 |
---|---|---|
committer | Huie-Ying Lee <Huie-Ying.Lee@Sun.COM> | 2009-09-14 16:58:01 -0700 |
commit | 2c0729151936ea8fe752509182c201a5242e9a98 (patch) | |
tree | e1e9ddcfa86c9188554d22ec32b8f96f60ed12b8 /usr/src/cmd/ssh/ssh-agent/ssh-agent.c | |
parent | 525b85dbd2fc64df4bd0092c1a2b0827dd8e1e89 (diff) | |
download | illumos-joyent-2c0729151936ea8fe752509182c201a5242e9a98.tar.gz |
6878610 ssh-agent needs a license to kill
Diffstat (limited to 'usr/src/cmd/ssh/ssh-agent/ssh-agent.c')
-rw-r--r-- | usr/src/cmd/ssh/ssh-agent/ssh-agent.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/usr/src/cmd/ssh/ssh-agent/ssh-agent.c b/usr/src/cmd/ssh/ssh-agent/ssh-agent.c index 3d2ea9732c..1ac5f4030d 100644 --- a/usr/src/cmd/ssh/ssh-agent/ssh-agent.c +++ b/usr/src/cmd/ssh/ssh-agent/ssh-agent.c @@ -889,7 +889,17 @@ cleanup_handler(int sig) static void check_parent_exists(void) { +#ifdef HAVE_SOLARIS_PRIVILEGE + /* + * We can not simply use "kill(ppid, 0) < 0" to detect if the parent + * has exited when the child process no longer has the + * PRIV_PROC_SESSION privilege. + */ + if (parent_pid != -1 && getppid() != parent_pid) { +#else if (parent_pid != -1 && kill(parent_pid, 0) < 0) { + +#endif /* printf("Parent has died - Authentication agent exiting.\n"); */ cleanup_socket(); _exit(2); |