public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>,
	pdm-devel@lists.proxmox.com
Subject: Re: [PATCH datacenter-manager] fix #7795: remote: guest shell: fix privilege path
Date: Wed, 8 Jul 2026 15:37:44 +0200	[thread overview]
Message-ID: <7366222b-7ebd-4c3f-a820-fe591cbc2fc6@proxmox.com> (raw)
In-Reply-To: <e7fd6763-4c68-4669-a32a-c34c9ad08cbe@proxmox.com>



On 7/8/26 1:24 PM, Dominik Csapak wrote:
> 
> 
> On 7/8/26 12:40 PM, Fabian Grünbichler wrote:
>> the wrong path was copied over from the node shell, and since there is no
>> "node" parameter here, calls as non-root will fail with 403..
>>
>> Fixes: 525c8c49 "server: add termproxy and vncwebsocket calls for qemu 
>> guests"
>>
>> Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
>> ---
>> 403 if the API schema is actually invalid might be something to catch
>> lower in the stack as well?
> 
> i guess the substitution fails during privilege check in proxmox-router
> and that triggers a 403 higher up in the stack?
> 
> since that must be const, maybe there can be a compile time check that
> the parameters must exist here?
> 

had a short stab at this and this does indeed work:
https://lore.proxmox.com/pdm-devel/20260708133630.1807997-1-d.csapak@proxmox.com/T/#t

it also found a third place where we used a non existant parameter
(2/2 in that series)

>>
>>   server/src/api/pve/lxc.rs  | 4 ++--
>>   server/src/api/pve/qemu.rs | 4 ++--
>>   2 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/server/src/api/pve/lxc.rs b/server/src/api/pve/lxc.rs
>> index 6183f62d..ca32eb84 100644
>> --- a/server/src/api/pve/lxc.rs
>> +++ b/server/src/api/pve/lxc.rs
>> @@ -807,9 +807,9 @@ pub const API_METHOD_LXC_WEBSOCKET: ApiMethod = 
>> ApiMethod::new(
>>       ),
>>   )
>>   .access(
>> -    Some("The user needs Sys.Console on /resource/{remote}/node/ 
>> {node}."),
>> +    Some("The user needs Sys.Console on /resource/{remote}/guest/ 
>> {vmid}."),
>>       &Permission::Privilege(
>> -        &["resource", "{remote}", "node", "{node}"],
>> +        &["resource", "{remote}", "guest", "{vmid}"],
>>           PRIV_SYS_CONSOLE,
>>           false,
>>       ),
>> diff --git a/server/src/api/pve/qemu.rs b/server/src/api/pve/qemu.rs
>> index 65de6389..5d01e69e 100644
>> --- a/server/src/api/pve/qemu.rs
>> +++ b/server/src/api/pve/qemu.rs
>> @@ -895,9 +895,9 @@ pub const API_METHOD_QEMU_WEBSOCKET: ApiMethod = 
>> ApiMethod::new(
>>       ),
>>   )
>>   .access(
>> -    Some("The user needs Sys.Console on /resource/{remote}/node/ 
>> {node}."),
>> +    Some("The user needs Sys.Console on /resource/{remote}/guest/ 
>> {vmid}."),
>>       &Permission::Privilege(
>> -        &["resource", "{remote}", "node", "{node}"],
>> +        &["resource", "{remote}", "guest", "{vmid}"],
>>           PRIV_SYS_CONSOLE,
>>           false,
>>       ),
> 
> 
> 
> 
> 





      reply	other threads:[~2026-07-08 13:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-08 10:40 [PATCH datacenter-manager] fix #7795: remote: guest shell: fix privilege path Fabian Grünbichler
2026-07-08 11:24 ` Dominik Csapak
2026-07-08 13:37   ` Dominik Csapak [this message]

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=7366222b-7ebd-4c3f-a820-fe591cbc2fc6@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=f.gruenbichler@proxmox.com \
    --cc=pdm-devel@lists.proxmox.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal