fix: initialize private Linux agent config and user service from desktop

This commit is contained in:
tongtong committed 2026-11-13 10:28:29 +08:00
1 parent 316292bdfb
commit e9cf55f597
3 files changed
+20 -1

No files matched your search

+9
View File
@@ -270,6 +270,15 @@ pub fn save_private(path: &Path, data: &[u8]) -> Result<()> {
let parent = path
.parent()
.context("configuration requires a parent directory")?;
#[cfg(unix)]
{
use std::os::unix::fs::DirBuilderExt;
std::fs::DirBuilder::new()
.recursive(true)
.mode(0o700)
.create(parent)?;
}
#[cfg(not(unix))]
std::fs::create_dir_all(parent)?;
let temporary = parent.join(format!(
".ads-{}-{}.tmp",