summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_subr.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2002-07-22 03:57:07 +0000
committerrwatson <rwatson@FreeBSD.org>2002-07-22 03:57:07 +0000
commit7be639a7c001f8dc5f8e7b6d1951845156bb997d (patch)
tree174e3bfd203f2088fac3efc5f68dfc8e96d1c5a3 /sys/kern/vfs_subr.c
parentc578ffd6e110dce1199cb540aa12951448b6e570 (diff)
downloadFreeBSD-src-7be639a7c001f8dc5f8e7b6d1951845156bb997d.zip
FreeBSD-src-7be639a7c001f8dc5f8e7b6d1951845156bb997d.tar.gz
Teach discretionary access control methods for files about VAPPEND
and VALLPERM. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r--sys/kern/vfs_subr.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index e620d4a..4d87718 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -3251,7 +3251,7 @@ vaccess(type, file_mode, file_uid, file_gid, acc_mode, cred, privused)
if (file_mode & S_IRUSR)
dac_granted |= VREAD;
if (file_mode & S_IWUSR)
- dac_granted |= VWRITE;
+ dac_granted |= (VWRITE | VAPPEND);
if ((acc_mode & dac_granted) == acc_mode)
return (0);
@@ -3266,7 +3266,7 @@ vaccess(type, file_mode, file_uid, file_gid, acc_mode, cred, privused)
if (file_mode & S_IRGRP)
dac_granted |= VREAD;
if (file_mode & S_IWGRP)
- dac_granted |= VWRITE;
+ dac_granted |= (VWRITE | VAPPEND);
if ((acc_mode & dac_granted) == acc_mode)
return (0);
@@ -3280,7 +3280,7 @@ vaccess(type, file_mode, file_uid, file_gid, acc_mode, cred, privused)
if (file_mode & S_IROTH)
dac_granted |= VREAD;
if (file_mode & S_IWOTH)
- dac_granted |= VWRITE;
+ dac_granted |= (VWRITE | VAPPEND);
if ((acc_mode & dac_granted) == acc_mode)
return (0);
@@ -3322,7 +3322,7 @@ privcheck:
if ((acc_mode & VWRITE) && ((dac_granted & VWRITE) == 0) &&
!cap_check(cred, NULL, CAP_DAC_WRITE, PRISON_ROOT))
- cap_granted |= VWRITE;
+ cap_granted |= (VWRITE | VAPPEND);
if ((acc_mode & VADMIN) && ((dac_granted & VADMIN) == 0) &&
!cap_check(cred, NULL, CAP_FOWNER, PRISON_ROOT))
OpenPOWER on IntegriCloud