Thu Sep 7 19:38:15 2023 UTC ()
filesystems/fuse: update to fuse-2.9.9.

This is the last and most recent maintainance release for the 2.x
branch.

# Changes (since version 2.9.3)

FUSE 2.9.9 (2019-01-04)
=======================

* Added OpenAFS to whitelist (so users can now mount FUSE filesystems
  on mountpoints within OpenAFS filesystems).
* Added a test of `seekdir` to test_syscalls.
* Fixed `readdir` bug when non-zero offsets are given to filler and the
  filesystem client, after reading a whole directory, re-reads it from a
  non-zero offset e. g. by calling `seekdir` followed by `readdir`.

FUSE 2.9.8 (2018-07-24)
=======================

* SECURITY UPDATE: In previous versions of libfuse it was possible to
  for unprivileged users to specify the `allow_other` option even when
  this was forbidden in `/etc/fuse.conf`.  The vulnerability is
  present only on systems where SELinux is active (including in
  permissive mode).
* libfuse no longer segfaults when fuse_interrupted() is called outside
  the event loop.
* The fusermount binary has been hardened in several ways to reduce
  potential attack surface. Most importantly, mountpoints and mount
  options must now match a hard-coded whitelist. It is expected that
  this whitelist covers all regular use-cases.
* Fixed rename deadlock on FreeBSD.

FUSE 2.9.7 (2016-06-20)
=======================

* Added SELinux support.
* Fixed race-condition when session is terminated right after starting
  a FUSE file system.

FUSE 2.9.6 (2016-04-23)
=======================

* Tarball now includes documentation.
* Shared-object version has now been bumped correctly.

FUSE 2.9.5 (2016-01-14)
=======================

* New maintainer: Nikolaus Rath <Nikolaus@rath.org>. Many thanks to
  Miklos Szeredi <miklos@szeredi.hu> for bringing FUSE to where it is
  now!

* fix warning in mount.c:receive_fd().  Reported by Albert Berger

* fix possible memory leak.  Reported by Jose R. Guzman

FUSE 2.9.4 (2015-05-22)
=======================

* fix exec environment for mount and umount.  Found by Tavis Ormandy
  (CVE-2015-3202).

* fix fuse_remove_signal_handlers() to properly restore the default
  signal handler.  Reported by: Chris Johnson

* highlevel API: fix directory file handle passed to ioctl() method.
  Reported by Eric Biggers

* libfuse: document deadlock avoidance for fuse_notify_inval_entry()
  and fuse_notify_delete()

* 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.

* Initilaize stat buffer passed to ->getattr() and ->fgetattr() to
  zero in all cases.  Reported by Daniel Iwan

* libfuse: Add missing includes.  This allows compiling fuse with
  musl.  Patch by Daniel Thau


(vins)
diff -r1.12 -r1.13 pkgsrc/filesystems/fuse/Makefile
diff -r1.2 -r1.3 pkgsrc/filesystems/fuse/PLIST.Linux
diff -r1.2 -r1.3 pkgsrc/filesystems/fuse/PLIST.common
diff -r1.5 -r1.6 pkgsrc/filesystems/fuse/buildlink3.mk
diff -r1.5 -r1.6 pkgsrc/filesystems/fuse/builtin.mk
diff -r1.7 -r1.8 pkgsrc/filesystems/fuse/distinfo
diff -r0 -r1.1 pkgsrc/filesystems/fuse/files/config.rpath
diff -r0 -r1.1 pkgsrc/filesystems/fuse/patches/patch-configure.ac
diff -r0 -r1.1 pkgsrc/filesystems/fuse/patches/patch-doc_Makefile.am
diff -r0 -r1.1 pkgsrc/filesystems/fuse/patches/patch-lib_mount__bsd.c
diff -r0 -r1.1 pkgsrc/filesystems/fuse/patches/patch-util_Makefile.am
diff -r0 -r1.1 pkgsrc/filesystems/fuse/patches/patch-util_ulockmgr__server.c

cvs diff -r1.12 -r1.13 pkgsrc/filesystems/fuse/Makefile (expand / switch to unified diff)

--- pkgsrc/filesystems/fuse/Makefile 2020/01/27 20:42:55 1.12
+++ pkgsrc/filesystems/fuse/Makefile 2023/09/07 19:38:14 1.13
@@ -1,29 +1,56 @@ @@ -1,29 +1,56 @@
1# $NetBSD: Makefile,v 1.12 2020/01/27 20:42:55 leot Exp $ 1# $NetBSD: Makefile,v 1.13 2023/09/07 19:38:14 vins Exp $
2# 2#
3 3
4DISTNAME= fuse-2.9.3 4DISTNAME= fuse-2.9.9
5CATEGORIES= filesystems 5CATEGORIES= filesystems
6MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=fuse/} 6MASTER_SITES= ${MASTER_SITE_GITHUB:=libfuse/}
 7GITHUB_PROJECT= libfuse
 8GITHUB_TAG= refs/tags/${DISTNAME}
