From 8d04ffee64bfeffae1ca257fe581b361ac2a7790 Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Thu, 9 Apr 2020 12:50:24 +0200 Subject: [PATCH] unset APT_CONFIG env var when running hook --- mmdebstrap | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mmdebstrap b/mmdebstrap index 6b394f2..c86a31c 100755 --- a/mmdebstrap +++ b/mmdebstrap @@ -1141,13 +1141,14 @@ sub run_hooks { # execute it directly if it's an executable file # or if it there are no shell metacharacters # (the /a regex modifier makes \w match only ASCII) - 0 == system('env', '--unset=TMPDIR', $script, $options->{root}) + 0 == system('env', '--unset=TMPDIR', '--unset=APT_CONFIG', + $script, $options->{root}) or error "command failed: $script"; } else { info "running --$name-hook in shell: sh -c '$script' exec" . " $options->{root}"; # otherwise, wrap everything in sh -c - 0 == system('env', '--unset=TMPDIR', + 0 == system('env', '--unset=TMPDIR', '--unset=APT_CONFIG', 'sh', '-c', $script, 'exec', $options->{root}) or error "command failed: $script"; }