aboutsummaryrefslogtreecommitdiff
path: root/loginutils
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2009-04-21 11:09:40 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2009-04-21 11:09:40 +0000
commit5e34ff29bcc870936ab18172f438a34d042d4e03 (patch)
treea5e7a528f2f916eb883f1161eadceacdf2dca4be /loginutils
parent8b814b4a349e2262c0ad25793b05206a14651ebb (diff)
downloadbusybox-w32-5e34ff29bcc870936ab18172f438a34d042d4e03.tar.gz
busybox-w32-5e34ff29bcc870936ab18172f438a34d042d4e03.tar.bz2
busybox-w32-5e34ff29bcc870936ab18172f438a34d042d4e03.zip
*: mass renaming of USE_XXXX to IF_XXXX
and SKIP_XXXX to IF_NOT_XXXX - the second one was especially badly named. It was not skipping anything!
Diffstat (limited to 'loginutils')
-rw-r--r--loginutils/chpasswd.c2
-rw-r--r--loginutils/login.c10
-rw-r--r--loginutils/su.c4
-rw-r--r--loginutils/sulogin.c2
4 files changed, 9 insertions, 9 deletions
diff --git a/loginutils/chpasswd.c b/loginutils/chpasswd.c
index 4bffbe83f..68b398068 100644
--- a/loginutils/chpasswd.c
+++ b/loginutils/chpasswd.c
@@ -29,7 +29,7 @@ int chpasswd_main(int argc UNUSED_PARAM, char **argv)
29 bb_error_msg_and_die(bb_msg_perm_denied_are_you_root); 29 bb_error_msg_and_die(bb_msg_perm_denied_are_you_root);
30 30
31 opt_complementary = "m--e:e--m"; 31 opt_complementary = "m--e:e--m";
32 USE_GETOPT_LONG(applet_long_options = chpasswd_longopts;) 32 IF_GETOPT_LONG(applet_long_options = chpasswd_longopts;)
33 opt = getopt32(argv, "em"); 33 opt = getopt32(argv, "em");
34 34
35 while ((name = xmalloc_fgetline(stdin)) != NULL) { 35 while ((name = xmalloc_fgetline(stdin)) != NULL) {
diff --git a/loginutils/login.c b/loginutils/login.c
index d57d529c0..31b25a43e 100644
--- a/loginutils/login.c
+++ b/loginutils/login.c
@@ -285,8 +285,8 @@ int login_main(int argc UNUSED_PARAM, char **argv)
285 char *opt_host = opt_host; /* for compiler */ 285 char *opt_host = opt_host; /* for compiler */
286 char *opt_user = opt_user; /* for compiler */ 286 char *opt_user = opt_user; /* for compiler */
287 char *full_tty; 287 char *full_tty;
288 USE_SELINUX(security_context_t user_sid = NULL;) 288 IF_SELINUX(security_context_t user_sid = NULL;)
289 USE_FEATURE_UTMP(struct utmp utent;) 289 IF_FEATURE_UTMP(struct utmp utent;)
290#if ENABLE_PAM 290#if ENABLE_PAM
291 int pamret; 291 int pamret;
292 pam_handle_t *pamh; 292 pam_handle_t *pamh;
@@ -333,7 +333,7 @@ int login_main(int argc UNUSED_PARAM, char **argv)
333 read_or_build_utent(&utent, run_by_root); 333 read_or_build_utent(&utent, run_by_root);
334 334
335 if (opt & LOGIN_OPT_h) { 335 if (opt & LOGIN_OPT_h) {
336 USE_FEATURE_UTMP(safe_strncpy(utent.ut_host, opt_host, sizeof(utent.ut_host));) 336 IF_FEATURE_UTMP(safe_strncpy(utent.ut_host, opt_host, sizeof(utent.ut_host));)
337 fromhost = xasprintf(" on '%s' from '%s'", short_tty, opt_host); 337 fromhost = xasprintf(" on '%s' from '%s'", short_tty, opt_host);
338 } else { 338 } else {
339 fromhost = xasprintf(" on '%s'", short_tty); 339 fromhost = xasprintf(" on '%s'", short_tty);
@@ -457,7 +457,7 @@ int login_main(int argc UNUSED_PARAM, char **argv)
457 457
458 write_utent(&utent, username); 458 write_utent(&utent, username);
459 459
460 USE_SELINUX(initselinux(username, full_tty, &user_sid)); 460 IF_SELINUX(initselinux(username, full_tty, &user_sid));
461 461
462 /* Try these, but don't complain if they fail. 462 /* Try these, but don't complain if they fail.
463 * _f_chown is safe wrt race t=ttyname(0);...;chown(t); */ 463 * _f_chown is safe wrt race t=ttyname(0);...;chown(t); */
@@ -482,7 +482,7 @@ int login_main(int argc UNUSED_PARAM, char **argv)
482 482
483 /* well, a simple setexeccon() here would do the job as well, 483 /* well, a simple setexeccon() here would do the job as well,
484 * but let's play the game for now */ 484 * but let's play the game for now */
485 USE_SELINUX(set_current_security_context(user_sid);) 485 IF_SELINUX(set_current_security_context(user_sid);)
486 486
487 // util-linux login also does: 487 // util-linux login also does:
488 // /* start new session */ 488 // /* start new session */
diff --git a/loginutils/su.c b/loginutils/su.c
index de8c18d25..a8b852b09 100644
--- a/loginutils/su.c
+++ b/loginutils/su.c
@@ -43,7 +43,7 @@ int su_main(int argc UNUSED_PARAM, char **argv)
43 the user, especially if someone su's from a su-shell. 43 the user, especially if someone su's from a su-shell.
44 But getlogin can fail -- usually due to lack of utmp entry. 44 But getlogin can fail -- usually due to lack of utmp entry.
45 in this case resort to getpwuid. */ 45 in this case resort to getpwuid. */
46 old_user = xstrdup(USE_FEATURE_UTMP(getlogin() ? : ) (pw = getpwuid(cur_uid)) ? pw->pw_name : ""); 46 old_user = xstrdup(IF_FEATURE_UTMP(getlogin() ? : ) (pw = getpwuid(cur_uid)) ? pw->pw_name : "");
47 tty = xmalloc_ttyname(2) ? : "none"; 47 tty = xmalloc_ttyname(2) ? : "none";
48 openlog(applet_name, 0, LOG_AUTH); 48 openlog(applet_name, 0, LOG_AUTH);
49 } 49 }
@@ -91,7 +91,7 @@ int su_main(int argc UNUSED_PARAM, char **argv)
91 change_identity(pw); 91 change_identity(pw);
92 /* setup_environment params: shell, clear_env, change_env, pw */ 92 /* setup_environment params: shell, clear_env, change_env, pw */
93 setup_environment(opt_shell, flags & SU_OPT_l, !(flags & SU_OPT_mp), pw); 93 setup_environment(opt_shell, flags & SU_OPT_l, !(flags & SU_OPT_mp), pw);
94 USE_SELINUX(set_current_security_context(NULL);) 94 IF_SELINUX(set_current_security_context(NULL);)
95 95
96 /* Never returns */ 96 /* Never returns */
97 run_shell(opt_shell, flags & SU_OPT_l, opt_command, (const char**)argv); 97 run_shell(opt_shell, flags & SU_OPT_l, opt_command, (const char**)argv);
diff --git a/loginutils/sulogin.c b/loginutils/sulogin.c
index 4ffefe933..77eff9f8d 100644
--- a/loginutils/sulogin.c
+++ b/loginutils/sulogin.c
@@ -99,7 +99,7 @@ int sulogin_main(int argc UNUSED_PARAM, char **argv)
99 99
100 bb_info_msg("System Maintenance Mode"); 100 bb_info_msg("System Maintenance Mode");
101 101
102 USE_SELINUX(renew_current_security_context()); 102 IF_SELINUX(renew_current_security_context());
103 103
104 shell = getenv("SUSHELL"); 104 shell = getenv("SUSHELL");
105 if (!shell) 105 if (!shell)