]> granicus.if.org Git - sudo/commitdiff
Avoid unused variable when getgrouplist_2() is available.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 19 Apr 2017 15:39:55 +0000 (09:39 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 19 Apr 2017 15:39:55 +0000 (09:39 -0600)
It would be nicer to just provide getgrouplist_2() (or the equivalent)
and avoid the ugly #ifdefs.

src/sudo.c

index 5dd090d6a77dc596eed33bfa6df102838028931d..2fc8df873529e338ecfe07c92ea9cec493908c88 100644 (file)
@@ -384,7 +384,7 @@ fix_fds(void)
 static int
 fill_group_list(struct user_details *ud, int system_maxgroups)
 {
-    int tries, ret = -1;
+    int ret = -1;
     debug_decl(fill_group_list, SUDO_DEBUG_UTIL)
 
     /*
@@ -408,6 +408,8 @@ fill_group_list(struct user_details *ud, int system_maxgroups)
        if (ud->ngroups != -1)
            ret = 0;
 #else
+       int tries;
+
        /*
         * It is possible to belong to more groups in the group database
         * than NGROUPS_MAX.  We start off with NGROUPS_MAX * 4 entries