aboutsummaryrefslogtreecommitdiffstats
path: root/testing/fuse3/fix-realpath.patch
blob: 375bedc961ca4f4a957aef33d2165bdc4e6c1856 (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
--- fuse-3.1.0.orig/util/fusermount.c
+++ fuse-3.1.0/util/fusermount.c
@@ -1200,19 +1200,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);
-			goto err_out;
-		}
-	}
-	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;