index
:
gogs.git
Gogs is a painless self-hosted Git service
log msg
author
committer
range
buildscript
main
mygogs
about
summary
refs
log
tree
commit
diff
path:
root
/
models
diff options
context:
1
2
3
4
5
6
7
8
9
10
15
20
25
30
35
40
space:
include
ignore
mode:
unified
ssdiff
stat only
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
parent
86abd34eb8b3bbc238ad695135f99f1a54b74da9
(
diff
)
#1050: Bad permissions on authorized_keys after rewrite
Diffstat
(limited to 'models')
-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 c8098748..f6cd5b4c 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
}