lib/, src/: Remove SCALE definition
SCALE is always DAY (and has to be always DAY), so replace it with DAY in source code and remove unneeded calculations. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org> Link: <https://github.com/shadow-maint/shadow/pull/876> Signed-off-by: Alejandro Colomar <alx@kernel.org> Cherry-picked-from:ecc3508877("lib/, src/: Remove SCALE definition") Cc: "Serge E. Hallyn" <serge@hallyn.com> Link: <https://github.com/shadow-maint/shadow/pull/888> Link: <https://github.com/shadow-maint/shadow/pull/876> [alx: This is a pre-requisite for674409e226("lib/: Saturate addition to avoid overflow")] Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
+2
-3
@@ -613,7 +613,7 @@ static void new_spent (struct spwd *spent)
|
||||
spent->sp_pwdp = new_pw_passwd (spent->sp_pwdp);
|
||||
|
||||
if (pflg) {
|
||||
spent->sp_lstchg = gettime () / SCALE;
|
||||
spent->sp_lstchg = gettime () / DAY;
|
||||
if (0 == spent->sp_lstchg) {
|
||||
/* Better disable aging than requiring a password
|
||||
* change. */
|
||||
@@ -1059,7 +1059,6 @@ static void process_flags (int argc, char **argv)
|
||||
Prog, optarg);
|
||||
exit (E_BAD_ARG);
|
||||
}
|
||||
user_newexpire *= DAY / SCALE;
|
||||
eflg = true;
|
||||
break;
|
||||
case 'f':
|
||||
@@ -1745,7 +1744,7 @@ static void usr_update (void)
|
||||
spent.sp_pwdp = xstrdup (pwent.pw_passwd);
|
||||
pwent.pw_passwd = xstrdup (SHADOW_PASSWD_STRING);
|
||||
|
||||
spent.sp_lstchg = gettime () / SCALE;
|
||||
spent.sp_lstchg = gettime () / DAY;
|
||||
if (0 == spent.sp_lstchg) {
|
||||
/* Better disable aging than
|
||||
* requiring a password change */
|
||||
|
||||
Reference in New Issue
Block a user