diff options
author | Jan Klemkow <jan@cvs.openbsd.org> | 2021-08-31 12:24:16 +0000 |
---|---|---|
committer | Jan Klemkow <jan@cvs.openbsd.org> | 2021-08-31 12:24:16 +0000 |
commit | dbbf6403323b75aa34b554ec97e5487dc4a3ed3d (patch) | |
tree | 34246344337938dcc629adc2991b113d8fbed059 /sys/dev | |
parent | 9cf9a4b56855523454b76fc7e0b01f05b39f61c8 (diff) |
Using suser() instead of doing it manually.
ok patrick@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/fdt/amluart.c | 4 | ||||
-rw-r--r-- | sys/dev/fdt/imxuart.c | 4 | ||||
-rw-r--r-- | sys/dev/fdt/mvuart.c | 4 | ||||
-rw-r--r-- | sys/dev/ic/pluart.c | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/sys/dev/fdt/amluart.c b/sys/dev/fdt/amluart.c index 0cc9ec572d6..3474446f6c8 100644 --- a/sys/dev/fdt/amluart.c +++ b/sys/dev/fdt/amluart.c @@ -1,4 +1,4 @@ -/* $OpenBSD: amluart.c,v 1.1 2019/08/26 09:10:22 kettenis Exp $ */ +/* $OpenBSD: amluart.c,v 1.2 2021/08/31 12:24:15 jan Exp $ */ /* * Copyright (c) 2019 Mark Kettenis <kettenis@openbsd.org> * @@ -396,7 +396,7 @@ amluartopen(dev_t dev, int flag, int mode, struct proc *p) /* No carrier detect support. */ SET(tp->t_state, TS_CARR_ON); - } else if (ISSET(tp->t_state, TS_XCLUDE) && p->p_ucred->cr_uid != 0) + } else if (ISSET(tp->t_state, TS_XCLUDE) && suser(p) != 0) return EBUSY; else s = spltty(); diff --git a/sys/dev/fdt/imxuart.c b/sys/dev/fdt/imxuart.c index 12bff1f08f8..1cec08ef5fa 100644 --- a/sys/dev/fdt/imxuart.c +++ b/sys/dev/fdt/imxuart.c @@ -1,4 +1,4 @@ -/* $OpenBSD: imxuart.c,v 1.9 2021/02/04 22:40:04 patrick Exp $ */ +/* $OpenBSD: imxuart.c,v 1.10 2021/08/31 12:24:15 jan Exp $ */ /* * Copyright (c) 2005 Dale Rahn <drahn@motorola.com> * @@ -572,7 +572,7 @@ imxuartopen(dev_t dev, int flag, int mode, struct proc *p) SET(tp->t_state, TS_CARR_ON); /* XXX */ - } else if (ISSET(tp->t_state, TS_XCLUDE) && p->p_ucred->cr_uid != 0) + } else if (ISSET(tp->t_state, TS_XCLUDE) && suser(p) != 0) return EBUSY; else s = spltty(); diff --git a/sys/dev/fdt/mvuart.c b/sys/dev/fdt/mvuart.c index 3d0229a396a..52cc8b98b74 100644 --- a/sys/dev/fdt/mvuart.c +++ b/sys/dev/fdt/mvuart.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mvuart.c,v 1.2 2019/07/19 00:17:15 cheloha Exp $ */ +/* $OpenBSD: mvuart.c,v 1.3 2021/08/31 12:24:15 jan Exp $ */ /* * Copyright (c) 2005 Dale Rahn <drahn@motorola.com> * Copyright (c) 2018 Patrick Wildt <patrick@blueri.se> @@ -425,7 +425,7 @@ mvuartopen(dev_t dev, int flag, int mode, struct proc *p) HSET4(sc, MVUART_CTRL, MVUART_CTRL_RX_RDY_INT); SET(tp->t_state, TS_CARR_ON); /* XXX */ - } else if (ISSET(tp->t_state, TS_XCLUDE) && p->p_ucred->cr_uid != 0) + } else if (ISSET(tp->t_state, TS_XCLUDE) && suser(p) != 0) return EBUSY; else s = spltty(); diff --git a/sys/dev/ic/pluart.c b/sys/dev/ic/pluart.c index 4548848afc2..b272c0bb093 100644 --- a/sys/dev/ic/pluart.c +++ b/sys/dev/ic/pluart.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pluart.c,v 1.5 2020/01/10 04:10:15 cheloha Exp $ */ +/* $OpenBSD: pluart.c,v 1.6 2021/08/31 12:24:15 jan Exp $ */ /* * Copyright (c) 2014 Patrick Wildt <patrick@blueri.se> * Copyright (c) 2005 Dale Rahn <drahn@dalerahn.com> @@ -538,7 +538,7 @@ pluartopen(dev_t dev, int flag, int mode, struct proc *p) SET(tp->t_state, TS_CARR_ON); /* XXX */ - } else if (ISSET(tp->t_state, TS_XCLUDE) && p->p_ucred->cr_uid != 0) + } else if (ISSET(tp->t_state, TS_XCLUDE) && suser(p) != 0) return EBUSY; else s = spltty(); |