PERFORCE change 16140 for review
Robert Watson
rwatson at freebsd.org
Sat Aug 17 02:46:31 GMT 2002
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=16140
Change 16140 by rwatson at rwatson_tislabs on 2002/08/16 19:45:47
IFC TrustedBSD base branch from main FreeBSD tree: trickle back
in MAC tree commits such as fo_ioctl() credential change.
Affected files ...
.. //depot/projects/trustedbsd/base/sys/cam/scsi/scsi_da.c#14 integrate
.. //depot/projects/trustedbsd/base/sys/compat/linux/linux_file.c#8 integrate
.. //depot/projects/trustedbsd/base/sys/compat/linux/linux_ioctl.c#11 integrate
.. //depot/projects/trustedbsd/base/sys/compat/svr4/svr4_fcntl.c#7 integrate
.. //depot/projects/trustedbsd/base/sys/compat/svr4/svr4_filio.c#5 integrate
.. //depot/projects/trustedbsd/base/sys/compat/svr4/svr4_sockio.c#3 integrate
.. //depot/projects/trustedbsd/base/sys/compat/svr4/svr4_stream.c#6 integrate
.. //depot/projects/trustedbsd/base/sys/compat/svr4/svr4_termios.c#3 integrate
.. //depot/projects/trustedbsd/base/sys/compat/svr4/svr4_ttold.c#3 integrate
.. //depot/projects/trustedbsd/base/sys/dev/aac/aac.c#9 integrate
.. //depot/projects/trustedbsd/base/sys/dev/drm/drm_drv.h#3 integrate
.. //depot/projects/trustedbsd/base/sys/dev/mii/mii.c#5 integrate
.. //depot/projects/trustedbsd/base/sys/dev/tdfx/tdfx_pci.c#4 integrate
.. //depot/projects/trustedbsd/base/sys/fs/fifofs/fifo_vnops.c#13 integrate
.. //depot/projects/trustedbsd/base/sys/i386/ibcs2/ibcs2_fcntl.c#4 integrate
.. //depot/projects/trustedbsd/base/sys/i386/ibcs2/ibcs2_ioctl.c#6 integrate
.. //depot/projects/trustedbsd/base/sys/kern/kern_descrip.c#22 integrate
.. //depot/projects/trustedbsd/base/sys/kern/kern_event.c#12 integrate
.. //depot/projects/trustedbsd/base/sys/kern/sys_generic.c#15 integrate
.. //depot/projects/trustedbsd/base/sys/kern/sys_pipe.c#18 integrate
.. //depot/projects/trustedbsd/base/sys/kern/sys_socket.c#9 integrate
.. //depot/projects/trustedbsd/base/sys/kern/vfs_vnops.c#25 integrate
.. //depot/projects/trustedbsd/base/sys/netinet/tcp_input.c#17 integrate
.. //depot/projects/trustedbsd/base/sys/pci/if_ste.c#6 integrate
.. //depot/projects/trustedbsd/base/sys/sys/file.h#11 integrate
.. //depot/projects/trustedbsd/base/sys/sys/socketvar.h#20 integrate
Differences ...
==== //depot/projects/trustedbsd/base/sys/cam/scsi/scsi_da.c#14 (text+ko) ====
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/cam/scsi/scsi_da.c,v 1.105 2002/08/15 20:54:02 njl Exp $
+ * $FreeBSD: src/sys/cam/scsi/scsi_da.c,v 1.106 2002/08/16 22:05:19 njl Exp $
*/
#ifdef _KERNEL
@@ -1284,40 +1284,43 @@
struct scsi_rw_6 cmd6;
struct scsi_rw_10 *cmd10;
struct da_softc *softc;
- struct ccb_scsiio *csio;
- u_int8_t opcode;
+ u_int8_t *cdb;
+ int frozen;
- csio = &ccb->csio;
- opcode = ((struct scsi_rw_6 *)csio->cdb_io.cdb_bytes)->opcode;
+ cdb = ccb->csio.cdb_io.cdb_bytes;
- if (opcode != READ_6 && opcode != WRITE_6)
+ /* Translation only possible if CDB is an array and cmd is R/W6 */
+ if ((ccb->ccb_h.flags & CAM_CDB_POINTER) != 0 ||
+ (*cdb != READ_6 && *cdb != WRITE_6))
return 0;
xpt_print_path(ccb->ccb_h.path);
- printf("READ(6)/WRITE(6) failed, "
- "minimum_cmd_size is increased to 10.\n");
+ printf("READ(6)/WRITE(6) not supported, "
+ "increasing minimum_cmd_size to 10.\n");
softc = (struct da_softc *)xpt_path_periph(ccb->ccb_h.path)->softc;
softc->minimum_cmd_size = 10;
- bcopy(&csio->cdb_io.cdb_bytes, &cmd6, sizeof(struct scsi_rw_6));
- cmd10 = (struct scsi_rw_10 *) &csio->cdb_io.cdb_bytes;
+ bcopy(cdb, &cmd6, sizeof(struct scsi_rw_6));
+ cmd10 = (struct scsi_rw_10 *)cdb;
cmd10->opcode = (cmd6.opcode == READ_6) ? READ_10 : WRITE_10;
cmd10->byte2 = 0;
scsi_ulto4b(scsi_3btoul(cmd6.addr), cmd10->addr);
cmd10->reserved = 0;
scsi_ulto2b(cmd6.length, cmd10->length);
cmd10->control = cmd6.control;
- csio->cdb_len = sizeof(*cmd10);
+ ccb->csio.cdb_len = sizeof(*cmd10);
- /* requeue */
+ /* Requeue request, unfreezing queue if necessary */
+ frozen = (ccb->ccb_h.status & CAM_DEV_QFRZN) != 0;
ccb->ccb_h.status = CAM_REQUEUE_REQ;
xpt_action(ccb);
- if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0)
+ if (frozen) {
cam_release_devq(ccb->ccb_h.path,
/*relsim_flags*/0,
/*reduction*/0,
/*timeout*/0,
/*getcount_only*/0);
+ }
return (ERESTART);
}
@@ -1595,14 +1598,14 @@
*/
error = 0;
if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_SCSI_STATUS_ERROR
- && ccb->csio.scsi_status == SCSI_STATUS_CHECK_COND) {
+ && ccb->csio.scsi_status == SCSI_STATUS_CHECK_COND) {
scsi_extract_sense(&ccb->csio.sense_data,
- &error_code, &sense_key, &asc, &ascq);
+ &error_code, &sense_key, &asc, &ascq);
if (sense_key == SSD_KEY_ILLEGAL_REQUEST)
error = cmd6workaround(ccb);
}
if (error == ERESTART)
- return ERESTART;
+ return (ERESTART);
/*
* XXX
==== //depot/projects/trustedbsd/base/sys/compat/linux/linux_file.c#8 (text+ko) ====
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/compat/linux/linux_file.c,v 1.68 2002/08/12 01:18:33 rwatson Exp $
+ * $FreeBSD: src/sys/compat/linux/linux_file.c,v 1.69 2002/08/17 02:36:14 rwatson Exp $
*/
#include "opt_compat.h"
@@ -143,7 +143,8 @@
PROC_UNLOCK(p);
if (!error) {
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 {
==== //depot/projects/trustedbsd/base/sys/compat/linux/linux_ioctl.c#11 (text+ko) ====
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/compat/linux/linux_ioctl.c,v 1.86 2002/06/26 15:53:11 arr Exp $
+ * $FreeBSD: src/sys/compat/linux/linux_ioctl.c,v 1.87 2002/08/17 02:36:14 rwatson Exp $
*/
#include <sys/param.h>
@@ -113,7 +113,8 @@
return (error);
switch (args->cmd & 0xffff) {
case LINUX_BLKGETSIZE:
- error = fo_ioctl(fp, DIOCGDINFO, (caddr_t)&dl, td);
+ error = fo_ioctl(fp, DIOCGDINFO, (caddr_t)&dl, td->td_ucred,
+ td);
fdrop(fp, td);
if (error)
return (error);
@@ -560,7 +561,8 @@
switch (args->cmd & 0xffff) {
case LINUX_TCGETS:
- error = fo_ioctl(fp, TIOCGETA, (caddr_t)&bios, td);
+ error = fo_ioctl(fp, TIOCGETA, (caddr_t)&bios, td->td_ucred,
+ td);
if (error)
break;
bsd_to_linux_termios(&bios, &lios);
@@ -572,7 +574,8 @@
if (error)
break;
linux_to_bsd_termios(&lios, &bios);
- error = (fo_ioctl(fp, TIOCSETA, (caddr_t)&bios, td));
+ error = (fo_ioctl(fp, TIOCSETA, (caddr_t)&bios, td->td_ucred,
+ td));
break;
case LINUX_TCSETSW:
@@ -580,7 +583,8 @@
if (error)
break;
linux_to_bsd_termios(&lios, &bios);
- error = (fo_ioctl(fp, TIOCSETAW, (caddr_t)&bios, td));
+ error = (fo_ioctl(fp, TIOCSETAW, (caddr_t)&bios, td->td_ucred,
+ td));
break;
case LINUX_TCSETSF:
@@ -588,11 +592,13 @@
if (error)
break;
linux_to_bsd_termios(&lios, &bios);
- error = (fo_ioctl(fp, TIOCSETAF, (caddr_t)&bios, td));
+ error = (fo_ioctl(fp, TIOCSETAF, (caddr_t)&bios, td->td_ucred,
+ td));
break;
case LINUX_TCGETA:
- error = fo_ioctl(fp, TIOCGETA, (caddr_t)&bios, td);
+ error = fo_ioctl(fp, TIOCGETA, (caddr_t)&bios, td->td_ucred,
+ td);
if (error)
break;
bsd_to_linux_termio(&bios, &lio);
@@ -604,7 +610,8 @@
if (error)
break;
linux_to_bsd_termio(&lio, &bios);
- error = (fo_ioctl(fp, TIOCSETA, (caddr_t)&bios, td));
+ error = (fo_ioctl(fp, TIOCSETA, (caddr_t)&bios, td->td_ucred,
+ td));
break;
case LINUX_TCSETAW:
@@ -612,7 +619,8 @@
if (error)
break;
linux_to_bsd_termio(&lio, &bios);
- error = (fo_ioctl(fp, TIOCSETAW, (caddr_t)&bios, td));
+ error = (fo_ioctl(fp, TIOCSETAW, (caddr_t)&bios, td->td_ucred,
+ td));
break;
case LINUX_TCSETAF:
@@ -620,7 +628,8 @@
if (error)
break;
linux_to_bsd_termio(&lio, &bios);
- error = (fo_ioctl(fp, TIOCSETAF, (caddr_t)&bios, td));
+ error = (fo_ioctl(fp, TIOCSETAF, (caddr_t)&bios, td->td_ucred,
+ td));
break;
/* LINUX_TCSBRK */
@@ -637,7 +646,8 @@
case LINUX_TCION: {
int c;
struct write_args wr;
- error = fo_ioctl(fp, TIOCGETA, (caddr_t)&bios, td);
+ error = fo_ioctl(fp, TIOCGETA, (caddr_t)&bios,
+ td->td_ucred, td);
if (error)
break;
fdrop(fp, td);
@@ -799,14 +809,16 @@
fdrop(fp, td);
return (EINVAL);
}
- error = (fo_ioctl(fp, TIOCSETD, (caddr_t)&line, td));
+ error = (fo_ioctl(fp, TIOCSETD, (caddr_t)&line, td->td_ucred,
+ td));
break;
}
case LINUX_TIOCGETD: {
int linux_line;
int bsd_line = TTYDISC;
- error = fo_ioctl(fp, TIOCGETD, (caddr_t)&bsd_line, td);
+ error = fo_ioctl(fp, TIOCGETD, (caddr_t)&bsd_line,
+ td->td_ucred, td);
if (error)
return (error);
switch (bsd_line) {
@@ -1275,7 +1287,8 @@
case LINUX_CDROMREADTOCHDR: {
struct ioc_toc_header th;
struct linux_cdrom_tochdr lth;
- error = fo_ioctl(fp, CDIOREADTOCHEADER, (caddr_t)&th, td);
+ error = fo_ioctl(fp, CDIOREADTOCHEADER, (caddr_t)&th,
+ td->td_ucred, td);
if (!error) {
lth.cdth_trk0 = th.starting_track;
lth.cdth_trk1 = th.ending_track;
@@ -1290,7 +1303,8 @@
struct ioc_read_toc_single_entry irtse;
irtse.address_format = ltep->cdte_format;
irtse.track = ltep->cdte_track;
- error = fo_ioctl(fp, CDIOREADTOCENTRY, (caddr_t)&irtse, td);
+ error = fo_ioctl(fp, CDIOREADTOCENTRY, (caddr_t)&irtse,
+ td->td_ucred, td);
if (!error) {
lte = *ltep;
lte.cdte_ctrl = irtse.entry.control;
@@ -1331,7 +1345,8 @@
bsdsc.track = 0;
bsdsc.data_len = sizeof(struct cd_sub_channel_info);
bsdsc.data = bsdinfo;
- error = fo_ioctl(fp, CDIOCREADSUBCHANNEL, (caddr_t)&bsdsc, td);
+ error = fo_ioctl(fp, CDIOCREADSUBCHANNEL, (caddr_t)&bsdsc,
+ td->td_ucred, td);
if (error)
break;
error = copyin((caddr_t)args->arg, &sc,
@@ -1397,7 +1412,8 @@
error = linux_to_bsd_dvd_struct(&lds, &bds);
if (error)
break;
- error = fo_ioctl(fp, DVDIOCREADSTRUCTURE, (caddr_t)&bds, td);
+ error = fo_ioctl(fp, DVDIOCREADSTRUCTURE, (caddr_t)&bds,
+ td->td_ucred, td);
if (error)
break;
error = bsd_to_linux_dvd_struct(&bds, &lds);
@@ -1422,7 +1438,8 @@
error = linux_to_bsd_dvd_authinfo(&lda, &bcode, &bda);
if (error)
break;
- error = fo_ioctl(fp, bcode, (caddr_t)&bda, td);
+ error = fo_ioctl(fp, bcode, (caddr_t)&bda, td->td_ucred,
+ td);
if (error) {
if (lda.type == LINUX_DVD_HOST_SEND_KEY2) {
lda.type = LINUX_DVD_AUTH_FAILURE;
@@ -1759,7 +1776,8 @@
fdrop(fp, td);
return (EINVAL);
}
- error = (fo_ioctl(fp, KDSKBMODE, (caddr_t)&kbdmode, td));
+ error = (fo_ioctl(fp, KDSKBMODE, (caddr_t)&kbdmode,
+ td->td_ucred, td));
break;
}
==== //depot/projects/trustedbsd/base/sys/compat/svr4/svr4_fcntl.c#7 (text+ko) ====
@@ -28,7 +28,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/compat/svr4/svr4_fcntl.c,v 1.24 2002/08/12 01:42:21 rwatson Exp $
+ * $FreeBSD: src/sys/compat/svr4/svr4_fcntl.c,v 1.25 2002/08/17 02:36:15 rwatson Exp $
*/
#include "opt_mac.h"
@@ -399,7 +399,8 @@
return (EBADF); /* XXX: correct errno? */
/* 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);
==== //depot/projects/trustedbsd/base/sys/compat/svr4/svr4_filio.c#5 (text+ko) ====
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/compat/svr4/svr4_filio.c,v 1.15 2002/05/31 11:52:29 tanimura Exp $
+ * $FreeBSD: src/sys/compat/svr4/svr4_filio.c,v 1.16 2002/08/17 02:36:15 rwatson Exp $
*/
#include <sys/param.h>
@@ -219,7 +219,7 @@
#ifdef SVR4_DEBUG
if (cmd == FIOASYNC) DPRINTF(("FIOASYNC\n"));
#endif
- error = fo_ioctl(fp, cmd, (caddr_t) &num, td);
+ error = fo_ioctl(fp, cmd, (caddr_t) &num, td->td_ucred, td);
if (error)
return error;
==== //depot/projects/trustedbsd/base/sys/compat/svr4/svr4_sockio.c#3 (text+ko) ====
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/compat/svr4/svr4_sockio.c,v 1.11 2002/03/20 05:41:38 alfred Exp $
+ * $FreeBSD: src/sys/compat/svr4/svr4_sockio.c,v 1.12 2002/08/17 02:36:15 rwatson Exp $
*/
#include <sys/param.h>
@@ -125,7 +125,8 @@
(void) strncpy(br.ifr_name, sr.svr4_ifr_name,
sizeof(br.ifr_name));
if ((error = fo_ioctl(fp, SIOCGIFFLAGS,
- (caddr_t) &br, td)) != 0) {
+ (caddr_t) &br, td->td_ucred,
+ td)) != 0) {
DPRINTF(("SIOCGIFFLAGS (%s) %s: error %d\n",
br.ifr_name, sr.svr4_ifr_name, error));
return error;
@@ -149,7 +150,8 @@
sc.svr4_ifc_len));
if ((error = fo_ioctl(fp, OSIOCGIFCONF,
- (caddr_t) &sc, td)) != 0)
+ (caddr_t) &sc, td->td_ucred,
+ td)) != 0)
return error;
DPRINTF(("SIOCGIFCONF\n"));
==== //depot/projects/trustedbsd/base/sys/compat/svr4/svr4_stream.c#6 (text+ko) ====
@@ -27,7 +27,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/compat/svr4/svr4_stream.c,v 1.30 2002/06/11 21:14:02 alfred Exp $
+ * $FreeBSD: src/sys/compat/svr4/svr4_stream.c,v 1.31 2002/08/17 02:36:15 rwatson Exp $
*/
/*
@@ -1267,7 +1267,8 @@
* for us, and if we do, then we assume that we have at least one
* message waiting for us.
*/
- if ((error = fo_ioctl(fp, FIONREAD, (caddr_t) &nread, td)) != 0)
+ if ((error = fo_ioctl(fp, FIONREAD, (caddr_t) &nread, td->td_ucred,
+ td)) != 0)
return error;
if (nread != 0)
==== //depot/projects/trustedbsd/base/sys/compat/svr4/svr4_termios.c#3 (text+ko) ====
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/compat/svr4/svr4_termios.c,v 1.9 2002/03/20 05:41:38 alfred Exp $
+ * $FreeBSD: src/sys/compat/svr4/svr4_termios.c,v 1.10 2002/08/17 02:36:15 rwatson Exp $
*/
#include <sys/param.h>
@@ -499,7 +499,8 @@
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 @@
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 @@
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 @@
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:
==== //depot/projects/trustedbsd/base/sys/compat/svr4/svr4_ttold.c#3 (text+ko) ====
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/compat/svr4/svr4_ttold.c,v 1.10 2002/03/20 05:41:38 alfred Exp $
+ * $FreeBSD: src/sys/compat/svr4/svr4_ttold.c,v 1.11 2002/08/17 02:36:15 rwatson Exp $
*/
#include <sys/param.h>
@@ -192,8 +192,9 @@
{
pid_t pid;
- if ((error = fo_ioctl(fp, TIOCGPGRP, (caddr_t) &pid, td)) != 0)
- return error;
+ if ((error = fo_ioctl(fp, TIOCGPGRP, (caddr_t) &pid,
+ td->td_ucred, td)) != 0)
+ return error;
DPRINTF(("TIOCGPGRP %d\n", pid));
@@ -211,14 +212,16 @@
DPRINTF(("TIOCSPGRP %d\n", pid));
- return fo_ioctl(fp, TIOCSPGRP, (caddr_t) &pid, td);
+ return fo_ioctl(fp, TIOCSPGRP, (caddr_t) &pid,
+ td->td_ucred, td);
}
case SVR4_TIOCGSID:
{
#if defined(TIOCGSID)
pid_t pid;
- if ((error = fo_ioctl(fp, TIOCGSID, (caddr_t) &pid, td)) != 0)
+ if ((error = fo_ioctl(fp, TIOCGSID, (caddr_t) &pid,
+ td->td_ucred, td)) != 0)
return error;
DPRINTF(("TIOCGSID %d\n", pid));
@@ -235,7 +238,8 @@
struct sgttyb bs;
struct svr4_sgttyb ss;
- error = fo_ioctl(fp, TIOCGETP, (caddr_t) &bs, td);
+ error = fo_ioctl(fp, TIOCGETP, (caddr_t) &bs,
+ td->td_ucred, td);
if (error)
return error;
@@ -260,7 +264,8 @@
print_svr4_sgttyb("SVR4_TIOCSET{P,N}", &ss);
#endif /* DEBUG_SVR4 */
cmd = (cmd == SVR4_TIOCSETP) ? TIOCSETP : TIOCSETN;
- return fo_ioctl(fp, cmd, (caddr_t) &bs, td);
+ return fo_ioctl(fp, cmd, (caddr_t) &bs,
+ td->td_ucred, td);
}
case SVR4_TIOCGETC:
@@ -268,7 +273,8 @@
struct tchars bt;
struct svr4_tchars st;
- error = fo_ioctl(fp, TIOCGETC, (caddr_t) &bt, td);
+ error = fo_ioctl(fp, TIOCGETC, (caddr_t) &bt,
+ td->td_ucred, td);
if (error)
return error;
@@ -291,7 +297,8 @@
#ifdef DEBUG_SVR4
print_svr4_tchars("SVR4_TIOCSETC", &st);
#endif /* DEBUG_SVR4 */
- return fo_ioctl(fp, TIOCSETC, (caddr_t) &bt, td);
+ return fo_ioctl(fp, TIOCSETC, (caddr_t) &bt,
+ td->td_ucred, td);
}
case SVR4_TIOCGLTC:
@@ -299,7 +306,8 @@
struct ltchars bl;
struct svr4_ltchars sl;
- error = fo_ioctl(fp, TIOCGLTC, (caddr_t) &bl, td);
+ error = fo_ioctl(fp, TIOCGLTC, (caddr_t) &bl,
+ td->td_ucred, td);
if (error)
return error;
@@ -322,13 +330,15 @@
#ifdef DEBUG_SVR4
print_svr4_ltchars("SVR4_TIOCSLTC", &sl);
#endif /* DEBUG_SVR4 */
- return fo_ioctl(fp, TIOCSLTC, (caddr_t) &bl, td);
+ return fo_ioctl(fp, TIOCSLTC, (caddr_t) &bl,
+ td->td_ucred, td);
}
case SVR4_TIOCLGET:
{
int flags;
- if ((error = fo_ioctl(fp, TIOCLGET, (caddr_t) &flags, td)) != 0)
+ if ((error = fo_ioctl(fp, TIOCLGET, (caddr_t) &flags,
+ td->td_ucred, td)) != 0)
return error;
DPRINTF(("SVR4_TIOCLGET %o\n", flags));
return copyout(&flags, data, sizeof(flags));
@@ -356,7 +366,8 @@
}
DPRINTF(("SVR4_TIOCL{SET,BIS,BIC} %o\n", flags));
- return fo_ioctl(fp, cmd, (caddr_t) &flags, td);
+ return fo_ioctl(fp, cmd, (caddr_t) &flags,
+ td->td_ucred, td);
}
default:
==== //depot/projects/trustedbsd/base/sys/dev/aac/aac.c#9 (text+ko) ====
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/aac/aac.c,v 1.39 2002/05/03 00:07:50 scottl Exp $
+ * $FreeBSD: src/sys/dev/aac/aac.c,v 1.40 2002/08/17 02:36:15 rwatson Exp $
*/
/*
@@ -2535,7 +2535,7 @@
/*
* Pass the ioctl off to our standard handler.
*/
- error = (fo_ioctl(fp, cmd, (caddr_t)args->arg, td));
+ error = (fo_ioctl(fp, cmd, (caddr_t)args->arg, td->td_ucred, td));
fdrop(fp, td);
return (error);
}
==== //depot/projects/trustedbsd/base/sys/dev/drm/drm_drv.h#3 (text+ko) ====
@@ -28,7 +28,7 @@
* Rickard E. (Rik) Faith <faith at valinux.com>
* Gareth Hughes <gareth at valinux.com>
*
- * $FreeBSD: src/sys/dev/drm/drm_drv.h,v 1.4 2002/05/06 19:31:27 alfred Exp $
+ * $FreeBSD: src/sys/dev/drm/drm_drv.h,v 1.5 2002/08/17 02:36:15 rwatson Exp $
*/
/*
@@ -1439,7 +1439,11 @@
/*
* Pass the ioctl off to our standard handler.
*/
+#if (__FreeBSD_version >= 500000)
+ return(fo_ioctl(fp, cmd, data, p->td_ucred, p));
+#else
return(fo_ioctl(fp, cmd, data, p));
+#endif
}
#endif /* DRM_LINUX */
#endif /* __FreeBSD__ */
==== //depot/projects/trustedbsd/base/sys/dev/mii/mii.c#5 (text+ko) ====
@@ -62,7 +62,7 @@
#if !defined(lint)
static const char rcsid[] =
- "$FreeBSD: src/sys/dev/mii/mii.c,v 1.13 2002/08/07 22:18:33 ambrisko Exp $";
+ "$FreeBSD: src/sys/dev/mii/mii.c,v 1.14 2002/08/16 23:19:16 ambrisko Exp $";
#endif
static int miibus_readreg (device_t, int, int);
@@ -110,17 +110,14 @@
{
struct mii_attach_args ma, *args;
struct mii_data *mii;
- device_t child = NULL, parent, *children;
- int bmsr, capmask = 0xFFFFFFFF, nchildren;
+ device_t child = NULL, parent;
+ int bmsr, capmask = 0xFFFFFFFF;
mii = device_get_softc(dev);
parent = device_get_parent(dev);
LIST_INIT(&mii->mii_phys);
for (ma.mii_phyno = 0; ma.mii_phyno < MII_NPHY; ma.mii_phyno++) {
- device_get_children(dev, &children, &nchildren);
- if (nchildren)
- break;
/*
* Check to see if there is a PHY at this address. Note,
* many braindead PHYs report 0/0 in their ID registers,
==== //depot/projects/trustedbsd/base/sys/dev/tdfx/tdfx_pci.c#4 (text+ko) ====
@@ -28,7 +28,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/tdfx/tdfx_pci.c,v 1.18 2002/04/20 01:35:45 marcel Exp $
+ * $FreeBSD: src/sys/dev/tdfx/tdfx_pci.c,v 1.19 2002/08/17 02:36:15 rwatson Exp $
*/
/* 3dfx driver for FreeBSD 4.x - Finished 11 May 2000, 12:25AM ET
@@ -848,7 +848,7 @@
return (error);
/* We simply copy the data and send it right to ioctl */
copyin((caddr_t)args->arg, &d_pio, sizeof(d_pio));
- error = fo_ioctl(fp, cmd, (caddr_t)&d_pio, td);
+ error = fo_ioctl(fp, cmd, (caddr_t)&d_pio, td->td_ucred, td);
fdrop(fp, td);
return error;
}
==== //depot/projects/trustedbsd/base/sys/fs/fifofs/fifo_vnops.c#13 (text+ko) ====
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)fifo_vnops.c 8.10 (Berkeley) 5/27/95
- * $FreeBSD: src/sys/fs/fifofs/fifo_vnops.c,v 1.71 2002/08/16 12:51:55 rwatson Exp $
+ * $FreeBSD: src/sys/fs/fifofs/fifo_vnops.c,v 1.72 2002/08/17 02:36:15 rwatson Exp $
*/
#include <sys/param.h>
@@ -348,13 +348,17 @@
return (0);
if (ap->a_fflag & FREAD) {
filetmp.f_data = (caddr_t)ap->a_vp->v_fifoinfo->fi_readsock;
- error = soo_ioctl(&filetmp, ap->a_command, ap->a_data, ap->a_td);
+ filetmp.f_cred = ap->a_cred;
+ error = soo_ioctl(&filetmp, ap->a_command, ap->a_data,
+ ap->a_td->td_ucred, ap->a_td);
if (error)
return (error);
}
if (ap->a_fflag & FWRITE) {
filetmp.f_data = (caddr_t)ap->a_vp->v_fifoinfo->fi_writesock;
- error = soo_ioctl(&filetmp, ap->a_command, ap->a_data, ap->a_td);
+ filetmp.f_cred = ap->a_cred;
+ error = soo_ioctl(&filetmp, ap->a_command, ap->a_data,
+ ap->a_td->td_ucred, ap->a_td);
if (error)
return (error);
}
==== //depot/projects/trustedbsd/base/sys/i386/ibcs2/ibcs2_fcntl.c#4 (text+ko) ====
@@ -24,7 +24,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/i386/ibcs2/ibcs2_fcntl.c,v 1.20 2002/03/20 05:45:58 alfred Exp $
+ * $FreeBSD: src/sys/i386/ibcs2/ibcs2_fcntl.c,v 1.21 2002/08/17 02:36:16 rwatson Exp $
*/
#include "opt_spx_hack.h"
@@ -203,7 +203,8 @@
/* 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);
==== //depot/projects/trustedbsd/base/sys/i386/ibcs2/ibcs2_ioctl.c#6 (text+ko) ====
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/i386/ibcs2/ibcs2_ioctl.c,v 1.24 2002/03/20 05:45:58 alfred Exp $
+ * $FreeBSD: src/sys/i386/ibcs2/ibcs2_ioctl.c,v 1.25 2002/08/17 02:36:16 rwatson Exp $
*/
#include <sys/param.h>
@@ -365,7 +365,8 @@
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 @@
}
/* 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 @@
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 @@
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 @@
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 @@
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 @@
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;
}
==== //depot/projects/trustedbsd/base/sys/kern/kern_descrip.c#22 (text+ko) ====
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_descrip.c 8.6 (Berkeley) 4/19/94
- * $FreeBSD: src/sys/kern/kern_descrip.c,v 1.154 2002/08/16 12:51:57 rwatson Exp $
+ * $FreeBSD: src/sys/kern/kern_descrip.c,v 1.155 2002/08/17 02:36:16 rwatson Exp $
*/
#include "opt_compat.h"
@@ -101,7 +101,7 @@
static int badfo_readwrite(struct file *fp, struct uio *uio,
struct ucred *active_cred, int flags, struct thread *td);
static int badfo_ioctl(struct file *fp, u_long com, void *data,
- struct thread *td);
+ struct ucred *active_cred, struct thread *td);
static int badfo_poll(struct file *fp, int events,
struct ucred *active_cred, struct thread *td);
static int badfo_kqfilter(struct file *fp, struct knote *kn);
@@ -315,34 +315,35 @@
fp->f_flag &= ~FCNTLFLAGS;
fp->f_flag |= FFLAGS(uap->arg & ~O_ACCMODE) & FCNTLFLAGS;
tmp = fp->f_flag & FNONBLOCK;
- error = fo_ioctl(fp, FIONBIO, &tmp, td);
+ error = fo_ioctl(fp, FIONBIO, &tmp, td->td_ucred, td);
if (error) {
fdrop(fp, td);
break;
}
tmp = fp->f_flag & FASYNC;
- error = fo_ioctl(fp, FIOASYNC, &tmp, td);
+ error = fo_ioctl(fp, FIOASYNC, &tmp, td->td_ucred, td);
if (!error) {
fdrop(fp, td);
break;
}
fp->f_flag &= ~FNONBLOCK;
tmp = 0;
- (void)fo_ioctl(fp, FIONBIO, &tmp, td);
+ (void)fo_ioctl(fp, FIONBIO, &tmp, td->td_ucred, td);
fdrop(fp, td);
break;
case F_GETOWN:
fhold(fp);
FILEDESC_UNLOCK(fdp);
- error = fo_ioctl(fp, FIOGETOWN, (void *)td->td_retval, td);
+ error = fo_ioctl(fp, FIOGETOWN, (void *)td->td_retval,
+ td->td_ucred, td);
fdrop(fp, td);
break;
case F_SETOWN:
fhold(fp);
FILEDESC_UNLOCK(fdp);
- error = fo_ioctl(fp, FIOSETOWN, &uap->arg, td);
+ error = fo_ioctl(fp, FIOSETOWN, &uap->arg, td->td_ucred, td);
fdrop(fp, td);
break;
@@ -2159,10 +2160,11 @@
}
static int
-badfo_ioctl(fp, com, data, td)
+badfo_ioctl(fp, com, data, active_cred, td)
struct file *fp;
u_long com;
void *data;
+ struct ucred *active_cred;
struct thread *td;
{
==== //depot/projects/trustedbsd/base/sys/kern/kern_event.c#12 (text+ko) ====
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/kern/kern_event.c,v 1.44 2002/08/16 14:12:40 rwatson Exp $
+ * $FreeBSD: src/sys/kern/kern_event.c,v 1.45 2002/08/17 02:36:16 rwatson Exp $
*/
#include <sys/param.h>
@@ -61,7 +61,7 @@
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 @@
/*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);
}
==== //depot/projects/trustedbsd/base/sys/kern/sys_generic.c#15 (text+ko) ====
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)sys_generic.c 8.5 (Berkeley) 1/21/94
- * $FreeBSD: src/sys/kern/sys_generic.c,v 1.109 2002/08/16 12:51:57 rwatson Exp $
+ * $FreeBSD: src/sys/kern/sys_generic.c,v 1.110 2002/08/17 02:36:16 rwatson Exp $
*/
#include "opt_ktrace.h"
@@ -656,7 +656,7 @@
else
fp->f_flag &= ~FNONBLOCK;
FILE_UNLOCK(fp);
- error = fo_ioctl(fp, FIONBIO, &tmp, td);
+ error = fo_ioctl(fp, FIONBIO, &tmp, td->td_ucred, td);
break;
case FIOASYNC:
@@ -666,11 +666,11 @@
else
fp->f_flag &= ~FASYNC;
FILE_UNLOCK(fp);
- error = fo_ioctl(fp, FIOASYNC, &tmp, td);
+ error = fo_ioctl(fp, FIOASYNC, &tmp, td->td_ucred, td);
break;
default:
- error = fo_ioctl(fp, com, data, td);
+ error = fo_ioctl(fp, com, data, td->td_ucred, td);
/*
* Copy any data to user, size was
* already set and checked above.
==== //depot/projects/trustedbsd/base/sys/kern/sys_pipe.c#18 (text+ko) ====
@@ -16,7 +16,7 @@
* 4. Modifications may be freely made to this file if the above conditions
* are met.
*
- * $FreeBSD: src/sys/kern/sys_pipe.c,v 1.115 2002/08/16 14:12:40 rwatson Exp $
+ * $FreeBSD: src/sys/kern/sys_pipe.c,v 1.116 2002/08/17 02:36:16 rwatson Exp $
*/
/*
@@ -105,7 +105,7 @@
static int pipe_stat(struct file *fp, struct stat *sb,
struct ucred *active_cred, struct thread *td);
>>> TRUNCATED FOR MAIL (1000 lines) <<<
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message
More information about the trustedbsd-cvs
mailing list