Date: Fri, 24 Nov 2017 16:38:57 +0000 From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 223846] msdosfs does not reflect READONLY to user Message-ID: <bug-223846-8@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223846 Bug ID: 223846 Summary: msdosfs does not reflect READONLY to user Product: Base System Version: 11.0-STABLE Hardware: Any OS: Any Status: New Severity: Affects Many People Priority: --- Component: kern Assignee: freebsd-bugs@FreeBSD.org Reporter: karl@denninger.net As documented on freebsd-fs in response to a query I posted after observing the above behavior msdosfs does not reflect the READONLY attribute on files in an msdosfs-mounted filesystem back to userspace. This means that while you can set the READONLY attribute on a file with chmod a subsequent "stat" of that file (from a program), or a display with "ls" will not reflect it in the file mode returned. Conrad Meyer posted a short code snippet that would fix this; credit to him of course on the identification but IMHO this should be changed globally and MFC'd as appropriate. --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -287,6 +287,8 @@ msdosfs_getattr(struct vop_getattr_args *ap) vap->va_fileid = fileid; mode = S_IRWXU|S_IRWXG|S_IRWXO; + if ((dep->de_Attributes & ATTR_READONLY) != 0) + mode &= ~(S_IWUSR|S_IWGRP|S_IWOTH); vap->va_mode = mode & (ap->a_vp->v_type == VDIR ? pmp->pm_dirmask : pmp->pm_mask); vap->va_uid = pmp->pm_uid; -- You are receiving this mail because: You are the assignee for the bug.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-223846-8>
