diff options
Diffstat (limited to 'loginutils/adduser.c')
-rw-r--r-- | loginutils/adduser.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/loginutils/adduser.c b/loginutils/adduser.c index 00232375b..136dcdff8 100644 --- a/loginutils/adduser.c +++ b/loginutils/adduser.c | |||
@@ -169,7 +169,18 @@ int adduser_main(int argc UNUSED_PARAM, char **argv) | |||
169 | free(p); | 169 | free(p); |
170 | 170 | ||
171 | #if ENABLE_FEATURE_SHADOWPASSWDS | 171 | #if ENABLE_FEATURE_SHADOWPASSWDS |
172 | p = xasprintf("!:%u:0:99999:7:::", (unsigned)(time(NULL) / 86400)); /* sp->sp_lstchg */ | 172 | /* /etc/shadow fields: |
173 | * 1. username | ||
174 | * 2. encrypted password | ||
175 | * 3. last password change (unix date (unix time/24*60*60)) | ||
176 | * 4. minimum days required between password changes | ||
177 | * 5. maximum days password is valid | ||
178 | * 6. days before password is to expire that user is warned | ||
179 | * 7. days after password expires that account is disabled | ||
180 | * 8. unix date when login expires (may no longer be used) | ||
181 | */ | ||
182 | /* fields: 2 3 4 5 6 78 */ | ||
183 | p = xasprintf("!:%u:0:99999:7:::", (unsigned)(time(NULL)) / (24*60*60)); | ||
173 | /* ignore errors: if file is missing we suppose admin doesn't want it */ | 184 | /* ignore errors: if file is missing we suppose admin doesn't want it */ |
174 | update_passwd(bb_path_shadow_file, pw.pw_name, p, NULL); | 185 | update_passwd(bb_path_shadow_file, pw.pw_name, p, NULL); |
175 | if (ENABLE_FEATURE_CLEAN_UP) | 186 | if (ENABLE_FEATURE_CLEAN_UP) |