Browse Source

fix: [0km] allow NUL characters to be sent to inner sub command when muxing

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
rc1
Valentin Lab 4 years ago
parent
commit
1e4c9eeba2
  1. 5
      bin/0km

5
bin/0km

@ -265,13 +265,14 @@ vps_mux() {
[ "$max_size" -lt "${size_name}" ] && [ "$max_size" -lt "${size_name}" ] &&
max_size="$size_name" max_size="$size_name"
done done
code=$(cat)
settmpdir "_0KM_TMP_DIR"
cat > "$_0KM_TMP_DIR/code"
for vps in "${new_vps[@]}"; do for vps in "${new_vps[@]}"; do
label=$(printf "%-${max_size}s" "$vps") label=$(printf "%-${max_size}s" "$vps")
( (
{ {
{ {
echo "$code" | "$fn" "$vps"
"$fn" "$vps" < "$_0KM_TMP_DIR/code"
} 3>&1 1>&2 2>&3 | sed -r "s/^/$DARKCYAN$label$NORMAL $DARKRED\!$NORMAL /g" } 3>&1 1>&2 2>&3 | sed -r "s/^/$DARKCYAN$label$NORMAL $DARKRED\!$NORMAL /g"
set_errlvl "${PIPESTATUS[0]}" set_errlvl "${PIPESTATUS[0]}"
} 3>&1 1>&2 2>&3 | sed -r "s/^/$DARKCYAN$label$NORMAL $DARKGRAY\|$NORMAL /g" } 3>&1 1>&2 2>&3 | sed -r "s/^/$DARKCYAN$label$NORMAL $DARKGRAY\|$NORMAL /g"

Loading…
Cancel
Save