Blob Blame History Raw
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"
 }