1
0

plugins: use util.make_dir for creating external plugin dir

This sets more restrictive unix permissions on the folder.
Also, util.make_dir is "multiprocess-safe".
This commit is contained in:
SomberNight
2025-05-23 15:46:08 +00:00
parent 5084f75724
commit 37350edeae

View File

@@ -46,7 +46,7 @@ from electrum_ecc import ECPrivkey, ECPubkey
from ._vendor.distutils.version import StrictVersion
from .version import ELECTRUM_VERSION
from .i18n import _
from .util import (profiler, DaemonThread, UserCancelled, ThreadJob, UserFacingException, ChoiceItem)
from .util import (profiler, DaemonThread, UserCancelled, ThreadJob, UserFacingException, ChoiceItem, make_dir)
from . import bip32
from . import plugins
from .simple_config import SimpleConfig
@@ -485,8 +485,7 @@ class Plugins(DaemonThread):
def get_external_plugin_dir(self) -> str:
pkg_path = os.path.join(self.config.electrum_path(), 'plugins')
if not os.path.exists(pkg_path):
os.mkdir(pkg_path)
make_dir(pkg_path)
return pkg_path
async def download_external_plugin(self, url: str) -> str: