From 5099e004b486e7c4f7153abc9843f49c1593fe66 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 12 Dec 2022 10:05:04 +0100 Subject: [PATCH] lib/shells: make sure line does not start with '#' It's probably unnecessary, but better safe than sorry. The original is_restricted_shell() from su(1) uses this check. Signed-off-by: Karel Zak --- lib/shells.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/shells.c b/lib/shells.c index 2d3ec01762..0707a18c8f 100644 --- a/lib/shells.c +++ b/lib/shells.c @@ -60,7 +60,7 @@ extern int is_known_shell(const char *shell_name) setusershell(); while ((s = getusershell())) { - if (strcmp(shell_name, s) == 0) { + if (*s != '#' && strcmp(shell_name, s) == 0) { ret = 1; break; } -- 2.47.3