stages/rpm: set machine-id to 444

According to the systemd spec file, /etc/machine-id should have the 444
permissions. Thus, we need to chmod the file to 444 after it's created.

See:
 - 9c05b44a4b/f/systemd.spec (_821)
 - https://bugzilla.redhat.com/show_bug.cgi?id=2221269
 - https://issues.redhat.com/browse/COMPOSER-1992
This commit is contained in:
Ondřej Budai 2023-07-10 15:13:28 +02:00 committed by Ondřej Budai
parent d2b6a2e570
commit dc372bbdea

View file

@ -378,7 +378,7 @@ def main(tree, inputs, options):
print("deleting the fake machine id")
machine_id_file = pathlib.Path(f"{tree}/etc/machine-id")
machine_id_file.unlink()
machine_id_file.touch()
machine_id_file.touch(mode=0o444)
if ostree_booted:
os.unlink(ostree_booted)