Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions server_manager/src/core/atomic_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use std::os::unix::fs::OpenOptionsExt;
/// 4. Synchronizes to disk via `fsync` (`sync_all`).
/// 5. Atomically renames the temporary file to the destination path.
pub fn atomic_write<P: AsRef<Path>>(path: P, content: &[u8], mode: u32) -> Result<()> {
crate::core::validate::validate_safe_path(path.as_ref())?;
let dest = path.as_ref();
let parent = dest.parent().unwrap_or_else(|| Path::new("."));
if !parent.as_os_str().is_empty() {
Expand Down
1 change: 1 addition & 0 deletions server_manager/src/core/journal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ impl Journal {

/// Opens or creates the journal file with 0600 permissions.
pub fn open_or_create<P: AsRef<Path>>(path: P) -> Result<Self> {
crate::core::validate::validate_safe_path(path.as_ref())?;
let target = path.as_ref();
let parent = target.parent().unwrap_or_else(|| Path::new("."));
if !parent.as_os_str().is_empty() {
Expand Down
1 change: 1 addition & 0 deletions server_manager/src/core/lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ impl ProcessLock {
/// Attempts to acquire an exclusive lock on the specified path.
/// If `non_blocking` is true and the lock is already held, returns an error immediately.
pub fn acquire<P: AsRef<Path>>(path: P, non_blocking: bool) -> Result<Self> {
crate::core::validate::validate_safe_path(path.as_ref())?;
let target = path.as_ref();
let parent = target.parent().unwrap_or_else(|| Path::new("."));
if !parent.as_os_str().is_empty() {
Expand Down
Loading