Re: pw keeps setting /etc/group to 0600

2012-11-30 Thread matt
On 11/17/12 07:24, Ryan Stone wrote: /etc/group is supposed to be world-reable, right? Tools like groups or pw groupshow certainly seem to think so: [rstone@rstone-server ~]groups 1001 920 [rstone@rstone-server ~]ls -l /etc/group -rw--- 1 root 0 482 Nov 14 21:02 /etc/group

Re: pw keeps setting /etc/group to 0600

2012-11-21 Thread Jaakko Heinonen
On 2012-11-19, Mateusz Guzik wrote: First, pw should not fail if other instance is running, it should wait instead (think of parallel batch scripts adding some users/groups). Second, current code has a race: lockfd = open(group_file, O_RDONLY, 0); if (lockfd 0 || fcntl(lockfd, F_SETFD, 1)

Re: pw keeps setting /etc/group to 0600

2012-11-21 Thread Mateusz Guzik
On Wed, Nov 21, 2012 at 05:45:43PM +0200, Jaakko Heinonen wrote: On 2012-11-19, Mateusz Guzik wrote: First, pw should not fail if other instance is running, it should wait instead (think of parallel batch scripts adding some users/groups). Second, current code has a race: lockfd =

Re: pw keeps setting /etc/group to 0600

2012-11-19 Thread Mateusz Guzik
On Sat, Nov 17, 2012 at 11:20:21AM -0500, Ryan Stone wrote: My original complaint that /etc/group gets permissions of 0600 is a result of a bug in libutil, which bapt@ ported pw to use in r242349. The new group manipulation API using mktemp to create a temporary file, writes the new group

Re: pw keeps setting /etc/group to 0600

2012-11-19 Thread Baptiste Daroussin
On Mon, Nov 19, 2012 at 11:28:43PM +0100, Mateusz Guzik wrote: On Sat, Nov 17, 2012 at 11:20:21AM -0500, Ryan Stone wrote: My original complaint that /etc/group gets permissions of 0600 is a result of a bug in libutil, which bapt@ ported pw to use in r242349. The new group manipulation API

Re: pw keeps setting /etc/group to 0600

2012-11-19 Thread Baptiste Daroussin
On Mon, Nov 19, 2012 at 11:37:45PM +0100, Baptiste Daroussin wrote: On Mon, Nov 19, 2012 at 11:28:43PM +0100, Mateusz Guzik wrote: On Sat, Nov 17, 2012 at 11:20:21AM -0500, Ryan Stone wrote: My original complaint that /etc/group gets permissions of 0600 is a result of a bug in libutil,

pw keeps setting /etc/group to 0600

2012-11-17 Thread Ryan Stone
/etc/group is supposed to be world-reable, right? Tools like groups or pw groupshow certainly seem to think so: [rstone@rstone-server ~]groups 1001 920 [rstone@rstone-server ~]ls -l /etc/group -rw--- 1 root 0 482 Nov 14 21:02 /etc/group [rstone@rstone-server ~]sudo chmod a+r /etc/group

Re: pw keeps setting /etc/group to 0600

2012-11-17 Thread Ryan Stone
Wow. So apparently things are even more broken than I though. Let's play, What group am I in? root@group-testing:/usr/home/rstone # cd /tmp root@group-testing:/tmp # pw groupadd testing root@group-testing:/tmp # mkdir testdir root@group-testing:/tmp # chown root:testing testdir/

Re: pw keeps setting /etc/group to 0600

2012-11-17 Thread Mateusz Guzik
On Sat, Nov 17, 2012 at 11:20:21AM -0500, Ryan Stone wrote: Wow. So apparently things are even more broken than I though. Let's play, What group am I in? root@group-testing:/usr/home/rstone # cd /tmp root@group-testing:/tmp # pw groupadd testing root@group-testing:/tmp # mkdir testdir