[Git][ghc/ghc][wip/T21965] hadrian: Fix access mode of installed package registration files

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Mon Aug 8 13:59:07 UTC 2022



Ben Gamari pushed to branch wip/T21965 at Glasgow Haskell Compiler / GHC


Commits:
b3cffa9b by Ben Gamari at 2022-08-08T09:56:40-04:00
hadrian: Fix access mode of installed package registration files

Previously hadrian's bindist Makefile would modify package
registrations placed by `install` via a shell pipeline and `mv`.
However, the use of `mv` means that if umask is set then the user may
otherwise end up with package registrations which are inaccessible.
Fix this by ensuring that the mode is 0644.

- - - - -


1 changed file:

- hadrian/bindist/Makefile


Changes:

=====================================
hadrian/bindist/Makefile
=====================================
@@ -83,6 +83,8 @@ define patchpackageconf \
 	((echo "$1" | grep rts) && (cat '$2.copy' | sed 's|haddock-.*||' > '$2.copy.copy')) || (cat '$2.copy' > '$2.copy.copy')
 	# We finally replace the original file.
 	mv '$2.copy.copy' '$2'
+	# Fix the mode, in case umask is set
+	chmod 644 '$2'
 endef
 
 # QUESTION : should we use shell commands?



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b3cffa9bfd2ac8e19750458799bd4804607c2d18

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b3cffa9bfd2ac8e19750458799bd4804607c2d18
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20220808/8533c76b/attachment-0001.html>


More information about the ghc-commits mailing list