2024年5月15日(水) 4:55 Chet Ramey <chet.ra...@case.edu>: > On 5/13/24 6:37 AM, Matheus Afonso Martins Moreira wrote: > > 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. > > Or you could simply ignore BASH_SOURCE_PATH in restricted mode.
As I've already replied to the previous patch, I think we should ignore BASH_SOURCE_PATH in the restricted mode. This will just become a loophole if it's enabled. (Or, at least, this should be an opt-in feature that the scripts to set up the restricted shells need to explicitly turn on instead of being automatically enabled through the existence of a variable BASH_SOURCE_PATH). If it is automatically turned on in the restricted shells, it implies that we change the list of the items that the scripts to set up restricted shells need to care about. All existing setups for the restricted shells would be spoiled.