From 54b8cd6757ed383c0da10a5ba6a778dd45f28ad6 Mon Sep 17 00:00:00 2001 From: gandalfs_cat Date: Sun, 23 Jun 2024 04:28:30 -0700 Subject: high-level: add fmask and dmask options dmask: umask applied to directories fmask: umask applied to non-directories to get "typical" permission bits for regular files (0644) and directories (0755), a single umask option is not sufficient (or well, it isn't the way fuse implements it) there is precident for separate umask and dmask options in other filesystems (see for example fat: https://github.com/torvalds/linux/tree/master/fs/fat) this addition should not affect backward-compatibility; the original umask option retains the same meaning, but non-zero fmask or dmask will override it. --- include/fuse.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/fuse.h') diff --git a/include/fuse.h b/include/fuse.h index a3549cb..ad50d7f 100644 --- a/include/fuse.h +++ b/include/fuse.h @@ -298,6 +298,14 @@ struct fuse_config { int show_help; char *modules; int debug; + + /** + * `fmask` and `dmask` function the same way as `umask`, but apply + * to files and directories separately. If non-zero, `fmask` and + * `dmask` take precedence over the `umask` setting. + */ + unsigned int fmask; + unsigned int dmask; }; -- cgit v1.2.3