diff --git a/ChangeLog b/ChangeLog index 93b1e5fd..9cb53d15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-06-15 Nicolas François + + * libmisc/failure.c: Try to close the open file if a failure + occured during lseek(), read() or write(). + 2008-06-15 Nicolas François * libmisc/log.c: Check return values. If lseek() failed, avoid diff --git a/libmisc/failure.c b/libmisc/failure.c index cae4f876..5afc439a 100644 --- a/libmisc/failure.c +++ b/libmisc/failure.c @@ -114,6 +114,7 @@ void failure (uid_t uid, const char *tty, struct faillog *fl) SYSLOG ((LOG_WARN, "Can't write faillog entry for UID %lu in %s.", (unsigned long) uid, FAILLOG_FILE)); + (void) close (fd); } } @@ -212,6 +213,7 @@ int failcheck (uid_t uid, struct faillog *fl, bool failed) SYSLOG ((LOG_WARN, "Can't reset faillog entry for UID %lu in %s.", (unsigned long) uid, FAILLOG_FILE)); + (void) close (fd); } } else { (void) close (fd); @@ -341,6 +343,7 @@ void failtmp ( SYSLOG ((LOG_WARN, "Can't append failure of user %s to %s.", ut_user, ftmp)); + (void) close (fd); } }