X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=loginutils%2Fsulogin.c;h=27ea5dff028b62a18b7adb46b8c04dff34f359b0;hb=3a4d5a73a876b0922afed095bc9f83dbdf07148e;hp=33f078ae75c7b586feb131b083ab218d2d22df78;hpb=32c08acba3d938ec2fa4f9d2ff8160bbe05a20cb;p=oweals%2Fbusybox.git diff --git a/loginutils/sulogin.c b/loginutils/sulogin.c index 33f078ae7..27ea5dff0 100644 --- a/loginutils/sulogin.c +++ b/loginutils/sulogin.c @@ -5,14 +5,14 @@ * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ //config:config SULOGIN -//config: bool "sulogin" +//config: bool "sulogin (17 kb)" //config: default y //config: select FEATURE_SYSLOG //config: help -//config: sulogin is invoked when the system goes into single user -//config: mode (this is done through an entry in inittab). +//config: sulogin is invoked when the system goes into single user +//config: mode (this is done through an entry in inittab). -//applet:IF_SULOGIN(APPLET(sulogin, BB_DIR_SBIN, BB_SUID_DROP)) +//applet:IF_SULOGIN(APPLET_NOEXEC(sulogin, sulogin, BB_DIR_SBIN, BB_SUID_DROP, sulogin)) //kbuild:lib-$(CONFIG_SULOGIN) += sulogin.o @@ -34,7 +34,7 @@ int sulogin_main(int argc UNUSED_PARAM, char **argv) /* Note: sulogin is not a suid app. It is meant to be run by init * for single user / emergency mode. init starts it as root. - * Normal users (potentially malisious ones) can only run it under + * Normal users (potentially malicious ones) can only run it under * their UID, therefore no paranoia here is warranted: * $LD_LIBRARY_PATH in env, TTY = /dev/sda * are no more dangerous here than in e.g. cp applet. @@ -43,8 +43,7 @@ int sulogin_main(int argc UNUSED_PARAM, char **argv) logmode = LOGMODE_BOTH; openlog(applet_name, 0, LOG_AUTH); - opt_complementary = "t+"; /* -t N */ - getopt32(argv, "t:", &timeout); + getopt32(argv, "t:+", &timeout); argv += optind; if (argv[0]) { @@ -69,17 +68,17 @@ int sulogin_main(int argc UNUSED_PARAM, char **argv) ); if (r < 0) { /* ^D, ^C, timeout, or read error */ - bb_info_msg("Normal startup"); + bb_error_msg("normal startup"); return 0; } if (r > 0) { break; } bb_do_delay(LOGIN_FAIL_DELAY); - bb_info_msg("Login incorrect"); + bb_error_msg("Login incorrect"); } - bb_info_msg("System Maintenance Mode"); + bb_error_msg("starting shell for system maintenance"); IF_SELINUX(renew_current_security_context()); @@ -90,5 +89,5 @@ int sulogin_main(int argc UNUSED_PARAM, char **argv) shell = pwd->pw_shell; /* Exec login shell with no additional parameters. Never returns. */ - run_shell(shell, 1, NULL, NULL); + run_shell(shell, 1, NULL); }