7 9
8MAINTAINER= pkgsrc-users@NetBSD.org 10MAINTAINER= pkgsrc-users@NetBSD.org
9HOMEPAGE= https://github.com/libfuse/libfuse 11HOMEPAGE= https://github.com/libfuse/libfuse
10COMMENT= Filesystem in Userspace 12COMMENT= Filesystem in Userspace
11LICENSE= gnu-gpl-v2 AND gnu-lgpl-v2.1 13LICENSE= gnu-gpl-v2 AND gnu-lgpl-v2.1
12 14
13GNU_CONFIGURE= yes 15GNU_CONFIGURE= yes
14 16
15# FUSE the implementation only builds on Linux and FreeBSD. 17# FUSE the implementation only builds on Linux and FreeBSD.
16ONLY_FOR_PLATFORM= Linux-*-* FreeBSD-*-* NetBSD-*-* 18ONLY_FOR_PLATFORM= Linux-*-* FreeBSD-*-* NetBSD-*-*
17# On NetBSD 4.99 after 2007-02, /usr/lib/librefuse provides the FUSE 19# On NetBSD 4.99 after 2007-02, /usr/lib/librefuse provides the FUSE
18# interface expected by filesystem implementations and therefore this 20# interface expected by filesystem implementations and therefore this
19# implementation is not needed. This FUSE implementation can also be 21# implementation is not needed. This FUSE implementation can also be
20# used with the perfuse package on NetBSD. 22# used with the perfuse package on NetBSD.
21 23
22USE_TOOLS+= gmake pkg-config 24USE_TOOLS+= gmake pkg-config
23USE_LIBTOOL= yes 25USE_TOOLS+= autoconf automake autoreconf
 26USE_LIBTOOL= yes
 27
 28CONFIGURE_ARGS+= --with-libiconv-prefix=${BUILDLINK_PREFIX.iconv}
 29CONFIGURE_ARGS+= --with-pkgconfigdir=${PREFIX}/lib/pkgconfig
 30
 31PKG_DOCS= doc/how-fuse-works doc/kernel.txt
 32DOCDIR= share/doc/${PKGBASE}
 33
 34INSTALL_TARGET= install-strip
 35INSTALLATION_DIRS+= ${DOCDIR}
 36
 37WRKSRC= ${WRKDIR}/libfuse-${DISTNAME}
 38
 39pre-configure:
 40 ${RUN}${CP} ${FILESDIR}/config.rpath ${WRKSRC}
 41 ${RUN}cd ${WRKSRC} && \
 42 ${SETENV} ${CONFIGURE_ENV} ${SH} ./makeconf.sh
 43
 44post-install:
 45 ${INSTALL_DATA} ${WRKSRC}/include/fuse_kernel.h \
 46 ${DESTDIR}${PREFIX}/include/fuse
 47 ${INSTALL_DATA} ${PKG_DOCS:S|^|${WRKSRC}/|} \
 48 ${DESTDIR}${PREFIX}/${DOCDIR}
24 49
25.include "../../mk/bsd.prefs.mk" 50.include "../../mk/bsd.prefs.mk"
26.if ${OPSYS} == "NetBSD" 51.if ${OPSYS} == "NetBSD"
27.include "../../filesystems/perfuse/buildlink3.mk" 52.include "../../filesystems/perfuse/buildlink3.mk"
28.endif 53.endif
 54
 55.include "../../converters/libiconv/buildlink3.mk"
29.include "../../mk/bsd.pkg.mk" 56.include "../../mk/bsd.pkg.mk"

cvs diff -r1.2 -r1.3 pkgsrc/filesystems/fuse/PLIST.Linux (expand / switch to unified diff)

--- pkgsrc/filesystems/fuse/PLIST.Linux 2011/10/16 23:45:45 1.2
+++ pkgsrc/filesystems/fuse/PLIST.Linux 2023/09/07 19:38:14 1.3
@@ -1,3 +1,6 @@ @@ -1,3 +1,6 @@
1@comment $NetBSD: PLIST.Linux,v 1.2 2011/10/16 23:45:45 sbd Exp $ 1@comment $NetBSD: PLIST.Linux,v 1.3 2023/09/07 19:38:14 vins Exp $
2bin/fusermount 2bin/fusermount
3bin/ulockmgr_server 3bin/ulockmgr_server
 4man/man1/fusermount.1
 5man/man1/ulockmgr_server.1
 6man/man8/mount.fuse.8

cvs diff -r1.2 -r1.3 pkgsrc/filesystems/fuse/PLIST.common (expand / switch to unified diff)

--- pkgsrc/filesystems/fuse/PLIST.common 2014/11/24 13:23:10 1.2
+++ pkgsrc/filesystems/fuse/PLIST.common 2023/09/07 19:38:14 1.3
@@ -1,17 +1,17 @@ @@ -1,17 +1,17 @@
1@comment $NetBSD: PLIST.common,v 1.2 2014/11/24 13:23:10 mef Exp $ 1@comment $NetBSD: PLIST.common,v 1.3 2023/09/07 19:38:14 vins Exp $
2include/fuse.h 2include/fuse.h
3include/fuse/cuse_lowlevel.h 3include/fuse/cuse_lowlevel.h
4include/fuse/fuse.h 4include/fuse/fuse.h
5include/fuse/fuse_common.h 5include/fuse/fuse_common.h
6include/fuse/fuse_common_compat.h 6include/fuse/fuse_common_compat.h
7include/fuse/fuse_compat.h 7include/fuse/fuse_compat.h
 8include/fuse/fuse_kernel.h
8include/fuse/fuse_lowlevel.h 9include/fuse/fuse_lowlevel.h
9include/fuse/fuse_lowlevel_compat.h 10include/fuse/fuse_lowlevel_compat.h
10include/fuse/fuse_opt.h 11include/fuse/fuse_opt.h
11include/ulockmgr.h 12include/ulockmgr.h
12lib/libfuse.la 13lib/libfuse.la
13lib/libulockmgr.la 14lib/libulockmgr.la
14lib/pkgconfig/fuse.pc 15lib/pkgconfig/fuse.pc
15man/man1/fusermount.1 16share/doc/fuse/how-fuse-works
16man/man1/ulockmgr_server.1 17share/doc/fuse/kernel.txt
17man/man8/mount.fuse.8 

cvs diff -r1.5 -r1.6 pkgsrc/filesystems/fuse/buildlink3.mk (expand / switch to unified diff)

--- pkgsrc/filesystems/fuse/buildlink3.mk 2010/09/06 12:13:30 1.5
+++ pkgsrc/filesystems/fuse/buildlink3.mk 2023/09/07 19:38:14 1.6
@@ -1,18 +1,19 @@ @@ -1,18 +1,19 @@
1# $NetBSD: buildlink3.mk,v 1.5 2010/09/06 12:13:30 wiz Exp $ 1# $NetBSD: buildlink3.mk,v 1.6 2023/09/07 19:38:14 vins Exp $
2 2
3BUILDLINK_TREE+= fuse 3BUILDLINK_TREE+= fuse
4 4
5.if !defined(FUSE_BUILDLINK3_MK) 5.if !defined(FUSE_BUILDLINK3_MK)
6FUSE_BUILDLINK3_MK:= 6FUSE_BUILDLINK3_MK:=
7 7
8BUILDLINK_API_DEPENDS.fuse+= fuse>=2.5.2 8BUILDLINK_API_DEPENDS.fuse+= fuse>=2.5.2
 9BUILDLINK_ABI_DEPENDS.fuse+= fuse>=2.9.9
9BUILDLINK_PKGSRCDIR.fuse?= ../../filesystems/fuse 10BUILDLINK_PKGSRCDIR.fuse?= ../../filesystems/fuse
10 11
11.include "../../mk/bsd.fast.prefs.mk" 12.include "../../mk/bsd.fast.prefs.mk"
12 13
13.if ${OPSYS} == "NetBSD" 14.if ${OPSYS} == "NetBSD"
14.include "../../filesystems/perfuse/buildlink3.mk" 15.include "../../filesystems/perfuse/buildlink3.mk"
15.endif 16.endif
16.endif # FUSE_BUILDLINK3_MK 17.endif # FUSE_BUILDLINK3_MK
17 18
18BUILDLINK_TREE+= -fuse 19BUILDLINK_TREE+= -fuse

cvs diff -r1.5 -r1.6 pkgsrc/filesystems/fuse/builtin.mk (expand / switch to unified diff)

--- pkgsrc/filesystems/fuse/builtin.mk 2019/11/03 19:26:20 1.5
+++ pkgsrc/filesystems/fuse/builtin.mk 2023/09/07 19:38:14 1.6
@@ -1,13 +1,13 @@ @@ -1,13 +1,13 @@
1# $NetBSD: builtin.mk,v 1.5 2019/11/03 19:26:20 rillig Exp $ 1# $NetBSD: builtin.mk,v 1.6 2023/09/07 19:38:14 vins Exp $
2 2
3BUILTIN_PKG:= fuse 3BUILTIN_PKG:= fuse
4PKGCONFIG_BASE.fuse= /usr 4PKGCONFIG_BASE.fuse= /usr
5PKGCONFIG_FILE.fuse= /usr/lib/pkgconfig/fuse.pc 5PKGCONFIG_FILE.fuse= /usr/lib/pkgconfig/fuse.pc
6PKGCONFIG_FILE.fuse+= /usr/lib${LIBABISUFFIX}/pkgconfig/fuse.pc 6PKGCONFIG_FILE.fuse+= /usr/lib${LIBABISUFFIX}/pkgconfig/fuse.pc
7 7
8.include "../../mk/buildlink3/pkgconfig-builtin.mk" 8.include "../../mk/buildlink3/pkgconfig-builtin.mk"
9 9
10.if !empty(USE_BUILTIN.fuse:M[yY][eE][sS]) 10.if ${USE_BUILTIN.fuse:tl} == yes
11BUILDLINK_FILES.fuse+= lib/pkgconfig/fuse.pc 11BUILDLINK_FILES.fuse+= lib/pkgconfig/fuse.pc
12BUILDLINK_FILES.fuse+= lib${LIBABISUFFIX}/pkgconfig/fuse.pc 12BUILDLINK_FILES.fuse+= lib${LIBABISUFFIX}/pkgconfig/fuse.pc
13.endif 13.endif

cvs diff -r1.7 -r1.8 pkgsrc/filesystems/fuse/distinfo (expand / switch to unified diff)

--- pkgsrc/filesystems/fuse/distinfo 2021/10/26 10:25:26 1.7
+++ pkgsrc/filesystems/fuse/distinfo 2023/09/07 19:38:14 1.8
@@ -1,6 +1,10 @@ @@ -1,6 +1,10 @@
1$NetBSD: distinfo,v 1.7 2021/10/26 10:25:26 nia Exp $ 1$NetBSD: distinfo,v 1.8 2023/09/07 19:38:14 vins Exp $
2 2
3BLAKE2s (fuse-2.9.3.tar.gz) = eefde91db5b8ea798f1ee31da31afa5b9930a791c202126d2426b83cf487d6e5 3BLAKE2s (fuse-2.9.9.tar.gz) = 5b851aa97441a9e13a4718a0775e01cbfff8020d7f4a0656adfca439f8d42d95
4SHA512 (fuse-2.9.3.tar.gz) = 03f43f88694ec7e039ff3579a8e76349b5a5a05872c55901fc1d9ee53dbb6b1e69f6dd0005b620f3b5ead0b14da8eeb31d46b922d10f88f4e3f830aa47e8162c 4SHA512 (fuse-2.9.9.tar.gz) = 1acd51a647ec3dbf9eaafb80cec92bd8542bcbb2cf4510fc8b079b4f8aaa8f4b301e469ddefe4f1cc4ae2bf941e028077601c20d97f187cc618cea8710cbe331
5Size (fuse-2.9.3.tar.gz) = 572044 bytes 5Size (fuse-2.9.9.tar.gz) = 212017 bytes
6SHA1 (patch-aa) = 1179876c7a4f230d8df8a7a6724b90779c9fa0e3 6SHA1 (patch-configure.ac) = 1e8d0081c8dc48e126d1cde856178c39f358ee37
 7SHA1 (patch-doc_Makefile.am) = ffe16fc87e03772ca2e1124549177e999806dbd9
 8SHA1 (patch-lib_mount__bsd.c) = 6b00d0950e0146321a575a2f90c83d8aa7d3cc07
 9SHA1 (patch-util_Makefile.am) = 9c1361a489203dc7a7cd09289b2a15189a82c030
 10SHA1 (patch-util_ulockmgr__server.c) = 2ec86dc8eca5e24952738171eb0937d822b8c657

File Added: pkgsrc/filesystems/fuse/files/config.rpath
#! /bin/sh
# Output a system dependent set of variables, describing how to set the
# run time search path of shared libraries in an executable.
#
#   Copyright 1996-2023 Free Software Foundation, Inc.
#   Taken from GNU libtool, 2001
#   Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
#   This file is free software; the Free Software Foundation gives
#   unlimited permission to copy and/or distribute it, with or without
#   modifications, as long as this notice is preserved.
#
# The first argument passed to this file is the canonical host specification,
#    CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or
#    CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
# should be set by the caller.
#
# The set of defined variables is at the end of this script.

# Known limitations:
# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
#   than 256 bytes, otherwise the compiler driver will dump core. The only
#   known workaround is to choose shorter directory names for the build
#   directory and/or the installation directory.

# All known linkers require a '.a' archive for static linking (except MSVC,
# which needs '.lib').
libext=a
shrext=.so

host="$1"
host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`

# Code taken from libtool.m4's _LT_CC_BASENAME.

for cc_temp in $CC""; do
  case $cc_temp in
    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
    \-*) ;;
    *) break;;
  esac
done
cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`

# Code taken from libtool.m4's _LT_COMPILER_PIC.

