From 74a451627101e81fce26ed3f6372e81add6609c9 Mon Sep 17 00:00:00 2001 From: TheSpad Date: Fri, 15 Jul 2022 21:12:39 +0100 Subject: [PATCH] Fix UMASK handling --- root/usr/bin/with-contenv | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/root/usr/bin/with-contenv b/root/usr/bin/with-contenv index e26f8f4..c5dabdd 100755 --- a/root/usr/bin/with-contenv +++ b/root/usr/bin/with-contenv @@ -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 "$@" \ No newline at end of file