This is the mail archive of the
mailing list for the Cygwin project.
Re: Different commands give different groups
- From: Eric Blake <eblake at redhat dot com>
- To: cygwin at cygwin dot com
- Date: Sat, 01 Oct 2011 07:54:55 -0600
- Subject: Re: Different commands give different groups
- References: <email@example.com>
On 09/30/2011 09:49 PM, gsingh93 wrote:
Why do these two commands give different groups? It's the same user.
Because the effective gid set for the existing process differs from the
recorded groups in /etc/groups - most likely, you've changed /etc/groups
but haven't logged out and back in to start a new process hierarchy that
uses the new groups.
$ id Gulshan
uid=1000(Gulshan) gid=545(Users) groups=545(Users),0(root)
That's what the groups will be if a new process is started for Gulshan.
uid=1000(Gulshan) gid=545(Users) groups=545(Users),513(None)
Whereas that's what the groups are now for the current process.
This aspect of your situation is not cygwin-specific, the same behavior
can be observed in other OSs when you change the user database after a
particular user already has a process started.
Furthermore, the commands mkgroup and mkpasswd give the orginial states of
their corresponding files instead of what I changed them to. Why is that?
This part is cygwin-specific - and the answer is that mkgroup and
mkpasswd are querying Window's database of user information, not /etc
(so that you can then populate /etc with information that matches the
Window's database). Windows doesn't care what you put in /etc, so the
amount of changes you can make in those files that still have a
worthwhile visible effect to cygwin processes is a bit limited.
Eric Blake firstname.lastname@example.org +1-801-349-2682
Libvirt virtualization library http://libvirt.org
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple