# Buildsheet autogenerated by ravenadm tool -- Do not edit. NAMEBASE= fuse2 VERSION= 2.9.9 KEYWORDS= sysutils VARIANTS= standard SDESC[standard]= File System in Userspace (FUSE), legacy HOMEPAGE= https://github.com/libfuse/libfuse CONTACT= nobody DOWNLOAD_GROUPS= main SITES[main]= GITHUB/libfuse:libfuse:fuse-2.9.9 DISTFILE[1]= generated:main DF_INDEX= 1 SPKGS[standard]= single OPTIONS_AVAILABLE= none OPTIONS_STANDARD= none NOT_FOR_OPSYS= dragonfly sunos USES= cpe iconv libtool autoreconf gettext:build LICENSE= LGPL21:single LICENSE_TERMS= single:{{WRKDIR}}/TERMS LICENSE_FILE= LGPL21:{{WRKSRC}}/COPYING.LIB LICENSE_AWK= TERMS:"\*\/" LICENSE_SOURCE= TERMS:{{WRKSRC}}/include/fuse.h LICENSE_SCHEME= solo CPE_PRODUCT= fuse CPE_VENDOR= fuse_project FPC_EQUIVALENT= sysutils/fusefs-libs MUST_CONFIGURE= gnu CONFIGURE_ARGS= --with-pkgconfigdir={{PREFIX}}/lib/pkgconfig CONFIGURE_ENV= MOUNT_FUSE_PATH={{PREFIX}}/sbin INSTALL_TARGET= install-strip SOVERSION= 2.9.9 post-install-linux: ${RM} -r ${STAGEDIR}/dev post-install: ${INSTALL_DATA} ${WRKSRC}/include/fuse_kernel.h \ ${STAGEDIR}${PREFIX}/include/fuse # This file conflicts with fuse3 ${RM} ${STAGEDIR}${PREFIX}/share/man/man8/mount.fuse.8 pre-configure: ${CP} ${LOCALBASE}/share/gettext/config.rpath ${WRKSRC} [FILE:1174:descriptions/desc.single] FUSE (Filesystem in Userspace) is an interface for userspace programs to export a filesystem to the kernel. The FUSE project consists of two components: the fuse kernel module (maintained by supported operating system) and the libfuse userspace library (the contents of this package). libfuse provides the reference implementation for communicating with the FUSE kernel module. A FUSE file system is typically implemented as a standalone application that links with libfuse. libfuse provides functions to mount the file system, unmount it, read requests from the kernel, and send responses back. libfuse offers two APIs: a "high-level", synchronous API, and a "low-level" asynchronous API. In both cases, incoming requests from the kernel are passed to the main program using callbacks. When using the high-level API, the callbacks may work with file names and paths instead of inodes, and processing of a request finishes when the callback function returns. When using the low-level API, the callbacks must work with inodes and responses must be sent explicitly using a separate set of API functions. This package contains FUSE version 2, the legacy version. [FILE:112:distinfo] e57a24721177c3b3dd71cb9239ca46b4dee283db9388d48f7ccd256184982194 212017 libfuse-libfuse-fuse-2.9.9.tar.gz [FILE:675:manifests/plist.single] %%ONLY-LINUX%%/etc/init.d/fuse %%ONLY-LINUX%%/etc/udev/rules.d/99-fuse.rules %%ONLY-LINUX%%@postunexec rm -f /dev/fuse %%ONLY-LINUX%%@preexec mknod -m 0666 /dev/fuse c 10 229 || true %%ONLY-LINUX%%bin/ fusermount ulockmgr_server %%ONLY-LINUX%%sbin/mount.fuse include/ fuse.h ulockmgr.h include/fuse/ cuse_lowlevel.h fuse.h fuse_common.h fuse_common_compat.h fuse_compat.h fuse_kernel.h fuse_lowlevel.h fuse_lowlevel_compat.h fuse_opt.h lib/ libfuse.a libfuse.so libfuse.so.%%SOMAJOR%% libfuse.so.%%SOVERSION%% libulockmgr.a libulockmgr.so libulockmgr.so.1 libulockmgr.so.1.0.1 lib/pkgconfig/fuse.pc share/man/man1/ fusermount.1.gz ulockmgr_server.1.gz [FILE:1481:patches/patch-support-closefrom] From ae2352bca9b4e607538412da0cc2a9625cd8b692 Mon Sep 17 00:00:00 2001 From: Sam James Date: Sat, 24 Jul 2021 22:02:45 +0100 Subject: [PATCH] util/ulockmgr_server.c: conditionally define closefrom (fix glibc-2.34+) closefrom(3) has joined us in glibc-land from *BSD and Solaris. Since it's available in glibc 2.34+, we want to detect it and only define our fallback if the libc doesn't provide it. Bug: https://bugs.gentoo.org/803923 Signed-off-by: Sam James --- configure.ac | 1 + util/ulockmgr_server.c | 6 ++++++ 2 files changed, 7 insertions(+) --- configure.ac.orig +++ configure.ac @@ -55,6 +55,7 @@ fi AC_CHECK_FUNCS([fork setxattr fdatasync splice vmsplice utimensat]) AC_CHECK_FUNCS([posix_fallocate]) +AC_CHECK_FUNCS([closefrom]) AC_CHECK_MEMBERS([struct stat.st_atim]) AC_CHECK_MEMBERS([struct stat.st_atimespec]) --- util/ulockmgr_server.c.orig +++ util/ulockmgr_server.c @@ -22,6 +22,10 @@ #include #include +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + struct message { unsigned intr : 1; unsigned nofd : 1; @@ -124,6 +128,7 @@ static int receive_message(int sock, void *buf, size_t buflen, int *fdp, return res; } +#if !defined(HAVE_CLOSEFROM) static int closefrom(int minfd) { DIR *dir = opendir("/proc/self/fd"); @@ -141,6 +146,7 @@ static int closefrom(int minfd) } return 0; } +#endif static void send_reply(int cfd, struct message *msg) { [FILE:150:files/pkg-message-single-freebsd] ================ FreeBSD Message ================ Install the fuse kernel module to use this port. ================================================= [FILE:2065:freebsd/patch-lib_helper.c] --- lib/helper.c.orig 2019-01-04 13:38:34 UTC +++ lib/helper.c @@ -31,7 +31,7 @@ enum { struct helper_opts { int singlethread; int foreground; - int nodefault_subtype; + int fsname; char *mountpoint; }; @@ -42,8 +42,7 @@ static const struct fuse_opt fuse_helper FUSE_HELPER_OPT("debug", foreground), FUSE_HELPER_OPT("-f", foreground), FUSE_HELPER_OPT("-s", singlethread), - FUSE_HELPER_OPT("fsname=", nodefault_subtype), - FUSE_HELPER_OPT("subtype=", nodefault_subtype), + FUSE_HELPER_OPT("fsname=", fsname), FUSE_OPT_KEY("-h", KEY_HELP), FUSE_OPT_KEY("--help", KEY_HELP), @@ -53,7 +52,6 @@ static const struct fuse_opt fuse_helper FUSE_OPT_KEY("-d", FUSE_OPT_KEY_KEEP), FUSE_OPT_KEY("debug", FUSE_OPT_KEY_KEEP), FUSE_OPT_KEY("fsname=", FUSE_OPT_KEY_KEEP), - FUSE_OPT_KEY("subtype=", FUSE_OPT_KEY_KEEP), FUSE_OPT_END }; @@ -123,24 +121,24 @@ static int fuse_helper_opt_proc(void *da } } -static int add_default_subtype(const char *progname, struct fuse_args *args) +static int add_default_fsname(const char *progname, struct fuse_args *args) { int res; - char *subtype_opt; + char *fsname_opt; const char *basename = strrchr(progname, '/'); if (basename == NULL) basename = progname; else if (basename[1] != '\0') basename++; - subtype_opt = (char *) malloc(strlen(basename) + 64); - if (subtype_opt == NULL) { + fsname_opt = (char *) malloc(strlen(basename) + 64); + if (fsname_opt == NULL) { fprintf(stderr, "fuse: memory allocation failed\n"); return -1; } - sprintf(subtype_opt, "-osubtype=%s", basename); - res = fuse_opt_add_arg(args, subtype_opt); - free(subtype_opt); + sprintf(fsname_opt, "-ofsname=%s", basename); + res = fuse_opt_add_arg(args, fsname_opt); + free(fsname_opt); return res; } @@ -156,8 +154,8 @@ int fuse_parse_cmdline(struct fuse_args if (res == -1) return -1; - if (!hopts.nodefault_subtype) { - res = add_default_subtype(args->argv[0], args); + if (!hopts.fsname) { + res = add_default_fsname(args->argv[0], args); if (res == -1) goto err; } [FILE:1611:freebsd/patch-lib_mount__bsd.c] --- lib/mount_bsd.c.orig 2019-01-04 13:38:34 UTC +++ lib/mount_bsd.c @@ -10,6 +10,8 @@ #include "fuse_misc.h" #include "fuse_opt.h" +#include +#include #include #include #include @@ -78,6 +80,7 @@ static const struct fuse_opt fuse_mount_ FUSE_DUAL_OPT_KEY("ro", KEY_KERN), FUSE_DUAL_OPT_KEY("rw", KEY_KERN), FUSE_DUAL_OPT_KEY("auto", KEY_KERN), + FUSE_DUAL_OPT_KEY("automounted", KEY_KERN), /* options supported under both Linux and FBSD */ FUSE_DUAL_OPT_KEY("allow_other", KEY_KERN), FUSE_DUAL_OPT_KEY("default_permissions",KEY_KERN), @@ -192,56 +195,12 @@ void fuse_unmount_compat22(const char *m free(umount_cmd); } -static void do_unmount(char *dev, int fd) -{ - char device_path[SPECNAMELEN + 12]; - const char *argv[4]; - const char umount_cmd[] = "/sbin/umount"; - pid_t pid; - - snprintf(device_path, SPECNAMELEN + 12, _PATH_DEV "%s", dev); - - argv[0] = umount_cmd; - argv[1] = "-f"; - argv[2] = device_path; - argv[3] = NULL; - - pid = fork(); - - if (pid == -1) - return; - - if (pid == 0) { - close(fd); - execvp(umount_cmd, (char **)argv); - exit(1); - } - - waitpid(pid, NULL, 0); -} - void fuse_kern_unmount(const char *mountpoint, int fd) { char *ep, dev[128]; struct stat sbuf; - (void)mountpoint; - - if (fstat(fd, &sbuf) == -1) - goto out; - - devname_r(sbuf.st_rdev, S_IFCHR, dev, 128); - - if (strncmp(dev, "fuse", 4)) - goto out; - - strtol(dev + 4, &ep, 10); - if (*ep != '\0') - goto out; - - do_unmount(dev, fd); - -out: + unmount(mountpoint, MNT_FORCE); close(fd); } [FILE:414:freebsd/patch-lib_mount__util.c] --- lib/mount_util.c.orig 2019-01-04 13:38:34 UTC +++ lib/mount_util.c @@ -344,20 +344,3 @@ int fuse_mnt_check_empty(const char *pro } return 0; } - -int fuse_mnt_check_fuseblk(void) -{ - char buf[256]; - FILE *f = fopen("/proc/filesystems", "r"); - if (!f) - return 1; - - while (fgets(buf, sizeof(buf), f)) - if (strstr(buf, "fuseblk\n")) { - fclose(f); - return 1; - } - - fclose(f); - return 0; -} [FILE:339:freebsd/patch-lib_mount__util.h] --- lib/mount_util.h.orig 2019-01-04 13:38:34 UTC +++ lib/mount_util.h @@ -16,4 +16,3 @@ int fuse_mnt_umount(const char *progname char *fuse_mnt_resolve_path(const char *progname, const char *orig); int fuse_mnt_check_empty(const char *progname, const char *mnt, mode_t rootmode, off_t rootsize); -int fuse_mnt_check_fuseblk(void);