armbian-build/lib
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
..
functions (#9400 P1b) configuration: change-tracking: replace eval with nameref 2026-03-02 02:55:58 +02:00
tools inventory-boards-csv: report ATFSOURCE and ATFBRANCH 2026-01-15 20:17:43 +01:00
library-functions.sh lib: drop unused functions/general/downloads.sh (get_urls()) 2026-01-14 20:08:21 +01:00
single.sh chore: update copyright years to 2026 2025-12-25 12:03:34 +01:00