[pbs-devel] [PATCH proxmox-backup 2/2] config: don't allow creation of sync job to same datastore
Hannes Laimer
h.laimer at proxmox.com
Mon Nov 27 12:59:44 CET 2023
Reported-by: Gabriel Goller <g.goller at proxmox.com>
Signed-off-by: Hannes Laimer <h.laimer at proxmox.com>
---
src/api2/config/sync.rs | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/api2/config/sync.rs b/src/api2/config/sync.rs
index 21634bd5..ea0e08f1 100644
--- a/src/api2/config/sync.rs
+++ b/src/api2/config/sync.rs
@@ -141,6 +141,10 @@ pub fn create_sync_job(
bail!("permission check failed");
}
+ if config.remote.is_none() && config.store.eq(&config.remote_store) {
+ bail!("source and target datastore can't be the same");
+ }
+
if let Some(max_depth) = config.max_depth {
if let Some(ref ns) = config.ns {
ns.check_max_depth(max_depth)?;
--
2.39.2
More information about the pbs-devel
mailing list