Chagrin has asked for the wisdom of the Perl Monks concerning the following question:
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)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using setuid() and absorbing that user's groups
by haukex (Archbishop) on Jan 13, 2017 at 08:28 UTC | |
|
Re: Using setuid() and absorbing that user's groups
by Anonymous Monk on Jan 13, 2017 at 00:38 UTC | |
|
Re: Using setuid() and absorbing that user's groups
by Chagrin (Initiate) on Jan 13, 2017 at 20:04 UTC |