From: Karel Zak Date: Mon, 12 Dec 2022 09:05:04 +0000 (+0100) Subject: lib/shells: make sure line does not start with '#' X-Git-Tag: v2.39-rc1~376 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5099e004b486e7c4f7153abc9843f49c1593fe66;p=thirdparty%2Futil-linux.git 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 --- 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; }