.gear/rules | 4 + .../tags/59d3809daa2921e1324a23b9dbec46e2a7cbd2be | 25 ++ .gear/tags/list | 1 + .gear/upstream/remotes | 3 + .gitignore | 1 + ChangeLog | 6 + configure.ac | 1 + fuse.spec | 310 +++++++++++++++++++++ fuserumount | 2 + include/fuse_kernel.h | 6 +- lib/fuse.c | 2 +- lib/fuse_kern_chan.c | 8 +- util/Makefile.am | 8 - util/fusermount.c | 1 + util/ulockmgr_server.c | 6 + 15 files changed, 371 insertions(+), 13 deletions(-) diff --git a/.gear/rules b/.gear/rules new file mode 100644 index 0000000..1ef5474 --- /dev/null +++ b/.gear/rules @@ -0,0 +1,4 @@ +copy: fuserumount +tar: @name@-@version@:. +diff: @name@-@version@:. . name=@name@-@version@.patch + diff --git a/.gear/tags/59d3809daa2921e1324a23b9dbec46e2a7cbd2be b/.gear/tags/59d3809daa2921e1324a23b9dbec46e2a7cbd2be new file mode 100644 index 0000000..5429702 --- /dev/null +++ b/.gear/tags/59d3809daa2921e1324a23b9dbec46e2a7cbd2be @@ -0,0 +1,25 @@ +object d04687923194d906fe5ad82dcd546c9807bf15b6 +type commit +tag fuse-2.9.9 +tagger Nikolaus Rath 1546609126 +0000 + +Tagged release. +-----BEGIN PGP SIGNATURE----- + +iQLKBAABCgC0FiEE7TF5GyxcFhOvOIuK0RP8rDxOWZ8FAlwvYepfFIAAAAAALgAo +aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEVE +MzE3OTFCMkM1QzE2MTNBRjM4OEI4QUQxMTNGQ0FDM0M0RTU5OUYjGmh0dHA6Ly93 +d3cucmF0aC5vcmcvZ3BncG9saWN5Lmh0bWwSHG5pa29sYXVzQHJhdGgub3JnAAoJ +ENET/Kw8TlmfW6wP+wUI22VYugO3OlFV/Sps8xwvdUaxj9paoFIvU9fQ2LgZteXA +z+HJZGz4UgpvPLC29QZhvsn75IUqZ6B2gDs6EWuQ+2P06ufWhUh9r70J5/qtoox/ +YJf+Nl9/fw9V5c/u+SVJU/xQ+9MxHcpCIlm6VH/eZvLTdBZIoSe12TcUYraFyDge +IEd8rp/esqVBuWsaYS9ZFTVEpiFNmM5XTQzX3S9Da8bN8NgHyIpb9R+DRvv31ZYi +SOC33KJtunCWSzWIa+ImjyVutShv5VmJuYCB07ke7mB48DV+zFaZsK6vnjiwpYic +bloO/wiKbXD7+izrlXEboYSvLAV0XRuppsekMe0u1/1hyBKxx/xHyu4M3OnoIrT4 +J/EJAF6ihmdEGTnGw1+v8ZPJztrnXbv34hDVzh6OlcqoQo9GrrG8ONxFasDQr06M +KhdCTGzz8J1F61JkJlg+EUR0VwuLskjoir/orroa/y9lF30Hw6j6MKtqVmOTlbMa +EnPGw8YNwjyLFi7th12vQpg9hOwYnNoy8WYR5KNmUcgjpha7ZuJNRJPwLX8Mqjbi +7BoVi3eaiUHHmp5LzdF6/X/h++sGADIy/UZZ/1/Y5mUOrSLNn9Ms/d8E74czdJJr +KJfXvVcMyMj2Fzar+j1Teo0GaEBs1DvCkxxrl6HP4b65Ozn/RJvEqT5+0Jsy +=N9Dx +-----END PGP SIGNATURE----- diff --git a/.gear/tags/list b/.gear/tags/list new file mode 100644 index 0000000..986d17a --- /dev/null +++ b/.gear/tags/list @@ -0,0 +1 @@ +59d3809daa2921e1324a23b9dbec46e2a7cbd2be fuse-2.9.9 diff --git a/.gear/upstream/remotes b/.gear/upstream/remotes new file mode 100644 index 0000000..fa15b42 --- /dev/null +++ b/.gear/upstream/remotes @@ -0,0 +1,3 @@ +[remote "upstream"] + url = https://github.com/libfuse/libfuse.git + fetch = +refs/heads/*:refs/remotes/upstream/* diff --git a/.gitignore b/.gitignore index 65a37c7..653b663 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ # any tracked files which get ignored after the change. .* !.gitignore +!.gear *.o *.lo *.la diff --git a/ChangeLog b/ChangeLog index 13a369f..5574f20 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Unreleased Changes +================== + +* Added UFSD to whitelist (so users can now mount FUSE filesystems + on mountpoints within UFSD filesystems). + FUSE 2.9.9 (2019-01-04) ======================= diff --git a/configure.ac b/configure.ac index 9946a0e..a2d481a 100644 --- a/configure.ac +++ b/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]) diff --git a/fuse.spec b/fuse.spec new file mode 100644 index 0000000..00a2fd5 --- /dev/null +++ b/fuse.spec @@ -0,0 +1,310 @@ +%define _unpackaged_files_terminate_build 1 +%global optflags_lto %optflags_lto -ffat-lto-objects + +Name: fuse +Version: 2.9.9 +Release: alt4 + +Summary: a tool for creating virtual filesystems +License: GPLv2 +Group: System/Kernel and hardware + +Url: https://github.com/libfuse/ + +Source: %name-%version.tar +Source1: fuserumount + +Patch: %name-%version.patch + +Requires: mount >= 2.11 +Provides: avfs-fuse = %version +Obsoletes: avfs-fuse < %version +Requires(pre): fuse-common >= 1.1.0 + +%description +FUSE (Filesystem in USErspace), an excellent tool +for creating custom filesystems with minimal effort +as well as for using them. + +%package -n lib%name +License: LGPLv2 +Group: System/Kernel and hardware +Summary: tool for creating virtual filesystems +Provides: FUSE = %version avfs-fuse = %version libavfs-fuse = %version +Obsoletes: FUSE < %version avfs-fuse < %version libavfs-fuse < %version + +%description -n lib%name +FUSE (Filesystem in USErspace), an excellent tool +for creating custom filesystems with minimal effort. + +This package contains shared libraries. + +%package -n lib%name-devel +License: LGPLv2 +Group: System/Kernel and hardware +Summary: tool for creating virtual filesystems +Requires: lib%name = %version-%release +Provides: libavfs-fuse-devel = %version +Obsoletes: libavfs-fuse-devel < %version + +%description -n lib%name-devel +FUSE (Filesystem in USErspace), an excellent tool +for creating custom filesystems with minimal effort. + +This package contains development headers. + +%prep +%setup +%patch -p1 + +%build +mkdir -p m4 +cp /usr/share/gettext/config.rpath ./config.rpath +%autoreconf +%configure \ + --enable-lib \ + --enable-util \ + --disable-static +%make_build + +%install +%makeinstall_std + +mkdir -p %buildroot/%_lib +mv %buildroot%_libdir/lib%name.so.* %buildroot/%_lib/ +ln -sf ../../%_lib/lib%name.so.%version %buildroot%_libdir/lib%name.so + +rm -f %buildroot%_sysconfdir/udev/rules.d/* + +install -pD %SOURCE1 %buildroot%_bindir/fuserumount +rm -f %buildroot/etc/init.d/fuse + +%pre +if [ $1 -ge 2 -o -e %_bindir/fusermount3 ]; then + %_sbindir/control-dump fusermount +fi + +%post +if [ $1 -ge 2 -o -e %_bindir/fusermount3 ]; then + %_sbindir/control-restore fusermount +else + %_sbindir/control fusermount fuseonly +fi + +%files +%doc AUTHORS NEWS README.md README.NFS doc/how-fuse-works doc/kernel.txt +/sbin/mount.fuse +%attr(4710,root,fuse) %_bindir/fusermount +%_bindir/ulockmgr_server +%attr(0755,root,root) %_bindir/fuserumount +%_man1dir/* +%_man8dir/* + +%files -n lib%name +/%_lib/lib%name.so.* +%_libdir/lib*.so.* + +%files -n lib%name-devel +%_includedir/* +%_libdir/lib*.so +%_pkgconfigdir/*.pc + +%changelog +* Wed Apr 13 2022 Alexey Shabalin 2.9.9-alt4 +- Added -ffat-lto-objects to %%optflags_lto. + +* Tue Apr 12 2022 Alexey Shabalin 2.9.9-alt3 +- build from upstream upstream/fuse_2_9_bugfix branch +- deleted depends on fuse in libfuse (ALT#38714) +- make buffer size match kernel max transfer size + +* Tue Jan 11 2022 Evgeny Sinelnikov 2.9.9-alt2 +- Fix build with closefrom() from newest unistd.h +- Adjust license to GPLv2 and LGPLv2 for library + +* Mon Feb 04 2019 Rustem Bapin 2.9.9-alt1 +- 2.9.9 +- fuserumount move back from fuse-common +- pre- and postinstall scriptlets are modified to take account mode of already installed fuse3 package + +* Wed Apr 11 2018 Sergey Bolshakov 2.9.7-alt3 +- pick mainline 914871b, fixes build on aarch64 + +* Tue Jul 25 2017 Denis Smirnov 2.9.7-alt2 +- split fuse-common to separate package (for fuse3 compatibility) + +* Sat Aug 13 2016 Denis Smirnov 2.9.7-alt1 +- 2.9.7 + +* Sun Sep 06 2015 Denis Smirnov 2.9.4-alt3 +- fix fuserumount script access (ALT#31225) + +* Mon Aug 24 2015 Denis Smirnov 2.9.4-alt2 +- add fuserumount script (ALT#31225) + +* Wed May 27 2015 Denis Smirnov 2.9.4-alt1 +- 2.9.4 + +* Sun Feb 09 2014 Denis Smirnov 2.9.3-alt4 +- fix wheelonly mode, thanks legion@ (ALT#29814) + +* Wed Jan 29 2014 Michael Shigorin 2.9.3-alt3 +- drop cuse.conf: conflicts with another one, see #29444 (ALT#29777) + +* Thu Oct 10 2013 Denis Smirnov 2.9.3-alt2 +- not use /lib/udev/devices (ALT#29444) + +* Mon Aug 05 2013 Denis Smirnov 2.9.3-alt1 +- 2.9.3 + +* Wed Apr 24 2013 Denis Smirnov 2.9.2-alt2 +- repocop fixes + +* Mon Nov 19 2012 Pavel Shilovsky 2.9.2-alt1 +- 2.9.2 +- remove mmap patch + +* Thu May 10 2012 Michael Shigorin 2.8.7-alt4 +- relaxed /lib/udev/devices/{c,f}use permissions somewhat + so that at least the default configuration is coherent + +* Sat May 05 2012 Michael Shigorin 2.8.7-alt3 +- enabled "fuseonly" mode by default (closes: #27117) +- tightened up /lib/udev/devices/{c,f}use permissions +- use control macros in package scripts +- enhanced descriptions a bit + +* Sun Mar 25 2012 Michael Shigorin 2.8.7-alt2 +- added "fuseonly" mode, thanks iv@ (see also #27117) + +* Sun Mar 25 2012 Michael Shigorin 2.8.7-alt1 +- 2.8.7 +- spec cleanup + +* Tue Oct 04 2011 Evgeny Sinelnikov 2.8.6-alt1 +- update to new release + +* Fri Apr 29 2011 Denis Smirnov 2.8.5-alt3 +- add 'cuse' group and grant access to /dev/cuse for 'cuse' group + +* Fri Apr 01 2011 Denis Smirnov 2.8.5-alt2 +- fix compatibility with new udev (thanks to shrek@) + +* Fri Mar 25 2011 Alexey Tourbin 2.8.5-alt1 +- 2.8.5 + +* Sun Oct 24 2010 Denis Smirnov 2.8.3-alt3 +- auto rebuild + +* Sun Oct 10 2010 Denis Smirnov 2.8.3-alt2 +- auto rebuild + +* Thu Mar 11 2010 Denis Smirnov 2.8.3-alt1 +- 2.8.3 + +* Wed Jan 27 2010 Denis Smirnov 2.8.2-alt1 +- 2.8.2 +- CVE-2009-3297 (ALT #22834) + +* Thu Nov 12 2009 Valery Inozemtsev 2.8.1-alt3 +- removed requires udev-extras + +* Fri Nov 06 2009 Valery Inozemtsev 2.8.1-alt2 +- used ACL + +* Thu Sep 17 2009 Valery Inozemtsev 2.8.1-alt1 +- 2.8.1 + +* Thu Sep 10 2009 Valery Inozemtsev 2.8.0-alt1 +- 2.8.0 release + +* Sun Aug 09 2009 L.A. Kostis 2.8.0-alt0.1.pre3 +- NMU: + + updated to 2.8.0pre3. + + remove obsoleted patches. + + disable -static build by default. + + disable KM sources (removed by upstream). + +* Sun Dec 07 2008 Denis Smirnov 2.7.3-alt3 +- fix building + +* Mon Dec 01 2008 Denis Smirnov 2.7.3-alt2 +- cleanup spec + +* Fri Feb 22 2008 Denis Smirnov 2.7.3-alt1 +- upstream update to 2.7.3 + +* Sun Feb 03 2008 Denis Smirnov 2.7.1-alt1 +- upstream update to 2.7.1 +- remove charset conversion patch (upstream add different solution for this) +- remove kernel-source-fuse subpackage + +* Sat Mar 17 2007 Denis Smirnov 2.6.3-alt2 +- add charset conversion patch from Andy Schevchenko (bug 10658) +- add FUSE_ICONV symbol version + +* Sun Feb 18 2007 Denis Smirnov 2.6.3-alt1 +- upstream update + +* Fri Dec 15 2006 Denis Smirnov 2.6.1-alt1 +- upstream update + +* Wed Oct 18 2006 Denis Smirnov 2.5.3-alt2 +- create 'fuse' group +- fix typo in udev rule (9874) + +* Mon Jun 19 2006 Denis Smirnov 2.5.3-alt1 +- version update + +* Sat Mar 25 2006 Denis Smirnov 2.5.2-alt1 +- upstream update + +* Sun Nov 27 2005 Denis Smirnov 2.4.2-alt1 +- version update + +* Tue Oct 11 2005 Denis Smirnov 2.4-alt1 +- version update + +* Sat Jun 04 2005 Denis Smirnov 2.3-alt1 +- version update + +* Fri Apr 22 2005 Denis Smirnov 2.2-alt6 +- fixed req from libfuse to fuse + +* Sun Apr 17 2005 Denis Smirnov 2.2-alt5 +- cleanup +- headers moved to %_includedir/fuse +- static libraries moved to libfuse-devel-static + +* Tue Feb 15 2005 Denis Smirnov 2.2-alt4 +- rename avfs-fuse to fuse + +* Thu Feb 10 2005 Denis Smirnov 2.2-alt3 +- requires fixed + +* Sun Feb 06 2005 Denis Smirnov 2.2-alt2 +- fix + +* Sat Feb 05 2005 Denis Smirnov 2.2-alt1 +- some cleanups from lav@ +- version update + +* Wed Dec 22 2004 Denis Smirnov 2.1-alt2 +- control support added (users now can user fusermount without sudo) + +* Mon Dec 06 2004 Denis Smirnov 2.1-alt1 +- version update + +* Sat Oct 30 2004 Denis Smirnov 1.9-alt1 +- version update +- support I/O in deleted files (upstream) +- some spec cleanups + +* Tue May 18 2004 Anton Farygin 1.1-alt1 +- new version, renamed to avfs-fuse (reselve packagename conflict with Spectrum Emulator fuse) + +* Fri Nov 07 2003 Alexander Nekrasov 1.0-alt2 +- now FUSE and kernel-source-FUSE build from one spec file + +* Thu Nov 06 2003 Alexander Nekrasov 1.0-alt1 +- first build diff --git a/fuserumount b/fuserumount new file mode 100755 index 0000000..ace9060 --- /dev/null +++ b/fuserumount @@ -0,0 +1,2 @@ +#!/bin/sh +exec fusermount -u "$@" diff --git a/include/fuse_kernel.h b/include/fuse_kernel.h index c632b58..9e02fe3 100644 --- a/include/fuse_kernel.h +++ b/include/fuse_kernel.h @@ -88,12 +88,16 @@ #ifndef _LINUX_FUSE_H #define _LINUX_FUSE_H -#include +#ifdef __linux__ +#include +#else +#include #define __u64 uint64_t #define __s64 int64_t #define __u32 uint32_t #define __s32 int32_t #define __u16 uint16_t +#endif /* * Version negotiation: diff --git a/lib/fuse.c b/lib/fuse.c index d1d873a..1ee0ef4 100644 --- a/lib/fuse.c +++ b/lib/fuse.c @@ -4350,7 +4350,7 @@ static int fuse_session_loop_remember(struct fuse *f) res = poll(&fds, 1, timeout * 1000); if (res == -1) { - if (errno == -EINTR) + if (errno == EINTR) continue; else break; diff --git a/lib/fuse_kern_chan.c b/lib/fuse_kern_chan.c index 4a9beb8..640b91a 100644 --- a/lib/fuse_kern_chan.c +++ b/lib/fuse_kern_chan.c @@ -83,7 +83,10 @@ static void fuse_kern_chan_destroy(struct fuse_chan *ch) close(fd); } -#define MIN_BUFSIZE 0x21000 +#define KERNEL_BUF_PAGES 32 + +/* room needed in buffer to accommodate header */ +#define HEADER_SIZE 0x1000 struct fuse_chan *fuse_kern_chan_new(int fd) { @@ -92,7 +95,6 @@ struct fuse_chan *fuse_kern_chan_new(int fd) .send = fuse_kern_chan_send, .destroy = fuse_kern_chan_destroy, }; - size_t bufsize = getpagesize() + 0x1000; - bufsize = bufsize < MIN_BUFSIZE ? MIN_BUFSIZE : bufsize; + size_t bufsize = KERNEL_BUF_PAGES * getpagesize() + HEADER_SIZE; return fuse_chan_new(&op, fd, bufsize, NULL); } diff --git a/util/Makefile.am b/util/Makefile.am index 059d5fc..667da79 100644 --- a/util/Makefile.am +++ b/util/Makefile.am @@ -20,14 +20,6 @@ ulockmgr_server_SOURCES = ulockmgr_server.c ulockmgr_server_CPPFLAGS = -D_FILE_OFFSET_BITS=64 -D_REENTRANT ulockmgr_server_LDFLAGS = -pthread -install-exec-hook: - -chmod u+s $(DESTDIR)$(bindir)/fusermount - @if test ! -e $(DESTDIR)/dev/fuse; then \ - $(MKDIR_P) $(DESTDIR)/dev; \ - echo "mknod $(DESTDIR)/dev/fuse -m 0666 c 10 229 || true"; \ - mknod $(DESTDIR)/dev/fuse -m 0666 c 10 229 || true; \ - fi - EXTRA_DIST = udev.rules init_script MOUNT_FUSE_PATH = @MOUNT_FUSE_PATH@ diff --git a/util/fusermount.c b/util/fusermount.c index 4b799d9..5af487a 100644 --- a/util/fusermount.c +++ b/util/fusermount.c @@ -1049,6 +1049,7 @@ static int check_perm(const char **mntp, struct stat *stbuf, int *mountpoint_fd) 0x73717368 /* SQUASHFS_MAGIC */, 0x01021994 /* TMPFS_MAGIC */, 0x24051905 /* UBIFS_SUPER_MAGIC */, + 0x736675005346544e /* UFSD */, 0x58465342 /* XFS_SB_MAGIC */, 0x2FC12FC1 /* ZFS_SUPER_MAGIC */, }; diff --git a/util/ulockmgr_server.c b/util/ulockmgr_server.c index 273c7d9..a04dac5 100644 --- a/util/ulockmgr_server.c +++ b/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) {