]> granicus.if.org Git - shadow/commitdiff
* src/pwck.c: Use a %lu format and cast group and user IDs to
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Fri, 13 Jun 2008 21:16:01 +0000 (21:16 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Fri, 13 Jun 2008 21:16:01 +0000 (21:16 +0000)
unsigned long integers.
* src/pwck.c: Cast number of days to a long integer.
* src/pwck.c: Use the SCALE macro instead of (24L * 3600L)
for the values to be set in /etc/shadow.
* src/pwck.c: Use SHADOW_SP_FLAG_UNSET for the initial
value of spent.sp_flag.

ChangeLog
src/pwck.c

index 9d52302937792e859dcf94bb8e79791d18d198a9..dd5bdcbe91826adeb00c5fa39010c17a6789c335 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2008-06-13  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * src/pwck.c: Use a %lu format and cast group and user IDs to
+       unsigned long integers.
+       * src/pwck.c: Cast number of days to a long integer.
+       * src/pwck.c: Use the SCALE macro instead of (24L * 3600L)
+       for the values to be set in /etc/shadow.
+       * src/pwck.c: Use SHADOW_SP_FLAG_UNSET for the initial
+       value of spent.sp_flag.
+
 2008-06-13  Nicolas François  <nicolas.francois@centraliens.net>
 
        * src/passwd.c: Ignore return value of time() when use with a
index 5554c5fd5a0afe15053a104813d2dd827379c34e..0d74d1b6012ba1a6b1ce062121a63bbc942c429c 100644 (file)
@@ -369,8 +369,8 @@ static void check_pw_file (int *errors, bool *changed)
                         * No primary group, just give a warning
                         */
 
-                       printf (_("user %s: no group %u\n"),
-                               pwd->pw_name, pwd->pw_gid);
+                       printf (_("user %s: no group %lu\n"),
+                               pwd->pw_name, (unsigned long) pwd->pw_gid);
                        *errors += 1;
                }
 
@@ -417,19 +417,18 @@ static void check_pw_file (int *errors, bool *changed)
                                        struct spwd sp;
                                        struct passwd pw;
 
-                                       sp.sp_namp = pwd->pw_name;
-                                       sp.sp_pwdp = pwd->pw_passwd;
-                                       sp.sp_min =
+                                       sp.sp_namp   = pwd->pw_name;
+                                       sp.sp_pwdp   = pwd->pw_passwd;
+                                       sp.sp_min    =
                                            getdef_num ("PASS_MIN_DAYS", -1);
-                                       sp.sp_max =
+                                       sp.sp_max    =
                                            getdef_num ("PASS_MAX_DAYS", -1);
-                                       sp.sp_warn =
+                                       sp.sp_warn   =
                                            getdef_num ("PASS_WARN_AGE", -1);
-                                       sp.sp_inact = -1;
+                                       sp.sp_inact  = -1;
                                        sp.sp_expire = -1;
-                                       sp.sp_flag = -1;
-                                       sp.sp_lstchg =
-                                           time ((time_t *) 0) / (24L * 3600L);
+                                       sp.sp_flag   = SHADOW_SP_FLAG_UNSET;
+                                       sp.sp_lstchg = (long) time ((time_t *) 0) / SCALE;
                                        *changed = true;
 
                                        if (spw_update (&sp) == 0) {
@@ -588,7 +587,7 @@ static void check_spw_file (int *errors, bool *changed)
                 * Warn if last password change in the future.  --marekm
                 */
                if (   !quiet
-                   && (spw->sp_lstchg > time ((time_t *) 0) / SCALE)) {
+                   && (spw->sp_lstchg > (long) time ((time_t *) 0) / SCALE)) {
                        printf (_("user %s: last password change in the future\n"),
                                spw->sp_namp);
                        *errors += 1;