wl=
if test "$GCC" = yes; then
  wl='-Wl,'
else
  case "$host_os" in
    aix*)
      wl='-Wl,'
      ;;
    mingw* | cygwin* | pw32* | os2* | cegcc*)
      ;;
    hpux9* | hpux10* | hpux11*)
      wl='-Wl,'
      ;;
    irix5* | irix6* | nonstopux*)
      wl='-Wl,'
      ;;
    linux* | k*bsd*-gnu | kopensolaris*-gnu)
      case $cc_basename in
        ecc*)
          wl='-Wl,'
          ;;
        icc* | ifort*)
          wl='-Wl,'
          ;;
        lf95*)
          wl='-Wl,'
          ;;
        nagfor*)
          wl='-Wl,-Wl,,'
          ;;
        pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
          wl='-Wl,'
          ;;
        ccc*)
          wl='-Wl,'
          ;;
        xl* | bgxl* | bgf* | mpixl*)
          wl='-Wl,'
          ;;
        como)
          wl='-lopt='
          ;;
        *)
          case `$CC -V 2>&1 | sed 5q` in
            *Sun\ F* | *Sun*Fortran*)
              wl=
              ;;
            *Sun\ C*)
              wl='-Wl,'
              ;;
          esac
          ;;
      esac
      ;;
    newsos6)
      ;;
    *nto* | *qnx*)
      ;;
    osf3* | osf4* | osf5*)
      wl='-Wl,'
      ;;
    rdos*)
      ;;
    solaris*)
      case $cc_basename in
        f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
          wl='-Qoption ld '
          ;;
        *)
          wl='-Wl,'
          ;;
      esac
      ;;
    sunos4*)
      wl='-Qoption ld '
      ;;
    sysv4 | sysv4.2uw2* | sysv4.3*)
      wl='-Wl,'
      ;;
    sysv4*MP*)
      ;;
    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
      wl='-Wl,'
      ;;
    unicos*)
      wl='-Wl,'
      ;;
    uts4*)
      ;;
  esac
fi

# Code taken from libtool.m4's _LT_LINKER_SHLIBS.

hardcode_libdir_flag_spec=
hardcode_libdir_separator=
hardcode_direct=no
hardcode_minus_L=no

case "$host_os" in
  cygwin* | mingw* | pw32* | cegcc*)
    # FIXME: the MSVC++ port hasn't been tested in a loooong time
    # When not using gcc, we currently assume that we are using
    # Microsoft Visual C++.
    if test "$GCC" != yes; then
      with_gnu_ld=no
    fi
    ;;
  interix*)
    # we just hope/assume this is gcc and not c89 (= MSVC++)
    with_gnu_ld=yes
    ;;
  openbsd*)
    with_gnu_ld=no
    ;;
esac

ld_shlibs=yes
if test "$with_gnu_ld" = yes; then
  # Set some defaults for GNU ld with shared library support. These
  # are reset later if shared libraries are not supported. Putting them
  # here allows them to be overridden if necessary.
  # Unlike libtool, we use -rpath here, not --rpath, since the documented
  # option of GNU ld is called -rpath, not --rpath.
  hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  case "$host_os" in
    aix[3-9]*)
      # On AIX/PPC, the GNU linker is very broken
      if test "$host_cpu" != ia64; then
        ld_shlibs=no
      fi
      ;;
    amigaos*)
      case "$host_cpu" in
        powerpc)
          ;;
        m68k)
          hardcode_libdir_flag_spec='-L$libdir'
          hardcode_minus_L=yes
          ;;
      esac
      ;;
    beos*)
      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
        :
      else
        ld_shlibs=no
      fi
      ;;
    cygwin* | mingw* | pw32* | cegcc*)
      # hardcode_libdir_flag_spec is actually meaningless, as there is
      # no search path for DLLs.
      hardcode_libdir_flag_spec='-L$libdir'
      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
        :
      else
        ld_shlibs=no
      fi
      ;;
    haiku*)
      ;;
    interix[3-9]*)
      hardcode_direct=no
      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
      ;;
    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
        :
      else
        ld_shlibs=no
      fi
      ;;
    netbsd*)
      ;;
    solaris*)
      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
        ld_shlibs=no
      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
        :
      else
        ld_shlibs=no
      fi
      ;;
    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
      case `$LD -v 2>&1` in
        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
          ld_shlibs=no
          ;;
        *)
          if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
            hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
          else
            ld_shlibs=no
          fi
          ;;
      esac
      ;;
    sunos4*)
      hardcode_direct=yes
      ;;
    *)
      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
        :
      else
        ld_shlibs=no
      fi
      ;;
  esac
  if test "$ld_shlibs" = no; then
    hardcode_libdir_flag_spec=
  fi
