]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
nfs: dynamically chown /var/lib/rpcbind
authorHarald Hoyer <harald@redhat.com>
Wed, 18 Jan 2017 09:33:09 +0000 (10:33 +0100)
committerHarald Hoyer <harald@redhat.com>
Wed, 18 Jan 2017 09:33:09 +0000 (10:33 +0100)
modules.d/95nfs/module-setup.sh
modules.d/95nfs/parse-nfsroot.sh

index 0f87761f9fa30502e02c8ea20cef8caf80241876..efa720d0cea0e891d07c8c01935c46fa820c1651 100755 (executable)
@@ -100,7 +100,7 @@ install() {
     inst "$moddir/nfsroot.sh" "/sbin/nfsroot"
     inst "$moddir/nfs-lib.sh" "/lib/nfs-lib.sh"
     mkdir -m 0755 -p "$initdir/var/lib/nfs/rpc_pipefs"
-    mkdir -m 0755 -p "$initdir/var/lib/rpcbind"
+    mkdir -m 0770 -p "$initdir/var/lib/rpcbind"
     mkdir -m 0755 -p "$initdir/var/lib/nfs/statd/sm"
 
     # Rather than copy the passwd file in, just set a user for rpcbind
@@ -112,7 +112,6 @@ install() {
     # file
     chmod 770 "$initdir/var/lib/rpcbind"
     grep -q '^rpc:' /etc/passwd \
-        && grep -q '^rpc:' /etc/group \
-        && chown rpc:rpc "$initdir/var/lib/rpcbind"
+        && grep -q '^rpc:' /etc/group
     dracut_need_initqueue
 }
index 54f73d8c2084c2400c25b64b29ebc7fd1a3cbb09..f715767bb31aeb57c92391262217d374e0bb3b55 100755 (executable)
@@ -117,3 +117,7 @@ rootok=1
 root="$fstype"
 
 echo '[ -e $NEWROOT/proc ]' > $hookdir/initqueue/finished/nfsroot.sh
+
+mkdir -p /var/lib/rpcbind
+chown rpc:rpc /var/lib/rpcbind
+chmod 770 /var/lib/rpcbind