su: silence a useless warning

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>
This commit is contained in:
Jouke Witteveen 2019-12-06 11:06:03 +01:00 committed by Karel Zak
parent 62dc77f3a2
commit 1c788737d7
1 changed files with 1 additions and 0 deletions

View 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