else
  case "$host_os" in
    aix3*)
      # Note: this linker hardcodes the directories in LIBPATH if there
      # are no directories specified by -L.
      hardcode_minus_L=yes
      if test "$GCC" = yes; then
        # Neither direct hardcoding nor static linking is supported with a
        # broken collect2.
        hardcode_direct=unsupported
      fi
      ;;
    aix[4-9]*)
      if test "$host_cpu" = ia64; then
        # On IA64, the linker does run time linking by default, so we don't
        # have to do anything special.
        aix_use_runtimelinking=no
      else
        aix_use_runtimelinking=no
        # Test if we are trying to use run time linking or normal
        # AIX style linking. If -brtl is somewhere in LDFLAGS, we
        # need to do runtime linking.
        case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
          for ld_flag in $LDFLAGS; do
            if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
              aix_use_runtimelinking=yes
              break
            fi
          done
          ;;
        esac
      fi
      hardcode_direct=yes
      hardcode_libdir_separator=':'
      if test "$GCC" = yes; then
        case $host_os in aix4.[012]|aix4.[012].*)
          collect2name=`${CC} -print-prog-name=collect2`
          if test -f "$collect2name" && \
            strings "$collect2name" | grep resolve_lib_name >/dev/null
          then
            # We have reworked collect2
            :
          else
            # We have old collect2
            hardcode_direct=unsupported
            hardcode_minus_L=yes
            hardcode_libdir_flag_spec='-L$libdir'
            hardcode_libdir_separator=
          fi
          ;;
        esac
      fi
      # Begin _LT_AC_SYS_LIBPATH_AIX.
      echo 'int main () { return 0; }' > conftest.c
      ${CC} ${LDFLAGS} conftest.c -o conftest
      aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
}'`
      if test -z "$aix_libpath"; then
        aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
}'`
      fi
      if test -z "$aix_libpath"; then
        aix_libpath="/usr/lib:/lib"
      fi
      rm -f conftest.c conftest
      # End _LT_AC_SYS_LIBPATH_AIX.
      if test "$aix_use_runtimelinking" = yes; then
        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
      else
        if test "$host_cpu" = ia64; then
          hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
        else
          hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
        fi
      fi
      ;;
    amigaos*)
      case "$host_cpu" in
        powerpc)
          ;;
        m68k)
          hardcode_libdir_flag_spec='-L$libdir'
          hardcode_minus_L=yes
          ;;
      esac
      ;;
    bsdi[45]*)
      ;;
    cygwin* | mingw* | pw32* | cegcc*)
      # When not using gcc, we currently assume that we are using
      # Microsoft Visual C++.
      # hardcode_libdir_flag_spec is actually meaningless, as there is
      # no search path for DLLs.
      hardcode_libdir_flag_spec=' '
      libext=lib
      ;;
    darwin* | rhapsody*)
      hardcode_direct=no
      if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then
        :
      else
        ld_shlibs=no
      fi
      ;;
    dgux*)
      hardcode_libdir_flag_spec='-L$libdir'
      ;;
    freebsd2.[01]*)
      hardcode_direct=yes
      hardcode_minus_L=yes
      ;;
    freebsd* | dragonfly* | midnightbsd*)
      hardcode_libdir_flag_spec='-R$libdir'
      hardcode_direct=yes
      ;;
    hpux9*)
      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
      hardcode_libdir_separator=:
      hardcode_direct=yes
      # hardcode_minus_L: Not really in the search PATH,
      # but as the default location of the library.
      hardcode_minus_L=yes
      ;;
    hpux10*)
      if test "$with_gnu_ld" = no; then
        hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
        hardcode_libdir_separator=:
        hardcode_direct=yes
        # hardcode_minus_L: Not really in the search PATH,
        # but as the default location of the library.
        hardcode_minus_L=yes
      fi
      ;;
    hpux11*)
      if test "$with_gnu_ld" = no; then
        hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
        hardcode_libdir_separator=:
        case $host_cpu in
          hppa*64*|ia64*)
            hardcode_direct=no
            ;;
          *)
            hardcode_direct=yes
            # hardcode_minus_L: Not really in the search PATH,
            # but as the default location of the library.
            hardcode_minus_L=yes
            ;;
        esac
      fi
      ;;
    irix5* | irix6* | nonstopux*)
      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
      hardcode_libdir_separator=:
      ;;
    netbsd*)
      hardcode_libdir_flag_spec='-R$libdir'
      hardcode_direct=yes
      ;;
    newsos6)
      hardcode_direct=yes
      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
      hardcode_libdir_separator=:
      ;;
    *nto* | *qnx*)
      ;;
    openbsd*)
      if test -f /usr/libexec/ld.so; then
        hardcode_direct=yes
        if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
          hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
        else
          case "$host_os" in
            openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
              hardcode_libdir_flag_spec='-R$libdir'
              ;;
            *)
              hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
              ;;
          esac
        fi
      else
        ld_shlibs=no
      fi
      ;;
    os2*)
      hardcode_libdir_flag_spec='-L$libdir'
      hardcode_minus_L=yes
      ;;
    osf3*)
      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
      hardcode_libdir_separator=:
      ;;
    osf4* | osf5*)
      if test "$GCC" = yes; then
        hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
      else
        # Both cc and cxx compiler support -rpath directly
        hardcode_libdir_flag_spec='-rpath $libdir'
      fi
      hardcode_libdir_separator=:
      ;;
    solaris*)
      hardcode_libdir_flag_spec='-R$libdir'
      ;;
    sunos4*)
      hardcode_libdir_flag_spec='-L$libdir'
      hardcode_direct=yes
      hardcode_minus_L=yes
      ;;
    sysv4)
      case $host_vendor in
        sni)
          hardcode_direct=yes # is this really true???
          ;;
        siemens)
          hardcode_direct=no
          ;;
        motorola)
          hardcode_direct=no #Motorola manual says yes, but my tests say they lie
          ;;
      esac
      ;;
    sysv4.3*)
      ;;
    sysv4*MP*)
      if test -d /usr/nec; then
        ld_shlibs=yes
      fi
      ;;
    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
      ;;
    sysv5* | sco3.2v5* | sco5v6*)
      hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
      hardcode_libdir_separator=':'
      ;;
    uts4*)
      hardcode_libdir_flag_spec='-L$libdir'
      ;;
    *)
      ld_shlibs=no
      ;;
  esac
