You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
agent-guards: actions-disable-guard: variable values that aliases, exported functions, order or made names change #1518
Follow-up from the round-1 lenses on #1504 (part of #1094). actions-disable-guard reads a shell variable's written-out value as its value (C='echo hi'; bash -c "$C" runs echo hi). Some shapes break that, and the guard does not see them. Each one below already passes on main without any trap, so none is new in #1504. #1504 only stops the trap and eval forms of them (fixed_names: an alias anywhere, or a trap/eval text that runs a command other than a known program or a function the text defines, keeps every name open).
What is left to decide and fix, in one place:
An alias the script defines and calls directly: shopt -s expand_aliases; alias f='C=$(cat file)'; f; bash -c "$C". The alias body sets C, but the guard does not read alias bodies as commands that set variables.
A function exported by the caller (g(){ C=$(cat file); }; export -f g; bash s.sh), called in the script by a name the script does not define. The same works for a function named after a program (rm, cat), which then replaces it.
A variable used before the script sets it: bash -c "$C"; C='echo hi'. The first line runs whatever C the caller's environment gave. The guard reads values without regard to order.
A name set by a word made at run time: read -r "$n", printf -v "$n" .., declare "$n=..". The guard taints only names that are written out.
Possible direction: treat a name as known only when its one assignment comes before every use at the top level, the text defines no alias, every command word it calls is a builtin, a known program or a function the text defines, and no setter takes a made name. Otherwise, read it as hidden. Each shape needs a refuse row in actions-disable.test.py (an existing table) and a check that the fork's own scripts still pass.
Activity
agent-guards: speed: the lexer follows case .. esac; a trap that runs…
agent-guards: speed: the lexer follows case .. esac; a trap that runs…
agent-guards: speed: actions-disable-guard keeps each function call's…