diff options
author | Unknwon <u@gogs.io> | 2017-03-08 22:08:31 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-03-08 22:08:31 -0500 |
commit | de2d3e3fd8d8e0ecbf420b94d58cc3e78af2aa72 (patch) | |
tree | 17d5dc6f9823e8de036dae7fcc0bf440fb7ed193 /models/ssh_key.go | |
parent | 295d2512325210d6a1a5251ac999a93a4de10c8a (diff) |
ssh_key: create parent directory of 'authorized_keys' file
Diffstat (limited to 'models/ssh_key.go')
-rw-r--r-- | models/ssh_key.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/models/ssh_key.go b/models/ssh_key.go index 387fc016..aedf42b9 100644 --- a/models/ssh_key.go +++ b/models/ssh_key.go @@ -527,6 +527,7 @@ func RewriteAllPublicKeys() error { sshOpLocker.Lock() defer sshOpLocker.Unlock() + os.MkdirAll(setting.SSH.RootPath, os.ModePerm) fpath := filepath.Join(setting.SSH.RootPath, "authorized_keys") tmpPath := fpath + ".tmp" f, err := os.OpenFile(tmpPath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0600) |