summaryrefslogtreecommitdiffstats
path: root/usr.sbin/powerd
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2005-07-25 16:43:12 +0000
committernjl <njl@FreeBSD.org>2005-07-25 16:43:12 +0000
commitb7400ec2b97be67dfb492d71ddd367283ec54c53 (patch)
treefb1973efe1579fc2e4f7b628e99a6bd8114b3b86 /usr.sbin/powerd
parentc79630aff348fbba7c657f839846f11eeb10e4c5 (diff)
downloadFreeBSD-src-b7400ec2b97be67dfb492d71ddd367283ec54c53.zip
FreeBSD-src-b7400ec2b97be67dfb492d71ddd367283ec54c53.tar.gz
powerd(8) requires root permissions to run so notify the user if they
try to start it without this. Submitted by: Philip S. Schulz MFC after: 2 days
Diffstat (limited to 'usr.sbin/powerd')
-rw-r--r--usr.sbin/powerd/powerd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/usr.sbin/powerd/powerd.c b/usr.sbin/powerd/powerd.c
index 555218c..7c8ab40 100644
--- a/usr.sbin/powerd/powerd.c
+++ b/usr.sbin/powerd/powerd.c
@@ -269,6 +269,10 @@ main(int argc, char * argv[])
vflag = 0;
apm_fd = -1;
+ /* User must be root to control frequencies. */
+ if (geteuid() != 0)
+ errx(1, "must be root to run");
+
while ((ch = getopt(argc, argv, "a:b:i:n:p:r:v")) != EOF)
switch (ch) {
case 'a':
OpenPOWER on IntegriCloud