projects
/
qemu-gpiodev
/
libfuse.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1b7d2b8
)
fusermount: drop privileges for chdir()
author
Sam Huffman
<40582525+samh-sifive@users.noreply.github.com>
Fri, 8 Mar 2019 21:26:31 +0000
(13:26 -0800)
committer
Nikolaus Rath
<Nikolaus@rath.org>
Fri, 8 Mar 2019 21:26:31 +0000
(21:26 +0000)
cd to mountpoint's parent directory using unprivileged rather than
privileged access. This is to ensure that unmount works on mountpoints
where root may not have privileged access.
Fixes: #376
util/fusermount.c
patch
|
blob
|
history
diff --git
a/util/fusermount.c
b/util/fusermount.c
index e6ac792ec02d86feec662be304a06f9e0cf57e94..3f13e4235ccd94a37440b9a94a717588ea4f427c 100644
(file)
--- a/
util/fusermount.c
+++ b/
util/fusermount.c
@@
-428,7
+428,9
@@
static int unmount_fuse_locked(const char *mnt, int quiet, int lazy)
return -1;
}
+ drop_privs();
res = chdir_to_parent(copy, &last);
+ restore_privs();
if (res == -1)
goto out;