From 111e457c73677ad6403666f106999499ec045dd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20Sch=C3=A4fer?= Date: Tue, 3 Sep 2024 10:11:52 +0200 Subject: [PATCH] Fix initrd permissions kiwi stored the initrd for ISO images as 600 which might be too restrictive. This commit makes sure the initrd is stored as 644 and Fixes bsc#1229257 --- kiwi/boot/image/dracut.py | 3 +++ test/unit/boot/image/dracut_test.py | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/kiwi/boot/image/dracut.py b/kiwi/boot/image/dracut.py index 0ff4c6d3e38..9aa4f436459 100644 --- a/kiwi/boot/image/dracut.py +++ b/kiwi/boot/image/dracut.py @@ -235,6 +235,9 @@ def create_initrd( self.initrd_filename = os.sep.join( [self.target_dir, dracut_initrd_basename] ) + Command.run( + ['chmod', '644', self.initrd_filename] + ) def _get_modules(self) -> List[str]: cmd = Command.run( diff --git a/test/unit/boot/image/dracut_test.py b/test/unit/boot/image/dracut_test.py index 16dec193dd4..096b2ce7779 100644 --- a/test/unit/boot/image/dracut_test.py +++ b/test/unit/boot/image/dracut_test.py @@ -152,6 +152,9 @@ def test_create_initrd( 'LimeJeOS.x86_64-1.13.2.initrd', 'some-target-dir' ] + ), + call( + ['chmod', '644', 'some-target-dir/LimeJeOS.x86_64-1.13.2.initrd'] ) ] mock_command.reset_mock() @@ -172,6 +175,9 @@ def test_create_initrd( 'system-directory/foo', 'some-target-dir' ] + ), + call( + ['chmod', '644', 'some-target-dir/foo'] ) ]