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:Which has an output of:print `id`; $( = 5002; $< = 5002; print `id`;
How do I eliminate the privileged user's secondary groups and, more importantly, replace them with the unprivileged user's secondary groups?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)
In reply to Using setuid() and absorbing that user's groups by Chagrin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |