d1a34d
From b4f4c927d25b273498d96ee0d367669ee011400e Mon Sep 17 00:00:00 2001
d1a34d
From: Lukas Nykryn <lnykryn@redhat.com>
d1a34d
Date: Mon, 19 Jul 2021 11:27:28 +0200
d1a34d
Subject: [PATCH] 95nfs: set correct ownership and permissions for statd 
d1a34d
 directory
d1a34d
d1a34d
The directory ownership for the statd directory should be
d1a34d
rpcuser:rpcuser.
d1a34d
d1a34d
Resolves: #2017846
d1a34d
---
d1a34d
 modules.d/95nfs/module-setup.sh | 9 +++++++--
d1a34d
 1 file changed, 7 insertions(+), 2 deletions(-)
d1a34d
d1a34d
diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh
d1a34d
index 38da5957..1c5f780e 100755
d1a34d
--- a/modules.d/95nfs/module-setup.sh
d1a34d
+++ b/modules.d/95nfs/module-setup.sh
d1a34d
@@ -120,8 +120,13 @@ install() {
d1a34d
     mkdir -m 0755 -p "$initdir/var/lib/nfs"
d1a34d
     mkdir -m 0755 -p "$initdir/var/lib/nfs/rpc_pipefs"
d1a34d
     mkdir -m 0770 -p "$initdir/var/lib/rpcbind"
d1a34d
-    [ -d "/var/lib/nfs/statd/sm" ] && mkdir -m 0755 -p "$initdir/var/lib/nfs/statd/sm"
d1a34d
-    [ -d "/var/lib/nfs/sm" ] && mkdir -m 0755 -p "$initdir/var/lib/nfs/sm"
d1a34d
+    [ -d "$dracutsysrootdir/var/lib/nfs/statd/sm" ] \
d1a34d
+        && mkdir -m 0700 -p "$initdir/var/lib/nfs/statd" \
d1a34d
+        && mkdir -m 0755 -p "$initdir/var/lib/nfs/statd/sm" \
d1a34d
+        && chown -R rpcuser:rpcuser "$initdir/var/lib/nfs/statd"
d1a34d
+    [ -d "$dracutsysrootdir/var/lib/nfs/sm" ] \
d1a34d
+        && mkdir -m 0755 -p "$initdir/var/lib/nfs/sm" \
d1a34d
+        && chown -R rpcuser:rpcuser "$initdir/var/lib/nfs/sm"
d1a34d
 
d1a34d
     # Rather than copy the passwd file in, just set a user for rpcbind
d1a34d
     # We'll save the state and restart the daemon from the root anyway