On 02/11/2025 09:24, Bruno Haible via GNU coreutils Bug Reports wrote:
Andrew Marshall wrote:
perhaps it’s worth documenting or making it an invalid config on Darwin.
We could document that users should not use environment variables
that start with "__", because these environment variables can be
set by the OS and can influence the behaviour of the OS. Proposed
patch is attached.
Once that is documented, I don't think anything is wrong with
CoreFoundation setting or use any __FOOBAR environment variable(s).
I think the doc change is a bit too much.
The user may very well want to change OS behavior.
Sure CoreFoundation is free to set any __FOOBAR variable,
but it's unfortunate that using env to set or clear specific env vars
has the side effect of implicitly setting __CF_USER_TEXT_ENCODING.
env -i is fine BTW as we'll exec with an empty environment.
I suppose if __CF_USER_TEXT_ENCODING was problematic for users
they've a workaround of explicitly unsetting it.
So yes not a huge issue, but best avoided if possible.
cheers,
Padraig