]> granicus.if.org Git - linux-pam/commitdiff
pam_lastlog: fix format string
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 19 Nov 2013 14:05:09 +0000 (14:05 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 20 Nov 2013 10:51:24 +0000 (10:51 +0000)
gcc -Wformat justly complains:
format '%d' expects argument of type 'int', but argument 5 has type 'time_t'

* modules/pam_lastlog/pam_lastlog.c (pam_sm_authenticate): Fix format
string.

modules/pam_lastlog/pam_lastlog.c

index bd454ffd9ececce32b1d8f804766c9b7a9976ca9..ad8c66053cc75f83f4bb06f4f32798a7048bcebf 100644 (file)
@@ -628,7 +628,8 @@ pam_sm_authenticate(pam_handle_t *pamh, int flags,
     lltime = (time(NULL) - lltime) / (24*60*60);
 
     if (lltime > inactive_days) {
-        pam_syslog(pamh, LOG_INFO, "user %s inactive for %d days - denied", user, lltime);
+        pam_syslog(pamh, LOG_INFO, "user %s inactive for %ld days - denied",
+                  user, (long) lltime);
         return PAM_AUTH_ERR;
     }