Project

General

Profile

Actions

Idea #7831

open

[FUSE] Add --umask, --fmask, --dmask options to control file permissions

Added by Brett Smith over 8 years ago. Updated about 2 months ago.

Status:
New
Priority:
Normal
Assigned To:
-
Category:
FUSE
Target version:
Start date:
Due date:
Story points:
1.0
Release:
Release relationship:
Auto

Description

Background

arv-mount uses mode 0777 for files and directories.
  • This is (probably) more permissive than desired 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.

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").

Fix

arv-mount should accept the following options, where N is an octal number.

  • --fmask=N -- remove these bits from the mode of files.
  • --dmask=N -- remove these bits from the mode of directories.
  • --umask=N -- remove these bits from the mode of 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 will have mode (0777 - dmask).

Except: read-only objects never have "write" bits on, regardless of umask.

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-----
Actions

Also available in: Atom PDF