kahing / catfs

Cache AnyThing filesystem written in Rust
Apache License 2.0
851 stars 54 forks source link

Pass-through FUSE mount options #6

Closed putty182 closed 6 years ago

putty182 commented 7 years ago

Mount options to FUSE appear to be hard-coded (eg: default_permissions)

This makes it difficult to expose a catfs mount for use in a docker container from the host; docker tries using it's overlayfs as root, but fails since the catfs mount isn't mounted with allow_other or allow_root.

Here's an example of what I'm trying to run with:

RUST_LOG=catfs=debug,fuse=debug,integration_tests=debug \
    /usr/local/bin/catfs /mnt/source /data/cache /mnt/dest \
    -o rw,allow_other,umask=002,gid=1000,uid=1000,syslog,dev,suid

## Output from `catfs`
2017-09-17 07:28:54 DEBUG - catfs "/mnt/source" "/data/cache"
2017-09-17 07:28:54 INFO  - Mounting /mnt/dest
2017-09-17 07:28:54 DEBUG - INIT(1)   kernel: ABI 7.26, flags 0x1ffffb, max readahead 131072
2017-09-17 07:28:54 DEBUG - INIT(1) response: ABI 7.8, flags 0x31, max readahead 131072, max write 16777216

##  Output from `mount`
/dev/fuse on /mnt/dest type fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000,default_permissions)
kahing commented 7 years ago

you need to do

catfs -o rw -o allow-other -o umask=002 ... --  /mnt/source /data/cache /mnt/dest

the -- is important.

putty182 commented 7 years ago

d'oh - thanks, this works a treat

kahing commented 7 years ago

Reopen for now, supporting the more natural syntax is probably necessary when we want to support mounting from fstab

kahing commented 6 years ago

note that catfs does not currently accept options like umask=002,gid=1000,uid=1000 because those options are implemented in the C libfuse.