Blame 0055-nfs-module-setup.sh-check-for-rpc.rpc-before-running.patch

Harald Hoyer 12f6cc
From 6ca264a1511eb181fb4ca58e25314b6930c2c2a7 Mon Sep 17 00:00:00 2001
Harald Hoyer 12f6cc
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer 12f6cc
Date: Thu, 26 Jul 2012 18:12:05 +0200
Harald Hoyer 12f6cc
Subject: [PATCH] nfs/module-setup.sh: check for "rpc.rpc" before running
Harald Hoyer 12f6cc
 chown
Harald Hoyer 12f6cc
Harald Hoyer 12f6cc
---
Harald Hoyer 12f6cc
 modules.d/95nfs/module-setup.sh | 4 +++-
Harald Hoyer 12f6cc
 1 file changed, 3 insertions(+), 1 deletion(-)
Harald Hoyer 12f6cc
Harald Hoyer 12f6cc
diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh
Harald Hoyer 12f6cc
index 0c07725..ecef635 100755
Harald Hoyer 12f6cc
--- a/modules.d/95nfs/module-setup.sh
Harald Hoyer 12f6cc
+++ b/modules.d/95nfs/module-setup.sh
Harald Hoyer 12f6cc
@@ -71,6 +71,8 @@ install() {
Harald Hoyer 12f6cc
     # rpc user needs to be able to write to this directory to save the warmstart
Harald Hoyer 12f6cc
     # file
Harald Hoyer 12f6cc
     chmod 770 "$initdir/var/lib/rpcbind"
Harald Hoyer 12f6cc
-    chown rpc.rpc "$initdir/var/lib/rpcbind"
Harald Hoyer 12f6cc
+    egrep -q '^rpc:' /etc/passwd \
Harald Hoyer 12f6cc
+        && egrep -q '^rpc:' /etc/group \
Harald Hoyer 12f6cc
+        && chown rpc.rpc "$initdir/var/lib/rpcbind"
Harald Hoyer 12f6cc
 }
Harald Hoyer 12f6cc