diff options
Diffstat (limited to 'modules/pam_tally2')
-rw-r--r-- | modules/pam_tally2/pam_tally2.8 | 4 | ||||
-rw-r--r-- | modules/pam_tally2/pam_tally2.c | 12 |
2 files changed, 14 insertions, 2 deletions
diff --git a/modules/pam_tally2/pam_tally2.8 b/modules/pam_tally2/pam_tally2.8 index 920a90b0..4e700e70 100644 --- a/modules/pam_tally2/pam_tally2.8 +++ b/modules/pam_tally2/pam_tally2.8 @@ -2,12 +2,12 @@ .\" Title: pam_tally2 .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 04/01/2016 +.\" Date: 05/18/2017 .\" Manual: Linux-PAM Manual .\" Source: Linux-PAM Manual .\" Language: English .\" -.TH "PAM_TALLY2" "8" "04/01/2016" "Linux-PAM Manual" "Linux\-PAM Manual" +.TH "PAM_TALLY2" "8" "05/18/2017" "Linux-PAM Manual" "Linux\-PAM Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/modules/pam_tally2/pam_tally2.c b/modules/pam_tally2/pam_tally2.c index 9f3bebeb..da1c0481 100644 --- a/modules/pam_tally2/pam_tally2.c +++ b/modules/pam_tally2/pam_tally2.c @@ -959,6 +959,18 @@ main( int argc UNUSED, char **argv ) exit(1); } + if (cline_reset == 0) { + struct stat st; + + if (stat(cline_filename, &st) && errno == ENOENT) { + if (!cline_quiet) { + memset(&tally, 0, sizeof(tally)); + print_one(&tally, uid); + } + return 0; /* no file => nothing to reset */ + } + } + i=get_tally(NULL, uid, cline_filename, &tfile, &tally, 0); if ( i != PAM_SUCCESS ) { if (tfile != -1) |