Fix overflow, race condition, and format bugs

This commit is contained in:
2026-03-07 22:14:48 +02:00
parent 150d483fbe
commit f471d22767
18 changed files with 600 additions and 113 deletions

View File

@@ -2,7 +2,7 @@ use std::path::{Path, PathBuf};
use crate::error::Result;
use crate::preset::Preset;
use crate::storage::PresetStore;
use crate::storage::{atomic_write, PresetStore};
/// Supported file managers for right-click integration.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
@@ -214,7 +214,7 @@ class PixstripExtension(GObject.GObject, Nautilus.MenuProvider):
bin = escaped_bin,
);
std::fs::write(nautilus_extension_path(), script)?;
atomic_write(&nautilus_extension_path(), &script)?;
Ok(())
}
@@ -259,7 +259,7 @@ fn install_nemo() -> Result<()> {
Mimetypes=image/*;\n",
bin = bin,
);
std::fs::write(nemo_action_path(), open_action)?;
atomic_write(&nemo_action_path(), &open_action)?;
// Per-preset actions
let presets = get_preset_names();
@@ -279,7 +279,7 @@ fn install_nemo() -> Result<()> {
safe_label = shell_safe(name),
bin = bin,
);
std::fs::write(action_path, action)?;
atomic_write(&action_path, &action)?;
}
Ok(())
@@ -361,7 +361,7 @@ fn install_thunar() -> Result<()> {
}
actions.push_str("</actions>\n");
std::fs::write(thunar_action_path(), actions)?;
atomic_write(&thunar_action_path(), &actions)?;
Ok(())
}
@@ -429,7 +429,7 @@ fn install_dolphin() -> Result<()> {
));
}
std::fs::write(dolphin_service_path(), desktop)?;
atomic_write(&dolphin_service_path(), &desktop)?;
Ok(())
}