[commit: ghc] ghc-7.10: Suggest how to fix .ghci when it is group writeable (#8248) (53f7235)

git at git.haskell.org git at git.haskell.org
Tue Apr 7 14:28:50 UTC 2015


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

On branch  : ghc-7.10
Link       : http://ghc.haskell.org/trac/ghc/changeset/53f723589819f5e232d2333a993a4d0341702dc4/ghc

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

commit 53f723589819f5e232d2333a993a4d0341702dc4
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
    
    (cherry picked from commit b972de0365f94e1be9d78537152eee969dc5f4cb)


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

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

diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs
index 7310dca..06fbc57 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