Use unix pipe to capture environment variables (#32136)
The use of `NamedTempFile` in #31799 was not secure and could potentially cause write permission issues (see [this comment](https://github.com/zed-industries/zed/issues/29528#issuecomment-2939672433)). Therefore, it has been replaced with a Unix pipe. Release Notes: - N/A
This commit is contained in:
parent
ee2a329981
commit
3bed830a1f
5 changed files with 87 additions and 29 deletions
|
@ -315,7 +315,7 @@ pub fn load_login_shell_environment() -> Result<()> {
|
|||
// into shell's `cd` command (and hooks) to manipulate env.
|
||||
// We do this so that we get the env a user would have when spawning a shell
|
||||
// in home directory.
|
||||
for (name, value) in shell_env::capture(Some(paths::home_dir()))? {
|
||||
for (name, value) in shell_env::capture(paths::home_dir())? {
|
||||
unsafe { env::set_var(&name, &value) };
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue