diff options
author | rwatson <rwatson@FreeBSD.org> | 2006-10-02 06:56:10 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2006-10-02 06:56:10 +0000 |
commit | 8e20187251b5eb6fa296c7915adc34f4072fa135 (patch) | |
tree | 0c0ba3b4b9eb022b585ea9f7abb7bf1958ba9bb6 | |
parent | b8619af36ab6d4c57bc5c6513f1f45851c08a632 (diff) | |
download | FreeBSD-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
-rw-r--r-- | sys/security/audit/audit_syscalls.c | 7 |
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); |