I had a look in src/newgrp.c
I wonder why the variable grp is overwritten several times, before check_perms 
is called.
In my understanding, this means the last found group entry wins.

If I have following group entries in my environment:
#From /etc/passwd
comgrp:x:27:user1
#From NIS/LDAP or something similar
comgrp:x:27:user2
#From /etc/gshadow
comgrp:*::user3

user1 and user2 aren't able to change primary group to comgrp because 
check_perms only sees user3 in that group.
I had expected that all three users are able to change to the comgrp.
What is the correct behaviour? And why?

[src/newgrp.c]
617         grp = getgrnam (group); /* local, no need for xgetgrnam */
[...]
628         grp = find_matching_group (name, grp->gr_gid);
[...]
637                 grp = xgetgrnam (group);
[...]
644                 grp->gr_mem = sgrp->sg_mem;
[...]
651         check_perms (grp, pwd, group);

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1355111

Title:
  newgrp fails with "crypt: Invalid argument"

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/shadow/+bug/1355111/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to