[git commit] sulogin: set ^C to SIG_DFL before execing the shell
Denys Vlasenko
vda.linux at googlemail.com
Fri Jul 18 05:29:24 UTC 2025
commit: https://git.busybox.net/busybox/commit/?id=504f44436f2a3903d9a71185c4e5bc62d923a8fb
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master
function old new delta
sulogin_main 331 340 +9
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
loginutils/sulogin.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/loginutils/sulogin.c b/loginutils/sulogin.c
index 9c927ed79..984889915 100644
--- a/loginutils/sulogin.c
+++ b/loginutils/sulogin.c
@@ -79,7 +79,7 @@ int sulogin_main(int argc UNUSED_PARAM, char **argv)
break;
}
pause_after_failed_login();
- bb_simple_info_msg("Login incorrect");
+ bb_simple_error_msg("Login incorrect");
}
/* util-linux 2.36.1 compat: no message */
@@ -119,9 +119,12 @@ int sulogin_main(int argc UNUSED_PARAM, char **argv)
}
/*
- * Note: login does this (should we do it too?):
+ * Note: login does this. util-linux's sulogin does NOT.
+ * But it's rather unpleasant to have non-functioning ^C in a shell,
+ * and surprisingly, there is no easy way to remove SIG_IGN from ^C
+ * in the shell. So, we are doing it:
*/
- /*signal(SIGINT, SIG_DFL);*/
+ signal(SIGINT, SIG_DFL);
/* Exec shell with no additional parameters. Never returns. */
exec_shell(shell, /* -p? then shell is login:*/(opts & 1), NULL);
More information about the busybox-cvs
mailing list