aboutsummaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2019-01-17 10:43:33 +0000
committerGerrit Code Review <review@openstack.org>2019-01-17 10:43:33 +0000
commit51cf061f386cbcc3907be257bf6c9d7efbd1eca4 (patch)
tree50d99cd032ec90c3c6b9c89bcd0308537c4c930e /docker
parent9cc0c84e8823e7b6cc49682a5dcb9c6ff7e91c23 (diff)
parentba2a69644f79ec54da8c2356f591f2c3f403bd6b (diff)
downloadkolla-51cf061f386cbcc3907be257bf6c9d7efbd1eca4.tar.gz
kolla-51cf061f386cbcc3907be257bf6c9d7efbd1eca4.zip
Merge "Ensure /run_command is readable by all users"
Diffstat (limited to 'docker')
-rw-r--r--docker/base/set_configs.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/docker/base/set_configs.py b/docker/base/set_configs.py
index 65ce210ba..5533e668a 100644
--- a/docker/base/set_configs.py
+++ b/docker/base/set_configs.py
@@ -310,8 +310,14 @@ def copy_config(config):
LOG.info('Writing out command to execute')
LOG.debug("Command is: %s", config['command'])
# The value from the 'command' key will be written to '/run_command'
- with open('/run_command', 'w+') as f:
+ cmd = '/run_command'
+ with open(cmd, 'w+') as f:
f.write(config['command'])
+ # Make sure the generated file is readable by all users
+ try:
+ os.chmod(cmd, 0o644)
+ except OSError:
+ LOG.exception('Failed to set permission of %s to 0o644', cmd)
def user_group(owner):