86 Commits

Author SHA1 Message Date
fangzhiyi18 bd5ee7c317 升级1.17.3
Signed-off-by: fangzhiyi18 <fangzhiyi1@h-partners.com>
2025-11-08 13:04:30 +08:00
psycho c99f6182b4 libfuse升级
Signed-off-by: psycho <wangmingxuan6@h-partners.com>
2024-01-09 09:19:42 +08:00
Stefan Hajnoczi 56345a98c5 Introduce callback for logging
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>
2019-09-04 15:59:18 +01:00
Banglang c0476a9f54 Fix compiler warnings of gcc-5.4.x
Signed-off-by: Banglang <banglang.huang@foxmail.com>
2017-08-01 16:26:23 +02:00
Nikolaus Rath ac25c15369 Set IGNORE_MTAB when running under NetBSD
Apparently, NetBSD does not have /etc/mtab. Setting IGNORE_MTAB
in this case makes the code a little nicer.

See also https://github.com/libfuse/libfuse/pull/123
2016-12-23 18:47:01 -08:00
Nikolaus Rath 56fde4ba9e Improve documentation of fuse_session_unmount 2016-11-29 08:25:52 -08:00
Przemysław Pawełczyk dfbfee07ab Rename more things from fuse to fuse3 2016-11-28 21:33:14 -08:00
Nikolaus Rath 4175f969bd Make handling of -oallow_root easier to understand
-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-11-22 16:34:21 -08:00
Nikolaus Rath 695e45a4de Renamed fusermount / mount.fuse to fusermount3 / mount.fuse3 2016-10-28 14:43:44 -07:00
Nikolaus Rath e885e84f79 Add max_read to fuse_conn_info
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-27 21:38:42 -07:00
Nikolaus Rath 199fc0f833 Inlined fuse_mount_help() into fuse_lowlevel_help().
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-16 14:28:47 -07:00
Nikolaus Rath b16650830d Make --help output more suitable for end-user
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-15 19:46:57 -07:00
Nikolaus Rath 0bef21e854 Removed -o nonempty option
This brings the default behavior in-line with that of the
regular `mount` command.
2016-10-15 18:53:45 -07:00
Nikolaus Rath d6217bb2a0 Drop -o large_read mount option
This was only relevant for 2.4 kernels. Fixes #92.
2016-10-15 18:49:52 -07:00
Nikolaus Rath 595f7c3906 fuse_mount_help(): clarify that listed options are FUSE specific
We also accept a number of mount options that are common to
all  file systems (nosuid, nodev, ro, etc).
2016-10-04 19:40:06 -07:00
Nikolaus Rath d968b4ddae Extended per-file comments.
This should make more clear what file contains code for what
purpose.
2016-10-02 21:20:44 -07:00
Nikolaus Rath a10ee045e7 fuse_mount_opts: don't keep max_read= option.
There is no consumer of it down the line.
2016-10-02 20:51:15 -07:00
Nikolaus Rath b4c3478b16 Add section headings for --help output
Also, do not include "General options" in usage message.
2016-10-02 20:51:15 -07:00
Nikolaus Rath 5698ee09cf Turn struct fuse_chan into an implementation detail
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-02 13:56:40 -07:00
Nikolaus Rath e20e5c9ae5 Improve documentation of argument parsing. 2016-10-01 11:24:46 -07:00
Nikolaus Rath 01c663699a Whitespace cleanup.
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.
2016-03-29 13:18:17 -07:00
Miklos Szeredi 9fd0abefb0 libfuse: fix warning mount.c:receive_fd()
Reported by Albert Berger
2015-08-12 11:51:39 +02:00
Miklos Szeredi 52f46cfa68 fusermount, libfuse: send value as unsigned in "user_id=" and "group_id="
...options.  Uids/gids larger than 2147483647 would result in EINVAL when
mounting the filesystem.  This also needs a fix in the kernel.
2014-07-15 16:03:12 +02:00
Miklos Szeredi 9ffe64abe1 Print help on stdout instead of stderr 2013-07-26 16:20:28 +02:00
Miklos Szeredi 39065e40e0 libfuse: set FD_CLOEXEC also when receiving device fd from fusermount 2013-06-21 14:03:08 +02:00
Miklos Szeredi af57c73304 libfuse: fix multiple close of device fd
- 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
2013-06-20 11:43:02 +02:00
Richard W.M. Jones 4a6fb6768a libfuse: use O_CLOEXEC flag when opening /dev/fuse device 2013-02-20 15:59:08 +01:00
Dalvik Khertel c52cafc81c libfuse: pass security context options to kernel
Mount can be used with an "-o context=" option in order to specify a
mountpoint-wide SELinux security context different from the default context
provided by the active SELinux policy.

