File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 55// http://opensource.org/licenses/MIT>, at your option. You may not use this file except in
66// accordance with one or both of these licenses.
77
8- use std:: fs;
8+ use std:: fs:: { self , OpenOptions } ;
99use std:: io:: Write ;
1010use std:: ops:: Deref ;
1111use std:: path:: Path ;
1212use std:: sync:: Arc ;
1313
14+ #[ cfg( unix) ]
15+ use std:: os:: unix:: fs:: OpenOptionsExt ;
16+
1417use bdk_chain:: indexer:: keychain_txout:: ChangeSet as BdkIndexerChangeSet ;
1518use bdk_chain:: local_chain:: ChangeSet as BdkLocalChainChangeSet ;
1619use bdk_chain:: miniscript:: { Descriptor , DescriptorPublicKey } ;
@@ -77,7 +80,11 @@ pub(crate) fn read_or_generate_seed_file(
7780 fs:: create_dir_all ( parent_dir) ?;
7881 }
7982
80- let mut f = fs:: File :: create ( keys_seed_path) ?;
83+ #[ cfg( unix) ]
84+ let mut f = OpenOptions :: new ( ) . write ( true ) . create_new ( true ) . mode ( 0o400 ) . open ( keys_seed_path) ?;
85+
86+ #[ cfg( not( unix) ) ]
87+ let mut f = OpenOptions :: new ( ) . write ( true ) . create_new ( true ) . open ( keys_seed_path) ?;
8188
8289 f. write_all ( & key) ?;
8390
You can’t perform that action at this time.
0 commit comments