From e001984b4f373749c704b41c246e2eef0874e3e9 Mon Sep 17 00:00:00 2001 From: Jesse Reichman <14865360+jreichman@users.noreply.github.com> Date: Thu, 24 Aug 2023 11:06:18 +0930 Subject: [PATCH] Auto allow shell for profiles with env override --- src/dfbar/dfbar.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/dfbar/dfbar.py b/src/dfbar/dfbar.py index 8483ccd..2914200 100755 --- a/src/dfbar/dfbar.py +++ b/src/dfbar/dfbar.py @@ -257,6 +257,13 @@ def main(): logger.log_warning('ignore missing does not apply with a profile name.') ignore_missing = False + # Shell parsing is automatically allowed for profiles, unless disabled by environment var + env_shell = os.environ.get('DFBAR_ALLOW_PROFILE_SHELL') + if env_shell is not None and env_shell.lower() not in ['1', 'true']: + allow_shell = False + else: + allow_shell = True + # dockerfile should be empty and we have an array of a single directory/spec, representing the # profile to run spec_list = [ os.path.join(os.path.expanduser('~'), '.dfbar', args.spec) ]