Accepting request 101559 from home:mszeredi:branches:filesystems

- update to 2.8.7
- compile fusermount as PIE [bnc#743155]
- use %set_permissions

OBS-URL: https://build.opensuse.org/request/show/101559
OBS-URL: https://build.opensuse.org/package/show/filesystems/fuse?expand=0&rev=32
This commit is contained in:
Miklos Szeredi 2012-01-25 20:09:26 +00:00 committed by Git OBS Bridge
parent 3e05103c49
commit 76b15d437f
8 changed files with 45 additions and 186 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:11c9c14dfb0f6ef251be83ba6b9c9c6bf973431d7f05290deb4fd382ef88ab40
size 395506

3
fuse-2.8.7.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fd9b14ce4e593be9f69f5f0e3dd5c187c5f1c322092d7fda3572e8c393660b09
size 429969

View File

@ -1,16 +0,0 @@
---
util/fusermount.c | 1 -
1 file changed, 1 deletion(-)
Index: fuse-2.7.2/util/fusermount.c
===================================================================
--- fuse-2.7.2.orig/util/fusermount.c 2011-02-21 17:30:34.000000000 +0100
+++ fuse-2.7.2/util/fusermount.c 2011-02-21 17:31:11.682067022 +0100
@@ -770,7 +770,6 @@ static int mount_fuse(const char *mnt, c
if (geteuid() == 0) {
res = add_mount(source, mnt, type, mnt_opts);
if (res == -1) {
- umount2(mnt, 2); /* lazy umount */
close(fd);
return -1;
}

View File

@ -1,35 +0,0 @@
From 9294657fb966c685cf6a99f4bbe73a91eb2b8f3c Mon Sep 17 00:00:00 2001
From: Miklos Szeredi <mszeredi@suse.cz>
Date: Sun, 23 Oct 2011 10:07:20 +0200
Subject: Reply with ENOMEM in case of failure to allocate request
Reply to request with ENOMEM in case of failure to allocate request
structure. Otherwise the task issuing the request will just freeze up
until the filesystem daemon is killed. Reported by Stephan Kulow
---
lib/fuse_lowlevel.c | 11 +++++++++++
1 file changed, 11 insertions(+)
Index: fuse-2.8.5/lib/fuse_lowlevel.c
===================================================================
--- fuse-2.8.5.orig/lib/fuse_lowlevel.c 2010-09-28 10:03:09.000000000 +0200
+++ fuse-2.8.5/lib/fuse_lowlevel.c 2011-11-03 13:10:07.000000000 +0100
@@ -1467,7 +1467,18 @@ static void fuse_ll_process(void *data,
req = (struct fuse_req *) calloc(1, sizeof(struct fuse_req));
if (req == NULL) {
+ struct fuse_out_header out = {
+ .unique = in->unique,
+ .error = -ENOMEM,
+ .len = sizeof(struct fuse_out_header),
+ };
+ struct iovec iov = {
+ .iov_base = &out,
+ .iov_len = sizeof(struct fuse_out_header),
+ };
+
fprintf(stderr, "fuse: failed to allocate request\n");
+ fuse_chan_send(ch, &iov, 1);
return;
}

View File

@ -1,123 +0,0 @@
---
lib/mount_util.c | 59 ++++++++++++++++++++++++++++++++++++++++++++----------
lib/mount_util.h | 1
util/fusermount.c | 9 +++++++-
3 files changed, 58 insertions(+), 11 deletions(-)
Index: fuse-2.8.5/lib/mount_util.c
===================================================================
--- fuse-2.8.5.orig/lib/mount_util.c 2010-09-28 10:03:09.000000000 +0200
+++ fuse-2.8.5/lib/mount_util.c 2010-12-02 14:58:34.000000000 +0100
@@ -140,14 +140,6 @@ static int add_mount(const char *prognam
goto out_restore;
}
if (res == 0) {
- /*
- * Hide output, because old versions don't support
- * --no-canonicalize
- */
- int fd = open("/dev/null", O_RDONLY);
- dup2(fd, 1);
- dup2(fd, 2);
-
sigprocmask(SIG_SETMASK, &oldmask, NULL);
setuid(geteuid());
execl("/bin/mount", "/bin/mount", "--no-canonicalize", "-i",
@@ -178,8 +170,6 @@ int fuse_mnt_add_mount(const char *progn
return 0;
res = add_mount(progname, fsname, mnt, type, opts);
- if (res == -1)
- res = add_mount_legacy(progname, fsname, mnt, type, opts);
return res;
}
@@ -243,6 +233,55 @@ int fuse_mnt_umount(const char *progname
return exec_umount(progname, rel_mnt, lazy);
}
+static int remove_mount(const char *progname, const char *mnt)
+{
+ int res;
+ int status;
+ sigset_t blockmask;
+ sigset_t oldmask;
+
+ sigemptyset(&blockmask);
+ sigaddset(&blockmask, SIGCHLD);
+ res = sigprocmask(SIG_BLOCK, &blockmask, &oldmask);
+ if (res == -1) {
+ fprintf(stderr, "%s: sigprocmask: %s\n", progname, strerror(errno));
+ return -1;
+ }
+
+ res = fork();
+ if (res == -1) {
+ fprintf(stderr, "%s: fork: %s\n", progname, strerror(errno));
+ goto out_restore;
+ }
+ if (res == 0) {
+ sigprocmask(SIG_SETMASK, &oldmask, NULL);
+ setuid(geteuid());
+ execl("/bin/umount", "/bin/umount", "--no-canonicalize", "-i",
+ "--fake", mnt, NULL);
+ fprintf(stderr, "%s: failed to execute /bin/umount: %s\n",
+ progname, strerror(errno));
+ exit(1);
+ }
+ res = waitpid(res, &status, 0);
+ if (res == -1)
+ fprintf(stderr, "%s: waitpid: %s\n", progname, strerror(errno));
+
+ if (status != 0)
+ res = -1;
+
+ out_restore:
+ sigprocmask(SIG_SETMASK, &oldmask, NULL);
+ return res;
+}
+
+int fuse_mnt_remove_mount(const char *progname, const char *mnt)
+{
+ if (!mtab_needs_update(mnt))
+ return 0;
+
+ return remove_mount(progname, mnt);
+}
+
char *fuse_mnt_resolve_path(const char *progname, const char *orig)
{
char buf[PATH_MAX];
Index: fuse-2.8.5/lib/mount_util.h
===================================================================
--- fuse-2.8.5.orig/lib/mount_util.h 2010-06-23 15:04:14.000000000 +0200
+++ fuse-2.8.5/lib/mount_util.h 2010-12-02 14:58:34.000000000 +0100
@@ -10,6 +10,7 @@
int fuse_mnt_add_mount(const char *progname, const char *fsname,
const char *mnt, const char *type, const char *opts);
+int fuse_mnt_remove_mount(const char *progname, const char *mnt);
int fuse_mnt_umount(const char *progname, const char *abs_mnt,
const char *rel_mnt, int lazy);
char *fuse_mnt_resolve_path(const char *progname, const char *orig);
Index: fuse-2.8.5/util/fusermount.c
===================================================================
--- fuse-2.8.5.orig/util/fusermount.c 2010-09-28 10:04:13.000000000 +0200
+++ fuse-2.8.5/util/fusermount.c 2010-12-02 14:58:34.000000000 +0100
@@ -407,8 +407,15 @@ static int unmount_fuse_locked(const cha
if (res == -1)
goto out;
- res = fuse_mnt_umount(progname, mnt, last, lazy);
+ res = umount2(last, lazy ? 2 : 0);
+ if (res == -1 && !quiet) {
+ fprintf(stderr,
+ "%s: failed to unmount %s: %s\n",
+ progname, mnt, strerror(errno));
+ }
+ if (res == 0)
+ res = fuse_mnt_remove_mount(progname, mnt);
out:
free(copy);
if (currdir_fd != -1) {

View File

@ -1,3 +1,22 @@
-------------------------------------------------------------------
Wed Jan 25 19:57:36 CET 2012 - mszeredi@suse.cz
- use %set_permissions instead of %run_permissions in specfile
-------------------------------------------------------------------
Wed Jan 25 19:11:44 CET 2012 - mszeredi@suse.cz
- compile /bin/fusermount as a position independent executable
[bnc#743155]
-------------------------------------------------------------------
Wed Jan 25 18:32:49 CET 2012 - mszeredi@suse.cz
- update to 2.8.7
* fix ambiguous symbol version for fuse_chan_new
* prevent calling ulockmgr_server with illegal arguments
* fix hang in wait_on_path()
-------------------------------------------------------------------
Thu Nov 3 13:15:39 CET 2011 - mszeredi@suse.cz

View File

@ -1,7 +1,7 @@
#
# spec file for package fuse
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -20,7 +20,7 @@
Name: fuse
Summary: User space File System
Version: 2.8.5
Version: 2.8.7
Release: 10
License: GPL-2.0+ ; LGPL-2.1+
Group: System/Filesystems
@ -30,10 +30,8 @@ Source2: fuse.rpmlintrc
Source3: baselibs.conf
Patch: fuse-install-fix.diff
Patch2: fuse-pc-remove-libdir-from-Libs.diff
Patch3: fuse-umount-race-fix.patch
Patch4: fuse-fix-cleanup-in-case-of-failed-mount.patch
Patch5: fuse-gnu_source.patch
Patch6: fuse-handle-failure-to-allocate-req.patch
Patch3: fuse-gnu_source.patch
Patch4: fusermount-compile-as-pie.patch
Url: http://fuse.sourceforge.net
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} > 1130
@ -276,10 +274,8 @@ Authors:
%if "%{_exec_prefix}" == "/" || "%{_exec_prefix}" == "/usr"
%patch2
%endif
%patch3 -p1
%patch3
%patch4 -p1
%patch5
%patch6 -p1
%build
autoreconf -fiv
@ -313,7 +309,11 @@ done
%{__rm} -rf example/.deps example/Makefile.am example/Makefile.in
%post
%if 0%{?suse_version} >= 1140
%set_permissions %{_bindir}/fusermount
%else
%run_permissions
%endif
%verifyscript
%verify_permissions -e %{_bindir}/fusermount

View File

@ -0,0 +1,14 @@
Index: fuse-2.8.7/util/Makefile.am
===================================================================
--- fuse-2.8.7.orig/util/Makefile.am 2012-01-25 19:13:34.000000000 +0100
+++ fuse-2.8.7/util/Makefile.am 2012-01-25 19:16:02.231609707 +0100
@@ -7,6 +7,9 @@ noinst_PROGRAMS = mount.fuse
fusermount_SOURCES = fusermount.c
fusermount_LDADD = ../lib/mount_util.lo
fusermount_CPPFLAGS = -I../lib
+fusermount_CFLAGS = -fPIE $(AM_CFLAGS)
+fusermount_LDFLAGS = -pie $(AM_LDFLAGS)
+
mount_fuse_SOURCES = mount.fuse.c
ulockmgr_server_SOURCES = ulockmgr_server.c