From: Tobias Stoeckmann Date: Wed, 25 Mar 2026 16:44:47 +0000 (+0100) Subject: su: Declare force_pty only with USE_PTY X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ecb24ae653c1329b34746e9ac8415f428ba33cb;p=thirdparty%2Futil-linux.git su: Declare force_pty only with USE_PTY This makes it easier to review that force_pty is only used (or actually useable) if USE_PTY is defined. Signed-off-by: Tobias Stoeckmann --- diff --git a/login-utils/su-common.c b/login-utils/su-common.c index 1f5940914..d7dd160dd 100644 --- a/login-utils/su-common.c +++ b/login-utils/su-common.c @@ -156,7 +156,9 @@ struct su_context { suppress_pam_info, /* don't print PAM info messages (Last login, etc.). */ pam_has_session, /* PAM session opened */ pam_has_cred, /* PAM cred established */ +#ifdef USE_PTY force_pty, /* create pseudo-terminal */ +#endif restricted; /* false for root user */ }; @@ -1087,7 +1089,9 @@ int su_main(int argc, char **argv, int mode) break; case 'T': +#ifdef USE_PTY su->force_pty = 0; +#endif break; case 's':