fluiday / macfuse

Automatically exported from code.google.com/p/macfuse
Other
0 stars 0 forks source link

No possibility to mark FUSE volume as read-only #138

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1. Open (ObjC) HelloFS example project in Xcode
2. Modify -[FUSEFileSystem fillStatvfsBuffer:forPath:] to add "stbuf->f_flag = 
ST_RDONLY;"
3. Compile and run project
4. In Finder, select HelloFS volume and display info

In 'Ownership and Permissions', we see "You can read and write", whereas we 
should see something 
like "You cannot modify", i.e. volume is read-only. You can try to drag files 
onto the Hello volume, 
and when you drop them Finder tells you you don't have enough privileges.

Based on MacFUSE 0.2.2, and sources with svn version 257.

Original issue reported on code.google.com by stephane...@gmail.com on 31 Mar 2007 at 3:35

GoogleCodeExporter commented 9 years ago
There's more to read-only than ST_RDONLY. As an aside, HelloFS is read-only in 
practice simply because it 
doesn't even implement a write method.

It should be mounted as read-only (that is, the '-oro' option should be 
specified at mount time). Then you'll see 
the expected behavior in the Finder.

Original comment by si...@gmail.com on 1 Apr 2007 at 1:37

GoogleCodeExporter commented 9 years ago
By the way, this goes for any MacFUSE file system and not just HelloFS. 
Read-only is not something that can be 
toggled on a per-call basis from the user daemon. You must mount a volume as 
read-only. In general, it's 
possible to update (by running the mount command) an existing mount from 
read-write to read-only, etc., but 
that's not implemented for MacFUSE yet.

Original comment by si...@gmail.com on 1 Apr 2007 at 1:41

GoogleCodeExporter commented 9 years ago

Original comment by si...@gmail.com on 2 Apr 2007 at 1:01

GoogleCodeExporter commented 9 years ago
I hadn't looked at MacFUSE options - only the ObjC code; thanks for the info. 
So, what's missing would be an 
addition to the ObjC API, -(BOOL)mountAsReadOnly, which would pass or not the 
-oro option to MacFUSE.

Original comment by stephane...@gmail.com on 3 Apr 2007 at 7:45

GoogleCodeExporter commented 9 years ago
I think rather than adding a method each for the various possible options, it'd 
be better to have a method that 
allow a file system to specify an optional argument string that can be joined 
together with any other arguments 
the ObjC API is internally using.

Original comment by si...@gmail.com on 6 Apr 2007 at 3:34