diff options
author | 2012-07-11 10:57:38 +0000 | |
---|---|---|
committer | 2012-07-11 10:57:38 +0000 | |
commit | 47614ba58989a426b9d3f3dfdc6c9c13a2e6ebae (patch) | |
tree | 3c782387b981037aff65b980b2a015bbdab50cb6 | |
parent | catch off-by-one errors in stpncpy(); ok guenther@ (diff) | |
download | wireguard-openbsd-47614ba58989a426b9d3f3dfdc6c9c13a2e6ebae.tar.xz wireguard-openbsd-47614ba58989a426b9d3f3dfdc6c9c13a2e6ebae.zip |
for now, restrict hibernate to root in the acpi ioctl kernel interface.
normal rules for controlling this interface through apmd still apply.
ok deraadt@
-rw-r--r-- | sys/dev/acpi/acpi.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index 2665620126e..94ab0f67133 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.236 2012/07/09 15:29:24 deraadt Exp $ */ +/* $OpenBSD: acpi.c,v 1.237 2012/07/11 10:57:38 mlarkin Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> @@ -2506,6 +2506,8 @@ acpiioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) break; #ifdef HIBERNATE case APM_IOC_HIBERNATE: + if (suser(p, 0) != 0) + return (EPERM); if ((flag & FWRITE) == 0) { error = EBADF; break; |