Fix UMASK handling

This commit is contained in:
TheSpad 2022-07-15 21:12:39 +01:00
parent b5f9bf1093
commit 74a4516271
No known key found for this signature in database
GPG key ID: 08F06191F4587860

View file

@ -1,7 +1,9 @@
#! /bin/bash
if [[ -f /var/run/s6/container_environment/UMASK ]] && [[ "$(pwdx $$)" =~ "/run/s6/services/" ]]; then
umask $(cat /var/run/s6/container_environment/UMASK)
exec /command/with-contenv "$@"
else
exec /command/with-contenv "$@"
if [[ -f /var/run/s6/container_environment/UMASK ]] && \
{ [[ "$(pwdx $$)" =~ "/run/s6/legacy-services/" ]] || \
[[ "$(pwdx $$)" =~ "/run/s6/services/" ]] || \
[[ "$(pwdx $$)" =~ "/servicedirs/svc-" ]]; }; then
umask $(cat /var/run/s6/container_environment/UMASK)
fi
exec /command/with-contenv "$@"