mirror of
https://github.com/gogs/gogs.git
synced 2025-05-31 11:42:13 +00:00
ssh_key: create parent directory of 'authorized_keys' file
This commit is contained in:
parent
295d251232
commit
de2d3e3fd8
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user