fix
This commit is contained in:
parent
27c8e9a434
commit
6d026e16f2
1 changed files with 5 additions and 2 deletions
|
|
@ -124,8 +124,11 @@ if [[ -z "${OWPENGRAM_SG_DOCKER:-}" && $EUID -ne 0 ]] && command -v docker >/dev
|
|||
getent group docker 2>/dev/null | grep -qE "[:,]${USER}(,|$)"; then
|
||||
# The marker travels inside the command rather than the environment: sg and
|
||||
# newgrp are setgid and may sanitise what they pass on, and losing it is the
|
||||
# one failure that would loop instead of stopping.
|
||||
RELAUNCH="OWPENGRAM_SG_DOCKER=1 $(printf '%q ' "$0" "$@")"
|
||||
# one failure that would loop instead of stopping. It goes through env
|
||||
# because the newgrp branch below runs this after `exec`, and exec takes no
|
||||
# assignment prefix -- it would look for a command called
|
||||
# "OWPENGRAM_SG_DOCKER=1".
|
||||
RELAUNCH="$(printf '%q ' env OWPENGRAM_SG_DOCKER=1 "$0" "$@")"
|
||||
if command -v sg >/dev/null 2>&1; then
|
||||
echo "[..] Applying your new 'docker' group membership for this run"
|
||||
exec sg docker -c "$RELAUNCH"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue