tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

mknod(2) and POSIX



I recently noticed that pkgsrc/sysutils/bup failed when restoring a fifo
under NetBSD because it calls mknod (in python) which calls mknod(3) and
hence mknod(2).

Our mknod(2) man page does not mention creating FIFOS, and claims

     The mknod() function conforms to IEEE Std 1003.1-1990 (“POSIX.1”).
     mknodat() conforms to IEEE Std 1003.1-2008 (“POSIX.1”).

I can't find 1990 online, but 2004 and 2008 require fifo support in
mknod:

  https://pubs.opengroup.org/onlinepubs/009695399/functions/mknod.html
  https://pubs.opengroup.org/onlinepubs/9699919799.2008edition/functions/mknod.html

However, at least in netbsd-8, our kernel (sys/vfs_syscalls.c:do_mknod_at):

  requires KAUTH_SYSTEM_MKNOD for all callers, and hence EPERM for non-root

  has a switch on allowable types, and S_IFIFO is not one of them, and
  hence EINVAL

I realize mkfifo is preferred in our world, and POSIX says it is
preferred.  But I believe we have a failure to follow POSIX.

Other opinions?


Home | Main Index | Thread Index | Old Index