summaryrefslogtreecommitdiffstats
path: root/0055-nfs-module-setup.sh-check-for-rpc.rpc-before-running.patch
blob: e93148d8135708ff728aa1a775cb27d5197f81da (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
From 6ca264a1511eb181fb4ca58e25314b6930c2c2a7 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Thu, 26 Jul 2012 18:12:05 +0200
Subject: [PATCH] nfs/module-setup.sh: check for "rpc.rpc" before running
 chown

---
 modules.d/95nfs/module-setup.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh
index 0c07725..ecef635 100755
--- a/modules.d/95nfs/module-setup.sh
+++ b/modules.d/95nfs/module-setup.sh
@@ -71,6 +71,8 @@ install() {
     # rpc user needs to be able to write to this directory to save the warmstart
     # file
     chmod 770 "$initdir/var/lib/rpcbind"
-    chown rpc.rpc "$initdir/var/lib/rpcbind"
+    egrep -q '^rpc:' /etc/passwd \
+        && egrep -q '^rpc:' /etc/group \
+        && chown rpc.rpc "$initdir/var/lib/rpcbind"
 }