summaryrefslogtreecommitdiff
path: root/repo/fuse/fix-realpath.patch
blob: 00991735c7770d0cbaf577b403e000f62286c7e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--- a/util/fusermount.c
+++ B/util/fusermount.c
@@ -1322,19 +1322,16 @@
 
 	origmnt = argv[optind];
 
-	drop_privs();
 	mnt = fuse_mnt_resolve_path(progname, origmnt);
-	if (mnt != NULL) {
-		res = chdir("/");
-		if (res == -1) {
-			fprintf(stderr, "%s: failed to chdir to '/'\n", progname);
-			exit(1);
-		}
-	}
-	restore_privs();
 	if (mnt == NULL)
 		exit(1);
 
+	res = chdir("/");
+	if (res == -1) {
+		fprintf(stderr, "%s: failed to chdir to '/'\n", progname);
+		exit(1);
+	}
+
 	umask(033);
 	if (unmount)
 		goto do_unmount;