diff options
Diffstat (limited to 'loginutils/sulogin.c')
-rw-r--r-- | loginutils/sulogin.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/loginutils/sulogin.c b/loginutils/sulogin.c index caa1a83..17bb15e 100644 --- a/loginutils/sulogin.c +++ b/loginutils/sulogin.c @@ -19,7 +19,6 @@ int sulogin_main(int argc ATTRIBUTE_UNUSED, char **argv) { char *cp; int timeout = 0; - char *timeout_arg; struct passwd *pwd; const char *shell; #if ENABLE_FEATURE_SHADOWPASSWDS @@ -31,9 +30,8 @@ int sulogin_main(int argc ATTRIBUTE_UNUSED, char **argv) logmode = LOGMODE_BOTH; openlog(applet_name, 0, LOG_AUTH); - if (getopt32(argv, "t:", &timeout_arg)) { - timeout = xatoi_u(timeout_arg); - } + opt_complementary = "t+"; /* -t N */ + getopt32(argv, "t:", &timeout); if (argv[optind]) { close(0); @@ -43,6 +41,7 @@ int sulogin_main(int argc ATTRIBUTE_UNUSED, char **argv) dup(0); } + /* Malicious use like "sulogin /dev/sda"? */ if (!isatty(0) || !isatty(1) || !isatty(2)) { logmode = LOGMODE_SYSLOG; bb_error_msg_and_die("not a tty"); |