Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Explicitly set 0644 permissions when populating disk image (#387)
The file permissions of `/etc/pam.d/system` was incorrect when using the minimal disk image. It prompts that: ``` 2024-01-28T07:59:02.046161+00:00 - login 83 - - in openpam_check_desc_owner_perms(): /etc/pam.d/system: insecure ownership or permissions 2024-01-28T07:59:02.059751+00:00 - login 83 - - pam_start(): System error ``` Once logged out the system, it is impossible to log back in. After ensuring the file permission of `/etc/pam.d/system` is `0644` when building the rootfs, logging out and logging in again works without any issue. ``` Logging in as root... 2024-01-28T09:27:25.194438+00:00 - login 83 - - login on console as root exec /bin/sh # ^D CheriBSD/arm64 (Amnesiac) (ttyu0) login: root 2024-01-28T09:32:54.297221+00:00 - login 86 - - login on ttyu0 as root 2024-01-28T09:32:54.305668+00:00 - login 86 - - ROOT LOGIN (root) ON ttyu0 # ``` This indicates that the inferred permissions on disk image files are not inferred correctly when using the default mode argument. This PR fix the issue by explicitly passing mode to all create_file_for_image calls. --------- Co-authored-by: Alexander Richardson <Alexander.Richardson@cl.cam.ac.uk>
- Loading branch information