--- embedaddon/sudo/common/setgroups.c 2012/02/21 16:23:02 1.1.1.1 +++ embedaddon/sudo/common/setgroups.c 2014/06/15 16:12:54 1.1.1.4 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 Todd C. Miller + * Copyright (c) 2011-2012 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -36,13 +36,16 @@ #include #include "missing.h" +#include "sudo_debug.h" +#include "sudo_util.h" int 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) @@ -51,7 +54,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); } - return rval; + debug_return_int(rval); }