From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 1876670D76 for ; Tue, 7 Jun 2022 08:23:33 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0CFEE2A237 for ; Tue, 7 Jun 2022 08:23:33 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 36C6B2A221 for ; Tue, 7 Jun 2022 08:23:31 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 0A17D42B76 for ; Tue, 7 Jun 2022 08:23:25 +0200 (CEST) Message-ID: Date: Tue, 7 Jun 2022 08:23:24 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.0 To: Proxmox Backup Server development discussion , Stefan Sterz References: <20220603153224.476172-1-s.sterz@proxmox.com> Content-Language: en-GB From: Thomas Lamprecht In-Reply-To: <20220603153224.476172-1-s.sterz@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.006 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% 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 T_SCC_BODY_TEXT_LINE -0.01 - URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [acl.rs] Subject: [pbs-devel] applied: [PATCH proxmox-backup] pbs-config: acl-tree: add any_priv_below 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: , X-List-Received-Date: Tue, 07 Jun 2022 06:23:33 -0000 Am 03/06/2022 um 17:32 schrieb Stefan Sterz: > `any_priv_below()` checks if a given AuthId has any given privileges > on a sub-tree of the AclTree. to do so, it first takes into account > propagating privileges on the path itself and then uses a depth-first > search to check if any of the provided privileges are set on any > node of the sub-tree pointed to by the path. > > Signed-off-by: Stefan Sterz > --- > pbs-config/src/acl.rs | 122 +++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 120 insertions(+), 2 deletions(-) > > applied, thanks! made a few small follow ups though, but mostly changing parameter names and some small styling stuff, so nothing changed in the actual implementation. And I put this to use for replacing the not so nice ns-iteration and one by one checking for an Ok priv, making it faster and irrelevant for maintenance operations, which is nice to have for UI-crucial API endpoints.