Browse Source

fix: [compose-core] improve protection of relation data file !minor

Fixes a timing issue where the data in the relation file could be read.
cache-relation
Valentin Lab 9 months ago
parent
commit
83108d4dc1
  1. 6
      bin/compose-core

6
bin/compose-core

@ -3069,9 +3069,11 @@ get_relation_data_file() {
new=true
fi
if [ "$new" ]; then
if [ -n "$new" ]; then
OLDUMASK=$(umask)
umask 0077
e "$relation_config" > "$relation_data_file"
chmod go-rwx "$relation_data_file" ## protecting this file
umask "$OLDUMASK"
e "$relation_config" | md5_compat > "$relation_data_file.md5_ref"
fi
echo "$relation_data_file"

Loading…
Cancel
Save