gh-122: Ensure files in /var/run/one-context/ have 0400 permissions

Closes #122
pull/129/head
Vlastimil Holer 6 years ago
parent 71ed25b578
commit fc8535e4d8
No known key found for this signature in database
GPG Key ID: EB549BADEFD07C53

@ -8,6 +8,7 @@ if [ -n "$ONEGATE_TOKEN" ]; then
TOKENTXT="$ONEGATE_TOKEN" TOKENTXT="$ONEGATE_TOKEN"
fi fi
umask 0377
echo "export TOKENTXT=\"$TOKENTXT\"" > $ENV_FILE echo "export TOKENTXT=\"$TOKENTXT\"" > $ENV_FILE
echo "export VMID=\"$VMID\"" >> $ENV_FILE echo "export VMID=\"$VMID\"" >> $ENV_FILE
echo "export ONEGATE_ENDPOINT=\"$ONEGATE_ENDPOINT\"" >> $ENV_FILE echo "export ONEGATE_ENDPOINT=\"$ONEGATE_ENDPOINT\"" >> $ENV_FILE
@ -28,5 +29,5 @@ function export_rc_vars
export_rc_vars ${CONTEXT_FILE} export_rc_vars ${CONTEXT_FILE}
chown root:root $ENV_FILE chown root:root $ENV_FILE
chmod a+r $ENV_FILE chmod 0400 $ENV_FILE

@ -181,6 +181,8 @@ function get_new_context {
log err 'Error: No contextualization found' 2 log err 'Error: No contextualization found' 2
exit 1 exit 1
fi fi
chmod 0400 "${CONTEXT_NEW}"
} }
function check_context { function check_context {

Loading…
Cancel
Save