diff options
author | csjp <csjp@FreeBSD.org> | 2006-03-11 17:14:05 +0000 |
---|---|---|
committer | csjp <csjp@FreeBSD.org> | 2006-03-11 17:14:05 +0000 |
commit | 1a65da68830e24175d6111cc80feee7922b00d28 (patch) | |
tree | 863797a5d496a188d15f4d0a542c1b020a56ea69 /sys | |
parent | 4bed556ee9ffb28b14c3b7da0161c729496fc4ce (diff) | |
download | FreeBSD-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')
-rw-r--r-- | sys/kern/vfs_vnops.c | 5 |
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; |