fi

# Check dynamic linker characteristics
# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
# Unlike libtool.m4, here we don't care about _all_ names of the library, but
# only about the one the linker finds when passed -lNAME. This is the last
# element of library_names_spec in libtool.m4, or possibly two of them if the
# linker has special search rules.
library_names_spec=      # the last element of library_names_spec in libtool.m4
libname_spec='lib$name'
case "$host_os" in
  aix3*)
    library_names_spec='$libname.a'
    ;;
  aix[4-9]*)
    library_names_spec='$libname$shrext'
    ;;
  amigaos*)
    case "$host_cpu" in
      powerpc*)
        library_names_spec='$libname$shrext' ;;
      m68k)
        library_names_spec='$libname.a' ;;
    esac
    ;;
  beos*)
    library_names_spec='$libname$shrext'
    ;;
  bsdi[45]*)
    library_names_spec='$libname$shrext'
    ;;
  cygwin* | mingw* | pw32* | cegcc*)
    shrext=.dll
    library_names_spec='$libname.dll.a $libname.lib'
    ;;
  darwin* | rhapsody*)
    shrext=.dylib
    library_names_spec='$libname$shrext'
    ;;
  dgux*)
    library_names_spec='$libname$shrext'
    ;;
  freebsd[23].*)
    library_names_spec='$libname$shrext$versuffix'
    ;;
  freebsd* | dragonfly* | midnightbsd*)
    library_names_spec='$libname$shrext'
    ;;
  gnu*)
    library_names_spec='$libname$shrext'
    ;;
  haiku*)
    library_names_spec='$libname$shrext'
    ;;
  hpux9* | hpux10* | hpux11*)
    case $host_cpu in
      ia64*)
        shrext=.so
        ;;
      hppa*64*)
        shrext=.sl
        ;;
      *)
        shrext=.sl
        ;;
    esac
    library_names_spec='$libname$shrext'
    ;;
  interix[3-9]*)
    library_names_spec='$libname$shrext'
    ;;
  irix5* | irix6* | nonstopux*)
    library_names_spec='$libname$shrext'
    case "$host_os" in
      irix5* | nonstopux*)
        libsuff= shlibsuff=
        ;;
      *)
        case $LD in
          *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
          *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
          *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
          *) libsuff= shlibsuff= ;;
        esac
        ;;
    esac
    ;;
  linux*oldld* | linux*aout* | linux*coff*)
    ;;
  linux* | k*bsd*-gnu | kopensolaris*-gnu)
    library_names_spec='$libname$shrext'
    ;;
  knetbsd*-gnu)
    library_names_spec='$libname$shrext'
    ;;
  netbsd*)
    library_names_spec='$libname$shrext'
    ;;
  newsos6)
    library_names_spec='$libname$shrext'
    ;;
  *nto* | *qnx*)
    library_names_spec='$libname$shrext'
    ;;
  openbsd*)
    library_names_spec='$libname$shrext$versuffix'
    ;;
  os2*)
    libname_spec='$name'
    shrext=.dll
    library_names_spec='$libname.a'
    ;;
  osf3* | osf4* | osf5*)
    library_names_spec='$libname$shrext'
    ;;
  rdos*)
    ;;
  solaris*)
    library_names_spec='$libname$shrext'
    ;;
  sunos4*)
    library_names_spec='$libname$shrext$versuffix'
    ;;
  sysv4 | sysv4.3*)
    library_names_spec='$libname$shrext'
    ;;
  sysv4*MP*)
    library_names_spec='$libname$shrext'
    ;;
  sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
    library_names_spec='$libname$shrext'
    ;;
  tpf*)
    library_names_spec='$libname$shrext'
    ;;
  uts4*)
    library_names_spec='$libname$shrext'
    ;;
