aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2025-11-10 13:58:11 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2025-11-14 14:43:38 +0000
commit0f910af019691bb829ebc8aef868e1d97c379462 (patch)
treebe0e3ec7599b047b9171deefda7a59923d691c34
parent3078279c33369c81b5391410936572b70715fcd8 (diff)
cd9660: Unbreak symbolic links
Since the introduction of permission masks, cd9660_getattr() returns a size of zero for all symbolic links, because the code to retrieve the length of the link target (as required by POSIX) is dead, since we strip away the type bits before we try to use them to identify the file as a link. Address this by checking the vnode type instead. PR: 290556 MFC after: 3 days Fixes: 82f2275b73e5 ("cd9660: Add support for mask,dirmask,uid,gid options") Reviewed by: olce Differential Revision: https://reviews.freebsd.org/D53598 (cherry picked from commit 978aaa72f3196f5489630052762cac5a7863e774)
-rw-r--r--sys/fs/cd9660/cd9660_vnops.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/fs/cd9660/cd9660_vnops.c b/sys/fs/cd9660/cd9660_vnops.c
index 4554f844104d..7f7468487b26 100644
--- a/sys/fs/cd9660/cd9660_vnops.c
+++ b/sys/fs/cd9660/cd9660_vnops.c
@@ -196,8 +196,8 @@ cd9660_getattr(struct vop_getattr_args *ap)
vap->va_ctime = ip->inode.iso_ctime;
vap->va_rdev = VN_ISDEV(vp) ? ip->inode.iso_rdev : NODEV;
- vap->va_size = (u_quad_t) ip->i_size;
- if (ip->i_size == 0 && (vap->va_mode & S_IFMT) == S_IFLNK) {
+ vap->va_size = ip->i_size;
+ if (ip->i_size == 0 && vp->v_type == VLNK) {
struct vop_readlink_args rdlnk;
struct iovec aiov;
struct uio auio;