summaryrefslogtreecommitdiff
path: root/sys/dev/acpi/acpi.c
diff options
context:
space:
mode:
authorMike Larkin <mlarkin@cvs.openbsd.org>2012-07-11 10:57:39 +0000
committerMike Larkin <mlarkin@cvs.openbsd.org>2012-07-11 10:57:39 +0000
commit4adda1767a38d51cee4c16eacea7488202647f36 (patch)
tree9298bffc8257a8bb4e3036e3a593dc2152f49c83 /sys/dev/acpi/acpi.c
parent600eadcdf657005a41d226a11defd085d01a8bd3 (diff)
for now, restrict hibernate to root in the acpi ioctl kernel interface.
normal rules for controlling this interface through apmd still apply. ok deraadt@
Diffstat (limited to 'sys/dev/acpi/acpi.c')
-rw-r--r--sys/dev/acpi/acpi.c4
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;