|
|
e34c53 |
--- ntfs-3g_ntfsprogs-2015.3.14/libfuse-lite/mount_util.c.ref 2015-03-14 15:10:12.000000000 +0100
|
|
|
e34c53 |
+++ ntfs-3g_ntfsprogs-2015.3.14/libfuse-lite/mount_util.c 2015-05-18 11:02:50.330654300 +0200
|
|
|
e34c53 |
@@ -66,6 +66,7 @@
|
|
|
e34c53 |
return -1;
|
|
|
e34c53 |
}
|
|
|
e34c53 |
if (res == 0) {
|
|
|
e34c53 |
+ char *env = NULL;
|
|
|
e34c53 |
char templ[] = "/tmp/fusermountXXXXXX";
|
|
|
e34c53 |
char *tmp;
|
|
|
e34c53 |
|
|
|
e34c53 |
@@ -87,8 +88,8 @@
|
|
|
e34c53 |
exit(1);
|
|
|
e34c53 |
}
|
|
|
e34c53 |
rmdir(tmp);
|
|
|
e34c53 |
- execl("/sbin/mount", "/sbin/mount", "-F", type, "-o", opts,
|
|
|
e34c53 |
- fsname, mnt, NULL);
|
|
|
e34c53 |
+ execle("/sbin/mount", "/sbin/mount", "-F", type, "-o", opts,
|
|
|
e34c53 |
+ fsname, mnt, NULL, &env;;
|
|
|
e34c53 |
fprintf(stderr, "%s: failed to execute /sbin/mount: %s\n", progname,
|
|
|
e34c53 |
strerror(errno));
|
|
|
e34c53 |
exit(1);
|
|
|
e34c53 |
@@ -120,9 +121,16 @@
|
|
|
e34c53 |
return -1;
|
|
|
e34c53 |
}
|
|
|
e34c53 |
if (res == 0) {
|
|
|
e34c53 |
+ char *env = NULL;
|
|
|
e34c53 |
+
|
|
|
e34c53 |
setuid(geteuid());
|
|
|
e34c53 |
- execl("/sbin/umount", "/sbin/umount", !lazy ? "-f" : NULL, mnt,
|
|
|
e34c53 |
- NULL);
|
|
|
e34c53 |
+ if (lazy) {
|
|
|
e34c53 |
+ execle("/sbin/umount", "/sbin/umount", mnt,
|
|
|
e34c53 |
+ NULL, &env;;
|
|
|
e34c53 |
+ } else {
|
|
|
e34c53 |
+ execle("/sbin/umount", "/sbin/umount", "-f", mnt,
|
|
|
e34c53 |
+ NULL, &env;;
|
|
|
e34c53 |
+ }
|
|
|
e34c53 |
fprintf(stderr, "%s: failed to execute /sbin/umount: %s\n", progname,
|
|
|
e34c53 |
strerror(errno));
|
|
|
e34c53 |
exit(1);
|
|
|
e34c53 |
@@ -302,6 +310,7 @@
|
|
|
e34c53 |
return 0;
|
|
|
e34c53 |
}
|
|
|
e34c53 |
if (res == 0) {
|
|
|
e34c53 |
+ char *env = NULL;
|
|
|
e34c53 |
char templ[] = "/tmp/fusermountXXXXXX";
|
|
|
e34c53 |
char *tmp;
|
|
|
e34c53 |
|
|
|
e34c53 |
@@ -325,8 +334,8 @@
|
|
|
e34c53 |
exit(1);
|
|
|
e34c53 |
}
|
|
|
e34c53 |
rmdir(tmp);
|
|
|
e34c53 |
- execl("/bin/mount", "/bin/mount", "-i", "-f", "-t", type, "-o", opts,
|
|
|
e34c53 |
- fsname, mnt, NULL);
|
|
|
e34c53 |
+ execle("/bin/mount", "/bin/mount", "-i", "-f", "-t", type, "-o", opts,
|
|
|
e34c53 |
+ fsname, mnt, NULL, &env;;
|
|
|
e34c53 |
fprintf(stderr, "%s: failed to execute /bin/mount: %s\n", progname,
|
|
|
e34c53 |
strerror(errno));
|
|
|
e34c53 |
exit(1);
|
|
|
e34c53 |
@@ -353,11 +362,18 @@
|
|
|
e34c53 |
return -1;
|
|
|
e34c53 |
}
|
|
|
e34c53 |
if (res == 0) {
|
|
|
e34c53 |
+ char *env = NULL;
|
|
|
e34c53 |
+
|
|
|
e34c53 |
if (setuid(geteuid()))
|
|
|
e34c53 |
fprintf(stderr, "%s: failed to setuid : %s\n", progname,
|
|
|
e34c53 |
strerror(errno));
|
|
|
e34c53 |
- execl("/bin/umount", "/bin/umount", "-i", mnt, lazy ? "-l" : NULL,
|
|
|
e34c53 |
- NULL);
|
|
|
e34c53 |
+ if (lazy) {
|
|
|
e34c53 |
+ execle("/bin/umount", "/bin/umount", "-i", mnt, "-l",
|
|
|
e34c53 |
+ NULL, &env;;
|
|
|
e34c53 |
+ } else {
|
|
|
e34c53 |
+ execle("/bin/umount", "/bin/umount", "-i", mnt,
|
|
|
e34c53 |
+ NULL, &env;;
|
|
|
e34c53 |
+ }
|
|
|
e34c53 |
fprintf(stderr, "%s: failed to execute /bin/umount: %s\n", progname,
|
|
|
e34c53 |
strerror(errno));
|
|
|
e34c53 |
exit(1);
|