Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Sep 2005 09:02:50 +0100 (BST)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Craig Rodrigues <rodrigc@FreeBSD.org>
Cc:        FreeBSD-gnats-submit@freebsd.org, freebsd-standards@FreeBSD.org
Subject:   Re: standards/86484: [PATCH] mkfifo(1) uses wrong permissions
Message-ID:  <20050923085442.J34322@fledge.watson.org>
In-Reply-To: <200509230436.j8N4aj1C018943@freefall.freebsd.org>
References:  <200509230436.j8N4aj1C018943@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On Fri, 23 Sep 2005, Craig Rodrigues wrote:

> Synopsis: [PATCH] mkfifo(1) uses wrong permissions
>
> Responsible-Changed-From-To: freebsd-standards->rwatson
> Responsible-Changed-By: rodrigc
> Responsible-Changed-When: Fri Sep 23 04:35:12 GMT 2005
> Responsible-Changed-Why:
> Robert has been working a lot with FIFO's lately....
>
> http://www.freebsd.org/cgi/query-pr.cgi?pr=86484

Our man page documents mkfifo(1) as interacting with umasks in two ways: 
(1) if -m is not used, then the requested mode is 0666 as influenced by 
the umask, and (2) if -m is used, the umask is ignored.  In my basic 
testing here, it appeared to operate correctly on FreeBSD 7.x-CURRENT:

peppercorn:/tmp/tmp> umask
22
peppercorn:/tmp/tmp> foreach mode (0600 0660 0666 0400 0440 0444 0200 0220 
0222)
foreach? mkfifo -m $mode $mode
foreach? end
peppercorn:/tmp/tmp> mkfifo nomode
peppercorn:/tmp/tmp> ls -l
total 12
drwxr-xr-x   2 robert  wheel    512 Sep 23 08:59 ./
drwxrwxrwt  16 root    wheel  10240 Sep 23 08:49 ../
p-w-------   1 robert  wheel      0 Sep 23 08:59 0200|
p-w--w----   1 robert  wheel      0 Sep 23 08:59 0220|
p-w--w--w-   1 robert  wheel      0 Sep 23 08:59 0222|
pr--------   1 robert  wheel      0 Sep 23 08:59 0400|
pr--r-----   1 robert  wheel      0 Sep 23 08:59 0440|
pr--r--r--   1 robert  wheel      0 Sep 23 08:59 0444|
prw-------   1 robert  wheel      0 Sep 23 08:59 0600|
prw-rw----   1 robert  wheel      0 Sep 23 08:59 0660|
prw-rw-rw-   1 robert  wheel      0 Sep 23 08:59 0666|
prw-r--r--   1 robert  wheel      0 Sep 23 08:59 nomode|

So on face value, the behavior of the application matches the 
specification in mkfifo(1).  The real question is whether mkfifo(1) 
matches some other important specification, like POSIX.  Since I don't 
have POSIX.2 on hand, I can't comment on that.

Robert N M Watson



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050923085442.J34322>