From: Tobias Stoeckmann Date: Tue, 16 Dec 2025 09:03:43 +0000 (+0100) Subject: passwd: check_password: Use shadow entry for logs X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d37f63a2b367fa22d14ed2257a6199b26be1fa7c;p=thirdparty%2Fshadow.git passwd: check_password: Use shadow entry for logs Always use the name in shadow entry for logging. This reduces the amount of data retrieved from password entry to bare minimum, i.e. passing through into library call. Reviewed-by: Alejandro Colomar Signed-off-by: Tobias Stoeckmann --- diff --git a/src/passwd.c b/src/passwd.c index 961dd0f00..9c0349f39 100644 --- a/src/passwd.c +++ b/src/passwd.c @@ -436,8 +436,8 @@ static void check_password (const struct passwd *pw, const struct spwd *sp) if (now < ok) { (void) fprintf (stderr, _("The password for %s cannot be changed yet.\n"), - pw->pw_name); - SYSLOG ((LOG_WARN, "now < minimum age for '%s'", pw->pw_name)); + sp->sp_namp); + SYSLOG ((LOG_WARN, "now < minimum age for '%s'", sp->sp_namp)); closelog (); exit (E_NOPERM); }