mar-file-system / marfs

MarFS provides a scalable near-POSIX file system by using one or more POSIX file systems as a scalable metadata component and one or more data stores (object, file, etc) as a scalable data component.
Other
96 stars 27 forks source link

always check directory perms when starting fuse #231

Closed bertschinger closed 1 year ago

bertschinger commented 1 year ago

This commit changes the posixmdal_checksec() function to take a parameter that determines whether to check directory ownership for the parent dir(s) of the MarFS metadata directory. This flag is needed because when running MarFS, we want to check for permissions of the parent dir(s) but not ownership, since it is permissible to run MarFS under a different user than the one who owns the directory (for example, run FUSE as root while directory is owned by a regular user).

marfs_init() is now modified to always run config_verify() prior to launching MarFS, and it calls config_verify() with the check ownership flag false.

marfs_verifyconf() always runs config_verify() with the new check ownership flag true.

In addition, the signatures of the config_verify() and posixmdal_checksec() are modified to take a single int flags argument containing the relevant flags for these functions, instead of multiple char args for each flag individually. This should simplify adding further parameters in the future.

The flags specified in this commit should be kept in sync with the flags in the LibNE source that are used for the DAL config verification functions.