My root user is a member of the following groups (output from "id" command):
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
An unprivileged user is a member of the following groups:
uid=5002(jim) gid=5002(jim) groups=5002(jim),666(software)
My problem is that when I attempt to set the effective UID of my process, in order to execute a command with the same privileges as the unprivileged user, that unprivileged user's group (the "software" group) is not included as an available group. To demonstrate this a short script:
print `id`;
$( = 5002;
$< = 5002;
print `id`;
Which has an output of:
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),
+6(disk),10(wheel)
uid=5002(jim) gid=5002(jim) euid=0(root) egid=0(root) groups=0(root),1
+(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
How do I eliminate the privileged user's secondary groups and, more importantly, replace them with the unprivileged user's secondary groups?