3 ms·
I don't know what your sudo does, but mine requires the --preserve-env flag if you want the new process to have access to all your environment variables. The t
by yorwba 3y ago
I don't know what your sudo does, but mine requires the --preserve-env flag if you want the new process to have access to all your environment variables.
The thing you're saying is going to be an endless source of problems should already be an endless source of problems! (And I think I've been briefly confused by some missing environment variable once or twice so far.)
- mid-kid 3y agoIt depends on whether sudo was compiled with --disable-env-reset or not, it's on by default[1]. Also some variables are inherited regardless (e.g. DISPLAY, TERM), and some useful ones (e.g. HOME) are initialized by sudo, but I can't tell where that's done. [1]: https://github.com/sudo-project/sudo/blob/ef52db46f9b375d7ffd2e8893f1ef65f5b0fc014/configure.ac#L1279 https://github.com/sudo-project/sudo/blob/ef52db46f9b375d7ff...
- crabbone 3y agoEven without the flag, sudo preserves a bunch of stuff. And it's not even consistent. Some implementations preserve locale setting, while others don't for example.
- 0x457 3y agoIt depends on what options sudo us built with. Notably `--disable-env-reset` option.