#1016103 lvm2: do not copy security attributes in initramfs hook

Package:
lvm2
Source:
lvm2
Description:
Linux Logical Volume Manager
Submitter:
Christian Göttsche
Date:
2023-02-26 16:15:05 UTC
Severity:
normal
Tags:
#1016103#5
Date:
2022-07-27 10:18:45 UTC
From:
To:
When copying files into the temporary working directory do not copy the
security context but use the default one for the target path.
Otherwise, e.g. when using SELinux, the context might not be allowed on
the destination filesystem and the process needs elevated access to the
original context.

(An alternative would be to use cp -dRp, which would be equivalent to
cp -a except not copying any extended attributes.)


diff --git a/debian/initramfs-tools/lvm2/hooks/lvm2
b/debian/initramfs-tools/lvm2/hooks/lvm2
index 6c186dc5a..f2588b625 100755
--- a/debian/initramfs-tools/lvm2/hooks/lvm2
+++ b/debian/initramfs-tools/lvm2/hooks/lvm2
@@ -16,7 +16,7 @@ esac

. /usr/share/initramfs-tools/hook-functions