mirror of
https://github.com/NVIDIA/OpenShell.git
synced 2026-10-23 06:30:28 +08:00
refactor(workdir): simplify review follow-ups
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
This commit is contained in:
@@ -2195,7 +2195,6 @@ fn build_environment_for_oci_user(
|
||||
user_env.extend(template.environment.clone());
|
||||
}
|
||||
user_env.extend(spec.environment.clone());
|
||||
user_env.remove(openshell_core::sandbox_env::OCI_WORKSPACE_IDENTITY);
|
||||
environment.extend(user_env.clone());
|
||||
if !user_env.is_empty()
|
||||
&& let Ok(json) = serde_json::to_string(&user_env)
|
||||
|
||||
@@ -522,7 +522,6 @@ fn build_env(
|
||||
user_env.insert(k.clone(), v.clone());
|
||||
}
|
||||
}
|
||||
user_env.remove(openshell_core::sandbox_env::OCI_WORKSPACE_IDENTITY);
|
||||
env.extend(user_env.clone());
|
||||
if !user_env.is_empty()
|
||||
&& let Ok(json) = serde_json::to_string(&user_env)
|
||||
|
||||
@@ -1409,12 +1409,7 @@ pub fn validate_oci_workspace_as_process_identity(
|
||||
supplementary_gids.dedup();
|
||||
|
||||
if nix::unistd::geteuid().is_root() {
|
||||
#[cfg(not(any(
|
||||
target_os = "macos",
|
||||
target_os = "ios",
|
||||
target_os = "haiku",
|
||||
target_os = "redox"
|
||||
)))]
|
||||
#[cfg(target_os = "linux")]
|
||||
nix::unistd::setgroups(&supplementary_gids).into_diagnostic()?;
|
||||
nix::unistd::setgid(gid).into_diagnostic()?;
|
||||
nix::unistd::setuid(uid).into_diagnostic()?;
|
||||
|
||||
Reference in New Issue
Block a user