lib/failure,utmp: update error messages

Include errno description.
This commit is contained in:
Christian Göttsche
2023-12-11 17:21:25 +01:00
committed by Serge Hallyn
parent 7f20bb88ad
commit 6178f5a3df
2 changed files with 5 additions and 5 deletions

View File

@@ -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);
}

View File

@@ -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);
}