armbian-build/lib/functions/configuration
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
..
aggregation.sh chore: update copyright years to 2026 2025-12-25 12:03:34 +01:00
change-tracking.sh (#9400 P1b) configuration: change-tracking: replace eval with nameref 2026-03-02 02:55:58 +02:00
compilation-config.sh Extension: ccache-remote — shared compilation cache via Redis/HTTP (#9369) 2026-03-01 01:18:35 +01:00
config-desktop.sh chore: update copyright years to 2026 2025-12-25 12:03:34 +01:00
interactive.sh (#9400 P1b) configuration: interactive: replace eval with declare -g 2026-03-02 02:51:26 +02:00
main-config.sh Disable APA for sid too 2026-01-16 08:10:03 -05:00
menu.sh chore: update copyright years to 2026 2025-12-25 12:03:34 +01:00
package-lists.sh chore: update copyright years to 2026 2025-12-25 12:03:34 +01:00