diff options
| author | nl6720 <nl6720@gmail.com> | 2021-04-27 13:45:17 +0300 |
|---|---|---|
| committer | nl6720 <nl6720@gmail.com> | 2021-04-30 20:37:18 +0300 |
| commit | a771297e12f77f4aeffa2303b33ffc7d7bbf1e3d (patch) | |
| tree | 709e2dd9fbef3cac8f7f3c04621a3c9f05164997 | |
| parent | 98c7b67697d2376ab37813295a5f352436040c59 (diff) | |
| download | archiso-a771297e12f77f4aeffa2303b33ffc7d7bbf1e3d.tar.gz archiso-a771297e12f77f4aeffa2303b33ffc7d7bbf1e3d.tar.bz2 | |
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.
| -rwxr-xr-x | archiso/mkarchiso | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/archiso/mkarchiso b/archiso/mkarchiso index e41d67e..410db80 100755 --- a/archiso/mkarchiso +++ b/archiso/mkarchiso @@ -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!" |
