From 80b23854bc6d2b7466b5cdef112db100372e1e0a Mon Sep 17 00:00:00 2001 From: Unknwon Date: Sat, 14 Mar 2015 22:37:23 -0400 Subject: #1050: Bad permissions on authorized_keys after rewrite --- models/publickey.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'models') 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 } -- cgit v1.2.3