diff options
| author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-12-30 14:46:51 +0000 |
|---|---|---|
| committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-12-30 14:46:51 +0000 |
| commit | b5a122b6f9643fb052d31390e435397960289154 (patch) | |
| tree | a6e22557206650da7a44300823621cbb17c86293 | |
| parent | d9e4ddc38b38b7cf6cc7bdd9dcf6794f8aad8d2e (diff) | |
| download | busybox-w32-b5a122b6f9643fb052d31390e435397960289154.tar.gz busybox-w32-b5a122b6f9643fb052d31390e435397960289154.tar.bz2 busybox-w32-b5a122b6f9643fb052d31390e435397960289154.zip | |
fix for uclibc-without-shadow.h compilation
| -rw-r--r-- | include/libbb.h | 20 | ||||
| -rw-r--r-- | loginutils/passwd.c | 4 | ||||
| -rw-r--r-- | loginutils/sulogin.c | 4 |
3 files changed, 18 insertions, 10 deletions
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 @@ | |||
| 39 | #include <unistd.h> | 39 | #include <unistd.h> |
| 40 | #include <utime.h> | 40 | #include <utime.h> |
| 41 | 41 | ||
| 42 | #ifdef CONFIG_SELINUX | 42 | #if ENABLE_SELINUX |
| 43 | #include <selinux/selinux.h> | 43 | #include <selinux/selinux.h> |
| 44 | #endif | 44 | #endif |
| 45 | 45 | ||
| 46 | #ifdef CONFIG_LOCALE_SUPPORT | 46 | #if ENABLE_LOCALE_SUPPORT |
| 47 | #include <locale.h> | 47 | #include <locale.h> |
| 48 | #else | 48 | #else |
| 49 | #define setlocale(x,y) | 49 | #define setlocale(x,y) ((void)0) |
| 50 | #endif | 50 | #endif |
| 51 | 51 | ||
| 52 | #include "pwd_.h" | 52 | #include "pwd_.h" |
| 53 | #include "grp_.h" | 53 | #include "grp_.h" |
| 54 | /* ifdef it out, because it may include <shadow.h> */ | ||
| 55 | /* and we may not even _have_ <shadow.h>! */ | ||
| 56 | #if ENABLE_FEATURE_SHADOWPASSWDS | ||
| 54 | #include "shadow_.h" | 57 | #include "shadow_.h" |
| 58 | #endif | ||
| 55 | 59 | ||
| 56 | /* Try to pull in PATH_MAX */ | 60 | /* Try to pull in PATH_MAX */ |
| 57 | #include <limits.h> | 61 | #include <limits.h> |
| 58 | #include <sys/param.h> | 62 | #include <sys/param.h> |
| 59 | #ifndef PATH_MAX | 63 | #ifndef PATH_MAX |
| 60 | #define PATH_MAX 256 | 64 | #define PATH_MAX 256 |
| 61 | #endif | 65 | #endif |
| 62 | 66 | ||
| 63 | /* Tested to work correctly (IIRC :]) */ | 67 | /* Tested to work correctly (IIRC :]) */ |
| @@ -142,12 +146,12 @@ | |||
| 142 | #endif | 146 | #endif |
| 143 | 147 | ||
| 144 | /* buffer allocation schemes */ | 148 | /* buffer allocation schemes */ |
| 145 | #ifdef CONFIG_FEATURE_BUFFERS_GO_ON_STACK | 149 | #if ENABLE_FEATURE_BUFFERS_GO_ON_STACK |
| 146 | #define RESERVE_CONFIG_BUFFER(buffer,len) char buffer[len] | 150 | #define RESERVE_CONFIG_BUFFER(buffer,len) char buffer[len] |
| 147 | #define RESERVE_CONFIG_UBUFFER(buffer,len) unsigned char buffer[len] | 151 | #define RESERVE_CONFIG_UBUFFER(buffer,len) unsigned char buffer[len] |
| 148 | #define RELEASE_CONFIG_BUFFER(buffer) ((void)0) | 152 | #define RELEASE_CONFIG_BUFFER(buffer) ((void)0) |
| 149 | #else | 153 | #else |
| 150 | #ifdef CONFIG_FEATURE_BUFFERS_GO_IN_BSS | 154 | #if ENABLE_FEATURE_BUFFERS_GO_IN_BSS |
| 151 | #define RESERVE_CONFIG_BUFFER(buffer,len) static char buffer[len] | 155 | #define RESERVE_CONFIG_BUFFER(buffer,len) static char buffer[len] |
| 152 | #define RESERVE_CONFIG_UBUFFER(buffer,len) static unsigned char buffer[len] | 156 | #define RESERVE_CONFIG_UBUFFER(buffer,len) static unsigned char buffer[len] |
| 153 | #define RELEASE_CONFIG_BUFFER(buffer) ((void)0) | 157 | #define RELEASE_CONFIG_BUFFER(buffer) ((void)0) |
| @@ -466,7 +470,7 @@ extern void bb_do_delay(int seconds); | |||
| 466 | extern void change_identity(const struct passwd *pw); | 470 | extern void change_identity(const struct passwd *pw); |
| 467 | extern const char *change_identity_e2str(const struct passwd *pw); | 471 | extern const char *change_identity_e2str(const struct passwd *pw); |
| 468 | extern void run_shell(const char *shell, int loginshell, const char *command, const char **additional_args); | 472 | extern void run_shell(const char *shell, int loginshell, const char *command, const char **additional_args); |
| 469 | #ifdef CONFIG_SELINUX | 473 | #if ENABLE_SELINUX |
| 470 | extern void renew_current_security_context(void); | 474 | extern void renew_current_security_context(void); |
| 471 | extern void set_current_security_context(security_context_t sid); | 475 | extern void set_current_security_context(security_context_t sid); |
| 472 | #endif | 476 | #endif |
| @@ -636,7 +640,7 @@ extern const char bb_default_login_shell[]; | |||
| 636 | #define DEFAULT_SHELL_SHORT_NAME (bb_default_login_shell+6) | 640 | #define DEFAULT_SHELL_SHORT_NAME (bb_default_login_shell+6) |
| 637 | 641 | ||
| 638 | 642 | ||
| 639 | #ifdef CONFIG_FEATURE_DEVFS | 643 | #if ENABLE_FEATURE_DEVFS |
| 640 | # define CURRENT_VC "/dev/vc/0" | 644 | # define CURRENT_VC "/dev/vc/0" |
| 641 | # define VC_1 "/dev/vc/1" | 645 | # define VC_1 "/dev/vc/1" |
| 642 | # define VC_2 "/dev/vc/2" | 646 | # 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) | |||
| 276 | } | 276 | } |
| 277 | 277 | ||
| 278 | filename = bb_path_passwd_file; | 278 | filename = bb_path_passwd_file; |
| 279 | if (ENABLE_FEATURE_SHADOWPASSWDS) { | 279 | #if ENABLE_FEATURE_SHADOWPASSWDS |
| 280 | { | ||
| 280 | struct spwd *sp = getspnam(name); | 281 | struct spwd *sp = getspnam(name); |
| 281 | if (!sp) { | 282 | if (!sp) { |
| 282 | /* LOGMODE_BOTH */ | 283 | /* LOGMODE_BOTH */ |
| @@ -288,6 +289,7 @@ int passwd_main(int argc, char **argv) | |||
| 288 | pw->pw_passwd = sp->sp_pwdp; | 289 | pw->pw_passwd = sp->sp_pwdp; |
| 289 | } | 290 | } |
| 290 | } | 291 | } |
| 292 | #endif | ||
| 291 | 293 | ||
| 292 | /* Decide what the new password will be */ | 294 | /* Decide what the new password will be */ |
| 293 | newp = NULL; | 295 | 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) | |||
| 74 | goto auth_error; | 74 | goto auth_error; |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | if (ENABLE_FEATURE_SHADOWPASSWDS) { | 77 | #if ENABLE_FEATURE_SHADOWPASSWDS |
| 78 | { | ||
| 78 | struct spwd *spwd = getspnam(pwd->pw_name); | 79 | struct spwd *spwd = getspnam(pwd->pw_name); |
| 79 | if (!spwd) { | 80 | if (!spwd) { |
| 80 | goto auth_error; | 81 | goto auth_error; |
| 81 | } | 82 | } |
| 82 | pwd->pw_passwd = spwd->sp_pwdp; | 83 | pwd->pw_passwd = spwd->sp_pwdp; |
| 83 | } | 84 | } |
| 85 | #endif | ||
| 84 | 86 | ||
| 85 | while (1) { | 87 | while (1) { |
| 86 | /* cp points to a static buffer that is zeroed every time */ | 88 | /* cp points to a static buffer that is zeroed every time */ |
