* 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
/* 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.
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]) {
);
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());
shell = pwd->pw_shell;
/* Exec login shell with no additional parameters. Never returns. */
- run_shell(shell, 1, NULL, NULL);
+ run_shell(shell, 1, NULL);
}