From bf6f6091a42014bc9d3a94ad39db39be05f0ac95 Mon Sep 17 00:00:00 2001 From: rwatson Date: Sun, 22 Jun 2003 22:28:56 +0000 Subject: 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 --- sys/kern/kern_ktr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys/kern/kern_ktr.c') 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; -- cgit v1.1