aboutsummaryrefslogtreecommitdiff
path: root/loginutils
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-10-31 17:34:44 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-10-31 17:34:44 +0000
commit6ae8079e2d66dd1328a32fba09e9ba6a6a79f0f9 (patch)
treea4e2c6524a05600038ce3e0b8526be8fb89af1ad /loginutils
parent3b8ff68ec874da01719af78dc46147d68d35c0ee (diff)
downloadbusybox-6ae8079e2d66dd1328a32fba09e9ba6a6a79f0f9.tar.gz
login: re-enable Ctrl-^C before execing shell.
Diffstat (limited to 'loginutils')
-rw-r--r--loginutils/login.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/loginutils/login.c b/loginutils/login.c
index 8003922f9..04283007b 100644
--- a/loginutils/login.c
+++ b/loginutils/login.c
@@ -342,6 +342,7 @@ auth_failed:
fchown(0, pw->pw_uid, pw->pw_gid);
fchmod(0, 0600);
+ /* TODO: be nommu-friendly, use spawn? */
if (ENABLE_LOGIN_SCRIPTS) {
char *script = getenv("LOGIN_PRE_SUID_SCRIPT");
if (script) {
@@ -370,7 +371,6 @@ auth_failed:
setup_environment(tmp, 1, !(opt & LOGIN_OPT_p), pw);
motd();
- signal(SIGALRM, SIG_DFL); /* default alarm signal */
if (pw->pw_uid == 0)
syslog(LOG_INFO, "root login%s", fromhost);
@@ -379,7 +379,17 @@ auth_failed:
* but let's play the game for now */
set_current_security_context(user_sid);
#endif
- run_shell(tmp, 1, 0, 0); /* exec the shell finally. */
+
+ // util-linux login also does:
+ // /* start new session */
+ // setsid();
+ // /* TIOCSCTTY: steal tty from other process group */
+ // if (ioctl(0, TIOCSCTTY, 1)) error_msg...
+
+ signal(SIGALRM, SIG_DFL); /* set signals to defaults */
+ signal(SIGINT, SIG_DFL);
+
+ run_shell(tmp, 1, 0, 0); /* exec the shell finally */
return EXIT_FAILURE;
}