Hello list,
I would like to suggest an enhancement for the proc:system/execute/fork family of functions: it should be possible to control the environment variables of the external process. At the moment, the environment is always inherited from the calling basex process, as far as I can tell.
There are several reasons why it is desirable to control the environment of external processes:
* set variables to values that are not known statically when starting basex * avoid information leaking (restrict environment to the minimal required subset) * control the PATH of the external process
It would be great to have an additional, optional entry in the $options map (maybe named "env" or "environment") that contains a map of environment variables for the external process. If absent, the current behavior (inherited environment) should be used. If the option is given, **only** the environment variables in the map should be used for the external process.
Effectively, the "env"/"environment" option would behave as if it had a default value of `map:merge( available-environment-variables() ! map:entry(., environment-variable(.)) )`
The ProcessBuilder in Java should allow for a straightforward implementation.
What do you think? Cheers, Hauke