diff options
author | rwatson <rwatson@FreeBSD.org> | 2002-07-22 12:51:06 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2002-07-22 12:51:06 +0000 |
commit | fcb9022bbd197d29db9969eb8ddad8754296f8d0 (patch) | |
tree | 944d51416459b321e880adef34e272e5cabacd7c | |
parent | 28e1b1786ca3342d3a2e208c6af3dd9738aa87a9 (diff) | |
download | FreeBSD-src-fcb9022bbd197d29db9969eb8ddad8754296f8d0.zip FreeBSD-src-fcb9022bbd197d29db9969eb8ddad8754296f8d0.tar.gz |
Set VAPPEND in open mode when O_APPEND is specified as an argument to
open() of fhopen(). Currently this has no actual affect due to the
treatment of VAPPEND in vaccess() and vaccess_acl() as a subset of
VWRITE, but when MAC comes in, MAC will distinguish the two. Note:
if any file systems are cutting their own permission models, they
may wish to now take this into account.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
-rw-r--r-- | sys/kern/vfs_extattr.c | 2 | ||||
-rw-r--r-- | sys/kern/vfs_syscalls.c | 2 | ||||
-rw-r--r-- | sys/kern/vfs_vnops.c | 2 |
3 files changed, 6 insertions, 0 deletions
diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c index b787bc2..2a8e247 100644 --- a/sys/kern/vfs_extattr.c +++ b/sys/kern/vfs_extattr.c @@ -3221,6 +3221,8 @@ fhopen(td, uap) } if (fmode & FREAD) mode |= VREAD; + if (fmode & O_APPEND) + mode |= VAPPEND; if (mode) { error = VOP_ACCESS(vp, mode, td->td_ucred, td); if (error) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index b787bc2..2a8e247 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -3221,6 +3221,8 @@ fhopen(td, uap) } if (fmode & FREAD) mode |= VREAD; + if (fmode & O_APPEND) + mode |= VAPPEND; if (mode) { error = VOP_ACCESS(vp, mode, td->td_ucred, td); if (error) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index cd14442..218dd72 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -201,6 +201,8 @@ restart: } if (fmode & FREAD) mode |= VREAD; + if (fmode & O_APPEND) + mode |= VAPPEND; if (mode) { error = VOP_ACCESS(vp, mode, cred, td); if (error) |