aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mount_bsd.c
AgeCommit message (Collapse)AuthorLines
2025-08-04mount_bsd.c: Actually report mount failures back to callerGleb Popov-1/+3
Signed-off-by: Gleb Popov <6yearold@gmail.com>
2025-06-27license: s/COPYING/GPL2.txt, s/COPYING.LIB/LGPL2.txtizxl007-1/+1
Signed-off-by: izxl007 <zeng.zheng@zte.com.cn>
2025-06-10mount_bsd.c: Fix race between actual mounting and returning to the callerGleb Popov-1/+2
Signed-off-by: Gleb Popov <6yearold@gmail.com>
2025-02-18mount_bsd: Remove unused headersVassili Tchersky-4/+0
Removed: - <sys/user.h>: used to be for kinfo_proc, long gone from the code - <paths.h>: used to be for _PATH_DEV and _PATH_DEVNULL, long gone - <limits.h>: used to be for _POSIX2_LINE_MAX, long gone - <sys/stat.h>: used to be for fstat/stat, long gone Signed-off-by: Vassili Tchersky <vt+git@vbcy.org>
2025-02-18mount_bsd: Show errors when syscalls failedVassili Tchersky-3/+7
Log on unmount() and close() failure Signed-off-by: Vassili Tchersky <vt+git@vbcy.org>
2025-02-18mount_bsd: Proper exit callsVassili Tchersky-4/+4
Use _exit() instead of exit() inside children Signed-off-by: Vassili Tchersky <vt+git@vbcy.org>
2025-02-18FreeBSD: Remove useless optionsVassili Tchersky-31/+6
These options never had any effect. See https://svnweb.freebsd.org/base?view=revision&revision=347544 Signed-off-by: Vassili Tchersky <vt+git@vbcy.org>
2025-02-18mount_bsd: Fix usage of libfuse_strtolVassili Tchersky-3/+4
The check on fd < 0 was recently removed. However, this check is important as the content of FUSE_DEV_FD is passed as-is to mount_fusefs, and a string beginning by '-' is treated as an option. Additionally, add a proper include and type. Signed-off-by: Vassili Tchersky <vt+git@vbcy.org>
2024-10-11Add libfuse util strtol wrapperJoanne Koong-8/+3
Add a wrapper around strtol for more rigorous error checking and convert uses of atoi and strtol to use this instead.
2024-04-25[libFuse 3.16.2]Compilation failure on freeBSD #936 (#938)Bernd Schubert-1/+1
Despite the creation of the header file fuse_config.h during LibFUSE version 3.16.2's Meson build process, the BSD mount_bsd.c file continues to reference config.h. Consequently, this discrepancy results in compilation failures. FIX : Point the mount_bsd.c to correct header.
2023-04-06Fix MS_LAZYTIME not defined on uclibc and move all MS_* and UMOUNT_* (#753)Giulio Benetti-1/+1
as well as <sys/mount.h> inclusion to new fuse_mount_compat.h file. Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
2019-11-03Use the -o intr mount option on FreeBSD (#462)Alan Somers-0/+3
FUSE file systems normally indicate their interruptibility by returning ENOSYS to the first FUSE_INTERRUPT operation. But that causes two problems for file systems that aren't interruptible: 1) A process may block on a signal, even if another thread could've handled the signal. The kernel must know whether the FUSE thread is interruptible before deciding which thread should receive a signal. 2) The protocol allows a FUSE daemon to simply ignore FUSE_INTERRUPT operations. From the kernel's point of view, that is indistinguishable from a FUSE_INTERRUPT operation arriving after the original operation had already completed. Thus, the kernel can't interpret an ignored FUSE_INTERRUPT as an indication that the daemon is non-interruptible. With the -o nointr mount option, no FUSE_INTERRUPT operations will ever be sent. Most FUSE file systems should require no modifications to take advantage of this mount option.
2019-09-04Introduce callback for loggingStefan Hajnoczi-1/+1
Introduce an API for custom log handler functions. This allows libfuse applications to send messages to syslog(3) or other logging systems. See include/fuse_log.h for details. Convert libfuse from fprintf(stderr, ...) to log_fuse(level, ...). Most messages are error messages with FUSE_LOG_ERR log level. There are also some debug messages which now use the FUSE_LOG_DEBUG log level. Note that lib/mount_util.c is used by both libfuse and fusermount3. Since fusermount3 does not link against libfuse, we cannot call fuse_log() from lib/mount_util.c. This file will continue to use fprintf(stderr, ...) until someone figures out how to split it up. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2018-11-11Fix mounting on FreeBSDRoman Bogorodskiy-4/+2
Currently, mounting on FreeBSD fails like this: mount_fusefs: ZZZZ<snip> on /mountpoint: No such file or directory This happens because right after doing argv[a++] = fdnam it's getting freed before calling execvp(). So move this free() call after execvp(). Also, when asprintf() fails for fdnam, close device fd before calling exit().
2017-09-11fuse_kern_unmount(): close fd before calling umountNikolaus Rath-1/+1
This is what the Linux version does, and it fixes a timeout under FreeBSD when the kernel sends a FUSE_DESTROY request that is never answered.
2017-08-11fuse_kern_unmount(): fix variable type.Nikolaus Rath-1/+2
2017-08-11Fix unused variable warnings under FreeBSD.Nikolaus Rath-2/+1
2017-08-03Simply #ifdefsNikolaus Rath-53/+0
mount_bsd.c is only used when compiling for *BSD, and FreeBSD is the only BSD that supports FUSE. So there really is no need to check if this file is compiled under FreeBSD.
2017-08-03FreeBSD: use unmount(2) and add missing FreeBSD mount optionBaptiste Daroussin-0/+12
2016-12-23Memory leak fixed in file : mount_bsd.citsdeepak-4/+14
2016-11-22Make handling of -oallow_root easier to understandNikolaus Rath-15/+0
-oallow_root is handled in userspace, and requires passing -oallow_other to the kernel. This patch should make the code easier to understand and avoid the confusion that gave rise to issue #86.
2016-10-27Add max_read to fuse_conn_infoNikolaus Rath-0/+7
Eventually, this setting should be negotiated in the filesystem's init() handler (like e.g. max_write). However, this requires corresponding changes in the FUSE kernel module. In preparation for this (and to allow a transition period) we already allow (and require) filesystems to set the value in the init() handler in addition to the mount option. The end-goal is tracked in issue #91.
2016-10-16Inlined fuse_mount_help() into fuse_lowlevel_help().Nikolaus Rath-7/+0
Both the BSD and Linux implementation actually accept mostly the same FUSE-specific mount options. Up to now, the BSD help function appended the output of ``mount_fusefs --help``, but looking at http://www.unix.com/man-page/freebsd/8/mount_fusefs/ this is likely more confusing than helpful (since the user is not actually invoking mount_fusefs directly, most of the options don't make sense).
2016-10-15Make --help output more suitable for end-userNikolaus Rath-2/+0
We now only list options that are potentially useful for an end-user (and unlikely to accidentally break a file system). The full list of FUSE options has been moved to the documentation of the fuse_new() and fuse_session_new() functions.
2016-10-15Removed -o nonempty optionNikolaus Rath-1/+0
This brings the default behavior in-line with that of the regular `mount` command.
2016-10-15Drop -o large_read mount optionNikolaus Rath-1/+0
This was only relevant for 2.4 kernels. Fixes #92.
2016-10-04fuse_mount_help(): clarify that listed options are FUSE specificNikolaus Rath-1/+1
We also accept a number of mount options that are common to all file systems (nosuid, nodev, ro, etc).
2016-10-02Extended per-file comments.Nikolaus Rath-0/+2
This should make more clear what file contains code for what purpose.
2016-10-02Add section headings for --help outputNikolaus Rath-1/+3
Also, do not include "General options" in usage message.
2016-10-02Turn struct fuse_chan into an implementation detailNikolaus Rath-37/+34
The only struct fuse_chan that's accessible to the user application is the "master" channel that is returned by fuse_mount and stored in struct fuse_session. When using the multi-threaded main loop with the "clone_fd" option, each worker thread gets its own struct fuse_chan. However, none of these are available to the user application, nor do they hold references to struct fuse_session (the pointer is always null). Therefore, any presence of struct fuse_chan can be removed without loss of functionality by relying on struct fuse_session instead. This reduces the number of API functions and removes a potential source of confusion (since the new API no longer looks as if it might be possible to add multiple channels to one session, or to share one channel between multiple sessions). Fixes issue #17.
2016-10-01Improve documentation of argument parsing.Nikolaus Rath-0/+2
2016-09-27Dropped fuse_unmount_compat22Nikolaus Rath-47/+0
This function was for backwards compatibility in FUSE 2.x, and is no longer exposed by FUSE 3.
2016-03-29Whitespace cleanup.Nikolaus Rath-1/+1
Applied (whitespace-cleanup) to each file. Having whitespace changes in the VCS is ugly, but it ensures that in the future committers can run this function to *avoid* commiting any whitespace.
2013-07-26Print help on stdout instead of stderrMiklos Szeredi-3/+1
2013-07-24libfuse: remove "-D_FILE_OFFSET_BITS=64" from fuse.pcMiklos Szeredi-0/+1
add AC_SYS_LARGEFILE to your configure.ac instead.
2013-06-20libfuse: fix multiple close of device fdMiklos Szeredi-3/+6
- fuse_kern_unmount closes handle (e.g. 19) - a thread in my process opens a file - the OS assigns newly freed handle (i.e. 19) - fuse_kern_chan_destroy closes the same handle (i.e. 19) - a thread in my process opens another file - the OS assigns newly freed handle (i.e. 19) - * MAYHEM * Reported by Dan Greenfield
2012-07-19Remove old symbol versionsMiklos Szeredi-2/+0
2008-02-08Add support for atomic open(O_TRUNC)Miklos Szeredi-2/+2
2008-02-05lib/mount_bsd.c: fix typoCsaba Henk-1/+1
2008-02-05lib/mount_bsd.c: add "-onosync_unmount" kernel optionCsaba Henk-0/+1
2008-02-03lib/mount_bsd.c: prettify option specificationsCsaba Henk-67/+42
2008-02-03lib/mount_bsd.c: get rid of all the hacks, we really need nothing just a ↵Csaba Henk-11/+1
forced unmount
2008-02-03lib/mount_bsd.c: ditch the kvm(8) stuff and fix unmounting in a simple and ↵Csaba Henk-50/+15
sensible way
2008-02-03lib/mount_bsd.c: string formatting fixes, exit if mounting has failedCsaba Henk-10/+22
2008-01-07lib/mount_bsd.c: add support for the subtype optionCsaba Henk-0/+1
2008-01-06lib/mount_bsd.c: fix up/refine device closing vs. unmountCsaba Henk-5/+77
2008-01-03lib/mount_bsd.c: Close device before unmount.Csaba Henk-1/+3
Cf. lib/mount.c rev. 1.43.
2008-01-03lib/mount_bsd.c: fix some warningsCsaba Henk-4/+4
2007-12-12change indentingMiklos Szeredi-277/+283
2007-12-12Disable old symbol versions if __UCLIBC__ is definedMiklos Szeredi-1/+2