* libmisc/failure.c: Try to close the open file if a failure
occured during lseek(), read() or write().
This commit is contained in:
parent
68cdac68cb
commit
dcd480ffd9
@ -1,3 +1,8 @@
|
||||
2008-06-15 Nicolas François <nicolas.francois@centraliens.net>
|
||||
|
||||
* libmisc/failure.c: Try to close the open file if a failure
|
||||
occured during lseek(), read() or write().
|
||||
|
||||
2008-06-15 Nicolas François <nicolas.francois@centraliens.net>
|
||||
|
||||
* libmisc/log.c: Check return values. If lseek() failed, avoid
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user