negative group permissions?

Matthew Seaman m.seaman at infracaninophile.co.uk
Fri Feb 24 15:37:22 UTC 2012


On 24/02/2012 14:04, Anton Shterenlikht wrote:
>> Looking at usr.sbin/lpr/lpr/lpr.c at around line 847 (RELENG_9):
>> > 
>> >         (void) snprintf(buf, sizeof(buf), "%s/.seq", pp->spool_dir);
>> >         seteuid(euid);
>> >         if ((fd = open(buf, O_RDWR|O_CREAT, 0661)) < 0) {
>> >                 printf("%s: cannot create %s\n", progname, buf);
>> >                 exit(1);
>> >         }
>> >         if (flock(fd, LOCK_EX)) {
>> >                 printf("%s: cannot lock %s\n", progname, buf);
>> >                 exit(1);
>> >         }
>> > 
>> > It remains a mystery why these files are created with mode 0661. Mode 
> Isn't .seq above has mode 641?
> 
> % chmod 641 z
> % ls -al z
> -rw-r----x  1 mexas  wheel  0 Feb 24 13:59 z
> %

A umask setting of 022 would explain that.

-- 
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
JID: matthew at infracaninophile.co.uk               Kent, CT11 9PW

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 267 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20120224/ced7d09d/signature.pgp


More information about the freebsd-questions mailing list