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

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