diff --git a/include/libbb.h b/include/libbb.h index 6948695e9..5d7248104 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -39,25 +39,29 @@ #include #include -#ifdef CONFIG_SELINUX +#if ENABLE_SELINUX #include #endif -#ifdef CONFIG_LOCALE_SUPPORT +#if ENABLE_LOCALE_SUPPORT #include #else -#define setlocale(x,y) +#define setlocale(x,y) ((void)0) #endif #include "pwd_.h" #include "grp_.h" +/* ifdef it out, because it may include */ +/* and we may not even _have_ ! */ +#if ENABLE_FEATURE_SHADOWPASSWDS #include "shadow_.h" +#endif /* Try to pull in PATH_MAX */ #include #include #ifndef PATH_MAX -#define PATH_MAX 256 +#define PATH_MAX 256 #endif /* Tested to work correctly (IIRC :]) */ @@ -142,12 +146,12 @@ #endif /* buffer allocation schemes */ -#ifdef CONFIG_FEATURE_BUFFERS_GO_ON_STACK +#if ENABLE_FEATURE_BUFFERS_GO_ON_STACK #define RESERVE_CONFIG_BUFFER(buffer,len) char buffer[len] #define RESERVE_CONFIG_UBUFFER(buffer,len) unsigned char buffer[len] #define RELEASE_CONFIG_BUFFER(buffer) ((void)0) #else -#ifdef CONFIG_FEATURE_BUFFERS_GO_IN_BSS +#if ENABLE_FEATURE_BUFFERS_GO_IN_BSS #define RESERVE_CONFIG_BUFFER(buffer,len) static char buffer[len] #define RESERVE_CONFIG_UBUFFER(buffer,len) static unsigned char buffer[len] #define RELEASE_CONFIG_BUFFER(buffer) ((void)0) @@ -466,7 +470,7 @@ extern void bb_do_delay(int seconds); extern void change_identity(const struct passwd *pw); extern const char *change_identity_e2str(const struct passwd *pw); extern void run_shell(const char *shell, int loginshell, const char *command, const char **additional_args); -#ifdef CONFIG_SELINUX +#if ENABLE_SELINUX extern void renew_current_security_context(void); extern void set_current_security_context(security_context_t sid); #endif @@ -636,7 +640,7 @@ extern const char bb_default_login_shell[]; #define DEFAULT_SHELL_SHORT_NAME (bb_default_login_shell+6) -#ifdef CONFIG_FEATURE_DEVFS +#if ENABLE_FEATURE_DEVFS # define CURRENT_VC "/dev/vc/0" # define VC_1 "/dev/vc/1" # define VC_2 "/dev/vc/2" diff --git a/loginutils/passwd.c b/loginutils/passwd.c index c825c978f..5c822b190 100644 --- a/loginutils/passwd.c +++ b/loginutils/passwd.c @@ -276,7 +276,8 @@ int passwd_main(int argc, char **argv) } filename = bb_path_passwd_file; - if (ENABLE_FEATURE_SHADOWPASSWDS) { +#if ENABLE_FEATURE_SHADOWPASSWDS + { struct spwd *sp = getspnam(name); if (!sp) { /* LOGMODE_BOTH */ @@ -288,6 +289,7 @@ int passwd_main(int argc, char **argv) pw->pw_passwd = sp->sp_pwdp; } } +#endif /* Decide what the new password will be */ newp = NULL; diff --git a/loginutils/sulogin.c b/loginutils/sulogin.c index 30f9d9350..8bcb393f5 100644 --- a/loginutils/sulogin.c +++ b/loginutils/sulogin.c @@ -74,13 +74,15 @@ int sulogin_main(int argc, char **argv) goto auth_error; } - if (ENABLE_FEATURE_SHADOWPASSWDS) { +#if ENABLE_FEATURE_SHADOWPASSWDS + { struct spwd *spwd = getspnam(pwd->pw_name); if (!spwd) { goto auth_error; } pwd->pw_passwd = spwd->sp_pwdp; } +#endif while (1) { /* cp points to a static buffer that is zeroed every time */