diff options
author | rwatson <rwatson@FreeBSD.org> | 2008-06-22 21:51:32 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2008-06-22 21:51:32 +0000 |
commit | 1e17e3cd45bf4ec8798dbb1b2f8b9d03917ac322 (patch) | |
tree | 0bd9e6c353c0e825d6c641d30b644669501eafa2 /sys/kern/vfs_syscalls.c | |
parent | 6aae4674ed0b1f59bead6c8c98b63b331cb4275e (diff) | |
download | FreeBSD-src-1e17e3cd45bf4ec8798dbb1b2f8b9d03917ac322.zip FreeBSD-src-1e17e3cd45bf4ec8798dbb1b2f8b9d03917ac322.tar.gz |
If S_IFIFO is passed to mknod(2), invoke kern_mkfifoat(9) to create a
FIFO, as required by SUSv3. No specific privilege check is performed
in this case, as FIFOs may be created by unprivileged processes
(subject to the normal file system name space restrictions that may be
in place).
Unlike the Apple implementation, we reject requests to create a FIFO
using mknod(2) if there is a non-zero dev argument to the system call,
which is permitted by the Open Group specification ("... undefined
..."). We might want to revise this if we find it causes
compatibility problems for applications in practice.
PR: kern/74242, kern/68459
Obtained from: Apple, Inc.
MFC after: 3 weeks
Diffstat (limited to 'sys/kern/vfs_syscalls.c')
-rw-r--r-- | sys/kern/vfs_syscalls.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 09f51e1..e38f80e 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1264,6 +1264,10 @@ kern_mknodat(struct thread *td, int fd, char *path, enum uio_seg pathseg, case S_IFWHT: error = priv_check(td, PRIV_VFS_MKNOD_WHT); break; + case S_IFIFO: + if (dev == 0) + return (kern_mkfifoat(td, fd, path, pathseg, mode)); + /* FALLTHROUGH */ default: error = EINVAL; break; |