[commit: ghc] ghc-8.6: Drop accidental write-attributes request (a2e3334)

git at git.haskell.org git at git.haskell.org
Fri Oct 5 22:49:26 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-8.6
Link       : http://ghc.haskell.org/trac/ghc/changeset/a2e3334c0eaf249c5bc105c2ac15ef2ac84d78a0/ghc

>---------------------------------------------------------------

commit a2e3334c0eaf249c5bc105c2ac15ef2ac84d78a0
Author: Tamar Christina <tamar at zhox.com>
Date:   Wed Oct 3 15:34:56 2018 +0200

    Drop accidental write-attributes request
    
    Summary:
    The new filesystem code accidentally asks for write attributes
    permissions when doing read-only access.
    
    I believe this is what's causing the GHC 8.6.1 tarballs to fail
    when installed to a privileged location.
    I haven't been able to reproduce the issue yet, but this permission
    bit is wrong anyway.
    
    Test Plan: I'm still trying to workout how to test that this works,
    changing the permissions on the folder doesn't seem to reproduce
    the error on a tarball I made from before the change.
    
    Reviewers: bgamari, tdammers
    
    Reviewed By: bgamari
    
    Subscribers: tdammers, monoidal, rwbarton, carter
    
    GHC Trac Issues: #15667
    
    Differential Revision: https://phabricator.haskell.org/D5177
    
    (cherry picked from commit deceb21b7ec64ae60377addc2679692ca500b6ae)


>---------------------------------------------------------------

a2e3334c0eaf249c5bc105c2ac15ef2ac84d78a0
 utils/fs/fs.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/utils/fs/fs.c b/utils/fs/fs.c
index 0f8fbe7..6644705 100644
--- a/utils/fs/fs.c
+++ b/utils/fs/fs.c
@@ -107,15 +107,13 @@ int FS(swopen) (const wchar_t* filename, int oflag, int shflag, int pmode)
   /* Construct access mode.  */
   DWORD dwDesiredAccess = 0;
   if (HAS_FLAG (oflag, _O_RDONLY))
-    dwDesiredAccess |= GENERIC_READ | FILE_READ_DATA | FILE_READ_ATTRIBUTES |
-                       FILE_WRITE_ATTRIBUTES;;
+    dwDesiredAccess |= GENERIC_READ | FILE_READ_DATA | FILE_READ_ATTRIBUTES;
   if (HAS_FLAG (oflag, _O_RDWR))
     dwDesiredAccess |= GENERIC_WRITE | GENERIC_READ | FILE_READ_DATA |
                        FILE_WRITE_DATA | FILE_READ_ATTRIBUTES |
                        FILE_WRITE_ATTRIBUTES;
   if (HAS_FLAG (oflag,  _O_WRONLY))
-    dwDesiredAccess|= GENERIC_WRITE | FILE_WRITE_DATA |
-                      FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES;
+    dwDesiredAccess|= GENERIC_WRITE | FILE_WRITE_DATA | FILE_WRITE_ATTRIBUTES;
 
   /* Construct shared mode.  */
   DWORD dwShareMode = FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE;



More information about the ghc-commits mailing list