summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2018-06-14 00:23:36 +0000
committermillert <millert@openbsd.org>2018-06-14 00:23:36 +0000
commitd44abbe7748a9dec7a543135491deef3fd8979a3 (patch)
tree288cad84208565e0994ea72195aa10349c1de39a /sys
parentalltraps was branching multiple times on whether the trap was from kernel (diff)
downloadwireguard-openbsd-d44abbe7748a9dec7a543135491deef3fd8979a3.tar.xz
wireguard-openbsd-d44abbe7748a9dec7a543135491deef3fd8979a3.zip
In dounlinkat() only perform the check for a mounted directory when
actually removing a directory. Fixes a problem where removing device special files could result in EBUSY. OK guenther@
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/vfs_syscalls.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 82914681da8..4d4c3364124 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_syscalls.c,v 1.288 2018/06/13 14:57:24 visa Exp $ */
+/* $OpenBSD: vfs_syscalls.c,v 1.289 2018/06/14 00:23:36 millert Exp $ */
/* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */
/*
@@ -1568,14 +1568,13 @@ dounlinkat(struct proc *p, int fd, const char *path, int flag)
error = EINVAL;
goto out;
}
- }
-
- /*
- * A mounted on directory cannot be deleted.
- */
- if (vp->v_mountedhere != NULL) {
- error = EBUSY;
- goto out;
+ /*
+ * A mounted on directory cannot be deleted.
+ */
+ if (vp->v_mountedhere != NULL) {
+ error = EBUSY;
+ goto out;
+ }
}
/*