From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 75CA81FF183 for ; Wed, 8 Oct 2025 15:44:11 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 1AF7A9AFC; Wed, 8 Oct 2025 15:44:17 +0200 (CEST) From: Dominik Csapak To: pbs-devel@lists.proxmox.com Date: Wed, 8 Oct 2025 15:43:32 +0200 Message-ID: <20251008134344.3512958-4-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251008134344.3512958-1-d.csapak@proxmox.com> References: <20251008134344.3512958-1-d.csapak@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.027 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pbs-devel] [PATCH proxmox-backup v2 2/6] backup: hierarchy: reuse 'NS_PRIVS_OK' for namespace helper X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Backup Server development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" Aside from the order of the privileges, it's identical to what we already used here, so simply reuse it. Signed-off-by: Dominik Csapak --- no changes in v2 src/backup/hierarchy.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/backup/hierarchy.rs b/src/backup/hierarchy.rs index febcb9a83..be11ece05 100644 --- a/src/backup/hierarchy.rs +++ b/src/backup/hierarchy.rs @@ -83,12 +83,10 @@ pub fn can_access_any_namespace_below( let Ok(mut iter) = store.recursive_iter_backup_ns_ok(ns, max_depth) else { return false; }; - let wanted = - PRIV_DATASTORE_AUDIT | PRIV_DATASTORE_MODIFY | PRIV_DATASTORE_READ | PRIV_DATASTORE_BACKUP; let name = store.name(); iter.any(|ns| -> bool { let user_privs = user_info.lookup_privs(auth_id, &["datastore", name, &ns.to_string()]); - user_privs & wanted != 0 + user_privs & NS_PRIVS_OK != 0 }) } -- 2.47.3 _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel