Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installkernel: updatever: preserve file permissions #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mxw39
Copy link

@mxw39 mxw39 commented Mar 13, 2025

This is especially important for initramfs where it may contain sensitive keys in plaintext (such as ZFS decryption key).

dracut by default produces initrd with umask 077. With the current cat piped to file approach we'd lose file permissions.

@Nowa-Ammerlaan
Copy link
Collaborator

I wonder what the original reason was to use cat here.

In any case we should make the same change in 90-compat.install

This is especially important for initramfs where it may contain
sensitive keys in plaintext (such as ZFS decryption key).

dracut by default produces initrd with umask 077. With the current cat
piped to file approach we'd lose file permissions.

Signed-off-by: Xian Wang <[email protected]>
@mxw39
Copy link
Author

mxw39 commented Mar 13, 2025

I wonder what the original reason was to use cat here.

My guess is working around /boot on a different filesystem such as FAT32 where file permissions are not supported. But I can test on a system like that over the weekend and get back.

@@ -55,7 +55,7 @@ if [[ ${COMMAND} == add ]]; then
INITRD="${KERNEL_INSTALL_STAGING_AREA}/initrd"
if [[ -f ${INITRD} ]]; then
[[ ${KERNEL_INSTALL_VERBOSE} == 1 ]] && echo "Installing initramfs image for ${KERNEL_VERSION}..."
cp "${INITRD}" "${KERNEL_INSTALL_ROOT}/initramfs-${KERNEL_VERSION}.img" || exit 1
cp -a "${INITRD}" "${KERNEL_INSTALL_ROOT}/initramfs-${KERNEL_VERSION}.img" || exit 1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To keep the symmetry between systemd and openrc we should also make this change for the kernel image and the microcode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants