mirror of
https://github.com/postmannen/ctrl.git
synced 2024-12-14 12:37:31 +00:00
seedfile: removed deletion, and changed file permissions to 600
This commit is contained in:
parent
fc2d1da165
commit
66c3307dd5
1 changed files with 9 additions and 8 deletions
17
server.go
17
server.go
|
@ -116,7 +116,7 @@ func NewServer(configuration *Configuration, version string) (*server, error) {
|
||||||
// return nil, fmt.Errorf("error: failed to create tmp seed file: %v", err)
|
// return nil, fmt.Errorf("error: failed to create tmp seed file: %v", err)
|
||||||
// }
|
// }
|
||||||
|
|
||||||
err = os.WriteFile(pth, []byte(configuration.NkeySeed), 0700)
|
err = os.WriteFile(pth, []byte(configuration.NkeySeed), 0600)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
cancel()
|
cancel()
|
||||||
return nil, fmt.Errorf("error: failed to write temp seed file: %v", err)
|
return nil, fmt.Errorf("error: failed to write temp seed file: %v", err)
|
||||||
|
@ -128,13 +128,14 @@ func NewServer(configuration *Configuration, version string) (*server, error) {
|
||||||
return nil, fmt.Errorf("error: failed to read temp nkey seed file: %v", err)
|
return nil, fmt.Errorf("error: failed to read temp nkey seed file: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
defer func() {
|
// // TODO: REMOVED for testing
|
||||||
err = os.Remove(pth)
|
//defer func() {
|
||||||
if err != nil {
|
// err = os.Remove(pth)
|
||||||
cancel()
|
// if err != nil {
|
||||||
log.Fatalf("error: failed to remove temp seed file: %v\n", err)
|
// cancel()
|
||||||
}
|
// log.Fatalf("error: failed to remove temp seed file: %v\n", err)
|
||||||
}()
|
// }
|
||||||
|
//}()
|
||||||
|
|
||||||
case configuration.NkeySeedFile != "" && configuration.NkeyFromED25519SSHKeyFile == "":
|
case configuration.NkeySeedFile != "" && configuration.NkeyFromED25519SSHKeyFile == "":
|
||||||
var err error
|
var err error
|
||||||
|
|
Loading…
Reference in a new issue