[Hackage] #454: file permissions of installed files on windows

Hackage trac at galois.com
Mon Jan 26 09:00:07 EST 2009

#454: file permissions of installed files on windows
  Reporter:  Toxaris        |        Owner:           
      Type:  defect         |       Status:  new      
  Priority:  normal         |    Milestone:  Cabal-1.6
 Component:  Cabal library  |      Version:  
  Severity:  normal         |   Resolution:           
  Keywords:                 |   Difficulty:  normal   
Ghcversion:  6.10.1         |     Platform:  Windows  
Changes (by duncan):

  * summary:  file permissions of executable on vista => file permissions
              of installed files on windows


 Unfortunately I'm completely stuck here. I cannot reproduce any of these
 issues because I've only go access as non-admin to a win2k3 machine.

 We need to get clear what is really going on and in what environments. The
 important factors seem to be if the user is using ghc-6.8 or 6.10,
 Cabal-1.2 or 1.6, XP or Vista and if they're installing as admin or not.
 Whether they are global installs or not is also relevant.

 In the email thread above Dominic notes:
 When I rebuild the package *without* having cleaned out haskell_packages
 then I get the access error. I think this is because cabal (copyFile)
 doesn't want to overwrite a read only file even though the directory
 permissions should allow it to do so.

 This should not be the case, but we should confirm it. The copyFile
 function creates a temporary file in the target directory, copies the data
 into it, then atomically renames over the target file. That should not
 fail even if the target file is read only. In my tests that works fine.

 I think what is clear however is that we should not be copying the
 original file permissions. We should set them explicitly. However what we
 should set them to is not clear. For a global install it would be
 customary to make the files read only while for a per-user install that is
 not necessary. How do ordinary unix installers manage this? Is it just via
 the umask? So perhaps all we have to do is set files to be readable (and
 executable files to be executable).

Ticket URL: <http://hackage.haskell.org/trac/hackage/ticket/454#comment:4>
Hackage <http://haskell.org/cabal/>
Hackage: Cabal and related projects

More information about the cabal-devel mailing list