public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Christian Ebner <c.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [PATCH proxmox-backup] sync: push: preserve sign-only and possibly future crypt-mode variants
Date: Mon,  3 Aug 2026 14:29:00 +0200	[thread overview]
Message-ID: <20260803122900.547807-1-c.ebner@proxmox.com> (raw)

When adding a file to a manifest, the crypt mode of the file is one of
3 variants: None, SignOnly or Encrypt. For push sync jobs the
FileInfo::chunk_crypt_mode() was used if not doing server-side
encryption, which however reduces this to 2 variants (None and
Encrypt) only, no longer reflecting the correct mode for signed only
archives.

Fix this by actually using the crypt mode as specified in the source
manifest when adding the archive to the target manifest, keeping the
exception when doing server-side encryption.

Do not change the crypt mode for the source chunk readers, as these
must always reflect the one specified in the source manifest, but
pass in the original mode and let the chunk reader do the mapping
internally so this is not performed twice.

Reported-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
 src/server/push.rs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/server/push.rs b/src/server/push.rs
index 18f8a6f0f..f634c6b84 100644
--- a/src/server/push.rs
+++ b/src/server/push.rs
@@ -1234,7 +1234,7 @@ pub(crate) async fn push_snapshot(
             let archive_prefix = format!("{prefix}/{archive_name}");
             let crypt_mode = match &encrypt_using_key {
                 Some(_) => CryptMode::Encrypt,
-                None => entry.chunk_crypt_mode(),
+                None => entry.crypt_mode,
             };
 
             load_previous_snapshot_known_chunks(
@@ -1291,7 +1291,7 @@ pub(crate) async fn push_snapshot(
                     let index =
                         DynamicIndexReader::open(&path).with_context(|| prefix.to_string())?;
                     let chunk_reader = reader
-                        .chunk_reader(None, entry.chunk_crypt_mode())
+                        .chunk_reader(None, entry.crypt_mode)
                         .context("failed to get chunk reader")?;
                     let upload_stats = push_index(
                         &archive_name,
@@ -1337,7 +1337,7 @@ pub(crate) async fn push_snapshot(
                     let index =
                         FixedIndexReader::open(&path).with_context(|| prefix.to_string())?;
                     let chunk_reader = reader
-                        .chunk_reader(None, entry.chunk_crypt_mode())
+                        .chunk_reader(None, entry.crypt_mode)
                         .context("failed to get chunk reader")
                         .with_context(|| archive_prefix.clone())?;
                     let size = index.index_bytes();
-- 
2.47.3





             reply	other threads:[~2026-08-03 12:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-03 12:29 Christian Ebner [this message]
2026-08-05  8:24 ` applied: [PATCH proxmox-backup] sync: push: preserve sign-only and possibly future crypt-mode variants Fabian Grünbichler

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=20260803122900.547807-1-c.ebner@proxmox.com \
    --to=c.ebner@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal