The pwd_to_spwd routine claims that fields without corresponding
information in the password file are set to uninitialized values,
but sets some aging information. These cannot be available in
struct passwd.
Also, the code is only used in passwd to temporarily hold the
new password. All other values are copied from an existing entry
later on. If no entry exists, all values are dismissed anyway.
Clarify that everything is uninitialized except name and password.
Gets rid of magic value 10000 for sp_max.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
#ident "$Id$"
#include <sys/types.h>
-#include "prototypes.h"
#include "defines.h"
#include <pwd.h>
sp.sp_namp = pw->pw_name;
sp.sp_pwdp = pw->pw_passwd;
- /*
- * Defaults used if there is no pw_age information.
- */
- sp.sp_min = 0;
- sp.sp_max = 10000;
- sp.sp_lstchg = gettime () / DAY;
- if (0 == sp.sp_lstchg) {
- /* Better disable aging than requiring a password
- * change */
- sp.sp_lstchg = -1;
- }
-
/*
* These fields have no corresponding information in the password
* file. They are set to uninitialized values.
*/
+ sp.sp_lstchg = -1;
+ sp.sp_min = 0;
+ sp.sp_max = -1;
sp.sp_warn = -1;
sp.sp_expire = -1;
sp.sp_inact = -1;