aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-allow-non-root-user-to-check-status.patch
blob: 6020c31e2339dc9170bff4574003c5634eda86c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
autofs-5.0.7 - allow non root user to check status

From: Ian Kent <ikent@redhat.com>


---

 CHANGELOG             |    1 +
 redhat/autofs.init.in |   20 +++++++++++++-------
 2 files changed, 14 insertions(+), 7 deletions(-)


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