1
0

safer os.chmod for wallet files and config: set perms before write

Set unix file permissions first, before writing data.
This commit is contained in:
SomberNight
2024-04-08 13:55:52 +00:00
parent 6d37e464f3
commit f495511886
3 changed files with 10 additions and 10 deletions

View File

@@ -2332,7 +2332,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger, QtEventListener):
def do_export_privkeys(self, fileName, pklist, is_csv):
with open(fileName, "w+") as f:
os_chmod(fileName, 0o600)
os_chmod(fileName, 0o600) # set restrictive perms *before* we write data
if is_csv:
transaction = csv.writer(f)
transaction.writerow(["address", "private_key"])