You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.expect("child process writes a UTF-8 string to stderr; qed")
905
-
.trim();
906
-
gum::warn!(
907
-
target:LOG_TARGET,
908
-
?prepare_worker_program_path,
909
-
// Docs say to always print status using `Display` implementation.
910
-
status = %output.status,
911
-
%stderr,
912
-
"Cannot unshare user namespace and change root, which are Linux-specific kernel security features. Running validation of malicious PVF code has a higher risk of compromising this machine. Consider running with support for unsharing user namespaces for maximum security."
913
-
);
914
-
false
915
-
},
916
-
Err(err) => {
917
-
gum::warn!(
918
-
target:LOG_TARGET,
919
-
?prepare_worker_program_path,
920
-
"Could not start child process: {}",
921
-
err
922
-
);
923
-
false
924
-
},
894
+
cfg_if::cfg_if! {
895
+
if #[cfg(target_os = "linux")]{
896
+
let output = std::process::Command::new(prepare_worker_program_path)
.expect("child process writes a UTF-8 string to stderr; qed")
905
+
.trim();
906
+
gum::warn!(
907
+
target:LOG_TARGET,
908
+
?prepare_worker_program_path,
909
+
// Docs say to always print status using `Display` implementation.
910
+
status = %output.status,
911
+
%stderr,
912
+
"Cannot unshare user namespace and change root, which are Linux-specific kernel security features. Running validation of malicious PVF code has a higher risk of compromising this machine. Consider running with support for unsharing user namespaces for maximum security."
913
+
);
914
+
false
915
+
},
916
+
Err(err) => {
917
+
gum::warn!(
918
+
target:LOG_TARGET,
919
+
?prepare_worker_program_path,
920
+
"Could not start child process: {}",
921
+
err
922
+
);
923
+
false
924
+
},
925
+
}
926
+
} else {
927
+
gum::warn!(
928
+
target:LOG_TARGET,
929
+
"Cannot unshare user namespace and change root, which are Linux-specific kernel security features. Running validation of malicious PVF code has a higher risk of compromising this machine. Consider running on Linux with support for unsharing user namespaces for maximum security."
930
+
);
931
+
false
925
932
}
926
933
}
927
-
928
-
#[cfg(not(target_os = "linux"))]
929
-
{
930
-
gum::warn!(
931
-
target:LOG_TARGET,
932
-
"Cannot unshare user namespace and change root, which are Linux-specific kernel security features. Running validation of malicious PVF code has a higher risk of compromising this machine. Consider running on Linux with support for unsharing user namespaces for maximum security."
933
-
);
934
-
false
935
-
}
936
934
}
937
935
938
936
/// Check if landlock is supported and emit a warning if not.
"Cannot fully enable landlock, a Linux-specific kernel security feature. Running validation of malicious PVF code has a higher risk of compromising this machine. Consider upgrading the kernel version for maximum security."
963
-
);
964
-
false
965
-
},
966
-
Err(err) => {
967
-
gum::warn!(
968
-
target:LOG_TARGET,
969
-
?prepare_worker_program_path,
970
-
"Could not start child process: {}",
971
-
err
972
-
);
973
-
false
974
-
},
945
+
cfg_if::cfg_if! {
946
+
if #[cfg(target_os = "linux")]{
947
+
match std::process::Command::new(prepare_worker_program_path)
"Cannot fully enable landlock, a Linux-specific kernel security feature. Running validation of malicious PVF code has a higher risk of compromising this machine. Consider upgrading the kernel version for maximum security."
961
+
);
962
+
false
963
+
},
964
+
Err(err) => {
965
+
gum::warn!(
966
+
target:LOG_TARGET,
967
+
?prepare_worker_program_path,
968
+
"Could not start child process: {}",
969
+
err
970
+
);
971
+
false
972
+
},
973
+
}
974
+
} else {
975
+
gum::warn!(
976
+
target:LOG_TARGET,
977
+
"Cannot enable landlock, a Linux-specific kernel security feature. Running validation of malicious PVF code has a higher risk of compromising this machine. Consider running on Linux with landlock support for maximum security."
978
+
);
979
+
false
975
980
}
976
981
}
977
-
978
-
#[cfg(not(target_os = "linux"))]
979
-
{
980
-
gum::warn!(
981
-
target:LOG_TARGET,
982
-
"Cannot enable landlock, a Linux-specific kernel security feature. Running validation of malicious PVF code has a higher risk of compromising this machine. Consider running on Linux with landlock support for maximum security."
0 commit comments