diff options
author | phk <phk@FreeBSD.org> | 1999-01-30 12:17:38 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1999-01-30 12:17:38 +0000 |
commit | 67f187760e45386080ca97c6bc73608f9fe52ae5 (patch) | |
tree | 640104e6ae29a9d3ec3b379eab1297863b5d84c5 /sys/dev | |
parent | 6c80ae4325fb5d1cab94603607c94d646aee0d8e (diff) | |
download | FreeBSD-src-67f187760e45386080ca97c6bc73608f9fe52ae5.zip FreeBSD-src-67f187760e45386080ca97c6bc73608f9fe52ae5.tar.gz |
Use suser() to check for super user rather than examining cr_uid directly.
Use TTYDEF_SPEED rather than 9600 a couple of places.
Reviewed by: bde, with a few grumbles.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/cy/cy.c | 5 | ||||
-rw-r--r-- | sys/dev/cy/cy_isa.c | 5 | ||||
-rw-r--r-- | sys/dev/dgb/dgb.c | 5 | ||||
-rw-r--r-- | sys/dev/dgb/dgm.c | 5 | ||||
-rw-r--r-- | sys/dev/rc/rc.c | 3 | ||||
-rw-r--r-- | sys/dev/rp/rp.c | 3 | ||||
-rw-r--r-- | sys/dev/si/si.c | 5 | ||||
-rw-r--r-- | sys/dev/sio/sio.c | 5 | ||||
-rw-r--r-- | sys/dev/syscons/syscons.c | 4 |
9 files changed, 24 insertions, 16 deletions
diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c index e95d7e6..42f6794 100644 --- a/sys/dev/cy/cy.c +++ b/sys/dev/cy/cy.c @@ -27,7 +27,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: cy.c,v 1.83 1999/01/08 19:17:46 bde Exp $ + * $Id: cy.c,v 1.84 1999/01/28 01:59:53 dillon Exp $ */ #include "opt_compat.h" @@ -728,7 +728,8 @@ open_top: goto open_top; } } - if (tp->t_state & TS_XCLUDE && p->p_ucred->cr_uid != 0) { + if (tp->t_state & TS_XCLUDE && + suser(p->p_ucred, &p->p_acflag)) { error = EBUSY; goto out; } diff --git a/sys/dev/cy/cy_isa.c b/sys/dev/cy/cy_isa.c index e95d7e6..42f6794 100644 --- a/sys/dev/cy/cy_isa.c +++ b/sys/dev/cy/cy_isa.c @@ -27,7 +27,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: cy.c,v 1.83 1999/01/08 19:17:46 bde Exp $ + * $Id: cy.c,v 1.84 1999/01/28 01:59:53 dillon Exp $ */ #include "opt_compat.h" @@ -728,7 +728,8 @@ open_top: goto open_top; } } - if (tp->t_state & TS_XCLUDE && p->p_ucred->cr_uid != 0) { + if (tp->t_state & TS_XCLUDE && + suser(p->p_ucred, &p->p_acflag)) { error = EBUSY; goto out; } diff --git a/sys/dev/dgb/dgb.c b/sys/dev/dgb/dgb.c index 7aeb258..14211bc 100644 --- a/sys/dev/dgb/dgb.c +++ b/sys/dev/dgb/dgb.c @@ -1,5 +1,5 @@ /*- - * dgb.c $Id: dgb.c,v 1.40 1998/08/23 08:26:39 bde Exp $ + * dgb.c $Id: dgb.c,v 1.41 1998/12/07 21:58:17 archie Exp $ * * Digiboard driver. * @@ -1032,7 +1032,8 @@ open_top: goto open_top; } } - if (tp->t_state & TS_XCLUDE && p->p_ucred->cr_uid != 0) { + if (tp->t_state & TS_XCLUDE && + suser(p->p_ucred, &p->p_acflag)) { error = EBUSY; goto out; } diff --git a/sys/dev/dgb/dgm.c b/sys/dev/dgb/dgm.c index 8b0ca1f..9321bb9 100644 --- a/sys/dev/dgb/dgm.c +++ b/sys/dev/dgb/dgm.c @@ -1,5 +1,5 @@ /*- - * $Id: dgm.c,v 1.5 1998/08/23 08:26:40 bde Exp $ + * $Id: dgm.c,v 1.6 1998/12/07 21:58:18 archie Exp $ * * This driver and the associated header files support the ISA PC/Xem * Digiboards. Its evolutionary roots are described below. @@ -833,7 +833,8 @@ open_top: goto open_top; } } - if (tp->t_state & TS_XCLUDE && p->p_ucred->cr_uid != 0) { + if (tp->t_state & TS_XCLUDE && + suser(p->p_ucred, &p->p_acflag)) { error = EBUSY; goto out; } diff --git a/sys/dev/rc/rc.c b/sys/dev/rc/rc.c index ae1108a..a5d96ec 100644 --- a/sys/dev/rc/rc.c +++ b/sys/dev/rc/rc.c @@ -766,7 +766,8 @@ again: goto again; } } - if (tp->t_state & TS_XCLUDE && p->p_ucred->cr_uid != 0) { + if (tp->t_state & TS_XCLUDE && + suser(p->p_ucred, &p->p_acflag)) { error = EBUSY; goto out; } diff --git a/sys/dev/rp/rp.c b/sys/dev/rp/rp.c index 28acaee..3ac4ee9 100644 --- a/sys/dev/rp/rp.c +++ b/sys/dev/rp/rp.c @@ -1346,7 +1346,8 @@ open_top: goto open_top; } } - if(tp->t_state & TS_XCLUDE && p->p_ucred->cr_uid != 0) { + if(tp->t_state & TS_XCLUDE && + suser(p->p_ucred, &p->p_acflag)) { splx(oldspl); return(EBUSY); } diff --git a/sys/dev/si/si.c b/sys/dev/si/si.c index 230e387..95a4e049 100644 --- a/sys/dev/si/si.c +++ b/sys/dev/si/si.c @@ -30,7 +30,7 @@ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN * NO EVENT SHALL THE AUTHORS BE LIABLE. * - * $Id: si.c,v 1.77 1998/08/23 10:12:12 bde Exp $ + * $Id: si.c,v 1.78 1999/01/12 00:36:35 eivind Exp $ */ #ifndef lint @@ -1205,7 +1205,8 @@ open_top: goto open_top; } } - if (tp->t_state & TS_XCLUDE && p->p_ucred->cr_uid != 0) { + if (tp->t_state & TS_XCLUDE && + suser(p->p_ucred, &p->p_acflag)) { DPRINT((pp, DBG_OPEN|DBG_FAIL, "already open and EXCLUSIVE set\n")); error = EBUSY; diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index 6a2084e..ee031b4 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: sio.c,v 1.219 1998/12/13 23:12:54 steve Exp $ + * $Id: sio.c,v 1.220 1999/01/19 00:21:47 peter Exp $ * from: @(#)com.c 7.5 (Berkeley) 5/16/91 * from: i386/isa sio.c,v 1.215 */ @@ -1205,7 +1205,8 @@ open_top: goto open_top; } } - if (tp->t_state & TS_XCLUDE && p->p_ucred->cr_uid != 0) { + if (tp->t_state & TS_XCLUDE && + suser(p->p_ucred, &p->p_acflag)) { error = EBUSY; goto out; } diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index 18d376c..ebe15a0 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -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. * - * $Id: syscons.c,v 1.295 1999/01/28 01:59:48 dillon Exp $ + * $Id: syscons.c,v 1.296 1999/01/28 17:31:58 dillon Exp $ */ #include "sc.h" @@ -707,7 +707,7 @@ scopen(dev_t dev, int flag, int mode, struct proc *p) mouse_level = 0; /* XXX */ } else - if (tp->t_state & TS_XCLUDE && p->p_ucred->cr_uid != 0) + if (tp->t_state & TS_XCLUDE && suser(p->p_ucred, &p->p_acflag)) return(EBUSY); if (minor(dev) < MAXCONS && !console[minor(dev)]) { console[minor(dev)] = alloc_scp(); |