Suggest how to fix .ghci when it is group writeable (#8248)
authorVikas Menon <menonvikas@gmail.com>
Tue, 7 Apr 2015 13:39:44 +0000 (15:39 +0200)
committerThomas Miedema <thomasmiedema@gmail.com>
Tue, 7 Apr 2015 13:42:47 +0000 (15:42 +0200)
```
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

ghc/InteractiveUI.hs

index 9941a60..fc2883f 100644 (file)
@@ -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