From 9571ea519d64a19df503e9742e7d84743e5e6400 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Fri, 20 Dec 2019 02:33:42 -0600 Subject: [PATCH] identify home better supports env home in non daemon --- src/bigbrother/ministry/ofexec.py | 2 +- src/utils/identifyhome.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bigbrother/ministry/ofexec.py b/src/bigbrother/ministry/ofexec.py index 56d474eb..48e28210 100644 --- a/src/bigbrother/ministry/ofexec.py +++ b/src/bigbrother/ministry/ofexec.py @@ -61,7 +61,7 @@ def block_exec(event, info): if info[0].co_filename.endswith(source): return - if info[0].co_filename.startswith(home + 'plugins/'): + if home + 'plugins/' in info[0].co_filename: return code_b64 = base64.b64encode(info[0].co_code).decode() diff --git a/src/utils/identifyhome.py b/src/utils/identifyhome.py index a78969ac..d55a3ddf 100644 --- a/src/utils/identifyhome.py +++ b/src/utils/identifyhome.py @@ -23,6 +23,9 @@ def identify_home(): path = os.environ.get('ONIONR_HOME', None) + if not os.getcwd().endswith('src') and path is not None: + path = 'src/' + path + if path is None: system = platform.system() if system == 'Linux':