Util-Linux Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] su: silence a useless warning
@ 2019-12-06 10:06 Jouke Witteveen
  2019-12-06 11:41 ` Karel Zak
  0 siblings, 1 reply; 2+ messages in thread
From: Jouke Witteveen @ 2019-12-06 10:06 UTC (permalink / raw)
  To: util-linux

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 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/login-utils/su-common.c b/login-utils/su-common.c
index 9bf0971b2..e671d822b 100644
--- a/login-utils/su-common.c
+++ b/login-utils/su-common.c
@@ -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
-- 
2.24.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] su: silence a useless warning
  2019-12-06 10:06 [PATCH] su: silence a useless warning Jouke Witteveen
@ 2019-12-06 11:41 ` Karel Zak
  0 siblings, 0 replies; 2+ messages in thread
From: Karel Zak @ 2019-12-06 11:41 UTC (permalink / raw)
  To: Jouke Witteveen; +Cc: util-linux

On Fri, Dec 06, 2019 at 11:06:03AM +0100, Jouke Witteveen wrote:
>  login-utils/su-common.c | 1 +
>  1 file changed, 1 insertion(+)

Applied, thanks.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-06 10:06 [PATCH] su: silence a useless warning Jouke Witteveen
2019-12-06 11:41 ` Karel Zak

Util-Linux Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/util-linux/0 util-linux/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 util-linux util-linux/ https://lore.kernel.org/util-linux \
		util-linux@vger.kernel.org
	public-inbox-index util-linux

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.util-linux


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git