* [PATCH proxmox-backup] api: node: replace trivial config change detection helper
@ 2026-04-07 7:50 Christian Ebner
2026-04-10 21:24 ` applied: " Thomas Lamprecht
0 siblings, 1 reply; 2+ messages in thread
From: Christian Ebner @ 2026-04-07 7:50 UTC (permalink / raw)
To: pbs-devel
Commit 1bab5905 ("pbs-config: refactor and move helper to detect
config digest changes") moved the previous helper to detect config
file changes. The DNS node config used its own helper for this.
Remove that and use the common helper instead to align with the rest
of the codebase.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
src/api2/node/dns.rs | 7 +++----
src/tools/mod.rs | 9 +--------
2 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/src/api2/node/dns.rs b/src/api2/node/dns.rs
index 7065401ea..9ed73396d 100644
--- a/src/api2/node/dns.rs
+++ b/src/api2/node/dns.rs
@@ -3,6 +3,7 @@ use std::sync::{Arc, LazyLock, Mutex};
use ::serde::{Deserialize, Serialize};
use anyhow::Error;
use const_format::concatcp;
+use hex::FromHex;
use openssl::sha;
use regex::Regex;
use serde_json::{json, Value};
@@ -134,11 +135,9 @@ pub fn update_dns(
let _guard = MUTEX.lock();
let mut config = read_etc_resolv_conf()?;
- let old_digest = config["digest"].as_str().unwrap();
+ let old_digest = <[u8; 32]>::from_hex(config["digest"].as_str().unwrap())?;
- if let Some(digest) = digest {
- crate::tools::assert_if_modified(old_digest, &digest)?;
- }
+ pbs_config::detect_modified_configuration_file(digest, &old_digest)?;
if let Some(delete) = delete {
for delete_prop in delete {
diff --git a/src/tools/mod.rs b/src/tools/mod.rs
index a31ae6c46..89b62f9a6 100644
--- a/src/tools/mod.rs
+++ b/src/tools/mod.rs
@@ -2,7 +2,7 @@
//!
//! This is a collection of small and useful tools.
-use anyhow::{bail, Error};
+use anyhow::Error;
use std::collections::HashSet;
use pbs_api_types::{
@@ -21,13 +21,6 @@ pub mod ticket;
pub mod parallel_handler;
-pub fn assert_if_modified(digest1: &str, digest2: &str) -> Result<(), Error> {
- if digest1 != digest2 {
- bail!("detected modified configuration - file changed by other user? Try again.");
- }
- Ok(())
-}
-
/// The default 2 hours are far too long for PBS
pub const PROXMOX_BACKUP_TCP_KEEPALIVE_TIME: u32 = 120;
pub const DEFAULT_USER_AGENT_STRING: &str = "proxmox-backup-client/1.0";
--
2.47.3
^ permalink raw reply [flat|nested] 2+ messages in thread* applied: [PATCH proxmox-backup] api: node: replace trivial config change detection helper
2026-04-07 7:50 [PATCH proxmox-backup] api: node: replace trivial config change detection helper Christian Ebner
@ 2026-04-10 21:24 ` Thomas Lamprecht
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2026-04-10 21:24 UTC (permalink / raw)
To: pbs-devel, Christian Ebner
On Tue, 07 Apr 2026 09:50:03 +0200, Christian Ebner wrote:
> Commit 1bab5905 ("pbs-config: refactor and move helper to detect
> config digest changes") moved the previous helper to detect config
> file changes. The DNS node config used its own helper for this.
>
> Remove that and use the common helper instead to align with the rest
> of the codebase.
>
> [...]
Applied, thanks!
[1/1] api: node: replace trivial config change detection helper
commit: a14dd714812a93cd2277d0407e340a08b31d680e
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-04-10 21:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-04-07 7:50 [PATCH proxmox-backup] api: node: replace trivial config change detection helper Christian Ebner
2026-04-10 21:24 ` applied: " Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox