Project

General

Profile

Idea #7831

Updated by Tom Clegg over 8 years ago

h2. Background 

 arv-mount uses mode 0777 for files and directories. 
 * This is (probably) more permissive than desired bad when combined with @--allow-other@: other users can write. 
 * This is misleading when _not_ combined with @--allow-other@: it looks like other users can read and write, but they can't. 
 * All files are executable, which is not always desired. @--allow-other@. 

 Other FUSE drivers like sshfs and ntfs-3g establish the convention of using "umask" to specify permissions (e.g., "-o umask=022", not "-o mode=0755"). Unlike "mode", the term "umask" is suggestive of the fact that it can subtract from the maximum sensible permissions, but can't add fake permissions (e.g., "--mode 0777" could be misunderstood to mean "advertise writable files, even on a readonly mount"). 

 h2. Fix 

 arv-mount should accept the following options, where N is a switch called @--mode@ and @--permissions@ as an octal number. 

 number, with default 0755. 
 * --fmask=N -- remove these When the mount is read-only, strip out any write bits from the mode of files. specified mode. 
 * --dmask=N -- remove these bits from the mode of directories. Files should have this specified mode. 
 * --umask=N -- remove these bits from the mode of Directories should have this specified mode, but with "x" added everywhere "r" exists. 

 For example, with --mode=0640, files and directories (set both fmask and dmask to N). 

 The default is N=022 if --allow-other-user is given, otherwise N=077. 

 Files will have mode @(0777 - fmask)@. Directories 0640 and directories will have mode @(0777 - dmask)@. 0750.    If the mount is read-only, they'll be 0440 and 0550, respectively. 

 Except: read-only objects never have "write" bits on, regardless of umask. h2. Optional/future work 

 Examples: 

 |*Arguments*                              |*Directories*|*Files*        | 
 |none                                     |@drwx------@ |@-rwx------@ | 
 |--fmask=0177                             |@drwx------@ |@-rw-------@ | 
 |--allow-other                            |@drwxr-xr-x@ |@-rwxr-xr-x@ | 
 |--allow-other --dmask=027 --fmask=0137 |@drwxr-x---@ |@-rw-r-----@ | Accept a --dir-mode argument, for cases where "same as --mode, but adding x wherever r exists" (which would still be the default) is not satisfactory. 

Back