[Pkg-shadow-commits] r2187 - in upstream/trunk: . libmisc
nekral-guest at alioth.debian.org
nekral-guest at alioth.debian.org
Sun Jun 15 19:16:35 UTC 2008
Author: nekral-guest
Date: 2008-06-15 19:16:34 +0000 (Sun, 15 Jun 2008)
New Revision: 2187
Modified:
upstream/trunk/ChangeLog
upstream/trunk/libmisc/failure.c
Log:
* libmisc/failure.c: Try to close the open file if a failure
occured during lseek(), read() or write().
Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog 2008-06-15 19:15:15 UTC (rev 2186)
+++ upstream/trunk/ChangeLog 2008-06-15 19:16:34 UTC (rev 2187)
@@ -1,5 +1,10 @@
2008-06-15 Nicolas François <nicolas.francois at 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 at centraliens.net>
+
* libmisc/log.c: Check return values. If lseek() failed, avoid
reading or writing at an unspecified location. Log to syslog in
case of failure.
Modified: upstream/trunk/libmisc/failure.c
===================================================================
--- upstream/trunk/libmisc/failure.c 2008-06-15 19:15:15 UTC (rev 2186)
+++ upstream/trunk/libmisc/failure.c 2008-06-15 19:16:34 UTC (rev 2187)
@@ -114,6 +114,7 @@
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 @@
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 @@
SYSLOG ((LOG_WARN,
"Can't append failure of user %s to %s.",
ut_user, ftmp));
+ (void) close (fd);
}
}
More information about the Pkg-shadow-commits
mailing list