From 7f2410deb1ae5f093f7c9bb761701e2d36fef388 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 13 Apr 2026 10:41:01 +0200 Subject: [PATCH] stat-util: add shortcut for fd_verify_symlink() We have a similar shortcut in the other fd_verify_xyz() calls, let's add it here too, just for completion's sake. --- src/basic/stat-util.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/basic/stat-util.c b/src/basic/stat-util.c index 3e2d191bbb..3811bd019e 100644 --- a/src/basic/stat-util.c +++ b/src/basic/stat-util.c @@ -145,6 +145,9 @@ int stat_verify_symlink(const struct stat *st) { } int fd_verify_symlink(int fd) { + if (IN_SET(fd, AT_FDCWD, XAT_FDROOT)) + return -EISDIR; + return verify_stat_at(fd, /* path= */ NULL, /* follow= */ false, stat_verify_symlink, /* verify= */ true); }