diff options
| author | Damien Ciabrini <dciabrin@redhat.com> | 2019-01-15 15:37:02 +0100 |
|---|---|---|
| committer | Damien Ciabrini <dciabrin@redhat.com> | 2019-01-15 15:43:38 +0100 |
| commit | ba2a69644f79ec54da8c2356f591f2c3f403bd6b (patch) | |
| tree | 8be49f4f5a8266daebd47c248779d5a19779a34a /docker/base | |
| parent | abbebb03502ad14fc109f54718b856ff074f2ae5 (diff) | |
| download | kolla-ba2a69644f79ec54da8c2356f591f2c3f403bd6b.tar.gz kolla-ba2a69644f79ec54da8c2356f591f2c3f403bd6b.zip | |
Ensure /run_command is readable by all users
On some distro, running kolla_start via su changes
the default UMASK, and consequently set_configs.py
generates a /run_command that is not world-readable,
and kolla cannot start the configured service.
Make sure /run_command always has 'go+r' permissions.
Change-Id: I6304f5937c512068ee1fb8aac5c88a2bd086e387
Diffstat (limited to 'docker/base')
| -rw-r--r-- | docker/base/set_configs.py | 8 |
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): |
