Browse Source

#1050: Bad permissions on authorized_keys after rewrite

Unknwon 10 years ago
parent
commit
80b23854bc
3 changed files with 3 additions and 3 deletions
  1. 1 1
      README.md
  2. 1 1
      README_ZH.md
  3. 1 1
      models/publickey.go

+ 1 - 1
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
 

+ 1 - 1
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)))
 
 ## 系统要求
 

+ 1 - 1
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
 	}