diff options
author | rwatson <rwatson@FreeBSD.org> | 2002-08-17 02:36:16 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2002-08-17 02:36:16 +0000 |
commit | 3246fbf45f089a96288563f2d5071bfbde5f99df (patch) | |
tree | fe31f7ea9a8713005d8ba378b027671dbea5c058 /sys/compat/svr4/svr4_termios.c | |
parent | 2c79764ced8717b21fed701119314cb23bbbbbf6 (diff) | |
download | FreeBSD-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/compat/svr4/svr4_termios.c')
-rw-r--r-- | sys/compat/svr4/svr4_termios.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/compat/svr4/svr4_termios.c b/sys/compat/svr4/svr4_termios.c index 5fdd5a6..ab1e799 100644 --- a/sys/compat/svr4/svr4_termios.c +++ b/sys/compat/svr4/svr4_termios.c @@ -499,7 +499,8 @@ svr4_term_ioctl(fp, td, retval, fd, cmd, data) case SVR4_TCGETA: case SVR4_TCGETS: DPRINTF(("ioctl(TCGET%c);\n", cmd == SVR4_TCGETA ? 'A' : 'S')); - if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t) &bt, td)) != 0) + if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t) &bt, + td->td_ucred, td)) != 0) return error; memset(&st, 0, sizeof(st)); @@ -526,7 +527,8 @@ svr4_term_ioctl(fp, td, retval, fd, cmd, data) case SVR4_TCSETSF: DPRINTF(("TCSET{A,S,AW,SW,AF,SF}\n")); /* get full BSD termios so we don't lose information */ - if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t) &bt, td)) != 0) + if ((error = fo_ioctl(fp, TIOCGETA, (caddr_t) &bt, + td->td_ucred, td)) != 0) return error; switch (cmd) { @@ -577,14 +579,15 @@ svr4_term_ioctl(fp, td, retval, fd, cmd, data) print_svr4_termios(&st); #endif /* DEBUG_SVR4 */ - return fo_ioctl(fp, cmd, (caddr_t) &bt, td); + return fo_ioctl(fp, cmd, (caddr_t) &bt, td->td_ucred, td); case SVR4_TIOCGWINSZ: DPRINTF(("TIOCGWINSZ\n")); { struct svr4_winsize ws; - error = fo_ioctl(fp, TIOCGWINSZ, (caddr_t) &ws, td); + error = fo_ioctl(fp, TIOCGWINSZ, (caddr_t) &ws, + td->td_ucred, td); if (error) return error; return copyout(&ws, data, sizeof(ws)); @@ -597,7 +600,8 @@ svr4_term_ioctl(fp, td, retval, fd, cmd, data) if ((error = copyin(data, &ws, sizeof(ws))) != 0) return error; - return fo_ioctl(fp, TIOCSWINSZ, (caddr_t) &ws, td); + return fo_ioctl(fp, TIOCSWINSZ, (caddr_t) &ws, + td->td_ucred, td); } default: |