summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica/acpi.c
diff options
context:
space:
mode:
authortakawata <takawata@FreeBSD.org>2003-02-15 01:46:22 +0000
committertakawata <takawata@FreeBSD.org>2003-02-15 01:46:22 +0000
commit13db998806c11c1ee13c750abfce62b98f5953f7 (patch)
tree279d6f919bdeb94f52789912221491e13eca1186 /sys/dev/acpica/acpi.c
parent12452d351089caef2009110815720045adc0b0a3 (diff)
downloadFreeBSD-src-13db998806c11c1ee13c750abfce62b98f5953f7.zip
FreeBSD-src-13db998806c11c1ee13c750abfce62b98f5953f7.tar.gz
Allow non-privilaged user to retrive battery or AC line information.
Reviewed by: rwatson
Diffstat (limited to 'sys/dev/acpica/acpi.c')
-rw-r--r--sys/dev/acpica/acpi.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
index 44ebe3d..9da9e6d 100644
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -33,6 +33,7 @@
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/proc.h>
+#include <sys/fcntl.h>
#include <sys/malloc.h>
#include <sys/bus.h>
#include <sys/conf.h>
@@ -487,7 +488,7 @@ acpi_attach(device_t dev)
/*
* Create the control device
*/
- sc->acpi_dev_t = make_dev(&acpi_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600,
+ sc->acpi_dev_t = make_dev(&acpi_cdevsw, 0, UID_ROOT, GID_WHEEL, 0644,
"acpi");
sc->acpi_dev_t->si_drv1 = sc;
@@ -1844,6 +1845,15 @@ acpiioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, d_thread_t *td)
}
/*
+ * Core ioctls are not permitted for non-writable user.
+ * Currently, other ioctls just fetch information.
+ * Not changing system behavior.
+ */
+ if(!(flag & FWRITE)){
+ return EPERM;
+ }
+
+ /*
* Core system ioctls.
*/
switch (cmd) {
OpenPOWER on IntegriCloud