summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-07-20 21:31:57 +0000
committerderaadt <deraadt@openbsd.org>2015-07-20 21:31:57 +0000
commit516d42a37e959abe3af667ee52ca4a479cfc1b0f (patch)
tree3b093a5efc5483eb922392518ca90f3a0cf0c3ee
parentKill NETISR_MPLS, from now on we will use interface input handlers to deal (diff)
downloadwireguard-openbsd-516d42a37e959abe3af667ee52ca4a479cfc1b0f.tar.xz
wireguard-openbsd-516d42a37e959abe3af667ee52ca4a479cfc1b0f.zip
Move the construction of p_tamenote from sys_open() to doopenat(), so that
it also applies to sys_openat().
-rw-r--r--sys/kern/vfs_syscalls.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 4161cd5d275..b5ac7b74bfb 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_syscalls.c,v 1.221 2015/07/19 02:35:35 deraadt Exp $ */
+/* $OpenBSD: vfs_syscalls.c,v 1.222 2015/07/20 21:31:57 deraadt Exp $ */
/* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */
/*
@@ -812,16 +812,6 @@ sys_open(struct proc *p, void *v, register_t *retval)
syscallarg(int) flags;
syscallarg(mode_t) mode;
} */ *uap = v;
- int flags = SCARG(uap, flags);
-
- switch (flags & O_ACCMODE) {
- case O_WRONLY:
- case O_RDWR:
- p->p_tamenote |= TMN_WRITE;
- break;
- }
- if (flags & O_CREAT)
- p->p_tamenote |= TMN_CREAT;
return (doopenat(p, AT_FDCWD, SCARG(uap, path), SCARG(uap, flags),
SCARG(uap, mode), retval));
@@ -854,6 +844,15 @@ doopenat(struct proc *p, int fd, const char *path, int oflags, mode_t mode,
struct flock lf;
struct nameidata nd;
+ switch (oflags & O_ACCMODE) {
+ case O_WRONLY:
+ case O_RDWR:
+ p->p_tamenote |= TMN_WRITE;
+ break;
+ }
+ if (oflags & O_CREAT)
+ p->p_tamenote |= TMN_CREAT;
+
fdplock(fdp);
if ((error = falloc(p, &fp, &indx)) != 0)