]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
su: don't use kill(0, ...) when propagate signal
authorKarel Zak <kzak@redhat.com>
Mon, 17 Feb 2014 12:22:30 +0000 (13:22 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 17 Feb 2014 12:22:30 +0000 (13:22 +0100)
The current code uses kill(0, caught_signal) after regular
signal cleanup and before exit (all just to make shells happy).

Unfortunately, kill(0, ...) is a bad idea. It seems better to use
kill(getpid(), ...) otherwise we kill our parent process too.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1063887
Signed-off-by: Karel Zak <kzak@redhat.com>
login-utils/su-common.c

index 7fd2792fd655c317037bd47862bc0548a6d60b7a..2766a6033dfcd62f8a06a28e2b7226f48d31a8e6 100644 (file)
@@ -415,7 +415,7 @@ create_watching_parent (void)
           caught_signal = SIGKILL;
           break;
       }
-      kill(0, caught_signal);
+      kill(getpid(), caught_signal);
     }
   exit (status);
 }