/*
- * 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
#include <limits.h>
#include "missing.h"
+#include "sudo_debug.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)
#endif
maxgids = NGROUPS_MAX;
if (ngids > maxgids)
- rval = setgroups(maxgids, gids);
+ rval = setgroups(maxgids, (GETGROUPS_T *)gids);
}
- return rval;
+ debug_return_int(rval);
}