[GHC] #14017: "make install" with non-standard umask causes bad permission on package.cache

#14017: "make install" with non-standard umask causes bad permission on package.cache -------------------------------------+------------------------------------- Reporter: djf | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: None | Version: 8.2.1-rc3 Keywords: | Operating System: Linux Architecture: | Type of failure: Installing GHC Unknown/Multiple | failed Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Using Debian 8 binary package ghc-8.2.1-x86_64-deb8-linux.tar.xz to install with `configure` and then `su` and `make install`. If your umask is 0027 rather than the default 0022, a file doesn't get made world-readable. (Other files in this directory do though.) {{{ $ ls -l /usr/local/lib/ghc-8.2.1/package.conf.d/package.cache -rw-r----- 1 root staff 161490 Jul 23 10:02 /usr/local/lib/ghc-8.2.1/package.conf.d/package.cache }}} It results in this message when trying to use ghc or ghci: {{{ $ ghci GHCi, version 8.2.1: http://www.haskell.org/ghc/ :? for help /usr/local/lib/ghc-8.2.1/package.conf.d/package.cache: openBinaryFile: permission denied (Permission denied) }}} (n.b. I have set the version field in this bug to 8.2.1-rc3 for now because 8.2.1 isn't in the list yet.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14017 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14017: "make install" with non-standard umask causes bad permission on package.cache -------------------------------------+------------------------------------- Reporter: djf | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.2.2 Component: Build System | Version: 8.2.1 Resolution: | Keywords: Operating System: Linux | Architecture: Type of failure: Installing GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * priority: normal => high * version: 8.2.1-rc3 => 8.2.1 * component: None => Build System * milestone: => 8.2.2 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14017#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14017: "make install" with non-standard umask causes bad permission on package.cache -------------------------------------+------------------------------------- Reporter: djf | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.2.2 Component: Build System | Version: 8.2.1 Resolution: | Keywords: Operating System: Linux | Architecture: Type of failure: Installing GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: #13375, #13354, | Differential Rev(s): #13194 | Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * cc: arybczak (added) * related: => #13375, #13354, #13194 Comment: I believe this more fallout from the atomic package database modification patch. The problem appears to be that `writeFileAtomic` (which is used by `writePackageDb` to populate the package database cache) uses the create- and-rename trick for atomic writes on POSIX platforms. However, when it creates the new file it doesn't take care to set the mode bits. It's not clear to me what should be done about this; what is the "correct" mode for this file? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14017#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14017: "make install" with non-standard umask causes bad permission on package.cache -------------------------------------+------------------------------------- Reporter: djf | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.2.2 Component: Build System | Version: 8.2.1 Resolution: | Keywords: Operating System: Linux | Architecture: Type of failure: Installing GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: #13375, #13354, | Differential Rev(s): #13194 | Wiki Page: | -------------------------------------+------------------------------------- Comment (by arybczak): Does it work as expected in 8.0.2? I doubt this is related to atomic package database modification as afair nothing about the method of updating package.cache file has changed. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14017#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14017: "make install" with non-standard umask causes bad permission on package.cache -------------------------------------+------------------------------------- Reporter: djf | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.2.2 Component: Build System | Version: 8.2.1 Resolution: | Keywords: Operating System: Linux | Architecture: Type of failure: Installing GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: #13375, #13354, | Differential Rev(s): #13194 | Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): I have no idea what specifically changed in 8.2.1 but this certainly worked correctly in 8.0.2. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14017#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14017: "make install" with non-standard umask causes bad permission on package.cache -------------------------------------+------------------------------------- Reporter: djf | Owner: bgamari Type: bug | Status: new Priority: high | Milestone: 8.2.2 Component: Build System | Version: 8.2.1 Resolution: | Keywords: Operating System: Linux | Architecture: Type of failure: Installing GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: #13375, #13354, | Differential Rev(s): #13194 | Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * owner: (none) => bgamari Comment: Alright, I'll try to look at this on the plane. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14017#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14017: "make install" with non-standard umask causes bad permission on package.cache -------------------------------------+------------------------------------- Reporter: djf | Owner: bgamari Type: bug | Status: new Priority: high | Milestone: 8.2.2 Component: Build System | Version: 8.2.1 Resolution: | Keywords: Operating System: Linux | Architecture: Type of failure: Installing GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: #13375, #13354, | Differential Rev(s): #13194 | Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Indeed the use of `writeFileAtomic` appears to be okay since it uses `openBinaryTempFileWithDefaultPermissions`, which uses a mode of `0666` to create the file. Looks like I'll have to look elsewhere. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14017#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14017: "make install" with non-standard umask causes bad permission on package.cache -------------------------------------+------------------------------------- Reporter: djf | Owner: bgamari Type: bug | Status: new Priority: high | Milestone: 8.2.2 Component: Build System | Version: 8.2.1 Resolution: | Keywords: Operating System: Linux | Architecture: Type of failure: Installing GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: #13375, #13354, | Differential Rev(s): #13194 | Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Actually, after looking the `umask` documentation more carefully I am even more confused. The mask is applied only to newly created files; this means that essential any file created during installation will need to `chmod` as well to ensure that the mode is set as expected in the event that the user has overridden umask. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14017#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14017: "make install" with non-standard umask causes bad permission on package.cache -------------------------------------+------------------------------------- Reporter: djf | Owner: bgamari Type: bug | Status: new Priority: high | Milestone: 8.2.3 Component: Build System | Version: 8.2.1 Resolution: | Keywords: Operating System: Linux | Architecture: Type of failure: Installing GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: #13375, #13354, | Differential Rev(s): #13194 | Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: 8.2.2 => 8.2.3 Comment: This won't happen for 8.2.2. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14017#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC