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 1
1
// Copyright 2014 The Gogs Authors. All rights reserved.
2
+ // Copyright 2017 The Gitea Authors. All rights reserved.
2
3
// Use of this source code is governed by a MIT-style
3
4
// license that can be found in the LICENSE file.
4
5
@@ -210,7 +211,7 @@ func GenKeyPair(keyPath string) error {
210
211
}
211
212
212
213
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 )
214
215
if err != nil {
215
216
return err
216
217
}
@@ -227,7 +228,7 @@ func GenKeyPair(keyPath string) error {
227
228
}
228
229
229
230
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 )
231
232
if err != nil {
232
233
return err
233
234
}
You can’t perform that action at this time.
0 commit comments