all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Lukas Wagner <l.wagner@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH proxmox-datacenter-manager] privileged api daemon: call fchownat with AT_SYMLINK_NOFOLLOW
Date: Thu,  7 Aug 2025 14:37:12 +0200	[thread overview]
Message-ID: <20250807123712.218439-1-l.wagner@proxmox.com> (raw)

AT_SYMLINK_FOLLOW makes the fchownat call fail with EINVAL, which
prevents daemon startup alltogether. The only supported flag for
fchownat is AT_SYMLINK_NOFOLLOW [1]. If one would actually would want to
follow a symlink here one would have to pass no flag at all.

The socket path which is fchownat'd here should not be a symlink at all,
so the safer option should be to pass AT_SYMLINK_NOFOLLOW.

[1] https://linux.die.net/man/2/fchownat

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
 server/src/bin/proxmox-datacenter-privileged-api.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/src/bin/proxmox-datacenter-privileged-api.rs b/server/src/bin/proxmox-datacenter-privileged-api.rs
index b62f4ea2..bcab882f 100644
--- a/server/src/bin/proxmox-datacenter-privileged-api.rs
+++ b/server/src/bin/proxmox-datacenter-privileged-api.rs
@@ -166,7 +166,7 @@ async fn run() -> Result<(), Error> {
                 sockpath,
                 None,
                 Some(api_user.gid),
-                AtFlags::AT_SYMLINK_FOLLOW,
+                AtFlags::AT_SYMLINK_NOFOLLOW,
             )
             .map_err(|err| {
                 format_err!("unable to set ownership for api socket '{sockpath}' - {err}")
-- 
2.47.2



_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


             reply	other threads:[~2025-08-07 12:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-07 12:37 Lukas Wagner [this message]
2025-08-08 13:01 ` [pdm-devel] applied: " Thomas Lamprecht

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=20250807123712.218439-1-l.wagner@proxmox.com \
    --to=l.wagner@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal