]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
useradd.c: Fix undeclared subuid_count when not using subids 403/head
authorSerge Hallyn <serge@hallyn.com>
Sun, 15 Aug 2021 00:25:51 +0000 (19:25 -0500)
committerSerge Hallyn <serge@hallyn.com>
Sun, 15 Aug 2021 00:25:51 +0000 (19:25 -0500)
subuid_count won't get used by usr_update(), but since we're passing it
as an argument we have to make sure it's always defined.  So just define
it as pre-set to 0.

Closes #402

Signed-off-by: Serge Hallyn <serge@hallyn.com>
src/useradd.c

index 9abeea6e4c676a256c87bf06248fcd2b3eda63bc..f90127cd52d2cb12c646efb2b911fc88287e3fc5 100644 (file)
@@ -2418,9 +2418,9 @@ int main (int argc, char **argv)
 #ifdef ENABLE_SUBIDS
        uid_t uid_min;
        uid_t uid_max;
-       unsigned long subuid_count;
-       unsigned long subgid_count;
 #endif
+       unsigned long subuid_count = 0;
+       unsigned long subgid_count = 0;
 
        /*
         * Get my name so that I can use it to report errors.