From: Todd C. Miller Date: Wed, 8 Mar 2017 16:17:53 +0000 (-0700) Subject: e_termination should be set to the value of WTERMSIG not WEXITSTATUS X-Git-Tag: SUDO_1_8_20^2~83 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=78f3f8bb9df0a42ff4dbea054acacec82d5be60b;p=sudo e_termination should be set to the value of WTERMSIG not WEXITSTATUS --- diff --git a/src/utmp.c b/src/utmp.c index a372a9411..12366b6c2 100644 --- a/src/utmp.c +++ b/src/utmp.c @@ -219,8 +219,8 @@ utmp_logout(const char *line, int status) ut->ut_type = DEAD_PROCESS; # endif # if defined(HAVE_STRUCT_UTMPX_UT_EXIT) || defined(HAVE_STRUCT_UTMP_UT_EXIT) - ut->ut_exit.__e_exit = WEXITSTATUS(status); - ut->ut_exit.__e_termination = WIFEXITED(status) ? WEXITSTATUS(status) : 0; + ut->ut_exit.__e_termination = WIFSIGNALED(status) ? WTERMSIG(status) : 0; + ut->ut_exit.__e_exit = WIFEXITED(status) ? WEXITSTATUS(status) : 0; # endif utmp_settime(ut); if (pututxline(ut) != NULL)