From 9340efbb0d60ae73222b6d049786725397043802 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Sun, 21 Jan 2024 13:48:21 +0100 Subject: [PATCH] src/su.c: do_check_perms(): Fix -Wincompatible-pointer-types bug Fixes: ef95bb7ed139 ("src/su.c: Fix type of variable") Closes: Reported-by: Sam James Signed-off-by: Alejandro Colomar --- src/su.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/su.c b/src/su.c index 5c7c240e0..ba13a67dd 100644 --- a/src/su.c +++ b/src/su.c @@ -647,6 +647,7 @@ static /*@only@*/struct passwd * do_check_perms (void) #ifdef USE_PAM int ret; const char *tmp_name; + const void *item; #endif /* !USE_PAM */ /* * The password file entries for the user is gotten and the account @@ -666,7 +667,7 @@ static /*@only@*/struct passwd * do_check_perms (void) #ifdef USE_PAM check_perms_pam (pw); /* PAM authentication can request a change of account */ - ret = pam_get_item(pamh, PAM_USER, &tmp_name); + ret = pam_get_item(pamh, PAM_USER, &item); if (ret != PAM_SUCCESS) { SYSLOG((LOG_ERR, "pam_get_item: internal PAM error\n")); (void) fprintf (stderr, @@ -675,6 +676,7 @@ static /*@only@*/struct passwd * do_check_perms (void) (void) pam_end (pamh, ret); su_failure (caller_tty, 0 == pw->pw_uid); } + tmp_name = item; if (strcmp (name, tmp_name) != 0) { SYSLOG ((LOG_INFO, "Change user from '%s' to '%s' as requested by PAM", -- 2.47.2