Ticket #1652 (closed merge: fixed)
System.Directory.copyFile breakage
| Reported by: | sorear | Owned by: | igloo |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.8.1 |
| Component: | libraries/base | Version: | 6.7 |
| Keywords: | Cc: | sorear | |
| Operating System: | Linux | Architecture: | x86 |
| Type of failure: | Difficulty: | Unknown | |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
Setup: /tmp, with one (executable) file 'x'.
stefan@stefans:/tmp$ rm * stefan@stefans:/tmp$ > x stefan@stefans:/tmp$ chmod +x x
copyFile with relative paths does not work:
stefan@stefans:/tmp$ ghc -e 'System.Directory.copyFile "x" "y"' *** Exception: : copyFile: permission denied (Permission denied)
strace reveals an attempt to access /, possibly from a filepath mixup:
stefan@stefans:/tmp$ strace ghc -e 'System.Directory.copyFile "x" "y"' 2>&1 | grep EACCES
open("/.copyFile.3550tmp", O_RDWR|O_CREAT|O_EXCL|O_NOCTTY|O_NONBLOCK|O_LARGEFILE, 0666) = -1 EACCES (Permission denied)
if absolute paths are used, the operation succeeds:
stefan@stefans:/tmp$ ghc -e 'System.Directory.copyFile "/tmp/x" "/tmp/y"'
... but does not copy permissions.
stefan@stefans:/tmp$ ls -l total 0 -rwxr-xr-x 1 stefan stefan 0 2007-08-30 09:37 x -rw-r--r-- 1 stefan stefan 0 2007-08-30 09:38 y
stefan@stefans:/tmp$ ghc -V The Glorious Glasgow Haskell Compilation System, version 6.7.20070829
(NB: Cabal 'install' trips over this)
Change History
Note: See
TracTickets for help on using
tickets.
