diff options
author | Fredrik Gustafsson <[email protected]> | 2013-07-09 15:00:18 +0200 |
---|---|---|
committer | Fredrik Gustafsson <[email protected]> | 2013-07-09 15:00:18 +0200 |
commit | 6ffa9ea73806a5c025d3c589cebdd911930060de (patch) | |
tree | 91cd499de9554a38e8255ee73601a14a0bc78ad0 /lib/ssh | |
parent | 3d8b8f2e77b5b247db26aa6a268fdc73458c0783 (diff) | |
parent | f0608e162193edf10d0591ff4ab3236935e0e52b (diff) | |
download | otp-6ffa9ea73806a5c025d3c589cebdd911930060de.tar.gz otp-6ffa9ea73806a5c025d3c589cebdd911930060de.tar.bz2 otp-6ffa9ea73806a5c025d3c589cebdd911930060de.zip |
Merge branch 'maint'
Diffstat (limited to 'lib/ssh')
-rw-r--r-- | lib/ssh/src/ssh_file.erl | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/ssh/src/ssh_file.erl b/lib/ssh/src/ssh_file.erl index f115a32710..21cdedc156 100644 --- a/lib/ssh/src/ssh_file.erl +++ b/lib/ssh/src/ssh_file.erl @@ -315,5 +315,12 @@ default_user_dir()-> {ok,[[Home|_]]} = init:get_argument(home), UserDir = filename:join(Home, ".ssh"), ok = filelib:ensure_dir(filename:join(UserDir, "dummy")), - ok = file:change_mode(UserDir, ?PERM_700), + {ok,Info} = file:read_file_info(UserDir), + #file_info{mode=Mode} = Info, + case (Mode band 8#777) of + ?PERM_700 -> + ok; + _Other -> + ok = file:change_mode(UserDir, ?PERM_700) + end, UserDir. |