Decouple client contracts and close private role registries

This commit is contained in:
ms2k 2026-07-19 03:44:30 +09:00
commit 22325aa76a

View file

@ -42,7 +42,7 @@ use crate::network::{
};
use crate::sandbox::RunscCommand;
const PRIVATE_ROLE_ARGUMENT: &str = "--lazaret-runtime-supervisor-role";
pub const PRIVATE_RUNTIME_ROLE: &str = "--lazaret-runtime-supervisor-role";
const MAX_CONTROL_MESSAGE: usize = 16 * 1024;
const READINESS_TIMEOUT: Duration = Duration::from_secs(30);
const TERMINATION_GRACE: Duration = Duration::from_secs(2);
@ -415,7 +415,7 @@ impl RuntimeSupervisorLaunch {
));
}
let mut target = TargetCommand::new("/proc/self/exe")
.argument(PRIVATE_ROLE_ARGUMENT)
.argument(PRIVATE_RUNTIME_ROLE)
.argument("--domain")
.argument(hex(ownership.domain_id.as_bytes()))
.argument("--generation")
@ -459,7 +459,7 @@ impl RuntimeSupervisorLaunch {
TargetCommand::new("/usr/bin/false").with_lifetime_pipe_parent_edge(),
);
launch.target = TargetCommand::new(runtime_supervisor_executable)
.argument(PRIVATE_ROLE_ARGUMENT)
.argument(PRIVATE_RUNTIME_ROLE)
.argument("--domain")
.argument(hex(ownership.domain_id.as_bytes()))
.argument("--generation")
@ -505,7 +505,7 @@ impl RuntimeSupervisorLaunch {
fn rebuild_target(&mut self) {
let mut target = TargetCommand::new("/proc/self/exe")
.argument(PRIVATE_ROLE_ARGUMENT)
.argument(PRIVATE_RUNTIME_ROLE)
.argument("--domain")
.argument(hex(self.ownership.domain_id.as_bytes()))
.argument("--generation")
@ -658,7 +658,7 @@ impl RuntimeSupervisorLaunch {
pub fn dispatch_private_runtime_role(arguments: &[OsString]) -> Option<io::Result<()>> {
if arguments
.first()
.is_none_or(|argument| argument != PRIVATE_ROLE_ARGUMENT)
.is_none_or(|argument| argument != PRIVATE_RUNTIME_ROLE)
{
return None;
}