summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_ktr.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2003-06-22 22:28:56 +0000
committerrwatson <rwatson@FreeBSD.org>2003-06-22 22:28:56 +0000
commitbf6f6091a42014bc9d3a94ad39db39be05f0ac95 (patch)
treebc4b3b8a3ea1113c0b04660bb9d668ef73c73e57 /sys/kern/kern_ktr.c
parent4e21fcc762aac198eecaa42ece0d974d33185911 (diff)
downloadFreeBSD-src-bf6f6091a42014bc9d3a94ad39db39be05f0ac95.zip
FreeBSD-src-bf6f6091a42014bc9d3a94ad39db39be05f0ac95.tar.gz
Add an explicit credential argument to alq_open() to allow the caller to
specify what credential to use when authorizing vn_open() and later write operations, rather than curthread->td_ucred. When writing KTR traces to an ALQ, specify the credential of the thread generating the sysctl request. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
Diffstat (limited to 'sys/kern/kern_ktr.c')
-rw-r--r--sys/kern/kern_ktr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/kern_ktr.c b/sys/kern/kern_ktr.c
index 27f3896..13d0526 100644
--- a/sys/kern/kern_ktr.c
+++ b/sys/kern/kern_ktr.c
@@ -141,8 +141,9 @@ sysctl_debug_ktr_alq_enable(SYSCTL_HANDLER_ARGS)
error = suser(curthread);
if (error)
return (error);
- error = alq_open(&ktr_alq, (const char *)ktr_alq_file,
- sizeof(struct ktr_entry), ktr_alq_depth);
+ error = alq_open(&ktr_alq, (const char *)ktr_alq_file,
+ req->td->td_ucred, sizeof(struct ktr_entry),
+ ktr_alq_depth);
if (error == 0) {
ktr_mask &= ~KTR_ALQ_MASK;
ktr_alq_cnt = 0;
OpenPOWER on IntegriCloud