aboutsummaryrefslogtreecommitdiffstats
path: root/lib/helper.c
AgeCommit message (Collapse)AuthorLines
2017-08-03Simplify and fix FreeBSD fsname handlingNikolaus Rath-29/+10
This should simplify the code a lot. It also corrects a bug in that the (former) add_default_fsname() function actually set the -osubtype option.
2017-08-03FreeBSD: supprt fsname= optionBaptiste Daroussin-0/+30
2017-07-08Added public fuse_lib_help(), bumped minor versionNikolaus Rath-8/+4
2016-10-20Accept zero value for fuse_conn_info optionsNikolaus Rath-5/+15
This may not make sense for all options, but it's good practice.
2016-10-18Cast to void where we deliberately ignore return valuesNikolaus Rath-2/+2
2016-10-18Ignore some errorsMihail Konev-2/+2
2016-10-16Inlined fuse_mount_help() into fuse_lowlevel_help().Nikolaus Rath-1/+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-3/+3
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-15Unify handling of fuse_conn_info optionsNikolaus Rath-0/+127
Instead of using command line options to modify struct fuse_conn_info before and after calling the init() handler, we now give the file system explicit control over this.
2016-10-13Make -o clone_fd into a parameter of session_loop_mt().Nikolaus Rath-1/+3
This option really affects the behavior of the session loop, not the low-level interface. Therefore, it does not belong in the fuse_session object.
2016-10-10fuse_main(): extend support for printing helpNikolaus Rath-0/+3
There's now a way to inhibit the "usage" line (which actually got lost in commit 225c12aebf2d), which makes it easier for simply file-systems to generate good-looking --help output.
2016-10-09fuse_main_real(): use fuse_parse_cmdline().Nikolaus Rath-11/+1
2016-10-09fuse_parse_cmdline(): do not print help/version textNikolaus Rath-35/+3
The current behavior makes it difficult to add help for additional options. With the change, this becomes a lot easier.
2016-10-04Clarified purpose of helper.c, moved *version() to fuse.cNikolaus Rath-10/+4
2016-10-02Don't handle --help and --version in fuse_session_new().Nikolaus Rath-119/+114
Help and version messages can be generated using the new fuse_lowlevel_help(), fuse_lowlevel_version(), fuse_mount_help(), and fuse_mount_version() functions. The fuse_parse_cmdline() function has been made more powerful to do this automatically, and is now explicitly intended only for low-level API users. This is a code simplication patch. We don't have to parse for --help and --version in quite as many places, and we no longer have a low-level initialization function be responsible for the (super-high level) task of printing a program usage message. In the high-level API, we can now handle the command line parsing earlier and avoid running other initialization code if we're just going to abort later on.
2016-10-02Add section headings for --help outputNikolaus Rath-6/+3
Also, do not include "General options" in usage message.
2016-10-02Turn struct fuse_chan into an implementation detailNikolaus Rath-23/+21
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-02Introduce separate mount/umount functions for low-level API.Nikolaus Rath-35/+0
2016-10-01Improve documentation of argument parsing.Nikolaus Rath-0/+1
2016-06-20libfuse/fuse_daemonize: wait until daemon child process is ready (#55)Hendrik Brueckner-0/+14
Mounting a FUSE file system remotely using SSH in combination with pseudo-terminal allocation (-t), results in "Transport endpoint is not connected" errors when trying to access the file system contents. For example: # ssh -t root@localhost "cmsfs-fuse /dev/disk/by-path/ccw-0.0.0190 /CMSFS" Connection to localhost closed. # ls /CMSFS ls: cannot access '/CMSFS': Transport endpoint is not connected The cmsfs-fuse main program (which can also be any other FUSE file system) calls into the fuse_main() libfuse library function. The fuse_main() function later calls fuse_daemonize() to fork the daemon process to handle the FUSE file system I/O. The fuse_daemonize() function calls fork() as usual. The child proceeds with setsid() and then redirecting its file descriptors to /dev/null etc. The parent process, simply exits. The child's functions and the parent's exit creates a subtle race. This is seen with an SSH connection. The SSH command above calls cmsfs-fuse on an allocated pseudo-terminal device (-t option). If the parent exits, SSH receives the command completion and closes the connection, that means, it closes the master side of the pseudo-terminal. This causes a HUP signal being sent to the process group on the pseudo-terminal. At this point in time, the child might not have completed the setsid() call and, hence, becomes terminated. Note that fuse daemon sets up its signal handlers after fuse_daemonize() has completed. Even if the child has the chance to disassociate from its parent process group to become it's own process group with setsid(), the child still has the pseudo-terminal opened as stdin, stdout, and stderr. So the pseudo-terminal still behave as controlling terminal and might cause a SIGHUP at closing the the master side. To solve the problem, the parent has to wait until the child (the fuse daemon process) has completed its processing, that means, has become its own process group with setsid() and closed any file descriptors pointing to the pseudo-terminal. Closes: #27 Reported-by: Ofer Baruch <oferba@il.ibm.com> Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com> Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
2015-09-29Merge branch 'clone_fd'Miklos Szeredi-2/+1
2015-08-12Canonicalised whitespace and added ChangeLog entryChristopher Harrison-1/+1
2015-07-30Added fuse_pkgversion functionChristopher Harrison-0/+4
Returns the full PACKAGE_VERSION string, per autoconf
2015-05-18libfuse: refcount fuse_chan objectsMiklos Szeredi-2/+1
New functions: fuse_chan_get(), fuse_chan_put(). Removed function: fuse_chan_destroy().
2013-07-26Print help on stdout instead of stderrMiklos Szeredi-16/+12
2013-06-21libfuse: remove session and chan abstractionsMiklos Szeredi-1/+1
There's actually just one type of channel and session, so we don't need the generic callback functions.
2013-06-21libfuse: replace fuse_session_next_chanMiklos Szeredi-1/+1
Replace fuse_session_next_chan() with fuse_session_chan(), as multiple channels per session were never actually supported and probably never will.
2013-06-20libfuse: fix multiple close of device fdMiklos Szeredi-4/+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
2013-02-22remove real fuse_main() symbolMiklos Szeredi-8/+0
2013-02-19fuse_daemonize(): chdir to "/" even if not running in the backgroundMiklos Szeredi-0/+2
for consistency. Reported by Vladimir Rutsky
2013-02-08libfuse: remove deprecated fuse_setup(), fuse_teardown()Miklos Szeredi-2/+2
2012-07-19Remove compat functionsMiklos Szeredi-141/+16
2012-07-19Remove old symbol versionsMiklos Szeredi-11/+0
2011-09-23Replace daemon() function with fork()Anatol Pomozov-5/+29
daemon() is a BSD-ism. Although it is available on many platforms it is not a standard function. Some platforms (e.g. MacOSX) deprecated it. It is safer just to use fork() function that is a part of POSIX.
2011-03-30Fix a potential null pointer dereference issueLaszlo Papp-1/+2
2010-08-27Add NetBSD supportMiklos Szeredi-2/+2
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
2009-06-18CUSE patches from Tejun HeoMiklos Szeredi-8/+8
2008-06-10Fix missing <sys/param.h> include for PATH_MAXMiklos Szeredi-0/+1
2008-02-08Add support for atomic open(O_TRUNC)Miklos Szeredi-22/+22
2007-12-12change indentingMiklos Szeredi-281/+287
2007-12-12Disable old symbol versions if __UCLIBC__ is definedMiklos Szeredi-9/+10
2007-10-16Clarify licence version to be "LGPLv2" for the libraryMiklos Szeredi-1/+1
2007-08-08fixesMiklos Szeredi-1/+13
2007-06-20Add fs subtype support to libfuse and fusermountMiklos Szeredi-11/+18
2007-04-25update copyright datesMiklos Szeredi-1/+1
2007-04-25*** empty log message ***Miklos Szeredi-7/+0
2006-12-04build fixesMiklos Szeredi-0/+1
2006-11-11fixesMiklos Szeredi-4/+4
2006-06-06fixMiklos Szeredi-3/+9
2006-06-03fix emergency unmount in helper.cCsaba Henk-1/+1