From 3246fbf45f089a96288563f2d5071bfbde5f99df Mon Sep 17 00:00:00 2001 From: rwatson Date: Sat, 17 Aug 2002 02:36:16 +0000 Subject: In continuation of early fileop credential changes, modify fo_ioctl() to accept an 'active_cred' argument reflecting the credential of the thread initiating the ioctl operation. - Change fo_ioctl() to accept active_cred; change consumers of the fo_ioctl() interface to generally pass active_cred from td->td_ucred. - In fifofs, initialize filetmp.f_cred to ap->a_cred so that the invocations of soo_ioctl() are provided access to the calling f_cred. Pass ap->a_td->td_ucred as the active_cred, but note that this is required because we don't yet distinguish file_cred and active_cred in invoking VOP's. - Update kqueue_ioctl() for its new argument. - Update pipe_ioctl() for its new argument, pass active_cred rather than td_ucred to MAC for authorization. - Update soo_ioctl() for its new argument. - Update vn_ioctl() for its new argument, use active_cred rather than td->td_ucred to authorize VOP_IOCTL() and the associated VOP_GETATTR(). Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs --- sys/kern/kern_event.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys/kern/kern_event.c') diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 820775d..d8bc894 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -61,7 +61,7 @@ static int kqueue_read(struct file *fp, struct uio *uio, static int kqueue_write(struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, struct thread *td); static int kqueue_ioctl(struct file *fp, u_long com, void *data, - struct thread *td); + struct ucred *active_cred, struct thread *td); static int kqueue_poll(struct file *fp, int events, struct ucred *active_cred, struct thread *td); static int kqueue_kqfilter(struct file *fp, struct knote *kn); @@ -794,7 +794,8 @@ kqueue_write(struct file *fp, struct uio *uio, struct ucred *active_cred, /*ARGSUSED*/ static int -kqueue_ioctl(struct file *fp, u_long com, void *data, struct thread *td) +kqueue_ioctl(struct file *fp, u_long com, void *data, + struct ucred *active_cred, struct thread *td) { return (ENOTTY); } -- cgit v1.1