1
0

create chmod aware of XDG_RUNTIME_DIR

closes https://github.com/spesmilo/electrum/pull/7681
related https://github.com/spesmilo/electrum/issues/6334

Co-authored-by: avirgovi <avirgovi@cisco.com>
Co-authored-by: SomberNight <somber.night@protonmail.com>
This commit is contained in:
avirgovi
2022-02-25 09:33:24 +01:00
committed by SomberNight
parent 233d2373df
commit b5d2b3c512
4 changed files with 20 additions and 7 deletions

View File

@@ -32,7 +32,7 @@ from enum import IntEnum
from . import ecc
from .util import (profiler, InvalidPassword, WalletFileException, bfh, standardize_path,
test_read_write_permissions)
test_read_write_permissions, os_chmod)
from .wallet_db import WalletDB
from .logging import Logger
@@ -95,7 +95,7 @@ class WalletStorage(Logger):
if not self.file_exists():
assert not os.path.exists(self.path)
os.replace(temp_path, self.path)
os.chmod(self.path, mode)
os_chmod(self.path, mode)
self._file_exists = True
self.logger.info(f"saved {self.path}")