File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 11// Copyright 2014 The Gogs Authors. All rights reserved.
2+ // Copyright 2017 The Gitea Authors. All rights reserved.
23// Use of this source code is governed by a MIT-style
34// license that can be found in the LICENSE file.
45
@@ -210,7 +211,7 @@ func GenKeyPair(keyPath string) error {
210211 }
211212
212213 privateKeyPEM := & pem.Block {Type : "RSA PRIVATE KEY" , Bytes : x509 .MarshalPKCS1PrivateKey (privateKey )}
213- f , err := os .Create (keyPath )
214+ f , err := os .OpenFile (keyPath , os . O_RDWR | os . O_CREATE | os . O_TRUNC , 0600 )
214215 if err != nil {
215216 return err
216217 }
@@ -227,7 +228,7 @@ func GenKeyPair(keyPath string) error {
227228 }
228229
229230 public := ssh .MarshalAuthorizedKey (pub )
230- p , err := os .Create (keyPath + ".pub" )
231+ p , err := os .OpenFile (keyPath + ".pub" , os . O_RDWR | os . O_CREATE | os . O_TRUNC , 0600 )
231232 if err != nil {
232233 return err
233234 }
You can’t perform that action at this time.
0 commit comments