mpartel / bindfs

Mount a directory elsewhere with changed permissions.
https://bindfs.org/
GNU General Public License v2.0
442 stars 64 forks source link

Allow mount to use bindfs with configuration via /etc/fstab. #140

Closed Kentzo closed 1 year ago

Kentzo commented 1 year ago

Apple's implementation of mount looks for /Library/Filesystems/<type>.fs/Contents/Resources/mount_<type>, which is user writable, where <type> is supplied via the -t argument or is the third argument in /etc/fstab.

mpartel commented 1 year ago

Thanks!

Kentzo commented 1 year ago

Perhaps it would make sense to install bindfs at /Library/Filesystems/bindfs.fs and then symlink /usr/local/bin/binfds to it, rather than doing it the other way around as is currently done.

slonopotamus commented 7 months ago

This broke make install on macOS:

==> make install
Last 15 lines from /Users/marat/Library/Logs/Homebrew/bindfs/03.make:

Making install in src
 .././install-sh -c -d '/opt/homebrew/Cellar/bindfs/1.17.6/bin'
 .././install-sh -c -d '/opt/homebrew/Cellar/bindfs/1.17.6/share/man/man1'
  /bin/sh ../libtool   --mode=install /usr/bin/install -c bindfs '/opt/homebrew/Cellar/bindfs/1.17.6/bin'
 /usr/bin/install -c -m 644 bindfs.1 '/opt/homebrew/Cellar/bindfs/1.17.6/share/man/man1'
libtool: install: /usr/bin/install -c bindfs /opt/homebrew/Cellar/bindfs/1.17.6/bin/bindfs
/Library/Developer/CommandLineTools/usr/bin/make  install-exec-hook
(mkdir -p ""/Library/Filesystems/bindfs.fs/Contents/Resources""; ln -s "/opt/homebrew/Cellar/bindfs/1.17.6/bin/bindfs" ""/Library/Filesystems/bindfs.fs/Contents/Resources"/mount_bindfs")
mkdir: /Library/Filesystems/bindfs.fs: Operation not permitted
ln: /Library/Filesystems/bindfs.fs/Contents/Resources/mount_bindfs: No such file or directory
make[3]: *** [install-exec-hook] Error 1
make[2]: *** [install-exec-am] Error 2
make[1]: *** [install-am] Error 2
make: *** [install-recursive] Error 1

Are we now supposed to sudo make install?

mpartel commented 7 months ago

I hadn't realized it used to be usefully installable without sudo. I guess this PR should be made disableable with a ./configure flag.

slonopotamus commented 7 months ago

https://github.com/mpartel/bindfs/pull/140#issue-1908213158 claims that /Library/Filesystems/ is user-writable while apparently it is not. I have a Homebrew formula that installs bindfs. And I'm not sure whether it is expected for installs to be interactive. Looking through homebrew-core, they never sudo. Instead, they install files to user-writable places like /opt/homebrew and then ask user to perform sudo <whatever> step manually, that normally just creates a symlink.

slonopotamus commented 7 months ago

So yeah, adding a ./configure flag would solve the issue.

Kentzo commented 7 months ago

@slonopotamus I see that the meaning of "user-writable" got confused. I did not mean "user" in the POSIX sense, but more generally as an end-user.

As you may know, generally system directories are not writable on macOS, root user or not. But this particular directory is writable by the end-user albeit requiring root privileges.

It is my opinion that Homebrew formula should require root and install at this location as it allows bindfs to be used alongside macOS's mount system.

mpartel commented 7 months ago

Added ./configure --disable-macos-fs-link and released 1.17.7