From 2ab758af39005dd1a5dcd5ff86ef70c6bf2d5337 Mon Sep 17 00:00:00 2001 From: "Olaf P. Faaland" Date: Wed, 13 May 2026 10:45:47 -0700 Subject: [PATCH] taker_group_ok(): accept empty gr_mem If the site is using User Private Groups, and the site chooses not to list primary groups in the list of supplementary groups, the struct group returned by getgrnam() may have an empty gr_mem. Accept an empty gr_mem as equivalent to a gr_mem which includes only the taker's primary group. --- give-assist.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/give-assist.c b/give-assist.c index 74bb507..95cdd8d 100644 --- a/give-assist.c +++ b/give-assist.c @@ -580,9 +580,9 @@ static bool taker_group_ok(struct passwd* t){ } //this is where we are actually checking to see if the access_grp->gr_mem has more than one member - if(onlycontains(t->pw_name, access_grp->gr_mem)){ + if(access_grp->gr_mem[0] == NULL || onlycontains(t->pw_name, access_grp->gr_mem)){ if(debug){ - printf("taker is alone in uname group\n"); + printf("taker is alone (or list is empty) in uname group\n"); } return (true);