From: Christian Göttsche Date: Mon, 11 Dec 2023 16:21:25 +0000 (+0100) Subject: lib/failure,utmp: update error messages X-Git-Tag: 4.15.0-rc1~79 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6178f5a3dfa53efa28d13ffd029f7afbdb2ba50e;p=thirdparty%2Fshadow.git lib/failure,utmp: update error messages Include errno description. --- diff --git a/lib/failure.c b/lib/failure.c index 8a196fd8c..cb22694ac 100644 --- a/lib/failure.c +++ b/lib/failure.c @@ -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); } diff --git a/lib/utmp.c b/lib/utmp.c index 6acd196f0..5ac5ecd6a 100644 --- a/lib/utmp.c +++ b/lib/utmp.c @@ -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); }