summaryrefslogtreecommitdiffstats
path: root/sys/kern/sys_pipe.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2002-08-17 02:36:16 +0000
committerrwatson <rwatson@FreeBSD.org>2002-08-17 02:36:16 +0000
commit3246fbf45f089a96288563f2d5071bfbde5f99df (patch)
treefe31f7ea9a8713005d8ba378b027671dbea5c058 /sys/kern/sys_pipe.c
parent2c79764ced8717b21fed701119314cb23bbbbbf6 (diff)
downloadFreeBSD-src-3246fbf45f089a96288563f2d5071bfbde5f99df.zip
FreeBSD-src-3246fbf45f089a96288563f2d5071bfbde5f99df.tar.gz
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
Diffstat (limited to 'sys/kern/sys_pipe.c')
-rw-r--r--sys/kern/sys_pipe.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c
index 624ac6b..d956501 100644
--- a/sys/kern/sys_pipe.c
+++ b/sys/kern/sys_pipe.c
@@ -105,7 +105,7 @@ static int pipe_kqfilter(struct file *fp, struct knote *kn);
static int pipe_stat(struct file *fp, struct stat *sb,
struct ucred *active_cred, struct thread *td);
static int pipe_ioctl(struct file *fp, u_long cmd, void *data,
- struct thread *td);
+ struct ucred *active_cred, struct thread *td);
static struct fileops pipeops = {
pipe_read, pipe_write, pipe_ioctl, pipe_poll, pipe_kqfilter,
@@ -1155,10 +1155,11 @@ pipe_write(fp, uio, active_cred, flags, td)
* we implement a very minimal set of ioctls for compatibility with sockets.
*/
int
-pipe_ioctl(fp, cmd, data, td)
+pipe_ioctl(fp, cmd, data, active_cred, td)
struct file *fp;
u_long cmd;
void *data;
+ struct ucred *active_cred;
struct thread *td;
{
struct pipe *mpipe = (struct pipe *)fp->f_data;
@@ -1166,7 +1167,7 @@ pipe_ioctl(fp, cmd, data, td)
int error;
/* XXXMAC: Pipe should be locked for this check. */
- error = mac_check_pipe_ioctl(td->td_ucred, mpipe, cmd, data);
+ error = mac_check_pipe_ioctl(active_cred, mpipe, cmd, data);
if (error)
return (error);
#endif
OpenPOWER on IntegriCloud