Android: Avoid crashing when unable to set file mode for ssh config file due to Android filesystem horribleness.
This commit is contained in:
parent
590adeb2a7
commit
3cbaa68be8
3 changed files with 11 additions and 2 deletions
|
@ -127,9 +127,13 @@ writeSshConfig f s = do
|
|||
|
||||
{- Ensure that the ssh config file lacks any group or other write bits,
|
||||
- since ssh is paranoid about not working if other users can write
|
||||
- to one of its config files (.ssh/config and .ssh/authorized_keys) -}
|
||||
- to one of its config files (.ssh/config and .ssh/authorized_keys).
|
||||
-
|
||||
- If the chmod fails, ignore the failure, as it might be a filesystem like
|
||||
- Android's that does not support file modes.
|
||||
-}
|
||||
setSshConfigMode :: FilePath -> IO ()
|
||||
setSshConfigMode f = modifyFileMode f $
|
||||
setSshConfigMode f = void $ tryIO $ modifyFileMode f $
|
||||
removeModes [groupWriteMode, otherWriteMode]
|
||||
|
||||
sshDir :: IO FilePath
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue