Bash from pkgsrc has a flag to disable importing functions unless explicitly enabled.
The patch was created in response to ShellShock and still remains: https://www.mail-archive.com/smartos-discuss@lists.smartos.org/msg01247.html https://github.com/NetBSD/pkgsrc/blob/trunk/shells/bash/patches/patch-shell.c
This commit is contained in:
@@ -39,7 +39,12 @@ export -f exported_internal_shred_file
|
||||
DEREFERENCED_BIN_DIR="${0%/*}"
|
||||
MAX_PARALLEL_SHRED=10
|
||||
|
||||
bash_args=
|
||||
if bash --help | grep import-functions >/dev/null 2>/dev/null; then
|
||||
bash_args=--import-functions
|
||||
fi
|
||||
|
||||
export IFS=
|
||||
tr '\n' '\0' <"$BB_FILES" | xargs -0 -I{} -n 1 -P $MAX_PARALLEL_SHRED bash -c "exported_internal_shred_file $DEREFERENCED_BIN_DIR \"{}\"" $DEREFERENCED_BIN_DIR/fake
|
||||
tr '\n' '\0' <"$BB_FILES" | xargs -0 -I{} -n 1 -P $MAX_PARALLEL_SHRED bash $bash_args -c "exported_internal_shred_file $DEREFERENCED_BIN_DIR \"{}\"" $DEREFERENCED_BIN_DIR/fake
|
||||
|
||||
echo '========== DONE.'
|
||||
|
||||
Reference in New Issue
Block a user