Runtime Paths Checks as opt-in #935

Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
This commit is contained in:
Alexey
2026-09-29 19:24:29 +03:00
parent e3f62db347
commit 53f131e34d
16 changed files with 635 additions and 94 deletions
+3
View File
@@ -29,6 +29,8 @@ pub struct DaemonOptions {
pub daemonize: bool,
/// Path to PID file.
pub pid_file: Option<PathBuf>,
/// Require trusted, symlink-free PID and log parents. Disabled by default for compatibility.
pub strict_runtime_paths: bool,
/// User to run as after binding sockets.
pub user: Option<String>,
/// Group to run as after binding sockets.
@@ -332,6 +334,7 @@ mod tests {
fn test_daemon_options_default() {
let opts = DaemonOptions::default();
assert!(!opts.daemonize);
assert!(!opts.strict_runtime_paths);
assert!(!opts.should_daemonize());
assert_eq!(opts.pid_file_path(), Path::new(DEFAULT_PID_FILE));
}