aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog24
-rw-r--r--configure.ac2
-rw-r--r--include/fuse_common.h7
-rwxr-xr-xlib/fuse_lowlevel.c2
-rw-r--r--lib/helper.c4
-rw-r--r--lib/mount.c2
-rw-r--r--lib/mount_util.c23
7 files changed, 55 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 4450ca5..342f91d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2015-08-12 Miklos Szeredi <miklos@szeredi.hu>
+
+ * libfuse: fix warning mount.c:receive_fd(). Reported by Albert
+ Berger
+
+ * libfuse: added fuse_pkgversion() function to retrieve the full
+ version string, per autoconf. Patch by Christopher Harrison
+
+2015-06-29 Miklos Szeredi <miklos@szeredi.hu>
+
+ * libfuse: fix possible memory leak. Reported by Jose R. Guzman
+
+2015-05-26 Miklos Szeredi <miklos@szeredi.hu>
+
+ * Use system directory for system-wide udev rules by default. This
+ ensures that fuse functions correctly on stateless operating
+ systems without requiring use of the site configuration directory
+ (/etc/). Patch by Ikey Doherty
+
2015-05-23 Miklos Szeredi <miklos@szeredi.hu>
* libfuse: refcount fuse_chan objects. New functions:
@@ -8,6 +27,11 @@
file descriptor for each processing thread, which might improve
performance.
+2015-05-22 Miklos Szeredi <miklos@szeredi.hu>
+
+ * libfuse: fix exec environment for mount and umount. Found by
+ Tavis Ormandy (CVE-2015-3202).
+
2015-04-23 Miklos Szeredi <miklos@szeredi.hu>
* libfuse: add FUSE_CAP_NO_OPEN_SUPPORT flag to ->init()
diff --git a/configure.ac b/configure.ac
index 14d64b6..513c434 100644
--- a/configure.ac
+++ b/configure.ac
@@ -86,7 +86,7 @@ if test -z "$MOUNT_FUSE_PATH"; then
fi
AC_SUBST(MOUNT_FUSE_PATH)
if test -z "$UDEV_RULES_PATH"; then
- UDEV_RULES_PATH=/etc/udev/rules.d
+ UDEV_RULES_PATH="${prefix}/lib/udev/rules.d"
AC_MSG_NOTICE([UDEV_RULES_PATH env var not set, using default $UDEV_RULES_PATH])
fi
AC_SUBST(UDEV_RULES_PATH)
diff --git a/include/fuse_common.h b/include/fuse_common.h
index 28dfc0b..beb44c7 100644
--- a/include/fuse_common.h
+++ b/include/fuse_common.h
@@ -269,6 +269,13 @@ int fuse_daemonize(int foreground);
int fuse_version(void);
/**
+ * Get the full package version string of the library
+ *
+ * @return the package version
+ */
+const char *fuse_pkgversion(void);
+
+/**
* Destroy poll handle
*
* @param ph the poll handle
diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c
index 05103c0..c5108f7 100755
--- a/lib/fuse_lowlevel.c
+++ b/lib/fuse_lowlevel.c
@@ -795,11 +795,11 @@ static int fuse_send_data_iov(struct fuse_ll *f, struct fuse_chan *ch,
goto clear_pipe;
}
res = read_back(llp->pipe[0], tmpbuf, headerlen);
+ free(tmpbuf);
if (res != 0) {
free(mbuf);
goto clear_pipe;
}
- free(tmpbuf);
res = read_back(llp->pipe[0], mbuf, now_len);
if (res != 0) {
free(mbuf);
diff --git a/lib/helper.c b/lib/helper.c
index cca21b5..28c6310 100644
--- a/lib/helper.c
+++ b/lib/helper.c
@@ -331,3 +331,7 @@ int fuse_version(void)
return FUSE_VERSION;
}
+const char *fuse_pkgversion(void)
+{
+ return PACKAGE_VERSION;
+}
diff --git a/lib/mount.c b/lib/mount.c
index 111b32b..de4ae74 100644
--- a/lib/mount.c
+++ b/lib/mount.c
@@ -281,7 +281,7 @@ static int receive_fd(int fd)
}
cmsg = CMSG_FIRSTHDR(&msg);
- if (!cmsg->cmsg_type == SCM_RIGHTS) {
+ if (cmsg->cmsg_type != SCM_RIGHTS) {
fprintf(stderr, "got control message of unknown type %d\n",
cmsg->cmsg_type);
return -1;
diff --git a/lib/mount_util.c b/lib/mount_util.c
index 87e3888..589f76d 100644
--- a/lib/mount_util.c
+++ b/lib/mount_util.c
@@ -97,10 +97,12 @@ static int add_mount(const char *progname, const char *fsname,
goto out_restore;
}
if (res == 0) {
+ char *env = NULL;
+
sigprocmask(SIG_SETMASK, &oldmask, NULL);
setuid(geteuid());
- execl("/bin/mount", "/bin/mount", "--no-canonicalize", "-i",
- "-f", "-t", type, "-o", opts, fsname, mnt, NULL);
+ execle("/bin/mount", "/bin/mount", "--no-canonicalize", "-i",
+ "-f", "-t", type, "-o", opts, fsname, mnt, NULL, &env);
fprintf(stderr, "%s: failed to execute /bin/mount: %s\n",
progname, strerror(errno));
exit(1);
@@ -148,10 +150,17 @@ static int exec_umount(const char *progname, const char *rel_mnt, int lazy)
goto out_restore;
}
if (res == 0) {
+ char *env = NULL;
+
sigprocmask(SIG_SETMASK, &oldmask, NULL);
setuid(geteuid());
- execl("/bin/umount", "/bin/umount", "-i", rel_mnt,
- lazy ? "-l" : NULL, NULL);
+ if (lazy) {
+ execle("/bin/umount", "/bin/umount", "-i", rel_mnt,
+ "-l", NULL, &env);
+ } else {
+ execle("/bin/umount", "/bin/umount", "-i", rel_mnt,
+ NULL, &env);
+ }
fprintf(stderr, "%s: failed to execute /bin/umount: %s\n",
progname, strerror(errno));
exit(1);
@@ -207,10 +216,12 @@ static int remove_mount(const char *progname, const char *mnt)
goto out_restore;
}
if (res == 0) {
+ char *env = NULL;
+
sigprocmask(SIG_SETMASK, &oldmask, NULL);
setuid(geteuid());
- execl("/bin/umount", "/bin/umount", "--no-canonicalize", "-i",
- "--fake", mnt, NULL);
+ execle("/bin/umount", "/bin/umount", "--no-canonicalize", "-i",
+ "--fake", mnt, NULL, &env);
fprintf(stderr, "%s: failed to execute /bin/umount: %s\n",
progname, strerror(errno));
exit(1);