armbian-build/lib/functions
Igor Velkov a4e2d2c4c7
(#9400 P1b) configuration: change-tracking: replace eval with nameref
The original code used eval to read an array variable with a dynamic name:

    eval "var_value=\"\${${var_name}[@]}\"" # sorry

eval works, but it executes arbitrary code — if $var_name were ever a
crafted string, it could inject commands.

bash 4.3+ nameref (local -n) creates an alias to the variable named in
$var_name without executing any code:

    local -n _ct_arr_ref="${var_name}"
    var_value="${_ct_arr_ref[*]}"
    unset -n _ct_arr_ref

unset -n removes only the alias (not the referenced array), preventing
"already a nameref" warnings on subsequent loop iterations.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-02 02:55:58 +02:00
..
artifacts (#9400 P3a) Replace useless cat with input redirection (#9404) 2026-02-18 09:28:14 +01:00
bsp drop deprecated KERNEL_UPGRADE_FREEZE feature 2026-03-01 01:15:10 +01:00
cli (#9400 P1b) cli: utils-cli: replace eval with declare -g 2026-03-02 02:50:49 +02:00
compilation Extension: ccache-remote — shared compilation cache via Redis/HTTP (#9369) 2026-03-01 01:18:35 +01:00
configuration (#9400 P1b) configuration: change-tracking: replace eval with nameref 2026-03-02 02:55:58 +02:00
general Properly handle git submodules when GIT_FIXED_WORKDIR is set 2026-02-23 00:51:03 +01:00
host Extension: ccache-remote — shared compilation cache via Redis/HTTP (#9369) 2026-03-01 01:18:35 +01:00
image (#9400 P3a) Replace useless cat with input redirection (#9404) 2026-02-18 09:28:14 +01:00
logging framework run_host_x86_binary_logged - unset QEMU_CPU 2026-02-18 15:03:08 -05:00
main chore: update copyright years to 2026 2025-12-25 12:03:34 +01:00
rootfs rootfs: enable loong64 in qemu binfmt registration 2026-01-22 14:32:05 +01:00