forked from TrueCloudLab/frostfs-node
[#1115] neofs-adm: generate wallets with 0644 permission
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
a91b59fff9
commit
7ca06aeae2
1 changed files with 8 additions and 1 deletions
|
@ -3,6 +3,7 @@ package morph
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/nspcc-dev/neo-go/cli/input"
|
"github.com/nspcc-dev/neo-go/cli/input"
|
||||||
|
@ -69,7 +70,13 @@ func initializeWallets(walletDir string, size int) ([]string, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
p := filepath.Join(walletDir, innerring.GlagoliticLetter(i).String()+".json")
|
p := filepath.Join(walletDir, innerring.GlagoliticLetter(i).String()+".json")
|
||||||
// TODO(@fyrchik): file is created with 0666 permissions, consider changing.
|
f, err := os.OpenFile(p, os.O_CREATE, 0644)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("can't create wallet file: %w", err)
|
||||||
|
}
|
||||||
|
if err := f.Close(); err != nil {
|
||||||
|
return nil, fmt.Errorf("can't close wallet file: %w", err)
|
||||||
|
}
|
||||||
w, err := wallet.NewWallet(p)
|
w, err := wallet.NewWallet(p)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("can't create wallet: %w", err)
|
return nil, fmt.Errorf("can't create wallet: %w", err)
|
||||||
|
|
Loading…
Reference in a new issue