lib/failure,utmp: update error messages
Include errno description.
This commit is contained in:
committed by
Serge Hallyn
parent
7f20bb88ad
commit
6178f5a3df
@@ -45,7 +45,7 @@ void failure (uid_t uid, const char *tty, struct faillog *fl)
|
||||
fd = open (FAILLOG_FILE, O_RDWR);
|
||||
if (fd < 0) {
|
||||
SYSLOG ((LOG_WARN,
|
||||
"Can't write faillog entry for UID %lu in %s.",
|
||||
"Can't write faillog entry for UID %lu in %s: %m",
|
||||
(unsigned long) uid, FAILLOG_FILE));
|
||||
return;
|
||||
}
|
||||
@@ -93,7 +93,7 @@ void failure (uid_t uid, const char *tty, struct faillog *fl)
|
||||
|| (write_full(fd, fl, sizeof *fl) == -1)
|
||||
|| (close (fd) != 0)) {
|
||||
SYSLOG ((LOG_WARN,
|
||||
"Can't write faillog entry for UID %lu in %s.",
|
||||
"Can't write faillog entry for UID %lu in %s: %m",
|
||||
(unsigned long) uid, FAILLOG_FILE));
|
||||
(void) close (fd);
|
||||
}
|
||||
@@ -148,7 +148,7 @@ int failcheck (uid_t uid, struct faillog *fl, bool failed)
|
||||
fd = open (FAILLOG_FILE, failed?O_RDONLY:O_RDWR);
|
||||
if (fd < 0) {
|
||||
SYSLOG ((LOG_WARN,
|
||||
"Can't open the faillog file (%s) to check UID %lu. "
|
||||
"Can't open the faillog file (%s) to check UID %lu: %m; "
|
||||
"User access authorized.",
|
||||
FAILLOG_FILE, (unsigned long) uid));
|
||||
return 1;
|
||||
@@ -192,7 +192,7 @@ int failcheck (uid_t uid, struct faillog *fl, bool failed)
|
||||
|| (write_full(fd, &fail, sizeof fail) == -1)
|
||||
|| (close (fd) != 0)) {
|
||||
SYSLOG ((LOG_WARN,
|
||||
"Can't reset faillog entry for UID %lu in %s.",
|
||||
"Can't reset faillog entry for UID %lu in %s: %m",
|
||||
(unsigned long) uid, FAILLOG_FILE));
|
||||
(void) close (fd);
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ static void failtmp (const char *username, const struct utmp *failent)
|
||||
if ( (write_full(fd, failent, sizeof *failent) == -1)
|
||||
|| (close (fd) != 0)) {
|
||||
SYSLOG ((LOG_WARN,
|
||||
"Can't append failure of user %s to %s.",
|
||||
"Can't append failure of user %s to %s: %m",
|
||||
username, ftmp));
|
||||
(void) close (fd);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user