aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-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
4 files changed, 23 insertions, 8 deletions
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);