Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: env arrays (was: Re: path PATH)



On Sat, Jan 21, 2023 at 12:38 PM <zeurkous@xxxxxxxxxxxxxxx> wrote:
>
> It might not be able to contain arrays, but it's possible to have it
> contain array *elements*--
>
>  % env 'blaat[0]=scaahp' 'blaat[1]=mekker' env | tail -n 2
>  blaat[0]=scaahp
>  blaat[1]=mekker
>  %
>
> Can zsh work w/ such an approach?

It could be implemented, but unless we were to rewrite the internals
to use sparse arrays, import of that syntax would allow the moral
equivalent of a zip bomb:

env 'kaboom[999999999999999999]=waytoobig' ...

Generally speaking, for security you do not want environment strings
to be "programmable" in any sense.




Messages sorted by: Reverse Date, Date, Thread, Author