version 1.1.1.1, 2013/07/22 10:46:12
|
version 1.1.1.3, 2014/06/15 16:12:54
|
Line 225 sudo_make_gritem(gid_t gid, const char *name)
|
Line 225 sudo_make_gritem(gid_t gid, const char *name)
|
* elements. Fills in datum from user_gids or from getgrouplist(3). |
* elements. Fills in datum from user_gids or from getgrouplist(3). |
*/ |
*/ |
struct cache_item * |
struct cache_item * |
sudo_make_grlist_item(struct passwd *pw, char * const *unused1, | sudo_make_grlist_item(const struct passwd *pw, char * const *unused1, |
char * const *unused2) |
char * const *unused2) |
{ |
{ |
char *cp; |
char *cp; |
size_t i, nsize, ngroups, total, len; | size_t nsize, ngroups, total, len; |
struct cache_item_grlist *grlitem; |
struct cache_item_grlist *grlitem; |
struct group_list *grlist; |
struct group_list *grlist; |
GETGROUPS_T *gids; |
GETGROUPS_T *gids; |
struct group *grp; |
struct group *grp; |
int ngids, groupname_len; | int i, ngids, groupname_len; |
debug_decl(sudo_make_grlist_item, SUDO_DEBUG_NSS) |
debug_decl(sudo_make_grlist_item, SUDO_DEBUG_NSS) |
|
|
if (pw == sudo_user.pw && sudo_user.gids != NULL) { |
if (pw == sudo_user.pw && sudo_user.gids != NULL) { |
Line 243 sudo_make_grlist_item(struct passwd *pw, char * const
|
Line 243 sudo_make_grlist_item(struct passwd *pw, char * const
|
user_gids = NULL; |
user_gids = NULL; |
user_ngids = 0; |
user_ngids = 0; |
} else { |
} else { |
if (sudo_user.max_groups != -1) { | if (sudo_user.max_groups > 0) { |
ngids = sudo_user.max_groups; |
ngids = sudo_user.max_groups; |
gids = emalloc2(ngids, sizeof(GETGROUPS_T)); |
gids = emalloc2(ngids, sizeof(GETGROUPS_T)); |
(void)getgrouplist(pw->pw_name, pw->pw_gid, gids, &ngids); |
(void)getgrouplist(pw->pw_name, pw->pw_gid, gids, &ngids); |