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); }