From a7339317595a92cde290f04bda5106bd99f73177 Mon Sep 17 00:00:00 2001 From: "Andrew G. Morgan" Date: Sat, 20 Jan 2001 22:21:22 +0000 Subject: Relevant BUGIDs: 117434 Purpose of commit: bugfix Commit summary: --------------- Appear to have left these fixes out with last commit to resolve 117434. --- modules/pam_tally/pam_tally.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'modules/pam_tally') diff --git a/modules/pam_tally/pam_tally.c b/modules/pam_tally/pam_tally.c index 90961731..3d994458 100644 --- a/modules/pam_tally/pam_tally.c +++ b/modules/pam_tally/pam_tally.c @@ -633,6 +633,8 @@ static int getopts( int argc, char **argv ) { int main ( int argc, char **argv ) { + struct fail_s fs, *fsp = &fs; + if ( ! getopts( argc, argv+1 ) ) { printf("%s: [--file rooted-filename] [--user username] " "[--reset[=n]] [--quiet]\n", @@ -658,7 +660,7 @@ int main ( int argc, char **argv ) { exit(0); } - i=get_tally( &tally, uid, cline_filename, &TALLY ); + i=get_tally( &tally, uid, cline_filename, &TALLY, fsp ); if ( i != PAM_SUCCESS ) { if (TALLY) fclose(TALLY); fprintf(stderr,"%s: %s\n",*argv,pam_errors(i)); @@ -669,7 +671,7 @@ int main ( int argc, char **argv ) { printf("User %s\t("UID_FMT")\t%s "TALLY_FMT"\n",cline_user,uid, (cline_reset!=TALLY_HI)?"had":"has",tally); - i=set_tally( cline_reset, uid, cline_filename, &TALLY ); + i=set_tally( cline_reset, uid, cline_filename, &TALLY, fsp ); if ( i != PAM_SUCCESS ) { if (TALLY) fclose(TALLY); fprintf(stderr,"%s: %s\n",*argv,pam_errors(i)); @@ -684,7 +686,8 @@ int main ( int argc, char **argv ) { for ( ; !feof(TALLY); uid++ ) { tally_t tally; struct passwd *pw; - if ( ! fread((char *) &fsp->fs_faillog, sizeof faillog, 1, TALLY) + if ( ! fread((char *) &fsp->fs_faillog, + sizeof (struct faillog), 1, TALLY) || ! fsp->fs_faillog.fail_cnt ) { tally=fsp->fs_faillog.fail_cnt; continue; -- cgit v1.2.3