diff --git a/0001-fix-chown-and-mknod-failed.patch b/0001-fix-chown-and-mknod-failed.patch new file mode 100644 index 0000000000000000000000000000000000000000..5db3dc752b3bad3ef11e9f639f7330186debeb5e --- /dev/null +++ b/0001-fix-chown-and-mknod-failed.patch @@ -0,0 +1,32 @@ +From ca0eb08b7f58a6ecffc1cb13b17a7fdc2f1cd7f2 Mon Sep 17 00:00:00 2001 +From: Shijie Luo +Date: Sat, 11 Jan 2020 17:14:38 +0800 +Subject: [PATCH] fix chown and mknod failed + +remove chown and mknod when user is root. +Signed-off-by: Shijie Luo +--- + util/install_helper.sh | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/util/install_helper.sh b/util/install_helper.sh +index cb649a7..a948fcc 100755 +--- a/util/install_helper.sh ++++ b/util/install_helper.sh +@@ -27,13 +27,7 @@ install -D -m 644 "${MESON_SOURCE_ROOT}/util/fuse.conf" \ + "${DESTDIR}${sysconfdir}/fuse.conf" + + if $useroot; then +- chown root:root "${DESTDIR}${bindir}/fusermount3" + chmod u+s "${DESTDIR}${bindir}/fusermount3" +- +- if test ! -e "${DESTDIR}/dev/fuse"; then +- mkdir -p "${DESTDIR}/dev" +- mknod "${DESTDIR}/dev/fuse" -m 0666 c 10 229 +- fi + fi + + install -D -m 644 "${MESON_SOURCE_ROOT}/util/udev.rules" \ +-- +1.8.3.1 + diff --git a/0002-libfuse-Assign-NULL-to-old-to-avoid-free-it-twice-52.patch b/0002-libfuse-Assign-NULL-to-old-to-avoid-free-it-twice-52.patch new file mode 100644 index 0000000000000000000000000000000000000000..bd6a0e5f233a9e0db588025e20ede99619fe608f --- /dev/null +++ b/0002-libfuse-Assign-NULL-to-old-to-avoid-free-it-twice-52.patch @@ -0,0 +1,29 @@ +From d632df7ef5ede4d5a818a1bedbea8659113470b8 Mon Sep 17 00:00:00 2001 +From: winndows +Date: Wed, 1 Jul 2020 13:20:01 +0800 +Subject: [PATCH 1/2] libfuse: Assign NULL to "old" to avoid free it twice + (#522) + +Assign NULL to "old" at the first free(), to avoid the possible 2nd free() for it. + +Signed-off-by: Liao Pingfang +Co-authored-by: Liao Pingfang +--- + lib/modules/iconv.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lib/modules/iconv.c b/lib/modules/iconv.c +index eb5edd8..3a4db7c 100644 +--- a/lib/modules/iconv.c ++++ b/lib/modules/iconv.c +@@ -705,6 +705,7 @@ static struct fuse_fs *iconv_new(struct fuse_args *args, + if (old) { + setlocale(LC_CTYPE, old); + free(old); ++ old = NULL; + } + + ic->next = next[0]; +-- +1.8.3.1 + diff --git a/0003-fuse_lowlevel-Move-assert-for-se-before-dereferencin.patch b/0003-fuse_lowlevel-Move-assert-for-se-before-dereferencin.patch new file mode 100644 index 0000000000000000000000000000000000000000..5040a337de3e1ca5b7273adf3a456320ea94bdaf --- /dev/null +++ b/0003-fuse_lowlevel-Move-assert-for-se-before-dereferencin.patch @@ -0,0 +1,39 @@ +From bcb7659504c0b0ba6ab0fe0db930b686381da9ab Mon Sep 17 00:00:00 2001 +From: winndows +Date: Sat, 11 Jul 2020 02:58:07 +0800 +Subject: [PATCH 2/2] fuse_lowlevel: Move assert for se before dereferencing it + with se->debug (#530) + +Move assert for se before dereferencing it with se->debug. + +Signed-off-by: Liao Pingfang + +Co-authored-by: Liao Pingfang +--- + lib/fuse_lowlevel.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c +index 3dabbd5..7b72ee0 100644 +--- a/lib/fuse_lowlevel.c ++++ b/lib/fuse_lowlevel.c +@@ -167,6 +167,7 @@ static int fuse_send_msg(struct fuse_session *se, struct fuse_chan *ch, + { + struct fuse_out_header *out = iov[0].iov_base; + ++ assert(se != NULL); + out->len = iov_length(iov, count); + if (se->debug) { + if (out->unique == 0) { +@@ -189,8 +190,6 @@ static int fuse_send_msg(struct fuse_session *se, struct fuse_chan *ch, + int err = errno; + + if (res == -1) { +- assert(se != NULL); +- + /* ENOENT means the operation was interrupted */ + if (!fuse_session_exited(se) && err != ENOENT) + perror("fuse: writing device"); +-- +1.8.3.1 + diff --git a/README.en.md b/README.en.md deleted file mode 100644 index 1a927944ae24bf54b10f525e310363af609f0236..0000000000000000000000000000000000000000 --- a/README.en.md +++ /dev/null @@ -1,36 +0,0 @@ -# fuse3 - -#### Description -FUSE is an interface for userspace programs to export a filesystem to the Linuxkernel. - -#### Software Architecture -Software architecture description - -#### Installation - -1. xxxx -2. xxxx -3. xxxx - -#### Instructions - -1. xxxx -2. xxxx -3. xxxx - -#### Contribution - -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request - - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md deleted file mode 100644 index a5b440772b1d3fc086755c150c9f430e1ba38076..0000000000000000000000000000000000000000 --- a/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# fuse3 - -#### 介绍 -FUSE is an interface for userspace programs to export a filesystem to the Linuxkernel. - -#### 软件架构 -软件架构说明 - - -#### 安装教程 - -1. xxxx -2. xxxx -3. xxxx - -#### 使用说明 - -1. xxxx -2. xxxx -3. xxxx - -#### 参与贡献 - -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request - - -#### 特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 -5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/fuse-3.9.2.tar.xz b/fuse-3.9.2.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..43102b376baab76f6b4822a1ee0a75d90ebc4516 Binary files /dev/null and b/fuse-3.9.2.tar.xz differ diff --git a/fuse.conf b/fuse.conf new file mode 100644 index 0000000000000000000000000000000000000000..3c9b6ac9877fd179bfc0e83bafd071efaeb6388f --- /dev/null +++ b/fuse.conf @@ -0,0 +1,17 @@ +# The file /etc/fuse.conf allows for the following parameters: +# +# user_allow_other - Using the allow_other mount option works fine as root, in +# order to have it work as user you need user_allow_other in /etc/fuse.conf as +# well. (This option allows users to use the allow_other option.) You need +# allow_other if you want users other than the owner to access a mounted fuse. +# This option must appear on a line by itself. There is no value, just the +# presence of the option. + +#user_allow_other + + +# mount_max = n - this option sets the maximum number of mounts. +# Currently (2014) it must be typed exactly as shown +# (with a single space before and after the equals sign). + +#mount_max = 1000 diff --git a/fuse3.spec b/fuse3.spec new file mode 100644 index 0000000000000000000000000000000000000000..afc9e49d79174801821ae0b5c73c4795b96b16c8 --- /dev/null +++ b/fuse3.spec @@ -0,0 +1,212 @@ +%global fuse3ver 3.9.2 + +Name: fuse3 +Version: %{fuse3ver} +Release: 4 +Summary: User space File System of fuse3 +License: GPL+ and LGPLv2+ +URL: http://fuse.sf.net +Source0: https://github.com/libfuse/libfuse/archive/fuse-%{fuse3ver}.tar.xz +Source1: fuse.conf + +Patch1: 0001-fix-chown-and-mknod-failed.patch +Patch2: 0002-libfuse-Assign-NULL-to-old-to-avoid-free-it-twice-52.patch +Patch3: 0003-fuse_lowlevel-Move-assert-for-se-before-dereferencin.patch + +BuildRequires: libselinux-devel, pkgconfig, systemd-udev, meson, fdupes +BuildRequires: autoconf, automake, libtool, gettext-devel, ninja-build +Requires: which, fuse-common +Recommends: %{name}-help = %{version}-%{release} +Conflicts: filesystem < 3 +Provides: %{name}-libs +Obsoletes: %{name}-libs + +%description +FUSE (Filesystem in Userspace) is an interface for userspace programs to export +a filesystem to the Linux kernel. The FUSE project consists of two components: +the fuse kernel module (maintained in the regular kernel repositories) and the +libfuse userspace library (maintained in this repository). libfuse provides the +reference implementation for communicating with the FUSE kernel module. + +%package -n fuse-common +Version: %{fuse3ver} +Summary: Common files (fuse.conf) for File System in Userspace (FUSE) v2 and v3 +License: GPL+ + +%description -n fuse-common +Common files (fuse.conf) for File System in Userspace (FUSE) v2 and v3 + +%package -n fuse3-devel +Version: %{fuse3ver} +Summary: User space File System of fuse3 devel files +Obsoletes: %{name}3-libs +Requires: pkgconfig +License: LGPLv2+ +Conflicts: filesystem < 3 + +%description -n fuse3-devel +This package contains all include files, libraries and configuration +files needed to develop programs that use the fuse3. + +%package help +Summary: Including man files for fuse +Requires: man + +%description help +This contains man files for the using of fuse + +%prep +%setup -q -T -c -n fuse3 -a0 + +pushd fuse-%{fuse3ver} +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 + +popd + +%build + +pushd fuse-%{fuse3ver} +%meson +%meson_build +popd + +%install + +pushd fuse-%{fuse3ver} +export MESON_INSTALL_DESTDIR_PREFIX=%{buildroot}/usr +%meson_install +popd + +chmod 0755 %{buildroot}/%{_bindir}/fusermount3 + +rm -f %{buildroot}/%{_libdir}/*.a +rm -f %{buildroot}%{_sysconfdir}/init.d/fuse3 +rm -f %{buildroot}/usr/lib/udev/rules.d/99-fuse3.rules +find %{buildroot} -type f -name "*.la" -delete -print + +# Install config-file +install -p -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir} + + +%post -n fuse3 -p /sbin/ldconfig +%postun -n fuse3 -p /sbin/ldconfig + +%files + +%files -n fuse3 +%doc fuse-%{fuse3ver}/{AUTHORS,ChangeLog*,README*} +%license fuse-%{fuse3ver}/LICENSE fuse-%{fuse3ver}/*GPL2.txt +%{_sbindir}/mount.fuse3 +%attr(4755,root,root) %{_bindir}/fusermount3 +%{_libdir}/libfuse3.so.* + +%files -n fuse-common +%config(noreplace) %{_sysconfdir}/fuse.conf + +%files -n fuse3-devel +%{_includedir}/fuse3/ +%{_libdir}/libfuse3.so +%{_libdir}/pkgconfig/fuse3.pc + +%files help +%{_mandir}/man1/* +%{_mandir}/man8/* + + +%changelog +* Sat May 22 2021 yanglongkang -3.9.2-4 +- fuse3 init + +* Thu Dec 17 2020 yanglongkang -3.9.2-3 +- set help package as install requires + +* Mon Jul 13 2020 Zhiqiang Liu -3.9.2-2 +- backport upstream bugfix patches + +* Mon Jul 06 2020 Youming Zhang -3.9.2-1 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC:update fuse3 from 3.9.0 to 3.9.2 + +* Tue Jun 30 2020 Zhiqiang Liu - 2.9.9-1 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC:renumber patches + +* Sat Jan 11 2020 openEuler Buildteam - 2.9.9-0 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC:update fuse2 from 2.9.7 to 2.9.9, + update fuse3 from 3.2.3 to 3.9.0 + +* Sat Dec 28 2019 openEuler Buildteam - 2.9.7-23 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:sync bugfix from community + +* Wed Sep 4 2019 zoujing - 2.9.7-22 +- Type:enhancemnet +- ID:NA +- SUG:restart +- DESCi:openEuler Debranding + +* Fri Aug 23 2019 zoujing - 2.9.7-21 +- Type:enhancement +- ID:NA +- SUG:restart +- DESC: remove sensitive information + +* Thu Aug 22 2019 zoujing - 2.9.7-20 +- Type: enhancement +- ID:NA +- SUG:restart +- DESC:rename patch name + +* Mon Aug 12 2019 huangzheng - 2.9.7-19 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC:safety code review, delete sensitive information + +* Tue Jul 23 2019 Shijie Luo - 2.9.7-18 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix fuse crash problem when rm node + +* Fri Apr 19 2019 wangchan - 2.9.7-17 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: bfuse-fix-fs-cleanup + fuse_opt_parse(): fix memory leak + fusermount: refuse unknown options + fusermount: whitelist known-good filesystems for mountpoints + fusermount: Fix memory leaks + Fix invalid free of memory pointer in 'struct fuse_buf' + Fix memory leak of FUSE modules + +* Fri Mar 22 2019 yangjian - 2.9.7-16 +- Type:cves +- ID:CVE-2018-10906 +- SUG:NA +- DESC:fix CVE-2018-10906 + +* Fri Jan 25 2019 liuqianya - 2.9.7-15 +- Type:bugfix +- ID:NA +- SUG:NA + DESC:increase idle thread + invalid free and core + memory leak and wild ptr + fuse exit when got EINVAL error + +* Wed Jul 18 2018 openEuler Buildteam - 2.9.7-14 +- Package init +