From b7801d03741e918f6fc7e163c936d8977d84a922 Mon Sep 17 00:00:00 2001 From: Daniel Aleksandersen Date: Fri, 24 Mar 2017 21:50:31 +0100 Subject: [PATCH] Tighten directory permissions --- lib/network.py | 1 + lib/simple_config.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/lib/network.py b/lib/network.py index 1c122de5..12763679 100644 --- a/lib/network.py +++ b/lib/network.py @@ -239,6 +239,7 @@ class Network(util.DaemonThread): dir_path = os.path.join( self.config.path, 'certs') if not os.path.exists(dir_path): os.mkdir(dir_path) + os.chmod(dir_path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR) # subscriptions and requests self.subscribed_addresses = set() diff --git a/lib/simple_config.py b/lib/simple_config.py index 748702af..4e650f64 100644 --- a/lib/simple_config.py +++ b/lib/simple_config.py @@ -90,6 +90,7 @@ class SimpleConfig(PrintError): if os.path.islink(path): raise BaseException('Dangling link: ' + path) os.mkdir(path) + os.chmod(path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR) self.print_error("electrum directory", path) return path @@ -164,6 +165,7 @@ class SimpleConfig(PrintError): if os.path.islink(dirpath): raise BaseException('Dangling link: ' + dirpath) os.mkdir(dirpath) + os.chmod(dirpath, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR) new_path = os.path.join(self.path, "wallets", "default_wallet")