Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

Commit

Permalink
Merge pull request #583 from cgwalters/isolation-keep-proxy
Browse files Browse the repository at this point in the history
isolation: Only drop a few strategic environment variables
  • Loading branch information
jmarrero authored Jan 17, 2024
2 parents 90a2d13 + 263cd73 commit 6d9f958
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/src/isolation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ pub(crate) fn unprivileged_subprocess(binary: &str, user: &str) -> Command {
return Command::new(binary);
}
let mut cmd = Command::new("setpriv");
// Clear some strategic environment variables that may cause the containers/image stack
// to look in the wrong places for things.
cmd.env_remove("HOME");
cmd.env_remove("XDG_DATA_DIR");
cmd.env_remove("USER");
cmd.args([
"--no-new-privs",
"--init-groups",
"--reset-env",
"--reuid",
user,
"--bounding-set",
Expand Down

0 comments on commit 6d9f958

Please sign in to comment.