summaryrefslogtreecommitdiff
path: root/sys/kern/uipc_socket.c
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2009-10-31 12:00:09 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2009-10-31 12:00:09 +0000
commit04783f7109699fb1efc94f9822ac1e849dc0b7ff (patch)
tree11514d25f29a5322b91cbc57e3b913945809976a /sys/kern/uipc_socket.c
parent4a9bd3706fe9ef219f0658e9acc9ab43b2bfd422 (diff)
Use suser when possible. Suggested by miod@.
miod@ deraadt@ ok.
Diffstat (limited to 'sys/kern/uipc_socket.c')
-rw-r--r--sys/kern/uipc_socket.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 9998ccae763..375e633a060 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_socket.c,v 1.78 2009/08/10 16:49:38 thib Exp $ */
+/* $OpenBSD: uipc_socket.c,v 1.79 2009/10/31 12:00:08 fgsch Exp $ */
/* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */
/*
@@ -108,7 +108,7 @@ socreate(int dom, struct socket **aso, int type, int proto)
TAILQ_INIT(&so->so_q0);
TAILQ_INIT(&so->so_q);
so->so_type = type;
- if (p->p_ucred->cr_uid == 0)
+ if (suser(p, 0) == 0)
so->so_state = SS_PRIV;
so->so_ruid = p->p_cred->p_ruid;
so->so_euid = p->p_ucred->cr_uid;