aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mount_util.h
AgeCommit message (Collapse)AuthorLines
2025-06-27license: s/COPYING/GPL2.txt, s/COPYING.LIB/LGPL2.txtizxl007-1/+1
Signed-off-by: izxl007 <zeng.zheng@zte.com.cn>
2018-10-09Allow passing `/dev/fuse` file descriptor from parent processMattias Nissler-0/+1
This adds support for a mode of operation in which a privileged parent process opens `/dev/fuse` and takes care of mounting. The FUSE file system daemon can then run as an unprivileged child that merely processes requests on the FUSE file descriptor, which get passed using the special `/dev/fd/%u` syntax for the mountpoint parameter. The main benefit is that no privileged operations need to be performed by the FUSE file system daemon itself directly or indirectly, so the FUSE process can run with fully unprivileged and mechanisms like securebits and no_new_privs can be used to prevent subprocesses from re-acquiring privilege via setuid, fscaps, etc. This reduces risk in case the FUSE file system gets exploited by malicious file system data. Below is an example that illustrates this. Note that I'm using shell for presentation purposes, the expectation is that the parent process will implement the equivalent of the `mount -i` and `capsh` commands. ``` \# example/hello can mount successfully with privilege $ sudo sh -c "LD_LIBRARY_PATH=build/lib ./example/hello /mnt/tmp" $ sudo cat /mnt/tmp/hello Hello World! $ sudo umount /mnt/tmp \# example/hello fails to mount without privilege $ sudo capsh --drop=all --secbits=0x2f -- -c 'LD_LIBRARY_PATH=build/lib ./example/hello -f /mnt/tmp' fusermount3: mount failed: Operation not permitted \# Passing FUSE file descriptor via /dev/fd/%u allows example/hello to work without privilege $ sudo sh -c ' exec 17<>/dev/fuse mount -i -o nodev,nosuid,noexec,fd=17,rootmode=40000,user_id=0,group_id=0 -t fuse hello /mnt/tmp capsh --drop=all --secbits=0x2f -- -c "LD_LIBRARY_PATH=build/lib example/hello /dev/fd/17" ' $ sudo cat /mnt/tmp/hello Hello World! $ sudo umount /mnt/tmp ```
2016-10-15Removed -o nonempty optionNikolaus Rath-2/+0
This brings the default behavior in-line with that of the regular `mount` command.
2010-11-08update umount procedureMiklos Szeredi-0/+1
If umount(8) supports --fake and --no-canonicalize (util-linux-ng version 2.18 or later), and umount(2) supports the UMOUNT_NOFOLLOW flag (linux kernel version 2.6.35 or later) then, "fusermount -u" will call the umount(2) system call and use "umount --fake ..." to update /etc/mtab Added --disable-legacy-umount option to configure. This disables the runtime checking of umount(8) version. When built with this option then "fusermount -u" will fail if umount(8) doesn't support the --fake and --no-canonicalize options.
2010-01-26* Fix race if two "fusermount -u" instances are run in parallel.Miklos Szeredi-1/+2
Reported by Dan Rosenberg * Make sure that the path to be unmounted doesn't refer to a symlink
2007-12-12change indentingMiklos Szeredi-6/+6
2007-10-16Clarify licence version to be "LGPLv2" for the libraryMiklos Szeredi-1/+1
2007-06-20Add fs subtype support to libfuse and fusermountMiklos Szeredi-0/+1
2007-04-27libfuse: call umount(8) directly...Miklos Szeredi-0/+1
2007-04-25update copyright datesMiklos Szeredi-1/+1
2007-04-25*** empty log message ***Miklos Szeredi-0/+15