summaryrefslogtreecommitdiffstats
path: root/login-utils
diff options
context:
space:
mode:
Diffstat (limited to 'login-utils')
-rw-r--r--login-utils/sulogin.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/login-utils/sulogin.c b/login-utils/sulogin.c
index 78a01f432..5f09bd48e 100644
--- a/login-utils/sulogin.c
+++ b/login-utils/sulogin.c
@@ -976,7 +976,7 @@ int main(int argc, char **argv)
while (1) {
const char *passwd = pwd->pw_passwd;
const char *answer;
- int failed = 0, doshell = 0;
+ int doshell = 0;
int deny = !opt_e && locked_account_password(pwd->pw_passwd);
doprompt(passwd, con, deny);
@@ -999,15 +999,13 @@ int main(int argc, char **argv)
}
if (doshell) {
+ /* sushell() unmask signals */
sushell(pwd);
- failed++;
- }
- mask_signal(SIGQUIT, SIG_IGN, &saved_sigquit);
- mask_signal(SIGTSTP, SIG_IGN, &saved_sigtstp);
- mask_signal(SIGINT, SIG_IGN, &saved_sigint);
+ mask_signal(SIGQUIT, SIG_IGN, &saved_sigquit);
+ mask_signal(SIGTSTP, SIG_IGN, &saved_sigtstp);
+ mask_signal(SIGINT, SIG_IGN, &saved_sigint);
- if (failed) {
fprintf(stderr, _("cannot execute su shell\n\n"));
break;
}