standards/86484: [PATCH] mkfifo(1) uses wrong permissions

Robert Watson rwatson at FreeBSD.org
Fri Sep 23 01:02:51 PDT 2005


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


More information about the freebsd-standards mailing list