From: Christian Ebner <c.ebner@proxmox.com>
To: Jakob-Tobias Winter <tobias@stuttgart.de>, pbs-devel@lists.proxmox.com
Subject: Re: [PATCH proxmox-backup v2] bin: debug: api: fix panic on parameters given more than once
Date: Fri, 13 Nov 2026 09:56:02 +0100 [thread overview]
Message-ID: <96d7a9cf-c1b3-4d63-b1a7-c1908ca7ed19@proxmox.com> (raw)
In-Reply-To: <20261112101029.726398-2-tobias@stuttgart.de>
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 <tobias@stuttgart.de>
> ---
> 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 <c.ebner@proxmox.com>
Tested-by: Christian Ebner <c.ebner@proxmox.com>
next prev parent reply other threads:[~2026-11-13 8:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 10:10 [PATCH proxmox-backup v2] bin: debug: api: fix panic on parameters given more than once Jakob-Tobias Winter
2026-11-13 8:56 ` Christian Ebner [this message]
2026-11-14 21:27 ` applied: " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=96d7a9cf-c1b3-4d63-b1a7-c1908ca7ed19@proxmox.com \
--to=c.ebner@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
--cc=tobias@stuttgart.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.