abuild: unset option variables to prevent environment leaking in

In abuild's getopts loop, option variables such as "keep", "verbose",
etc are only set if the corresponding option is found. If such an option
is *not* found, any environment variable with the same name will leak
in, instead. Prevent this by explicitly unsetting almost all of them.
This commit is contained in:
Dimitry Andric 2023-06-05 14:57:06 +02:00 committed by alice
parent d27b635768
commit 76ff15a7b1
1 changed files with 1 additions and 1 deletions

View File

@ -2865,7 +2865,7 @@ usage() {
}
APKBUILD="${APKBUILD:-./APKBUILD}"
unset force
unset color_opt force forceroot install_deps keep keep_build nodeps quiet verbose
while getopts ":AcdD:fFhkKmnP:qrRs:uvV" opt; do
case $opt in
'A') echo "$CARCH"; exit 0;;