diff options
author | Can Erkin Acar <canacar@cvs.openbsd.org> | 2005-04-05 20:11:11 +0000 |
---|---|---|
committer | Can Erkin Acar <canacar@cvs.openbsd.org> | 2005-04-05 20:11:11 +0000 |
commit | d8599424563e515b63978313fb2c9af755545f11 (patch) | |
tree | db6499aec1d90fab1f30641da4bb0875c45748c6 /sys/dev/pci/if_san_common.c | |
parent | 3531dcb24f56d56bea9272d19f91572f99af1092 (diff) |
prevent non-root users to invoke wanpipe ioctls.
noticed by uwe@, looks ok deraadt@
Diffstat (limited to 'sys/dev/pci/if_san_common.c')
-rw-r--r-- | sys/dev/pci/if_san_common.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/pci/if_san_common.c b/sys/dev/pci/if_san_common.c index 801c91e971d..e641dc05bd1 100644 --- a/sys/dev/pci/if_san_common.c +++ b/sys/dev/pci/if_san_common.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_san_common.c,v 1.7 2005/04/01 21:42:35 canacar Exp $ */ +/* $OpenBSD: if_san_common.c,v 1.8 2005/04/05 20:11:10 canacar Exp $ */ /*- * Copyright (c) 2001-2004 Sangoma Technologies (SAN) @@ -43,6 +43,7 @@ # include <sys/errno.h> # include <sys/exec.h> # include <sys/mbuf.h> +# include <sys/proc.h> # include <sys/socket.h> # include <sys/kernel.h> # include <sys/time.h> @@ -266,6 +267,10 @@ wan_ioctl(struct ifnet *ifp, int cmd, struct ifreq *ifr) SAN_ASSERT(common == NULL); SAN_ASSERT(common->card == NULL); + + if ((err = suser(curproc, 0)) != 0) + return err; + switch (cmd) { case SIOC_WANPIPE_HWPROBE: err = wan_ioctl_hwprobe(ifp, ifr->ifr_data); |