]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
src/useradd.c: create_home(): Use !streq() instead of its pattern
authorAlejandro Colomar <alx@kernel.org>
Tue, 10 Dec 2024 14:57:58 +0000 (15:57 +0100)
committerSerge Hallyn <serge@hallyn.com>
Sat, 8 Feb 2025 05:47:21 +0000 (23:47 -0600)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
src/useradd.c

index 70a48cb8df24e72af43d620e045ee1bf2dce7a3c..562ba44fc824af1ffce9ccd3d1a1505a15853556 100644 (file)
@@ -2259,9 +2259,9 @@ static void create_home (void)
         */
        for (cp = strtok(bhome, "/"); cp != NULL; cp = strtok(NULL, "/")) {
                /* Avoid turning a relative path into an absolute path. */
-               if (bhome[0] == '/' || strlen(path) != 0) {
+               if (bhome[0] == '/' || !streq(path, ""))
                        strcat(path, "/");
-               }
+
                strcat(path, cp);
                if (access(path, F_OK) == 0) {
                        continue;