From a1ee01486d4d2da0dce2fd97a58ca548a402d598 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Fri, 15 Aug 2003 20:32:22 +0000 Subject: change arguments to suser. suser now takes the process, and a flags argument. old cred only calls user suser_ucred. this will allow future work to more flexibly implement the idea of a root process. looks like something i saw in freebsd, but a little different. use of suser_ucred vs suser in file system code should be looked at again, for the moment semantics remain unchanged. review and input from art@ testing and further review miod@ --- sys/arch/sparc64/dev/pcons.c | 4 ++-- sys/arch/sparc64/dev/sab.c | 6 +++--- sys/arch/sparc64/dev/z8530tty.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'sys/arch/sparc64/dev') diff --git a/sys/arch/sparc64/dev/pcons.c b/sys/arch/sparc64/dev/pcons.c index 7a7e1020851..d2a503d0484 100644 --- a/sys/arch/sparc64/dev/pcons.c +++ b/sys/arch/sparc64/dev/pcons.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcons.c,v 1.5 2002/03/14 03:16:00 millert Exp $ */ +/* $OpenBSD: pcons.c,v 1.6 2003/08/15 20:32:15 tedu Exp $ */ /* $NetBSD: pcons.c,v 1.7 2001/05/02 10:32:20 scw Exp $ */ /*- @@ -191,7 +191,7 @@ pconsopen(dev, flag, mode, p) tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED; pconsparam(tp, &tp->t_termios); ttsetwater(tp); - } else if ((tp->t_state&TS_XCLUDE) && suser(p->p_ucred, &p->p_acflag)) + } else if ((tp->t_state&TS_XCLUDE) && suser(p, 0)) return EBUSY; tp->t_state |= TS_CARR_ON; diff --git a/sys/arch/sparc64/dev/sab.c b/sys/arch/sparc64/dev/sab.c index fc22a641db7..14250d7f600 100644 --- a/sys/arch/sparc64/dev/sab.c +++ b/sys/arch/sparc64/dev/sab.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sab.c,v 1.13 2003/06/24 21:54:39 henric Exp $ */ +/* $OpenBSD: sab.c,v 1.14 2003/08/15 20:32:15 tedu Exp $ */ /* * Copyright (c) 2001 Jason L. Wright (jason@thought.net) @@ -696,7 +696,7 @@ sabttyopen(dev, flags, mode, p) else tp->t_state &= ~TS_CARR_ON; } else if ((tp->t_state & TS_XCLUDE) && - (!suser(p->p_ucred, &p->p_acflag))) { + (!suser(p, 0))) { return (EBUSY); } else { s = spltty(); @@ -862,7 +862,7 @@ sabttyioctl(dev, cmd, data, flags, p) *((int *)data) = sc->sc_openflags; break; case TIOCSFLAGS: - if (suser(p->p_ucred, &p->p_acflag)) + if (suser(p, 0)) error = EPERM; else sc->sc_openflags = *((int *)data) & diff --git a/sys/arch/sparc64/dev/z8530tty.c b/sys/arch/sparc64/dev/z8530tty.c index f9cb77836c8..a7c597e22bd 100644 --- a/sys/arch/sparc64/dev/z8530tty.c +++ b/sys/arch/sparc64/dev/z8530tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: z8530tty.c,v 1.7 2003/06/02 23:27:55 millert Exp $ */ +/* $OpenBSD: z8530tty.c,v 1.8 2003/08/15 20:32:15 tedu Exp $ */ /* $NetBSD: z8530tty.c,v 1.77 2001/05/30 15:24:24 lukem Exp $ */ /*- @@ -720,7 +720,7 @@ zsioctl(dev, cmd, data, flag, p) break; case TIOCSFLAGS: - error = suser(p->p_ucred, &p->p_acflag); + error = suser(p, 0); if (error) break; zst->zst_swflags = *(int *)data; -- cgit v1.2.3