]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/nss.c: Use !strcaseprefix() instead of its pattern
authorAlejandro Colomar <alx@kernel.org>
Sat, 8 Feb 2025 10:06:40 +0000 (11:06 +0100)
committerSerge Hallyn <serge@hallyn.com>
Tue, 3 Jun 2025 01:08:57 +0000 (20:08 -0500)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/nss.c

index a2eb9e006373f4d9c9d7b44440484f7c5c828f8b..d97e0709ce94bad29a15bba7c98e20749c849b92 100644 (file)
--- a/lib/nss.c
+++ b/lib/nss.c
@@ -15,6 +15,7 @@
 #include "shadowlog_internal.h"
 #include "shadowlog.h"
 #include "string/sprintf/snprintf.h"
+#include "string/strcmp/strcaseprefix.h"
 #include "string/strcmp/streq.h"
 #include "string/strcmp/strprefix.h"
 #include "string/strspn/stpspn.h"
@@ -84,7 +85,7 @@ nss_init(const char *nsswitch_path) {
                        continue;
                if (strlen(line) < 8)
                        continue;
-               if (strncasecmp(line, "subid:", 6) != 0)
+               if (!strcaseprefix(line, "subid:"))
                        continue;
                p = &line[6];
                p = stpspn(p, " \t\n");