* [pve-devel] [PATCH access-control] api: domains: fix setting only the realm authentication password
@ 2023-07-20 14:48 Christoph Heiss
2023-07-21 14:14 ` [pve-devel] applied: " Thomas Lamprecht
0 siblings, 1 reply; 2+ messages in thread
From: Christoph Heiss @ 2023-07-20 14:48 UTC (permalink / raw)
To: pve-devel
Previously, if one tried to only update e.g. the bind password for an
LDAP realm, it would fail with an rather unhelpful error message:
# pveum realm modify ldap -password foo
update auth server failed: no options specified
The root cause was that the `password` parameter was removed early from
the parameter object, which than would fail the check whether it is
empty or not.
Thus, additionally check if only `password` was specified and if so,
allow it.
Reported-by: Friedrich Weber <f.weber@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
---
src/PVE/API2/Domains.pm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/PVE/API2/Domains.pm b/src/PVE/API2/Domains.pm
index aa8e716..9332aa7 100644
--- a/src/PVE/API2/Domains.pm
+++ b/src/PVE/API2/Domains.pm
@@ -203,7 +203,8 @@ __PACKAGE__->register_method ({
if !$ids->{$realm};
my $delete_str = extract_param($param, 'delete');
- die "no options specified\n" if !$delete_str && !scalar(keys %$param);
+ die "no options specified\n"
+ if !$delete_str && !scalar(keys %$param) && !defined($password);
my $delete_pw = 0;
foreach my $opt (PVE::Tools::split_list($delete_str)) {
--
2.41.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* [pve-devel] applied: [PATCH access-control] api: domains: fix setting only the realm authentication password
2023-07-20 14:48 [pve-devel] [PATCH access-control] api: domains: fix setting only the realm authentication password Christoph Heiss
@ 2023-07-21 14:14 ` Thomas Lamprecht
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2023-07-21 14:14 UTC (permalink / raw)
To: Proxmox VE development discussion, Christoph Heiss
On 20/07/2023 16:48, Christoph Heiss wrote:
> Previously, if one tried to only update e.g. the bind password for an
> LDAP realm, it would fail with an rather unhelpful error message:
>
> # pveum realm modify ldap -password foo
> update auth server failed: no options specified
>
> The root cause was that the `password` parameter was removed early from
> the parameter object, which than would fail the check whether it is
> empty or not.
>
> Thus, additionally check if only `password` was specified and if so,
> allow it.
>
> Reported-by: Friedrich Weber <f.weber@proxmox.com>
> Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
> ---
> src/PVE/API2/Domains.pm | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>
applied, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-07-21 14:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-20 14:48 [pve-devel] [PATCH access-control] api: domains: fix setting only the realm authentication password Christoph Heiss
2023-07-21 14:14 ` [pve-devel] applied: " Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox