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 E33901FF0AB for ; Wed, 09 Sep 2026 14:32:22 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 8854621646; Wed, 09 Sep 2026 14:32:12 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: Re: [PATCH proxmox-backup 27/28] api: admin: allow to update snapshot retention for root user From: Robert Obkircher To: Christian Ebner In-Reply-To: <20260813171002.809441-28-c.ebner@proxmox.com> References: <20260813171002.809441-1-c.ebner@proxmox.com> <20260813171002.809441-28-c.ebner@proxmox.com> Date: Wed, 09 Sep 2026 14:32:04 +0200 Message-Id: <178895712463.166875.4501217517577099782.b4-review@b4> X-Mailer: b4 0.16-dev X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1788957118049 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.547 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: O75ZDM4FSCT7PLRU5NPZ7ICX7JW4VDXU X-Message-ID-Hash: O75ZDM4FSCT7PLRU5NPZ7ICX7JW4VDXU X-MailFrom: r.obkircher@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: > Only root user should be able to ever modify the retention setting > set by the sync/backup api. > > Signed-off-by: Christian Ebner > > diff --git a/src/api2/admin/datastore.rs b/src/api2/admin/datastore.rs > index bb829cd3f..244320989 100644 > --- a/src/api2/admin/datastore.rs > +++ b/src/api2/admin/datastore.rs > @@ -45,7 +45,7 @@ use pbs_api_types::{ > MaintenanceMode, MaintenanceType, NS_MAX_DEPTH_SCHEMA, Operation, PRIV_DATASTORE_AUDIT, > PRIV_DATASTORE_BACKUP, PRIV_DATASTORE_MODIFY, PRIV_DATASTORE_PRUNE, PRIV_DATASTORE_READ, > PRIV_DATASTORE_VERIFY, PRIV_SYS_MODIFY, PruneJobOptions, SnapshotListItem, SyncJobConfig, UPID, > - UPID_SCHEMA, VERIFICATION_OUTDATED_AFTER_SCHEMA, VERIFY_JOB_READ_THREADS_SCHEMA, > + UPID_SCHEMA, Userid, VERIFICATION_OUTDATED_AFTER_SCHEMA, VERIFY_JOB_READ_THREADS_SCHEMA, > VERIFY_JOB_VERIFY_THREADS_SCHEMA, print_ns_and_snapshot, print_store_and_ns, > }; > use pbs_client::pxar::{create_tar, create_zip}; > @@ -2319,6 +2319,56 @@ pub async fn set_protection( > .await? > } > > +#[api( > + input: { > + properties: { > + store: { schema: DATASTORE_SCHEMA }, > + ns: { > + type: BackupNamespace, > + optional: true, > + }, > + backup_dir: { > + type: pbs_api_types::BackupDir, > + flatten: true, > + }, > + "retain-until": { > + type: Number, > + description: "Set retention timestamp (clears retention if not given)", > + optional: true, > + }, > + }, > + }, > + access: { > + permission: &Permission::Anybody, > + description: "Only root@pam is allowed to modify retentions", Could this be Permission::Superuser? -- Robert Obkircher