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