summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-allow-non-root-user-to-check-status.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-allow-non-root-user-to-check-status.patch')
-rw-r--r--meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-allow-non-root-user-to-check-status.patch69
1 files changed, 69 insertions, 0 deletions
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-allow-non-root-user-to-check-status.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-allow-non-root-user-to-check-status.patch
new file mode 100644
index 0000000000..6020c31e23
--- /dev/null
+++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-allow-non-root-user-to-check-status.patch
@@ -0,0 +1,69 @@
1autofs-5.0.7 - allow non root user to check status
2
3From: Ian Kent <ikent@redhat.com>
4
5
6---
7
8 CHANGELOG | 1 +
9 redhat/autofs.init.in | 20 +++++++++++++-------
10 2 files changed, 14 insertions(+), 7 deletions(-)
11
12
13diff --git a/CHANGELOG b/CHANGELOG
14index 44c9fb2..936c9ab 100644
15--- a/CHANGELOG
16+++ b/CHANGELOG
17@@ -11,6 +11,7 @@
18 - make description of default MOUNT_WAIT setting clear.
19 - configure.in: allow cross compilation.
20 - README: update mailing list subscription info.
21+- allow non root user to check status.
22
23 25/07/2012 autofs-5.0.7
24 =======================
25diff --git a/redhat/autofs.init.in b/redhat/autofs.init.in
26index cd5cb34..fe18b3e 100644
27--- a/redhat/autofs.init.in
28+++ b/redhat/autofs.init.in
29@@ -167,6 +167,19 @@ function usage_message() {
30
31 RETVAL=0
32
33+# allow non-root users to read status / usage
34+
35+case "$1" in
36+ status)
37+ status -p @@autofspiddir@@/autofs.pid -l autofs $prog
38+ exit 0;
39+ ;;
40+ usage)
41+ usage_message
42+ exit 0;
43+ ;;
44+esac
45+
46 # Only the root user may change the service status
47 if [ `id -u` -ne 0 ] && [ "$1" != "status" ]; then
48 echo "insufficient privilege to change service status"
49@@ -184,9 +197,6 @@ case "$1" in
50 stop)
51 stop
52 ;;
53- status)
54- status -p @@autofspiddir@@/autofs.pid -l autofs $prog
55- ;;
56 restart|force-reload)
57 restart
58 ;;
59@@ -202,10 +212,6 @@ case "$1" in
60 restart
61 fi
62 ;;
63- usage)
64- usage_message
65- exit 0
66- ;;
67 *)
68 usage_message
69 exit 2