Ver. 2.8.6
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
This commit is contained in:
parent
cc487b2593
commit
d359e10447
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
fuse-2.8.4.tar.gz
|
||||
/fuse-2.8.5.tar.gz
|
||||
/fuse-2.8.6.tar.gz
|
||||
|
@ -1,125 +0,0 @@
|
||||
From d8bdebc639a84fa280153a466d4bb420fc9572bc Mon Sep 17 00:00:00 2001
|
||||
From: Peter Lemenkov <lemenkov@gmail.com>
|
||||
Date: Wed, 27 Oct 2010 16:29:45 +0400
|
||||
Subject: [PATCH 3/3] Fix mounting FUSE fs into current working directory
|
||||
|
||||
See rhbz #622255 for bug description:
|
||||
|
||||
https://bugzilla.redhat.com/622255
|
||||
|
||||
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
|
||||
---
|
||||
lib/mount_util.c | 75 +++++++++++++-----------------------------------------
|
||||
1 files changed, 18 insertions(+), 57 deletions(-)
|
||||
|
||||
diff --git a/lib/mount_util.c b/lib/mount_util.c
|
||||
index 33e6697..b9a0895 100644
|
||||
--- a/lib/mount_util.c
|
||||
+++ b/lib/mount_util.c
|
||||
@@ -54,8 +54,8 @@ static int mtab_needs_update(const char *mnt)
|
||||
return 1;
|
||||
}
|
||||
|
||||
-static int add_mount_legacy(const char *progname, const char *fsname,
|
||||
- const char *mnt, const char *type, const char *opts)
|
||||
+static int add_mount(const char *progname, const char *fsname,
|
||||
+ const char *mnt, const char *type, const char *opts, int is_legacy)
|
||||
{
|
||||
int res;
|
||||
int status;
|
||||
@@ -76,6 +76,14 @@ static int add_mount_legacy(const char *progname, const char *fsname,
|
||||
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);
|
||||
+
|
||||
char templ[] = "/tmp/fusermountXXXXXX";
|
||||
char *tmp;
|
||||
|
||||
@@ -99,59 +107,12 @@ static int add_mount_legacy(const char *progname, const char *fsname,
|
||||
exit(1);
|
||||
}
|
||||
rmdir(tmp);
|
||||
- execl("/bin/mount", "/bin/mount", "-i", "-f", "-t", type,
|
||||
- "-o", opts, fsname, mnt, NULL);
|
||||
- fprintf(stderr, "%s: failed to execute /bin/mount: %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;
|
||||
-}
|
||||
-
|
||||
-static int add_mount(const char *progname, const char *fsname,
|
||||
- const char *mnt, const char *type, const char *opts)
|
||||
-{
|
||||
- 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) {
|
||||
- /*
|
||||
- * 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",
|
||||
- "-f", "-t", type, "-o", opts, fsname, mnt, NULL);
|
||||
+ if(is_legacy)
|
||||
+ execl("/bin/mount", "/bin/mount", "-i",
|
||||
+ "-f", "-t", type, "-o", opts, fsname, mnt, NULL);
|
||||
+ else
|
||||
+ execl("/bin/mount", "/bin/mount", "--no-canonicalize", "-i",
|
||||
+ "-f", "-t", type, "-o", opts, fsname, mnt, NULL);
|
||||
fprintf(stderr, "%s: failed to execute /bin/mount: %s\n",
|
||||
progname, strerror(errno));
|
||||
exit(1);
|
||||
@@ -177,9 +138,9 @@ int fuse_mnt_add_mount(const char *progname, const char *fsname,
|
||||
if (!mtab_needs_update(mnt))
|
||||
return 0;
|
||||
|
||||
- res = add_mount(progname, fsname, mnt, type, opts);
|
||||
+ res = add_mount(progname, fsname, mnt, type, opts, 0);
|
||||
if (res == -1)
|
||||
- res = add_mount_legacy(progname, fsname, mnt, type, opts);
|
||||
+ res = add_mount(progname, fsname, mnt, type, opts, 1);
|
||||
|
||||
return res;
|
||||
}
|
||||
--
|
||||
1.7.3.1
|
||||
|
12
fuse.spec
12
fuse.spec
@ -1,6 +1,6 @@
|
||||
Name: fuse
|
||||
Version: 2.8.5
|
||||
Release: 5%{?dist}
|
||||
Version: 2.8.6
|
||||
Release: 1%{?dist}
|
||||
Summary: File System in Userspace (FUSE) utilities
|
||||
|
||||
Group: System Environment/Base
|
||||
@ -11,7 +11,6 @@ Source1: %{name}.conf
|
||||
|
||||
Patch1: fuse-0001-Fix-udev-rules-Fedora-specific.patch
|
||||
Patch2: fuse-0002-More-parentheses.patch
|
||||
Patch3: fuse-0003-Fix-mounting-FUSE-fs-into-current-working-directory.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
Requires: kernel >= 2.6.14
|
||||
Requires: which
|
||||
@ -54,11 +53,10 @@ pgk-config) to develop FUSE based applications/filesystems.
|
||||
sed -i 's|mknod|echo Disabled: mknod |g' util/Makefile.in
|
||||
%patch1 -p1 -b .fix_udev_rules
|
||||
%patch2 -p1 -b .add_parentheses
|
||||
%patch3 -p1 -b allow_mount_to_cwd
|
||||
|
||||
%build
|
||||
# Can't pass --disable-static here, or else the utils don't build
|
||||
%configure \
|
||||
CFLAGS="%{optflags} -D_GNU_SOURCE" %configure \
|
||||
--libdir=/%{_lib} \
|
||||
--bindir=/bin \
|
||||
--exec-prefix=/
|
||||
@ -132,6 +130,10 @@ fi
|
||||
%{_includedir}/fuse
|
||||
|
||||
%changelog
|
||||
* Thu Sep 22 2011 Peter Lemenkov <lemenkov@gmail.com> - 2.8.6-1
|
||||
- Ver. 2.8.6
|
||||
- Dropped patch 3 - fixed upstream
|
||||
|
||||
* Thu Mar 03 2011 Peter Lemenkov <lemenkov@gmail.com> - 2.8.5-5
|
||||
- Use noreplace for /etc/fuse.conf
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user