From 2f57f73ac9365fa9e09900d573f420d1d194f472 Mon Sep 17 00:00:00 2001 From: ppom Date: Thu, 12 Feb 2026 12:00:00 +0100 Subject: [PATCH] Fix systemd functionality - Non-absolute WorkingDirectory was refused by systemd - Plugin specific-conf updated Improvements: - ReadOnlyPaths=/ - ProtectHome=true in release builds - SystemCallFilter further restricted Disabled: - DynamicUser: breaks stdio communication, FIXME! - RestrictAddressFamilies: seems impossible to override to default. - CapabilityBoundingSet: too restrictive --- src/concepts/mod.rs | 1 - src/concepts/plugin.rs | 37 ++++++++++++++++++++-------- tests/test-conf/test-ipset.jsonnet | 2 +- tests/test-conf/test-virtual.jsonnet | 1 - 4 files changed, 28 insertions(+), 13 deletions(-) diff --git a/src/concepts/mod.rs b/src/concepts/mod.rs index fc93d56..1952b1b 100644 --- a/src/concepts/mod.rs +++ b/src/concepts/mod.rs @@ -8,7 +8,6 @@ mod stream; use std::fmt::Debug; use serde::{Deserialize, Serialize}; -use serde_json::Value; pub use action::Action; pub use config::{Config, Patterns}; diff --git a/src/concepts/plugin.rs b/src/concepts/plugin.rs index fa323cf..204f6f2 100644 --- a/src/concepts/plugin.rs +++ b/src/concepts/plugin.rs @@ -1,4 +1,4 @@ -use std::{collections::BTreeMap, io::Error, process::Stdio}; +use std::{collections::BTreeMap, io::Error, path, process::Stdio}; #[cfg(target_os = "freebsd")] use std::os::freebsd::fs::MetadataExt; @@ -32,8 +32,7 @@ fn systemd_default_options(working_directory: &str) -> BTreeMap BTreeMap