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 661C6A1072 for ; Wed, 14 Jun 2023 10:46:25 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 4E02A186B1 for ; Wed, 14 Jun 2023 10:46:25 +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)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Wed, 14 Jun 2023 10:46:24 +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 15ED24551B for ; Wed, 14 Jun 2023 10:46:24 +0200 (CEST) From: Dominik Csapak To: pve-devel@lists.proxmox.com Date: Wed, 14 Jun 2023 10:46:07 +0200 Message-Id: <20230614084622.1446211-8-d.csapak@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230614084622.1446211-1-d.csapak@proxmox.com> References: <20230614084622.1446211-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.015 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy 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 - Subject: [pve-devel] [PATCH manager v6 01/15] pvesh: fix parameters for proxyto_callback X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jun 2023 08:46:25 -0000 in pve-http-server the proxyto_callback always has a complete list of parameters, not only the ones in the url, so adapt the implementation here to do the same Signed-off-by: Dominik Csapak --- PVE/CLI/pvesh.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/PVE/CLI/pvesh.pm b/PVE/CLI/pvesh.pm index 9acf292a..28e2518d 100755 --- a/PVE/CLI/pvesh.pm +++ b/PVE/CLI/pvesh.pm @@ -82,13 +82,15 @@ my $method_map = { }; sub check_proxyto { - my ($info, $uri_param) = @_; + my ($info, $uri_param, $params) = @_; my $rpcenv = PVE::RPCEnvironment->get(); + my $all_params = { %$uri_param, %$params }; + if ($info->{proxyto} || $info->{proxyto_callback}) { my $node = PVE::API2Tools::resolve_proxyto( - $rpcenv, $info->{proxyto_callback}, $info->{proxyto}, $uri_param); + $rpcenv, $info->{proxyto_callback}, $info->{proxyto}, $all_params); if ($node ne 'localhost' && ($node ne PVE::INotify::nodename())) { die "proxy loop detected - aborting\n" if $disable_proxy; @@ -301,7 +303,7 @@ sub call_api_method { } my $data; - my ($node, $remip) = check_proxyto($info, $uri_param); + my ($node, $remip) = check_proxyto($info, $uri_param, $param); if ($node) { $data = proxy_handler($node, $remip, $path, $cmd, $param); } else { @@ -345,7 +347,7 @@ __PACKAGE__->register_method ({ my $res; - my ($node, $remip) = check_proxyto($info, $uri_param); + my ($node, $remip) = check_proxyto($info, $uri_param, $param); if ($node) { $res = proxy_handler($node, $remip, $path, 'ls', $param); } else { -- 2.30.2