esac

sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`

LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF

# How to pass a linker flag through the compiler.
wl="$escaped_wl"

# Static library suffix (normally "a").
libext="$libext"

# Shared library suffix (normally "so").
shlibext="$shlibext"

# Format of library name prefix.
libname_spec="$escaped_libname_spec"

# Library names that the linker finds when passed -lNAME.
library_names_spec="$escaped_library_names_spec"

# Flag to hardcode \$libdir into a binary during linking.
# This must work even if \$libdir does not exist.
hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"

# Whether we need a single -rpath flag with a separated argument.
hardcode_libdir_separator="$hardcode_libdir_separator"

# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
# resulting binary.
hardcode_direct="$hardcode_direct"

# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
# resulting binary.
hardcode_minus_L="$hardcode_minus_L"

EOF

File Added: pkgsrc/filesystems/fuse/patches/patch-configure.ac
$NetBSD: patch-configure.ac,v 1.1 2023/09/07 19:38:15 vins Exp $

Check for closefrom(). 

--- configure.ac.orig	2019-01-04 13:38:34.000000000 +0000
+++ 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])
 

File Added: pkgsrc/filesystems/fuse/patches/patch-doc_Makefile.am
$NetBSD: patch-doc_Makefile.am,v 1.1 2023/09/07 19:38:15 vins Exp $

Do not install manuals for Linux only binaries on *BSD.

--- doc/Makefile.am.orig	2019-01-04 13:38:34.000000000 +0000
+++ doc/Makefile.am
@@ -1,5 +1,7 @@
 ## Process this file with automake to produce Makefile.in
 
+if LINUX
 dist_man_MANS = fusermount.1 mount.fuse.8 ulockmgr_server.1
+endif
 
 EXTRA_DIST = how-fuse-works kernel.txt Doxyfile html

File Added: pkgsrc/filesystems/fuse/patches/patch-lib_mount__bsd.c
$NetBSD: patch-lib_mount__bsd.c,v 1.1 2023/09/07 19:38:15 vins Exp $

Use unmount() instead of defining a local function.

--- lib/mount_bsd.c.orig	2019-01-04 13:38:34.000000000 +0000
+++ lib/mount_bsd.c
@@ -10,6 +10,8 @@
 #include "fuse_misc.h"
 #include "fuse_opt.h"
 
+#include <sys/param.h>
+#include <sys/mount.h>
 #include <sys/stat.h>
 #include <sys/wait.h>
 #include <sys/sysctl.h>
@@ -192,56 +194,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 Added: pkgsrc/filesystems/fuse/patches/patch-util_Makefile.am
$NetBSD: patch-util_Makefile.am,v 1.1 2023/09/07 19:38:15 vins Exp $

mount.fuse is a script, not a binary.

--- util/Makefile.am.orig	2019-01-04 13:38:34.000000000 +0000
+++ util/Makefile.am
@@ -36,7 +36,7 @@ INIT_D_PATH = @INIT_D_PATH@
 
 install-exec-local:
 	$(MKDIR_P) $(DESTDIR)$(MOUNT_FUSE_PATH)
-	$(INSTALL_PROGRAM) $(builddir)/mount.fuse $(DESTDIR)$(MOUNT_FUSE_PATH)/mount.fuse
+	$(INSTALL_SCRIPT) $(builddir)/mount.fuse $(DESTDIR)$(MOUNT_FUSE_PATH)/mount.fuse
 	$(MKDIR_P) $(DESTDIR)$(INIT_D_PATH)
 	$(INSTALL_SCRIPT) $(srcdir)/init_script $(DESTDIR)$(INIT_D_PATH)/fuse
 	@if test -x /usr/sbin/update-rc.d; then \

File Added: pkgsrc/filesystems/fuse/patches/patch-util_ulockmgr__server.c
$NetBSD: patch-util_ulockmgr__server.c,v 1.1 2023/09/07 19:38:15 vins Exp $

Do not define closefrom() if libc provides it.

--- util/ulockmgr_server.c.orig	2019-01-04 13:38:34.000000000 +0000
+++ util/ulockmgr_server.c
@@ -22,6 +22,10 @@
 #include <sys/socket.h>
 #include <sys/wait.h>
 
+#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, voi
 	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)
 {