Summary: | msdosfs does not reflect READONLY to user | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | karl | ||||
Component: | kern | Assignee: | freebsd-fs (Nobody) <fs> | ||||
Status: | New --- | ||||||
Severity: | Affects Many People | CC: | cem, damjan.jov | ||||
Priority: | --- | Keywords: | patch | ||||
Version: | 11.0-STABLE | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
Description
karl
2017-11-24 16:38:57 UTC
I committed it to CURRENT shortly after posting it: r326031 Bruce raised some concerns, but in his typical long-winded fashion that I haven't had the energy to parse. I think he would prefer READONLY not be reflected in mode flags, but I'm not sure why. He does point out that showing a readonly mode flag does not prevent applications from writing to these files. Maybe it should. (In reply to Conrad Meyer from comment #1) I would argue it should; what's the point of a read-only flag if it's ignored If you're going to have a permission system then IMHO it ought to be enforced, such as it is and within the constraints of the underlying file system (e.g. in the case of msdosfs the "owner" is effectively synthetic and there is no such thing as "group" or "other".) Yeah, I agree with you. Created attachment 192866 [details]
deny writing to READONLY files in msdosfs
Hi. Here is my patch to deny writing to files with the READONLY attribute on msdosfs filesystems. It just affects the file_mode variable in msdosfs_access(). My tests show writing and appending to READONLY files is successfully denied the same way on ufs, zfs, and msdosfs.
|