aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-03-14 22:37:23 -0400
committerUnknwon <u@gogs.io>2015-03-14 22:37:23 -0400
commit80b23854bc6d2b7466b5cdef112db100372e1e0a (patch)
treea4dae8d753fcb84d6c2ff86587ab36fa41bda686
parent86abd34eb8b3bbc238ad695135f99f1a54b74da9 (diff)
downloadgitea-80b23854bc6d2b7466b5cdef112db100372e1e0a.tar.gz
gitea-80b23854bc6d2b7466b5cdef112db100372e1e0a.zip
#1050: Bad permissions on authorized_keys after rewrite
-rw-r--r--README.md2
-rw-r--r--README_ZH.md2
-rw-r--r--models/publickey.go2
3 files changed, 3 insertions, 3 deletions
diff --git a/README.md b/README.md
index 5bc45adaf7..c7931a84c8 100644
--- a/README.md
+++ b/README.md
@@ -52,7 +52,7 @@ The goal of this project is to make the easiest, fastest, and most painless way
- Drone CI integration
- Supports MySQL, PostgreSQL and SQLite3
- Social account login (GitHub, Google, QQ, Weibo)
-- Multi-language support ([10 languages](https://crowdin.com/project/gogs))
+- Multi-language support ([11 languages](https://crowdin.com/project/gogs))
## System Requirements
diff --git a/README_ZH.md b/README_ZH.md
index 1d2cfa3e84..4da9cccdae 100644
--- a/README_ZH.md
+++ b/README_ZH.md
@@ -39,7 +39,7 @@ Gogs 的目标是打造一个最简单、最快速和最轻松的方式搭建自
- Drone CI 持续部署集成
- 支持 MySQL、PostgreSQL 以及 SQLite3 数据库
- 社交帐号登录(GitHub、Google、QQ、微博)
-- 多语言支持([10 种语言]([more](https://crowdin.com/project/gogs)))
+- 多语言支持([11 种语言]([more](https://crowdin.com/project/gogs)))
## 系统要求
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
}