Skip to contentSkip to conversation

su: silence a useless warning

PATCH Applied Jouke Witteveen 2 participants 2 messages Dec 6, 2019 Util-Linux package

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 login-utils/su-common.c | 1 +
 1 file changed, 1 insertion(+)
login-utils/su-common.c +1 -0
index 9bf0971b2..e671d822b 100644
@@ -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
Signature · 1 line
2.24.0
maintainer Applied
#1 lore raw
Quoted 2 lines · Jouke Witteveen
 login-utils/su-common.c | 1 +
 1 file changed, 1 insertion(+)

Applied, thanks.

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com