diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-10-31 20:34:44 +0300 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-10-31 20:34:44 +0300 |
commit | 6ae8079e2d66dd1328a32fba09e9ba6a6a79f0f9 (patch) | |
tree | a4e2c6524a05600038ce3e0b8526be8fb89af1ad /loginutils/login.c | |
parent | 3b8ff68ec874da01719af78dc46147d68d35c0ee (diff) |
login: re-enable Ctrl-^C before execing shell.
Diffstat (limited to 'loginutils/login.c')
-rw-r--r-- | loginutils/login.c | 14 |
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; } |