From 3c1b9add8d8dd305106cddec18f1175511aecbe7 Mon Sep 17 00:00:00 2001 From: Cem Keylan Date: Sat, 16 May 2020 20:56:30 +0300 Subject: shalt: don't check for root --- bin/shalt.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/bin/shalt.c b/bin/shalt.c index 924d85d..b2e199d 100644 --- a/bin/shalt.c +++ b/bin/shalt.c @@ -1,11 +1,8 @@ -#include +// shalt -- simple halt utility #include -/* Simple halt utility */ -/* Reboot if the argument is r, Poweroff is the argument is p */ - int main (int argc, char *argv[]) { - switch ((int)argv[argc < 2 ? 0 : 1][0] + geteuid()) { + switch ((int)argv[argc < 2 ? 0 : 1][0]) { case 'p': reboot(RB_POWER_OFF); break; case 'r': reboot(RB_AUTOBOOT); break; default: return 1; -- cgit v1.2.3