From fc4b48df673c48b7c3521757ad68df54f92e7330 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Tue, 17 Feb 2026 20:33:59 +0100 Subject: [PATCH] initfs: Fix stat for symlinks --- bootstrap/src/initfs.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bootstrap/src/initfs.rs b/bootstrap/src/initfs.rs index 3db98b067f..2ef8dcb21c 100644 --- a/bootstrap/src/initfs.rs +++ b/bootstrap/src/initfs.rs @@ -185,8 +185,9 @@ impl SchemeSync for InitFsScheme { Self::get_inode(&self.fs, current_inode)?.kind(), InodeKind::Link(_) ); + let o_stat_nofollow = flags & O_STAT != 0 && flags & O_NOFOLLOW != 0; let o_symlink = flags & O_SYMLINK != 0; - if is_link && !o_symlink { + if is_link && !o_stat_nofollow && !o_symlink { return Err(Error::new(EXDEV)); } @@ -328,6 +329,7 @@ impl SchemeSync for InitFsScheme { | match inode.kind() { InodeKind::Dir(_) => MODE_DIR, InodeKind::File(_) => MODE_FILE, + InodeKind::Link(_) => MODE_SYMLINK, _ => 0, }; stat.st_uid = 0;