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

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