[arch-projects] [INITSCRIPTS][PATCH 4/4] Remove NEED_ROOT crap

Sébastien Luttringer seblu at seblu.net
Mon Mar 12 17:54:51 EDT 2012


This patch revert patch 042d197b4d989ec64.

Signed-off-by: Sébastien Luttringer <seblu at seblu.net>
---
 functions |   10 ----------
 rc.d      |    1 -
 2 files changed, 11 deletions(-)

diff --git a/functions b/functions
index a3c2660..25861d0 100644
--- a/functions
+++ b/functions
@@ -656,15 +656,5 @@ for f in /etc/rc.d/functions.d/*; do
 	[[ -e $f ]] && . "$f"
 done
 
-# Exit current shell if user is not root
-need_root() {
-	(( EUID )) && printf 'You need to be root.\n' && exit 1
-}
-
-# Quit script if it's not running by root
-# This can be disabled in scripts sourcing functions by setting NEED_ROOT=0
-# A local call to need_root can be done to ensure part of script need root privilege
-(( NEED_ROOT )) && need_root
-
 # End of file
 # vim: set ts=2 sw=2 noet:
diff --git a/rc.d b/rc.d
index 115dc05..0cfbdaf 100755
--- a/rc.d
+++ b/rc.d
@@ -1,6 +1,5 @@
 #!/bin/bash
 
-NEED_ROOT=0 # this script can be run without be root
 . /etc/rc.conf
 . /etc/rc.d/functions
 
-- 
Sebastien "Seblu" Luttringer



More information about the arch-projects mailing list