Imported Upstream version 1.8.7
[debian/sudo] / common / setgroups.c
index 41df2256c1fb677eac23a0ca856528e1a440ff14..f9568a6df2bcd3105b713cf24b14b342e546ad6c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 2011-2012 Todd C. Miller <Todd.Miller@courtesan.com>
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -44,7 +44,7 @@ sudo_setgroups(int ngids, const GETGROUPS_T *gids)
     int maxgids, rval;
     debug_decl(sudo_setgroups, SUDO_DEBUG_UTIL)
 
-    rval = setgroups(ngids, gids);
+    rval = setgroups(ngids, (GETGROUPS_T *)gids);
     if (rval == -1 && errno == EINVAL) {
        /* Too many groups, try again with fewer. */
 #if defined(HAVE_SYSCONF) && defined(_SC_NGROUPS_MAX)
@@ -53,7 +53,7 @@ sudo_setgroups(int ngids, const GETGROUPS_T *gids)
 #endif
            maxgids = NGROUPS_MAX;
        if (ngids > maxgids)
-           rval = setgroups(maxgids, gids);
+           rval = setgroups(maxgids, (GETGROUPS_T *)gids);
     }
     debug_return_int(rval);
 }