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

make private keys readable for owners only #362

Merged
merged 1 commit into from
Nov 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading