Make the BASH_SOURCE_PATH variable read-only and unsettable when the shell is operating in restricted mode. This variable should be restricted for the same reasons why PATH is restricted.
Signed-off-by: Matheus Afonso Martins Moreira <math...@matheusmoreira.com> --- shell.c | 1 + 1 file changed, 1 insertion(+) diff --git a/shell.c b/shell.c index 15e005d6..940de31b 100644 --- a/shell.c +++ b/shell.c @@ -1294,6 +1294,7 @@ maybe_make_restricted (char *name) set_var_read_only ("ENV"); set_var_read_only ("BASH_ENV"); set_var_read_only ("HISTFILE"); + set_var_read_only ("BASH_SOURCE_PATH"); restricted = 1; } return (restricted); -- 2.44.0