summaryrefslogtreecommitdiffstats
path: root/sys/security
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2006-10-02 06:56:10 +0000
committerrwatson <rwatson@FreeBSD.org>2006-10-02 06:56:10 +0000
commit8e20187251b5eb6fa296c7915adc34f4072fa135 (patch)
tree0c0ba3b4b9eb022b585ea9f7abb7bf1958ba9bb6 /sys/security
parentb8619af36ab6d4c57bc5c6513f1f45851c08a632 (diff)
downloadFreeBSD-src-8e20187251b5eb6fa296c7915adc34f4072fa135.zip
FreeBSD-src-8e20187251b5eb6fa296c7915adc34f4072fa135.tar.gz
Audit path argument when changing audit trails.
Call NDFREE(), which while not currently strictly necessary, isn't a bad idea. MFC after: 3 days Obtained from: TrustedBSD Project
Diffstat (limited to 'sys/security')
-rw-r--r--sys/security/audit/audit_syscalls.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/security/audit/audit_syscalls.c b/sys/security/audit/audit_syscalls.c
index 03884b2..da894fd 100644
--- a/sys/security/audit/audit_syscalls.c
+++ b/sys/security/audit/audit_syscalls.c
@@ -555,15 +555,16 @@ auditctl(struct thread *td, struct auditctl_args *uap)
if (uap->path == NULL)
return (EINVAL);
- NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | MPSAFE, UIO_USERSPACE,
- uap->path, td);
+ NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | MPSAFE | AUDITVNODE1,
+ UIO_USERSPACE, uap->path, td);
flags = AUDIT_OPEN_FLAGS;
error = vn_open(&nd, &flags, 0, -1);
if (error)
return (error);
vfslocked = NDHASGIANT(&nd);
- VOP_UNLOCK(nd.ni_vp, 0, td);
vp = nd.ni_vp;
+ VOP_UNLOCK(vp, 0, td);
+ NDFREE(&nd, NDF_ONLY_PNBUF);
if (vp->v_type != VREG) {
vn_close(vp, AUDIT_CLOSE_FLAGS, td->td_ucred, td);
VFS_UNLOCK_GIANT(vfslocked);
OpenPOWER on IntegriCloud