diff --git a/poezio_omemo/__init__.py b/poezio_omemo/__init__.py index e862c3e..d6b4b77 100644 --- a/poezio_omemo/__init__.py +++ b/poezio_omemo/__init__.py @@ -74,7 +74,12 @@ class Plugin(E2EEPlugin): digest = hashlib.sha256(jid_str).digest() hashed_jid = base64.b32encode(digest).decode('US-ASCII') data_dir = os.path.join(DATA_HOME, 'omemo', hashed_jid) - os.makedirs(data_dir, exist_ok=True) + + try: + # Raise exception if folder exists so that we don't chmod again. + os.makedirs(data_dir, mode=0o700, exist_ok=False) + except OSError: # Folder already exists + pass try: self.core.xmpp.register_plugin(