diff options
Diffstat (limited to 'loginutils/passwd.c')
-rw-r--r-- | loginutils/passwd.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/loginutils/passwd.c b/loginutils/passwd.c index 8b6a63eec..810644e61 100644 --- a/loginutils/passwd.c +++ b/loginutils/passwd.c | |||
@@ -184,8 +184,7 @@ int passwd_main(int argc UNUSED_PARAM, char **argv) | |||
184 | * strdup'ing to avoid nasty surprizes */ | 184 | * strdup'ing to avoid nasty surprizes */ |
185 | newp = xstrdup(&pw->pw_passwd[1]); | 185 | newp = xstrdup(&pw->pw_passwd[1]); |
186 | } else if (opt & OPT_delete) { | 186 | } else if (opt & OPT_delete) { |
187 | //newp = xstrdup(""); | 187 | newp = (char*)""; //xstrdup(""); |
188 | newp = (char*)""; | ||
189 | } | 188 | } |
190 | 189 | ||
191 | rlimit_fsize.rlim_cur = rlimit_fsize.rlim_max = 512L * 30000; | 190 | rlimit_fsize.rlim_cur = rlimit_fsize.rlim_max = 512L * 30000; |
@@ -201,7 +200,11 @@ int passwd_main(int argc UNUSED_PARAM, char **argv) | |||
201 | #if ENABLE_FEATURE_SHADOWPASSWDS | 200 | #if ENABLE_FEATURE_SHADOWPASSWDS |
202 | filename = bb_path_shadow_file; | 201 | filename = bb_path_shadow_file; |
203 | rc = update_passwd(bb_path_shadow_file, name, newp, NULL); | 202 | rc = update_passwd(bb_path_shadow_file, name, newp, NULL); |
204 | if (rc == 0) /* no lines updated, no errors detected */ | 203 | if (rc > 0) |
204 | /* password in /etc/shadow was updated */ | ||
205 | newp = (char*) "x"; //xstrdup("x"); | ||
206 | if (rc >= 0) | ||
207 | /* 0 = /etc/shadow missing (not an error), >0 = passwd changed in /etc/shadow */ | ||
205 | #endif | 208 | #endif |
206 | { | 209 | { |
207 | filename = bb_path_passwd_file; | 210 | filename = bb_path_passwd_file; |