[pdm-devel] [PATCH proxmox-datacenter-manager 2/3] api: privileged: fix fchownat call
Stefan Hanreich
s.hanreich at proxmox.com
Mon Aug 11 16:18:43 CEST 2025
When starting the privileged API, the server would fail with the
following error messages:
Error: unable to set ownership for api socket '/run/proxmox-datacenter-manager/priv.sock' - EINVAL: Invalid argument
chown(2) only supports the AT_SYMLINK_NOFOLLOW, not AT_SYMLINK_FOLLOW
so this was probably a oversight. Pass empty flags to fchownat
instead.
Signed-off-by: Stefan Hanreich <s.hanreich at proxmox.com>
---
server/src/bin/proxmox-datacenter-privileged-api.rs | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/server/src/bin/proxmox-datacenter-privileged-api.rs b/server/src/bin/proxmox-datacenter-privileged-api.rs
index 66033eb..bd2c6dd 100644
--- a/server/src/bin/proxmox-datacenter-privileged-api.rs
+++ b/server/src/bin/proxmox-datacenter-privileged-api.rs
@@ -161,16 +161,9 @@ async fn run() -> Result<(), Error> {
format_err!("unable to set mode for api socket '{sockpath:?}' - {err}")
})?;
- fchownat(
- None,
- sockpath,
- None,
- Some(api_user.gid),
- AtFlags::AT_SYMLINK_FOLLOW,
- )
- .map_err(|err| {
- format_err!("unable to set ownership for api socket '{sockpath}' - {err}")
- })?;
+ fchownat(None, sockpath, None, Some(api_user.gid), AtFlags::empty()).map_err(
+ |err| format_err!("unable to set ownership for api socket '{sockpath}' - {err}"),
+ )?;
log::info!("created socket, notifying readiness to systemd and starting API server");
--
2.47.2
More information about the pdm-devel
mailing list