[pbs-devel] [PATCH proxmox-backup] fix: api: permission using wrong pathname

Gabriel Goller g.goller at proxmox.com
Wed May 29 14:54:58 CEST 2024


The read_interface endpoint uses the wrong path identifier. It has been
renamed to 'iface' some time ago but hasn't been changed here.

When a user has a permission on '/' with 'Admin', he wasn't able to
show the config of a single interface, as the non-existent path didn't
match.

Reported-by: https://forum.proxmox.com/threads/permissons-not-working-for-network-settings.147899/

Signed-off-by: Gabriel Goller <g.goller at proxmox.com>
---
 src/api2/node/network.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/api2/node/network.rs b/src/api2/node/network.rs
index 92297421..273751c4 100644
--- a/src/api2/node/network.rs
+++ b/src/api2/node/network.rs
@@ -149,7 +149,7 @@ pub fn list_network_devices(
     },
     returns: { type: Interface },
     access: {
-        permission: &Permission::Privilege(&["system", "network", "interfaces", "{name}"], PRIV_SYS_AUDIT, false),
+        permission: &Permission::Privilege(&["system", "network", "interfaces", "{iface}"], PRIV_SYS_AUDIT, false),
     },
 )]
 /// Read a network interface configuration.
-- 
2.43.0





More information about the pbs-devel mailing list