about summary refs log tree commit diff
path: root/tools
diff options
context:
space:
mode:
authorTim Cuthbertson <tim@gfxmonk.net>2024-02-03 19:55:23 -0500
committerRich Felker <dalias@aerifal.cx>2024-02-03 19:57:30 -0500
commit2e1bb87af24e3cb053bb3d5f4bb6e2e72f79c44a (patch)
treee9cf8d98782d559af6272d0373f22c0724a12a17 /tools
parent0e330722c353e71ec9d1518d77278c09f39a1c55 (diff)
downloadmusl-2e1bb87af24e3cb053bb3d5f4bb6e2e72f79c44a.tar.gz
musl-2e1bb87af24e3cb053bb3d5f4bb6e2e72f79c44a.tar.xz
musl-2e1bb87af24e3cb053bb3d5f4bb6e2e72f79c44a.zip
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.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/install.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/install.sh b/tools/install.sh
index d913b60b..855a8ca2 100755
--- a/tools/install.sh
+++ b/tools/install.sh
@@ -48,7 +48,9 @@ trap 'rm -f "$tmp"' EXIT INT QUIT TERM HUP
 umask 077
 
 if test "$symlink" ; then
+umask 000
 ln -s "$1" "$tmp"
+umask 077
 else
 cat < "$1" > "$tmp"
 chmod "$mode" "$tmp"