system/linux-pam: pam_tally and pam_tally2 have invalid printf formats
Bugzilla ID | 225 |
Reporter | A. Wilcox (awilfox) |
Assignee | A. Wilcox (awilfox) |
Reported | 2019-12-22 20:10:43 -0600 |
Modified | 2019-12-22 20:10:43 -0600 |
Status | CONFIRMED |
Version | 1.0-BETA4 |
Hardware | Adélie Linux / All |
Importance | --- / trivial |
Description
In file included from pam_tally.c:47:
pam_tally.c: In function ‘tally_check’:
pam_tally.c:541:7: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘time_t’ {aka ‘long long int’} [-Wformat=]
("Account temporary locked (%ld seconds left)"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../libpam/include/security/pam_ext.h:74:70: note: in definition of macro ‘pam_info’
#define pam_info(pamh, fmt...) pam_prompt(pamh, PAM_TEXT_INFO, NULL, fmt)
^~~
pam_tally.c:541:5: note: in expansion of macro ‘’
_("Account temporary locked (%ld seconds left)"),
^
pam_tally.c:546:40: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 6 has type ‘time_t’ {aka ‘long long int’} [-Wformat=]
"user %s (%lu) has time limit [%lds left]"
~~^
%lld
pam_tally.c:549:7:
oldtime+lock_time-time(NULL));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
========
In file included from pam_tally2.c:93:
pam_tally2.c: In function ‘tally_check’:
pam_tally2.c:597:27: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘time_t’ {aka ‘long long int’} [-Wformat=]
pam_info(pamh, ("Account temporary locked (%ld seconds left)"),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../libpam/include/security/pam_ext.h:74:70: note: in definition of macro ‘pam_info’
#define pam_info(pamh, fmt...) pam_prompt(pamh, PAM_TEXT_INFO, NULL, fmt)
^~~
pam_tally2.c:597:25: note: in expansion of macro ‘’
pam_info(pamh, _("Account temporary locked (%ld seconds left)"),
^
pam_tally2.c:602:50: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 6 has type ‘time_t’ {aka ‘long long int’} [-Wformat=]
"user %s (%lu) has time limit [%lds left]"
~~^
%lld
pam_tally2.c:605:17:
oldtime+opts->lock_time-time(NULL));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~