Problem: test_filter_with_supplemental_process_owner_gid fails

Solution: only set supgroup to a valid gid
This commit is contained in:
Andreas Hasenack 2019-03-15 21:48:18 -03:00
parent 645df4e602
commit d81f3ec21c
2 changed files with 6 additions and 2 deletions

View File

@ -122,8 +122,10 @@ void init_groups ()
supgroup = group;
notgroup = group + 1;
for (int i = 0; i < ngroups; i++) {
if (supgroup == group && group != groups[i])
if (supgroup == group && group != groups[i]) {
if (getgrgid (groups[i]))
supgroup = groups[i];
}
if (notgroup <= groups[i])
notgroup = groups[i] + 1;
}

View File

@ -78,8 +78,10 @@
#include <unistd.h>
#include <signal.h>
#include <stdlib.h>
#include <grp.h>
#include <sys/wait.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <net/if.h>