all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Hannes Laimer <h.laimer@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 2/2] config: don't allow creation of sync job to same datastore
Date: Mon, 27 Nov 2023 12:59:44 +0100	[thread overview]
Message-ID: <20231127115944.209681-3-h.laimer@proxmox.com> (raw)
In-Reply-To: <20231127115944.209681-1-h.laimer@proxmox.com>

Reported-by: Gabriel Goller <g.goller@proxmox.com>
Signed-off-by: Hannes Laimer <h.laimer@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





  parent reply	other threads:[~2023-11-27 11:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-27 11:59 [pbs-devel] [PATCH proxmox-backup 0/2] local sync follow-up Hannes Laimer
2023-11-27 11:59 ` [pbs-devel] [PATCH proxmox-backup 1/2] ui: fix sync job initial loading of local datastores Hannes Laimer
2023-11-27 11:59 ` Hannes Laimer [this message]
2023-11-27 13:50 ` [pbs-devel] applied-series: [PATCH proxmox-backup 0/2] local sync follow-up Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231127115944.209681-3-h.laimer@proxmox.com \
    --to=h.laimer@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal