Permalink
Browse files

su: don't use kill(0, ...) when propagate signal

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>
  • Loading branch information...
1 parent 5980048 commit 270ab78a0c84a0d580d3dfa257813abbba385687 @karelzak committed Feb 17, 2014
Showing with 1 addition and 1 deletion.
  1. +1 −1 login-utils/su-common.c
View
2 login-utils/su-common.c
@@ -415,7 +415,7 @@ create_watching_parent (void)
caught_signal = SIGKILL;
break;
}
- kill(0, caught_signal);
+ kill(getpid(), caught_signal);
}
exit (status);
}

0 comments on commit 270ab78

Please sign in to comment.