diff options
author | Unknwon <u@gogs.io> | 2015-03-14 22:37:23 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-03-14 22:37:23 -0400 |
commit | 80b23854bc6d2b7466b5cdef112db100372e1e0a (patch) | |
tree | a4dae8d753fcb84d6c2ff86587ab36fa41bda686 /models/publickey.go | |
parent | 86abd34eb8b3bbc238ad695135f99f1a54b74da9 (diff) | |
download | gitea-80b23854bc6d2b7466b5cdef112db100372e1e0a.tar.gz gitea-80b23854bc6d2b7466b5cdef112db100372e1e0a.zip |
#1050: Bad permissions on authorized_keys after rewrite
Diffstat (limited to 'models/publickey.go')
-rw-r--r-- | models/publickey.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/models/publickey.go b/models/publickey.go index c8098748b2..f6cd5b4cbb 100644 --- a/models/publickey.go +++ b/models/publickey.go @@ -434,7 +434,7 @@ func RewriteAllPublicKeys() error { defer sshOpLocker.Unlock() tmpPath := filepath.Join(SSHPath, "authorized_keys.tmp") - f, err := os.Create(tmpPath) + f, err := os.OpenFile(tmpPath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0600) if err != nil { return err } |