From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 06AAC1FF09B for ; Mon, 14 Sep 2026 16:36:36 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 8DBE1215A4; Mon, 14 Sep 2026 16:36:35 +0200 (CEST) Message-ID: <3416b5bd-9278-49a6-b206-758ef7f5e431@proxmox.com> Date: Mon, 14 Sep 2026 16:36:30 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH proxmox-backup 14/28] sync: pull: allow pulling for user/token with append permission To: Robert Obkircher References: <20260813171002.809441-1-c.ebner@proxmox.com> <20260813171002.809441-15-c.ebner@proxmox.com> <178895712462.166875.18343483733473580009.b4-review@b4> Content-Language: en-US, de-DE From: Christian Ebner In-Reply-To: <178895712462.166875.18343483733473580009.b4-review@b4> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1789396578443 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.659 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: KTZNOWN7NNF2WYQWNA2CDKXY4ZQDWJN7 X-Message-ID-Hash: KTZNOWN7NNF2WYQWNA2CDKXY4ZQDWJN7 X-MailFrom: c.ebner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: pbs-devel@lists.proxmox.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 9/9/26 2:31 PM, Robert Obkircher wrote: >> Extends the access checks for syncs in pull direction to allow >> appending contents when user has Datastore.Append permissions. >> >> Signed-off-by: Christian Ebner >> >> diff --git a/src/api2/pull.rs b/src/api2/pull.rs >> index 17c1e4f34..6b53c55b7 100644 >> --- a/src/api2/pull.rs >> +++ b/src/api2/pull.rs >> @@ -8,9 +8,9 @@ use proxmox_schema::api; >> >> use pbs_api_types::{ >> Authid, BackupNamespace, CRYPT_KEY_ID_SCHEMA, DATASTORE_SCHEMA, GROUP_FILTER_LIST_SCHEMA, >> - GroupFilter, NS_MAX_DEPTH_REDUCED_SCHEMA, PRIV_DATASTORE_BACKUP, PRIV_DATASTORE_PRUNE, >> - PRIV_REMOTE_READ, REMOTE_ID_SCHEMA, REMOVE_VANISHED_BACKUPS_SCHEMA, RESYNC_CORRUPT_SCHEMA, >> - RateLimitConfig, SYNC_ENCRYPTED_ONLY_SCHEMA, SYNC_VERIFIED_ONLY_SCHEMA, >> + GroupFilter, NS_MAX_DEPTH_REDUCED_SCHEMA, PRIV_DATASTORE_APPEND, PRIV_DATASTORE_BACKUP, >> + PRIV_DATASTORE_PRUNE, PRIV_REMOTE_READ, REMOTE_ID_SCHEMA, REMOVE_VANISHED_BACKUPS_SCHEMA, >> + RESYNC_CORRUPT_SCHEMA, RateLimitConfig, SYNC_ENCRYPTED_ONLY_SCHEMA, SYNC_VERIFIED_ONLY_SCHEMA, >> SYNC_WORKER_THREADS_SCHEMA, SyncJobConfig, TRANSFER_LAST_SCHEMA, >> }; >> use pbs_config::CachedUserInfo; >> @@ -36,8 +36,8 @@ pub fn check_pull_privs( >> user_info.check_privs( >> auth_id, >> &local_store_ns_acl_path, >> - PRIV_DATASTORE_BACKUP, >> - false, >> + PRIV_DATASTORE_APPEND | PRIV_DATASTORE_BACKUP, >> + true, >> )?; >> >> if let Some(remote) = remote { >> diff --git a/src/server/pull.rs b/src/server/pull.rs >> index 8c6253604..856e0fc5a 100644 >> --- a/src/server/pull.rs >> +++ b/src/server/pull.rs >> @@ -1442,13 +1442,16 @@ fn check_and_create_ns(params: &PullParameters, ns: &BackupNamespace) -> Result< >> created = true; >> } >> >> - check_ns_privs( >> - params.target.store.name(), >> - ns, >> - ¶ms.owner, >> - PRIV_DATASTORE_BACKUP | PRIV_DATASTORE_APPEND, >> - ) >> - .map_err(|err| format_err!("sync into {store_ns_str} not allowed - {err}"))?; >> + let privs = if params.resync_corrupt { >> + PRIV_DATASTORE_BACKUP > Should we really skip the entire namespace if we only have append > permission? We could still pull the snapshots that aren't corrupt. Yeah, pulling new snapshots which are not corrupt might be more intuitive here. I would however argue that setting the resync corrupt while having only append privs is a misconfiguration. Will see to extend this and prominently log the lack of privs.