+2008-09-25 Tomas Mraz <t8m@centrum.cz>
+
+ * modules/pam_tally/pam_tally.c(get_tally): Fix syslog message.
+ (tally_check): Open faillog read only. Close file descriptor.
+ Fix typos in messages.
+
2008-09-25 Thorsten Kukuk <kukuk@thkukuk.de>
* modules/pam_mail/pam_mail.c (report_mail): Fix logic of
}
if ( ! ( *TALLY = fopen(filename,(*tally!=TALLY_HI)?"r+":"r") ) ) {
- pam_syslog(pamh, LOG_ALERT, "Error opening %s for update", filename);
+ pam_syslog(pamh, LOG_ALERT, "Error opening %s for %s", filename, *tally!=TALLY_HI?"update":"read");
/* Discovering why account service fails: e/uid are target user.
*
tally_t
deny = opts->deny;
tally_t
- tally = 0; /* !TALLY_HI --> Log opened for update */
+ tally = TALLY_HI;
long
lock_time = opts->lock_time;
i=get_tally(pamh, &tally, uid, opts->filename, &TALLY, fsp);
if ( i != PAM_SUCCESS ) { RETURN_ERROR( i ); }
+ if ( TALLY != NULL ) {
+ fclose(TALLY);
+ }
+
if ( !(opts->ctrl & OPT_MAGIC_ROOT) || getuid() ) { /* magic_root skips tally check */
/* To deny or not to deny; that is the question */
{
if (!(opts->ctrl & OPT_SILENT))
pam_info (pamh,
- _("Account temporary locked (%lds seconds left)"),
+ _("Account temporary locked (%ld seconds left)"),
oldtime+lock_time-time(NULL));
if (!(opts->ctrl & OPT_NOLOGNOTICE))
( ((opts->ctrl & OPT_DENY_ROOT) || uid) ) /* even_deny stops uid check */
) {
if (!(opts->ctrl & OPT_SILENT))
- pam_info (pamh, _("Accounted locked due to "TALLY_FMT" failed login"),
- tally);
+ pam_info (pamh, _("Account locked due to %u failed logins"),
+ (unsigned int)tally);
if (!(opts->ctrl & OPT_NOLOGNOTICE))
pam_syslog(pamh, LOG_NOTICE,