Isolate nested IPC sockets and define session ownership policy

This commit is contained in:
Samuel Onoja committed 2026-10-07 08:03:30 +01:00
1 parent 97026a0db7
commit ce024d4794
42 files changed
+635 -147

No files matched your search

+1 -5
View File
@@ -1,5 +1,4 @@
use std::os::unix::net::UnixStream;
use std::path::PathBuf;
use std::time::{Duration, Instant};
use serde_json::{Value, json};
@@ -15,10 +14,7 @@ struct SessionConnection {
impl SessionConnection {
fn connect() -> Result<Self, String> {
let path = std::env::var_os("XDG_RUNTIME_DIR")
.map(PathBuf::from)
.ok_or("Missing runtime directory")?
.join("ferese/control.sock");
let path = ferese_ipc::socket::resolve(None).map_err(|error| error.to_string())?;
let stream = UnixStream::connect(path).map_err(|error| error.to_string())?;
stream
.set_read_timeout(Some(Duration::from_secs(2)))