[commit: ghc] master: Suggest how to fix .ghci when it is group writeable (#8248) (b972de0)

git at git.haskell.org git at git.haskell.org
Tue Apr 7 13:43:18 UTC 2015


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/b972de0365f94e1be9d78537152eee969dc5f4cb/ghc

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

commit b972de0365f94e1be9d78537152eee969dc5f4cb
Author: Vikas Menon <menonvikas at gmail.com>
Date:   Tue Apr 7 15:39:44 2015 +0200

    Suggest how to fix .ghci when it is group writeable (#8248)
    
    ```
    chmod 664 $PATH_TO_GHCI_CONF/.ghci
    ```
    
    Run ghci. You will now get a warning + a suggestion:
    
    ```
      *** WARNING: $PATH_TO_GHCI_CONF/.ghci is writable by someone else, IGNORING!
      Suggested fix: execute 'chmod 644 $PATH_TO_GHCI_CONF/.ghci'
    ```
    
    Execute fix and the warning should disappear.
    
    Reviewed By: mboes, thomie
    
    Differential Revision: https://phabricator.haskell.org/D805


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

b972de0365f94e1be9d78537152eee969dc5f4cb
 ghc/InteractiveUI.hs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs
index 9941a60..fc2883f 100644
--- a/ghc/InteractiveUI.hs
+++ b/ghc/InteractiveUI.hs
@@ -611,8 +611,10 @@ checkPerms name =
              groupWriteMode /= mode `intersectFileModes` groupWriteMode &&
              otherWriteMode /= mode `intersectFileModes` otherWriteMode
     unless ok $
+      -- #8248: Improving warning to include a possible fix.
       putStrLn $ "*** WARNING: " ++ name ++
-                 " is writable by someone else, IGNORING!"
+                 " is writable by someone else, IGNORING!" ++
+                 "\nSuggested fix: execute 'chmod 644 " ++ name ++ "'"
     return ok
 #endif
 



More information about the ghc-commits mailing list