This is useful in order to enable users to mount multiple sshfs targets under
distinct contexts, which is my main motivation for getting this patch mainlined.
2013-02-08 08:03:01 +01:00
Miklos Szeredi cc1a1f4edd Remove compat functions 2012-07-19 19:02:42 +02:00
Miklos Szeredi 966d97b1f8 Remove old symbol versions 2012-07-19 18:47:51 +02:00
Miklos Szeredi 3b5acfac06 libfuse: mark some data constant 2012-07-04 12:19:29 +02:00
Miklos Szeredi 0131407f4e Don't ignore --disable-mtab
If configured with --disable-mtab then don't call mount(8) from
libfuse to update the mtab.

Reported by: James Sierp
2011-08-31 12:55:06 +02:00
Max Krasnyansky 9ca8283f6f libfuse: Added support for auto_unmount option
This change adds support for "auto_unmount" option to libfuse.
auto_umount option unmounts the fs automatically on application
termination, whether normal or not (segfault, etc).

When auto_unmount option is specified libfuse will alway use
fusermount for mounting the fs. This change is selfcontained but
for complete functionaly it requires auto_unmount support in
fusermount tool.
2011-04-15 15:10:04 -07:00
Laszlo Papp 9deaced060 Initialize the variable properly before passing to any function 2011-03-30 19:34:58 +02:00
Laszlo Papp b0ceaa0670 Check the negative return value after an open syscall 2011-03-30 19:34:58 +02:00
Miklos Szeredi 555d6b5043 Fix option escaping for fusermount.
If the "fsname=" option contained a comma then the option parser in
fusermount was confused (Novell bugzilla #641480).  Fix by escaping
commas when passing them over to fusermount.

Reported by Jan Engelhardt
2010-09-28 19:22:24 +02:00
Miklos Szeredi 64222fbcbd Add NetBSD support
The bulk of it is just about adding ifdef __NetBSD__ where there is
already an ifdef __FreeBSD__

Add a arch=netbsd to deal with NetBSD specifics. I suggests that
arch=bsd could be renamed to arch=freebsd

NetBSD specific linking with -lperfuse

NetBSD patches to lib/mount.c. It turned to be less itrusive to patch
mount;c than mount_bsd.c. I suggest mount_bsd.c could be renamed to 
mount_freebsd.c

Patch from Emmanuel Dreyfus
2010-08-27 17:16:54 +02:00
Miklos Szeredi 8b3a0c74a1 * Fix race if two "fusermount -u" instances are run in parallel.
Reported by Dan Rosenberg

* Make sure that the path to be unmounted doesn't refer to a
symlink
2010-01-26 18:20:13 +00:00
Miklos Szeredi 6134eff5f1 Fix mounting over symlink 2008-06-09 10:21:28 +00:00
Miklos Szeredi ac6d6502f1 Update error message for missing mountpoint parameter 2008-04-08 13:44:52 +00:00
Miklos Szeredi f2625f1106 Fix memory leaks on mount 2008-03-25 21:20:40 +00:00
Miklos Szeredi da077510ef Add support for atomic open(O_TRUNC) 2008-02-08 17:46:57 +00:00
Miklos Szeredi cdb8b79bad change indenting 2007-12-12 14:25:40 +00:00
Miklos Szeredi 918f0ad95b Disable old symbol versions if __UCLIBC__ is defined 2007-12-12 11:53:38 +00:00
Miklos Szeredi 7d62647d7a Clarify licence version to be "LGPLv2" for the library 2007-10-16 15:12:09 +00:00
Miklos Szeredi 37fb19c74f lib: fix locking when loading a filesystem module 2007-06-22 20:41:26 +00:00
Miklos Szeredi 62c24a8e4b Add fs subtype support to libfuse and fusermount 2007-06-20 21:37:58 +00:00
Miklos Szeredi ccd1fa686c libfuse: call umount(8) directly... 2007-04-27 18:08:15 +00:00
Miklos Szeredi 611ad93ac7 update copyright dates 2007-04-25 16:19:15 +00:00
Miklos Szeredi 8e10b7420a *** empty log message *** 2007-04-25 15:52:39 +00:00