changeset 10528:9c88f2e713fc

6878610 ssh-agent needs a license to kill
author Huie-Ying Lee <Huie-Ying.Lee@Sun.COM>
date Mon, 14 Sep 2009 16:58:01 -0700
parents 239e78cbcf46
children 491ebcaf58d9
files usr/src/cmd/ssh/ssh-agent/ssh-agent.c
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/cmd/ssh/ssh-agent/ssh-agent.c	Mon Sep 14 16:49:06 2009 -0700
+++ b/usr/src/cmd/ssh/ssh-agent/ssh-agent.c	Mon Sep 14 16:58:01 2009 -0700
@@ -889,7 +889,17 @@
 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);