artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c3bcced
)
Return EINVAL for mknod/mknodat when dev is -1 (aka VNOVAL).
author
millert
<millert@openbsd.org>
Wed, 6 Jul 2016 19:26:35 +0000
(19:26 +0000)
committer
millert
<millert@openbsd.org>
Wed, 6 Jul 2016 19:26:35 +0000
(19:26 +0000)
OK beck@ tedu@
sys/kern/vfs_syscalls.c
patch
|
blob
|
history
diff --git
a/sys/kern/vfs_syscalls.c
b/sys/kern/vfs_syscalls.c
index
4378e3d
..
1b01622
100644
(file)
--- a/
sys/kern/vfs_syscalls.c
+++ b/
sys/kern/vfs_syscalls.c
@@
-1,4
+1,4
@@
-/* $OpenBSD: vfs_syscalls.c,v 1.26
0 2016/07/03 04:36:08 semarie
Exp $ */
+/* $OpenBSD: vfs_syscalls.c,v 1.26
1 2016/07/06 19:26:35 millert
Exp $ */
/* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */
/*
@@
-1228,6
+1228,8
@@
domknodat(struct proc *p, int fd, const char *path, mode_t mode, dev_t dev)
if (p->p_fd->fd_rdir)
return (EINVAL);
}
+ if (dev == VNOVAL)
+ return (EINVAL);
NDINITAT(&nd, CREATE, LOCKPARENT, UIO_USERSPACE, fd, path, p);
nd.ni_pledge = PLEDGE_DPATH;
if ((error = namei(&nd)) != 0)