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