Ismail Donmez wrote:
> Hi,
> 
> Using coreutils 6.4 ,
> 
> [~]> whoami
> cartman
> [~]> groups
> users disk wheel audio dialout video pnp removable power

Lists the access groups of the currently running process.

> [~]> groups cartman
> users disk wheel audio dialout video apache pnp removable power

Lists the access groups of the 'cartman' user if that user were to log
in at this moment.  Does not list the current process.  Does not list
past history of the process.  Does not list future possibilities.

> Notice that "apache" is in the second output, id shows similar behaviour,
> 
> [~]> id
> uid=1000(cartman) gid=100(users) groups=6(disk),10(wheel),18(audio),20
> (dialout),27(video),100(users),200(pnp),201(removable),204(power)
> [~]> id cartman
> uid=1000(cartman) gid=100(users) groups=100(users),6(disk),10(wheel),18
> (audio),20(dialout),27(video),80(apache),200(pnp),201(removable),204(power)
> 
> 
> Is this a bug or a feature?

Did you recently add 'cartman' to the 'apache' group?  Have you logged
in since then?

The kernel only places the user in the groups when the process is
configured at login time, usually through PAM.  You need to log in to
get the current settings.  Usually that means logging out but you
could 'ssh localhost' for example to spawn a login session through
ssh.

See the initgroups(2) and setgroups(2) man pages for more information.

Bob


_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to