]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
su: Declare force_pty only with USE_PTY
authorTobias Stoeckmann <tobias@stoeckmann.org>
Wed, 25 Mar 2026 16:44:47 +0000 (17:44 +0100)
committerTobias Stoeckmann <tobias@stoeckmann.org>
Wed, 25 Mar 2026 16:46:19 +0000 (17:46 +0100)
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 <tobias@stoeckmann.org>
login-utils/su-common.c

index 1f5940914b3506acb22ece05b6c003c4260e0dbf..d7dd160dd5060095666961d142f6b1c2e98b68bf 100644 (file)
@@ -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':