summaryrefslogtreecommitdiffstats
path: root/sys/i386/ibcs2
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/i386/ibcs2
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/i386/ibcs2')
-rw-r--r--sys/i386/ibcs2/ibcs2_fcntl.c3
-rw-r--r--sys/i386/ibcs2/ibcs2_ioctl.c21
2 files changed, 15 insertions, 9 deletions
diff --git a/sys/i386/ibcs2/ibcs2_fcntl.c b/sys/i386/ibcs2/ibcs2_fcntl.c
index 1a2a22a..6ada6c9 100644
--- a/sys/i386/ibcs2/ibcs2_fcntl.c
+++ b/sys/i386/ibcs2/ibcs2_fcntl.c
@@ -203,7 +203,8 @@ ibcs2_open(td, uap)
/* ignore any error, just give it a try */
if (fp->f_type == DTYPE_VNODE)
- fo_ioctl(fp, TIOCSCTTY, (caddr_t) 0, td);
+ fo_ioctl(fp, TIOCSCTTY, (caddr_t) 0, td->td_ucred,
+ td);
fdrop(fp, td);
} else
PROC_UNLOCK(p);
diff --git a/sys/i386/ibcs2/ibcs2_ioctl.c b/sys/i386/ibcs2/ibcs2_ioctl.c
index b192b61..dc25012 100644
--- a/sys/i386/ibcs2/ibcs2_ioctl.c
+++ b/sys/i386/ibcs2/ibcs2_ioctl.c
@@ -365,7 +365,8 @@ ibcs2_ioctl(td, uap)
struct ibcs2_termios sts;
struct ibcs2_termio st;
- if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t)&bts, td)) != 0)
+ if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t)&bts,
+ td->td_ucred, td)) != 0)
break;
btios2stios (&bts, &sts);
@@ -403,7 +404,8 @@ ibcs2_ioctl(td, uap)
}
/* get full BSD termios so we don't lose information */
- if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t)&bts, td)) != 0) {
+ if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t)&bts,
+ td->td_ucred, td)) != 0) {
DPRINTF(("ibcs2_ioctl(%d): TCSET ctl failed fd %d ",
p->p_pid, SCARG(uap, fd)));
break;
@@ -418,7 +420,7 @@ ibcs2_ioctl(td, uap)
stios2btios(&sts, &bts);
error = fo_ioctl(fp, SCARG(uap, cmd) - IBCS2_TCSETA + TIOCSETA,
- (caddr_t)&bts, td);
+ (caddr_t)&bts, td->td_ucred, td);
break;
}
@@ -434,7 +436,7 @@ ibcs2_ioctl(td, uap)
break;
stios2btios (&sts, &bts);
error = fo_ioctl(fp, SCARG(uap, cmd) - IBCS2_XCSETA + TIOCSETA,
- (caddr_t)&bts, td);
+ (caddr_t)&bts, td->td_ucred, td);
break;
}
@@ -450,7 +452,7 @@ ibcs2_ioctl(td, uap)
break;
stios2btios (&sts, &bts);
error = fo_ioctl(fp, SCARG(uap, cmd) - IBCS2_OXCSETA + TIOCSETA,
- (caddr_t)&bts, td);
+ (caddr_t)&bts, td->td_ucred, td);
break;
}
@@ -468,10 +470,12 @@ ibcs2_ioctl(td, uap)
error = ENOSYS;
break;
case 2:
- error = fo_ioctl(fp, TIOCSTOP, (caddr_t)0, td);
+ error = fo_ioctl(fp, TIOCSTOP, (caddr_t)0,
+ td->td_ucred, td);
break;
case 3:
- error = fo_ioctl(fp, TIOCSTART, (caddr_t)1, td);
+ error = fo_ioctl(fp, TIOCSTART, (caddr_t)1,
+ td->td_ucred, td);
break;
default:
error = EINVAL;
@@ -498,7 +502,8 @@ ibcs2_ioctl(td, uap)
fdrop(fp, td);
return EINVAL;
}
- error = fo_ioctl(fp, TIOCFLUSH, (caddr_t)&arg, td);
+ error = fo_ioctl(fp, TIOCFLUSH, (caddr_t)&arg, td->td_ucred,
+ td);
break;
}
OpenPOWER on IntegriCloud