]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
su.c: s/doshell/do_interactive_shell/
authorVito Caputo <vcaputo@pengaru.com>
Sun, 10 May 2020 00:43:14 +0000 (17:43 -0700)
committerSerge Hallyn <shallyn@cisco.com>
Fri, 28 Aug 2020 04:43:29 +0000 (23:43 -0500)
Mechanical rename distinguishing this variable from intended changes
supporting executing commands without using an interpretive shell
(i.e. no '/bin/sh -c').

src/su.c

index 006d51d70dab2e0fced7d7ca5f1a91447a8991f1..578361a760fdf7c7944949bc606c7517100b4dd7 100644 (file)
--- a/src/su.c
+++ b/src/su.c
@@ -90,7 +90,7 @@ static bool caller_on_console = false;
 static /*@only@*/char *caller_pass;
 #endif
 #endif                         /* !USE_PAM */
-static bool doshell = false;
+static bool do_interactive_shell = false;
 static bool fakelogin = false;
 static /*@observer@*/const char *shellstr;
 static /*@null@*/char *command = NULL;
@@ -327,11 +327,11 @@ static void prepare_pam_close_session (void)
                if (   (sigaddset (&ourset, SIGTERM) != 0)
                    || (sigaddset (&ourset, SIGALRM) != 0)
                    || (sigaction (SIGTERM, &action, NULL) != 0)
-                   || (   !doshell /* handle SIGINT (Ctrl-C), SIGQUIT
-                                    * (Ctrl-\), and SIGTSTP (Ctrl-Z)
-                                    * since the child will not control
-                                    * the tty.
-                                    */
+                   || (!do_interactive_shell /* handle SIGINT (Ctrl-C), SIGQUIT
+                                              * (Ctrl-\), and SIGTSTP (Ctrl-Z)
+                                              * since the child will not control
+                                              * the tty.
+                                              */
                        && (   (sigaddset (&ourset, SIGINT)  != 0)
                            || (sigaddset (&ourset, SIGQUIT) != 0)
                            || (sigaddset (&ourset, SIGTSTP) != 0)
@@ -866,9 +866,9 @@ static void process_flags (int argc, char **argv)
                optidx++;
        }
 
-       doshell = (argc == optidx);     /* any arguments remaining? */
+       do_interactive_shell = (argc == optidx);        /* any arguments remaining? */
        if (NULL != command) {
-               doshell = false;
+               do_interactive_shell = false;
        }
 }
 
@@ -1144,7 +1144,7 @@ int main (int argc, char **argv)
 
        set_environment (pw);
 
-       if (!doshell) {
+       if (!do_interactive_shell) {
                /* There is no need for a controlling terminal.
                 * This avoids the callee to inject commands on
                 * the caller's tty. */
@@ -1212,7 +1212,7 @@ int main (int argc, char **argv)
                cp = Basename (shellstr);
        }
 
-       if (!doshell) {
+       if (!do_interactive_shell) {
                int err;
                /* Position argv to the remaining arguments */
                argv += optidx;