Skip to content
Snippets Groups Projects
Unverified Commit a771297e authored by nl6720's avatar nl6720
Browse files

mkarchiso: make sure to remove potentially preexisting files from...

mkarchiso: make sure to remove potentially preexisting files from $airootfs_dir before creating them with output redirection

mkarchiso creates "${airootfs_dir}/etc/machine-id" by using output redirection. If this file is an existing symlink, then the printf output would be written to the symlink target. It can be a big issue in case the symlink resolves to a path outside ${airootfs_dir}.

Fixes #121.
parent 98c7b676
No related branches found
No related tags found
1 merge request!161mkarchiso: append IMAGE_ID and IMAGE_VERSION to /etc/os-release
Pipeline #6820 passed
......@@ -149,6 +149,7 @@ _cleanup_airootfs() {
# Delete package pacman related files.
find "${work_dir}" \( -name '*.pacnew' -o -name '*.pacsave' -o -name '*.pacorig' \) -delete
# Create an empty /etc/machine-id
rm -f -- "${airootfs_dir}/etc/machine-id"
printf '' > "${airootfs_dir}/etc/machine-id"
_msg_info "Done!"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment