- rename SU_SYSLOG to FEATURE_SU_SYSLOG

This commit is contained in:
Bernhard Reutner-Fischer 2006-12-19 08:55:38 +00:00
parent 7f1dc21a5d
commit 359d7ca0e7
3 changed files with 10 additions and 9 deletions

View File

@ -161,7 +161,7 @@ config SU
Note that Busybox binary must be setuid root for this applet to Note that Busybox binary must be setuid root for this applet to
work properly. work properly.
config SU_SYSLOG config FEATURE_SU_SYSLOG
bool "Enable su to write to syslog" bool "Enable su to write to syslog"
default y default y
depends on SU depends on SU

View File

@ -8,6 +8,9 @@
#include "busybox.h" #include "busybox.h"
#include <syslog.h> #include <syslog.h>
#define SU_OPT_mp (3)
#define SU_OPT_l (4)
int su_main(int argc, char **argv) int su_main(int argc, char **argv)
{ {
unsigned flags; unsigned flags;
@ -22,8 +25,6 @@ int su_main(int argc, char **argv)
flags = getopt32(argc, argv, "mplc:s:", &opt_command, &opt_shell); flags = getopt32(argc, argv, "mplc:s:", &opt_command, &opt_shell);
argc -= optind; argc -= optind;
argv -= optind; argv -= optind;
#define SU_OPT_mp (3)
#define SU_OPT_l (4)
if (argc && LONE_DASH(argv[0])) { if (argc && LONE_DASH(argv[0])) {
flags |= SU_OPT_l; flags |= SU_OPT_l;
@ -38,7 +39,7 @@ int su_main(int argc, char **argv)
argv++; argv++;
} }
if (ENABLE_SU_SYSLOG) { if (ENABLE_FEATURE_SU_SYSLOG) {
/* The utmp entry (via getlogin) is probably the best way to identify /* The utmp entry (via getlogin) is probably the best way to identify
the user, especially if someone su's from a su-shell. the user, especially if someone su's from a su-shell.
But getlogin can fail -- usually due to lack of utmp entry. But getlogin can fail -- usually due to lack of utmp entry.
@ -59,17 +60,17 @@ int su_main(int argc, char **argv)
pw->pw_shell = (char *)DEFAULT_SHELL; pw->pw_shell = (char *)DEFAULT_SHELL;
if ((cur_uid == 0) || correct_password(pw)) { if ((cur_uid == 0) || correct_password(pw)) {
if (ENABLE_SU_SYSLOG) if (ENABLE_FEATURE_SU_SYSLOG)
syslog(LOG_NOTICE, "%c %s %s:%s", syslog(LOG_NOTICE, "%c %s %s:%s",
'+', tty, old_user, opt_username); '+', tty, old_user, opt_username);
} else { } else {
if (ENABLE_SU_SYSLOG) if (ENABLE_FEATURE_SU_SYSLOG)
syslog(LOG_NOTICE, "%c %s %s:%s", syslog(LOG_NOTICE, "%c %s %s:%s",
'-', tty, old_user, opt_username); '-', tty, old_user, opt_username);
bb_error_msg_and_die("incorrect password"); bb_error_msg_and_die("incorrect password");
} }
if (ENABLE_FEATURE_CLEAN_UP && ENABLE_SU_SYSLOG) { if (ENABLE_FEATURE_CLEAN_UP && ENABLE_FEATURE_SU_SYSLOG) {
closelog(); closelog();
free(old_user); free(old_user);
} }

View File

@ -340,7 +340,7 @@ CONFIG_LOGIN_SCRIPTS=y
CONFIG_FEATURE_SECURETTY=y CONFIG_FEATURE_SECURETTY=y
CONFIG_PASSWD=y CONFIG_PASSWD=y
CONFIG_SU=y CONFIG_SU=y
CONFIG_SU_SYSLOG=y CONFIG_FEATURE_SU_SYSLOG=y
CONFIG_SULOGIN=y CONFIG_SULOGIN=y
CONFIG_VLOCK=y CONFIG_VLOCK=y