Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #362 from consensus-shipyard/fix/access-rights
Browse files Browse the repository at this point in the history
make private keys readable for owners only
  • Loading branch information
dnkolegov authored Nov 1, 2023
2 parents 67156c4 + f279b63 commit 21d1ed2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ipc/cli/src/commands/wallet/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ use fvm_shared::address::Address;
use ipc_identity::{EvmKeyStore, PersistentKeyInfo, WalletType};
use ipc_provider::{lotus::message::wallet::WalletKeyType, IpcProvider, LotusJsonKeyType};
use std::fmt::Debug;
use std::fs::Permissions;
use std::io::Write;
use std::os::unix::fs::PermissionsExt;
use std::str::FromStr;

use crate::{get_ipc_provider, CommandLineHandler, GlobalArguments};
Expand Down Expand Up @@ -81,6 +83,7 @@ impl CommandLineHandler for WalletExport {
match &arguments.output {
Some(p) => {
let mut file = std::fs::File::create(p)?;
file.set_permissions(Permissions::from_mode(0o600))?;
file.write_all(v.as_bytes())?;
println!(
"exported new wallet with address {:?} in file {:?}",
Expand Down

0 comments on commit 21d1ed2

Please sign in to comment.