aboutsummaryrefslogtreecommitdiff
path: root/loginutils/passwd.c
diff options
context:
space:
mode:
authorbug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277>2004-09-15 02:39:09 +0000
committerbug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277>2004-09-15 02:39:09 +0000
commit0f69811499160f2c76951dd3ff50168b705826b1 (patch)
treea91ad6bc383a597f674d483040037c86a7c7b597 /loginutils/passwd.c
parentef43bfe2d191134b7fb104ba2f2468dd563841ac (diff)
downloadbusybox-w32-0f69811499160f2c76951dd3ff50168b705826b1.tar.gz
busybox-w32-0f69811499160f2c76951dd3ff50168b705826b1.tar.bz2
busybox-w32-0f69811499160f2c76951dd3ff50168b705826b1.zip
Only write to shadow file is shadow passwords are enabled. Patch by magicfox modified by myself to retain check for shadow file access.
git-svn-id: svn://busybox.net/trunk/busybox@9255 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to '')
-rw-r--r--loginutils/passwd.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/loginutils/passwd.c b/loginutils/passwd.c
index 400ddb9a5..9c4b4ddfb 100644
--- a/loginutils/passwd.c
+++ b/loginutils/passwd.c
@@ -38,7 +38,6 @@ extern int update_passwd(const struct passwd *pw, char *crypt_pw)
38 char buffer[80]; 38 char buffer[80];
39 char username[32]; 39 char username[32];
40 char *pw_rest; 40 char *pw_rest;
41 int has_shadow = 0;
42 int mask; 41 int mask;
43 int continued; 42 int continued;
44 FILE *fp; 43 FILE *fp;
@@ -46,12 +45,12 @@ extern int update_passwd(const struct passwd *pw, char *crypt_pw)
46 struct stat sb; 45 struct stat sb;
47 struct flock lock; 46 struct flock lock;
48 47
48#ifdef CONFIG_FEATURE_SHADOWPASSWDS
49 if (access(bb_path_shadow_file, F_OK) == 0) { 49 if (access(bb_path_shadow_file, F_OK) == 0) {
50 has_shadow = 1;
51 }
52 if (has_shadow) {
53 snprintf(filename, sizeof filename, "%s", bb_path_shadow_file); 50 snprintf(filename, sizeof filename, "%s", bb_path_shadow_file);
54 } else { 51 } else
52#endif
53 {
55 snprintf(filename, sizeof filename, "%s", bb_path_passwd_file); 54 snprintf(filename, sizeof filename, "%s", bb_path_passwd_file);
56 } 55 }
57 56