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 00D2A1FF0E0 for ; Thu, 23 Jul 2026 13:09:56 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 02652214B2; Thu, 23 Jul 2026 13:09:53 +0200 (CEST) From: Elias Huhsovitz To: pve-devel@lists.proxmox.com Subject: [PATCH access-control v2 0/2] fix: #6510: Allow deleting ACLs for non-existent entities & add API tests Date: Thu, 23 Jul 2026 13:09:37 +0200 Message-ID: <20260723110939.84932-1-e.huhsovitz@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1784804958499 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.008 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) POISEN_SPAM_PILL 0.1 Meta: its spam POISEN_SPAM_PILL_1 0.1 random spam to be learned in bayes POISEN_SPAM_PILL_3 0.1 random spam to be learned in bayes RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low 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: RFYS4FFQRGPAGUIJVGKIWKFTKPRI6KSZ X-Message-ID-Hash: RFYS4FFQRGPAGUIJVGKIWKFTKPRI6KSZ X-MailFrom: e.huhsovitz@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: Elias Huhsovitz X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: v1: https://lore.proxmox.com/pve-devel/20260720134535.136172-1-e.huhsovitz@proxmox.com/ This series fixes Bug #6510, which prevents the deletion of ACLs for non-existent users, groups, or API tokens. Patch 1/2 introduces automated tests for the `PUT /access/acl` endpoint. The test suite verifies standard creation, modification, and deletion workflows, enforces privilege boundaries, and specifically tests the edge case resolved in the first patch. Patch 2/2 modifies the `update_acl` API endpoint to bypass the entity existence check when the `delete` flag is set. This change allows administrators to clean up orphaned ACLs without weakening the strict validation applied when adding new permissions. changes v1->v2: - declare all tests up front in $tests. - run all tests using the same logic in loop. - evaluate test results using `Test::More::is_deeply`. - use redefine() instead of mock(). - use `no_auto => 1` for MockModule to prvent auto loading. - run make tidy. Elias Huhsovitz (2): test: api: add tests for ACL modification endpoint fix #6510: api: acl: allow deleting ACLs for non-existent entities src/PVE/API2/ACL.pm | 7 +- src/test/api-tests.pl | 2 +- src/test/api-update-acl-test.pl | 297 ++++++++++++++++++++++++++++++++ 3 files changed, 302 insertions(+), 4 deletions(-) create mode 100644 src/test/api-update-acl-test.pl -- 2.47.3