diff options
author | Dmitry V. Levin <ldv@altlinux.org> | 2020-03-19 18:40:16 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2020-03-19 18:40:16 +0000 |
commit | 2dc4cc4dcecf1ba299de1bd1eb40d8f9d9d0e054 (patch) | |
tree | de85584846eb21b8af2e22a0e30dbad02add516b /modules/pam_namespace/md5.c | |
parent | 69f3b27b3f1d6e8ff37923bca3d2d3559129e843 (diff) | |
download | pam-2dc4cc4dcecf1ba299de1bd1eb40d8f9d9d0e054.tar.gz pam-2dc4cc4dcecf1ba299de1bd1eb40d8f9d9d0e054.tar.bz2 pam-2dc4cc4dcecf1ba299de1bd1eb40d8f9d9d0e054.zip |
modules/pam_tally, modules/pam_tally2: fix compilation warnings
Fix the following compilation warnings reported by gcc
when sizeof(time_t) > sizeof(long), e.g. on x32:
modules/pam_tally/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=]
541 | _("The account is temporarily locked (%ld seconds left)."),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
modules/pam_tally/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=]
546 | "user %s (%lu) has time limit [%lds left]"
| ~~^
| |
| long int
| %lld
......
549 | oldtime+lock_time-time(NULL));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| time_t {aka long long int}
modules/pam_tally2/pam_tally2.c:592:27: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘time_t’ {aka ‘long long int’} [-Wformat=]
592 | pam_info(pamh, _("The account is temporarily locked (%ld seconds left)."),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
modules/pam_tally2/pam_tally2.c:597:50: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 6 has type ‘time_t’ {aka ‘long long int’} [-Wformat=]
597 | "user %s (%lu) has time limit [%lds left]"
| ~~^
| |
| long int
| %lld
......
600 | oldtime+opts->lock_time-time(NULL));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| time_t {aka long long int}
This change doesn't attempt to fix handling of 64-bit time_t on 32-bit
systems in these modules.
* modules/pam_tally/pam_tally.c (tally_check): Cast time_t expressions
to long int before passing them to pam_info and pam_syslog.
* modules/pam_tally2/pam_tally2.c (tally_check): Likewise.
Diffstat (limited to 'modules/pam_namespace/md5.c')
0 files changed, 0 insertions, 0 deletions