aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Miciah Masters <miciah.masters@gmail.com>2016-12-24 03:23:43 -0500
committerGravatar Miciah Dashiel Butler Masters <mmasters@redhat.com>2017-01-15 01:59:49 -0500
commit8d17af9cc111d50a8b0be9ff2f35a9b333290781 (patch)
treeba7f2aef9bb0f34bea29cfbe394c3aa0b927f5dd
parentcaf20af422a7fc14c0d6eaa9cc330066b447a968 (diff)
-r/--restore requires root, same as set
The -r/--restore flag requires root, the same as the set verb does, so print an error message if either the flag or the verb is used without running as root.
-rw-r--r--brightnessctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/brightnessctl.c b/brightnessctl.c
index d6170e9..86a0e21 100644
--- a/brightnessctl.c
+++ b/brightnessctl.c
@@ -172,7 +172,7 @@ int main(int argc, char **argv) {
fail("Invalid value given");
if (!(dev = find_device(devs, dev_name)))
fail("Device '%s' not found.\n", dev_name);
- if (p.operation == SET && !p.pretend && geteuid())
+ if ((p.operation == SET || p.restore) && !p.pretend && geteuid())
fail("You need to run this program as root to be able to modify values!\n");
if (p.save)
if (save_device_data(dev))