]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
nfs/module-setup.sh: check for "rpc.rpc" before running chown
authorHarald Hoyer <harald@redhat.com>
Thu, 26 Jul 2012 16:12:05 +0000 (18:12 +0200)
committerHarald Hoyer <harald@redhat.com>
Thu, 26 Jul 2012 16:12:05 +0000 (18:12 +0200)
modules.d/95nfs/module-setup.sh

index 0c0772567fa2b13083d92de2bb322e215ce0dae0..ecef635c6aaadd8579ef2830f9db6d15e737a2cb 100755 (executable)
@@ -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"
 }