summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorcsjp <csjp@FreeBSD.org>2006-03-11 17:14:05 +0000
committercsjp <csjp@FreeBSD.org>2006-03-11 17:14:05 +0000
commit1a65da68830e24175d6111cc80feee7922b00d28 (patch)
tree863797a5d496a188d15f4d0a542c1b020a56ea69 /sys/kern
parent4bed556ee9ffb28b14c3b7da0161c729496fc4ce (diff)
downloadFreeBSD-src-1a65da68830e24175d6111cc80feee7922b00d28.zip
FreeBSD-src-1a65da68830e24175d6111cc80feee7922b00d28.tar.gz
Make sure that we are adding a path token to the audit record in open(2).
Do this by making sure we are using the AUDITVNODE1 mask in the namei flags. Obtained from: TrustedBSD Project
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/vfs_vnops.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index f598360..fd126a5 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -118,7 +118,8 @@ restart:
fmode = *flagp;
if (fmode & O_CREAT) {
ndp->ni_cnd.cn_nameiop = CREATE;
- ndp->ni_cnd.cn_flags = ISOPEN | LOCKPARENT | LOCKLEAF | MPSAFE;
+ ndp->ni_cnd.cn_flags = ISOPEN | LOCKPARENT | LOCKLEAF |
+ MPSAFE | AUDITVNODE1;
if ((fmode & O_EXCL) == 0 && (fmode & O_NOFOLLOW) == 0)
ndp->ni_cnd.cn_flags |= FOLLOW;
bwillwrite();
@@ -178,7 +179,7 @@ restart:
ndp->ni_cnd.cn_nameiop = LOOKUP;
ndp->ni_cnd.cn_flags = ISOPEN |
((fmode & O_NOFOLLOW) ? NOFOLLOW : FOLLOW) |
- LOCKSHARED | LOCKLEAF | MPSAFE;
+ LOCKSHARED | LOCKLEAF | MPSAFE | AUDITVNODE1;
if ((error = namei(ndp)) != 0)
return (error);
ndp->ni_cnd.cn_flags &= ~MPSAFE;
OpenPOWER on IntegriCloud