diff options
Diffstat (limited to 'Utility/SshConfig.hs')
-rw-r--r-- | Utility/SshConfig.hs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Utility/SshConfig.hs b/Utility/SshConfig.hs index ca336a4b8..57e4f0f38 100644 --- a/Utility/SshConfig.hs +++ b/Utility/SshConfig.hs @@ -15,6 +15,7 @@ import Utility.FileMode import Data.Char import Data.Ord import Data.Either +import System.Directory data SshConfig = GlobalConfig SshSetting @@ -117,8 +118,11 @@ changeUserSshConfig modifier = do whenM (doesFileExist configfile) $ do c <- readFileStrict configfile let c' = modifier c - when (c /= c') $ - viaTmp writeSshConfig configfile c' + when (c /= c') $ do + -- If it's a symlink, replace the file it + -- points to. + f <- catchDefaultIO configfile (canonicalizePath configfile) + viaTmp writeSshConfig f c' writeSshConfig :: FilePath -> String -> IO () writeSshConfig f s = do |