install.sh: avoid creating symlinks with restricted permissions

Linux and most systems do not have symlink permissions, but some
systems, including MacOS, do, and creation of the symlink with umask
set to 0777 makes the symlink inaccessible on such systems.

clear umask when making a symlink so that the behavior is uniform.
This commit is contained in:
Tim Cuthbertson 2024-02-03 19:55:23 -05:00 committed by Rich Felker
parent 0e330722c3
commit 2e1bb87af2
1 changed files with 2 additions and 0 deletions

View File

@ -48,7 +48,9 @@ trap 'rm -f "$tmp"' EXIT INT QUIT TERM HUP
umask 077 umask 077
if test "$symlink" ; then if test "$symlink" ; then
umask 000
ln -s "$1" "$tmp" ln -s "$1" "$tmp"
umask 077
else else
cat < "$1" > "$tmp" cat < "$1" > "$tmp"
chmod "$mode" "$tmp" chmod "$mode" "$tmp"