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 5EA971FF0B7 for ; Fri, 13 Nov 2026 09:56:09 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id CFF1D2170E; Fri, 13 Nov 2026 09:56:08 +0100 (CET) Message-ID: <96d7a9cf-c1b3-4d63-b1a7-c1908ca7ed19@proxmox.com> Date: Fri, 13 Nov 2026 09:56:02 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH proxmox-backup v2] bin: debug: api: fix panic on parameters given more than once To: Jakob-Tobias Winter , pbs-devel@lists.proxmox.com References: <20261112101029.726398-2-tobias@stuttgart.de> Content-Language: en-US, de-DE From: Christian Ebner In-Reply-To: <20261112101029.726398-2-tobias@stuttgart.de> 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: 1794560162554 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.398 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: OE5GP6URDTYFSJS5MAJIPZB4JXIEGVID X-Message-ID-Hash: OE5GP6URDTYFSJS5MAJIPZB4JXIEGVID 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 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 11/12/26 11:17 AM, Jakob-Tobias Winter wrote: > Array parameters, for example 'group-filter', are set by giving the > parameter once per value. The command line parser collects the values of > a repeated parameter in an array, while the 'api' subcommands expected a > single string for each parameter and panicked with "entered unreachable > code". So array parameters could only be passed with one value. > > Hand each value over to the parameter verification separately. Array > parameters now accept more than one value, and other parameters that are > given more than once get rejected as duplicate instead of causing a > panic. > > Anything other than a string or an array of strings cannot come from the > command line parser. Such a value was the other way to reach that panic, > and parameters that are no object at all were ignored. Return an error > for both, and add tests for all of these cases. > > Signed-off-by: Jakob-Tobias Winter > --- > changes since v1, thanks to Christian for the review: > * return an error for a value that is no string, where unreachable!() > was left, and for parameters that are no object, which were ignored > * add regression tests. Without the fix they fail: on master with the > panic, on v1 for parameters that are no object. > > v1: https://lore.proxmox.com/pbs-devel/20261109215938.903397-1-tobias@stuttgart.de/ Thanks for the revised version of the patch and including some regression test: change look good to me now. Spot checked the array grouping now works correctly and does not lead to a panic and tests cover relevant cases. Reviewed-by: Christian Ebner Tested-by: Christian Ebner