From: Alejandro Colomar Date: Sat, 11 Jul 2026 22:16:59 +0000 (+0200) Subject: lib/: Use SYSLOGE() instead of SYSLOG() with %m X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=thirdparty%2Fshadow.git lib/: Use SYSLOGE() instead of SYSLOG() with %m Signed-off-by: Alejandro Colomar --- diff --git a/lib/failure.c b/lib/failure.c index 107c526a3..c8a4ea069 100644 --- a/lib/failure.c +++ b/lib/failure.c @@ -18,6 +18,7 @@ #include "defines.h" #include "faillog.h" #include "failure.h" +#include "io/syslog.h" #include "prototypes.h" #include "string/memset/memzero.h" #include "string/strftime.h" @@ -46,9 +47,9 @@ 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: %m", - (unsigned long) uid, FAILLOG_FILE); + SYSLOGE(LOG_WARN, + "Can't write faillog entry for UID %lu in %s", + (unsigned long) uid, FAILLOG_FILE); return; } @@ -109,9 +110,9 @@ err_write: errno = saved_errno; } err_close: - SYSLOG(LOG_WARN, - "Can't write faillog entry for UID %lu to %s: %m", - (unsigned long) uid, FAILLOG_FILE); + SYSLOGE(LOG_WARN, + "Can't write faillog entry for UID %lu to %s", + (unsigned long) uid, FAILLOG_FILE); } static bool too_many_failures (const struct faillog *fl) @@ -162,10 +163,10 @@ 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: %m; " - "User access authorized.", - FAILLOG_FILE, (unsigned long) uid); + SYSLOGE(LOG_WARN, + "User access authorized; " + "can't open the faillog file (%s) to check UID %lu", + FAILLOG_FILE, (unsigned long) uid); return 1; } @@ -224,9 +225,9 @@ err_write: errno = saved_errno; } err_close: - SYSLOG(LOG_WARN, - "Can't reset faillog entry for UID %lu in %s: %m", - (unsigned long) uid, FAILLOG_FILE); + SYSLOGE(LOG_WARN, + "Can't reset faillog entry for UID %lu in %s", + (unsigned long) uid, FAILLOG_FILE); return 1; } diff --git a/lib/log.c b/lib/log.c index 52abbead1..37dbabfbc 100644 --- a/lib/log.c +++ b/lib/log.c @@ -18,6 +18,7 @@ #include "attr.h" #include "defines.h" +#include "io/syslog.h" #include "prototypes.h" #include "string/memset/memzero.h" #include "string/strcpy/strncpy.h" @@ -104,7 +105,7 @@ err_write: errno = saved_errno; } err_close: - SYSLOG(LOG_WARN, - "Can't write lastlog entry for UID %lu in %s: %m", - (unsigned long) pw->pw_uid, _PATH_LASTLOG); + SYSLOGE(LOG_WARN, + "Can't write lastlog entry for UID %lu in %s", + (unsigned long) pw->pw_uid, _PATH_LASTLOG); } diff --git a/lib/utmp.c b/lib/utmp.c index dc9870a7c..62002768e 100644 --- a/lib/utmp.c +++ b/lib/utmp.c @@ -29,6 +29,7 @@ #include "alloc/calloc.h" #include "alloc/malloc.h" #include "attr.h" +#include "io/syslog.h" #include "sizeof.h" #include "string/strchr/strnul.h" #include "string/strcmp/streq.h" @@ -102,9 +103,9 @@ failtmp(const char *username, const struct utmpx *failent) fd = open (ftmp, O_WRONLY | O_APPEND); if (-1 == fd) { if (errno != ENOENT) { - SYSLOG(LOG_WARN, - "Can't append failure of user %s to %s: %m", - username, ftmp); + SYSLOGE(LOG_WARN, + "Can't append failure of user %s to %s", + username, ftmp); } return; } @@ -130,7 +131,7 @@ err_write: errno = saved_errno; } err_close: - SYSLOG(LOG_WARN, "Can't append failure of user %s to %s: %m", username, ftmp); + SYSLOGE(LOG_WARN, "Can't append failure of user %s to %s", username, ftmp); }