]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
su: silence a useless warning
authorJouke Witteveen <j.witteveen@gmail.com>
Fri, 6 Dec 2019 10:06:03 +0000 (11:06 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 6 Dec 2019 11:40:55 +0000 (12:40 +0100)
When the requested shell matches the restricted shell, there is no reason
to issue a warning, since we will be doing precisely as requested.

Signed-off-by: Jouke Witteveen <j.witteveen@gmail.com>
login-utils/su-common.c

index 9bf0971b299444efac408ad5a7eff248f42f1082..e671d822b070a66fb31f73064a28e357de85652c 100644 (file)
@@ -1149,6 +1149,7 @@ int su_main(int argc, char **argv, int mode)
                        shell = getenv("SHELL");
 
                if (shell
+                   && strcmp(shell, su->pwd->pw_shell)
                    && getuid() != 0
                    && is_restricted_shell(su->pwd->pw_shell)) {
                        /* The user being su'd to has a nonstandard shell, and