Blame SOURCES/autofs-5.0.7-allow-non-root-user-to-check-status.patch

306fa1
autofs-5.0.7 - allow non root user to check status
306fa1
306fa1
From: Ian Kent <ikent@redhat.com>
306fa1
306fa1
306fa1
---
306fa1
306fa1
 CHANGELOG             |    1 +
306fa1
 redhat/autofs.init.in |   20 +++++++++++++-------
306fa1
 2 files changed, 14 insertions(+), 7 deletions(-)
306fa1
306fa1
306fa1
diff --git a/CHANGELOG b/CHANGELOG
306fa1
index 44c9fb2..936c9ab 100644
306fa1
--- a/CHANGELOG
306fa1
+++ b/CHANGELOG
306fa1
@@ -11,6 +11,7 @@
306fa1
 - make description of default MOUNT_WAIT setting clear.
306fa1
 - configure.in: allow cross compilation.
306fa1
 - README: update mailing list subscription info.
306fa1
+- allow non root user to check status.
306fa1
 
306fa1
 25/07/2012 autofs-5.0.7
306fa1
 =======================
306fa1
diff --git a/redhat/autofs.init.in b/redhat/autofs.init.in
306fa1
index cd5cb34..fe18b3e 100644
306fa1
--- a/redhat/autofs.init.in
306fa1
+++ b/redhat/autofs.init.in
306fa1
@@ -167,6 +167,19 @@ function usage_message() {
306fa1
 
306fa1
 RETVAL=0
306fa1
 
306fa1
+# allow non-root users to read status / usage
306fa1
+
306fa1
+case "$1" in
306fa1
+	status)
306fa1
+		status -p @@autofspiddir@@/autofs.pid -l autofs $prog
306fa1
+		exit 0;
306fa1
+		;;
306fa1
+	usage)
306fa1
+		usage_message
306fa1
+		exit 0;
306fa1
+		;;
306fa1
+esac
306fa1
+
306fa1
 # Only the root user may change the service status
306fa1
 if [ `id -u` -ne 0 ] && [ "$1" != "status" ]; then
306fa1
 	echo "insufficient privilege to change service status"
306fa1
@@ -184,9 +197,6 @@ case "$1" in
306fa1
 	stop)
306fa1
 		stop
306fa1
 		;;
306fa1
-	status)
306fa1
-		status -p @@autofspiddir@@/autofs.pid -l autofs $prog
306fa1
-		;;
306fa1
 	restart|force-reload)
306fa1
 		restart
306fa1
 		;;
306fa1
@@ -202,10 +212,6 @@ case "$1" in
306fa1
 			restart
306fa1
 		fi
306fa1
 		;;
306fa1
-	usage)
306fa1
-		usage_message
306fa1
-		exit 0
306fa1
-		;;
306fa1
 	*)
306fa1
 		usage_message
306fa1
 		exit 2