]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
su: be sensitive to another SIGCHLD ssi_codes
authorKarel Zak <kzak@redhat.com>
Wed, 6 Mar 2019 11:02:30 +0000 (12:02 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 2 Apr 2019 10:57:52 +0000 (12:57 +0200)
See the same issue for script: 27afe5016842c22d256ea9f88b598d637ca0df84

Signed-off-by: Karel Zak <kzak@redhat.com>
login-utils/su-common.c

index e0604e246d8f4a7ca72415ee2275b602f08f2d27..459e5c0aea79a7bf7266afc96b7c661f75167bac 100644 (file)
@@ -438,7 +438,10 @@ static int pty_handle_signal(struct su_context *su, int fd)
 
                /* The child terminated or stopped. Note that we ignore SIGCONT
                 * here, because stop/cont semantic is handled by wait_for_child() */
-               if (info.ssi_code == CLD_EXITED || info.ssi_status == SIGSTOP)
+               if (info.ssi_code == CLD_EXITED
+                   || info.ssi_code == CLD_KILLED
+                   || info.ssi_code == CLD_DUMPED
+                   || info.ssi_status == SIGSTOP)
                        wait_for_child(su);
                /* The child is dead, force poll() timeout. */
                if (su->child == (pid_t) -1)