summaryrefslogtreecommitdiff
path: root/loginutils
diff options
context:
space:
mode:
authorGlenn L McGrath2004-09-15 02:39:09 +0000
committerGlenn L McGrath2004-09-15 02:39:09 +0000
commit995d96a99d5f2d546d5e15b2614ae7408da27631 (patch)
treea91ad6bc383a597f674d483040037c86a7c7b597 /loginutils
parent240a91d8a17ba8168775de85dd91eebef8c243a6 (diff)
downloadbusybox-995d96a99d5f2d546d5e15b2614ae7408da27631.zip
busybox-995d96a99d5f2d546d5e15b2614ae7408da27631.tar.gz
Only write to shadow file is shadow passwords are enabled. Patch by magicfox modified by myself to retain check for shadow file access.
Diffstat (limited to 'loginutils')
-rw-r--r--loginutils/passwd.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/loginutils/passwd.c b/loginutils/passwd.c
index 400ddb9..9c4b4dd 100644
--- a/loginutils/passwd.c
+++ b/loginutils/passwd.c
@@ -38,7 +38,6 @@ extern int update_passwd(const struct passwd *pw, char *crypt_pw)
char buffer[80];
char username[32];
char *pw_rest;
- int has_shadow = 0;
int mask;
int continued;
FILE *fp;
@@ -46,12 +45,12 @@ extern int update_passwd(const struct passwd *pw, char *crypt_pw)
struct stat sb;
struct flock lock;
+#ifdef CONFIG_FEATURE_SHADOWPASSWDS
if (access(bb_path_shadow_file, F_OK) == 0) {
- has_shadow = 1;
- }
- if (has_shadow) {
snprintf(filename, sizeof filename, "%s", bb_path_shadow_file);
- } else {
+ } else
+#endif
+ {
snprintf(filename, sizeof filename, "%s", bb_path_passwd_file);
}