aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLOLi <[email protected]>2017-08-21 18:31:54 +0200
committerBrian Behlendorf <[email protected]>2017-08-21 09:31:54 -0700
commit9000a9fac950d2e2c9578d760dd775ac1ceaa507 (patch)
tree7de56a7f652c3e1baa7a505db4d8bd89a411688e /lib
parentf763c3d1df569a8d6b60bcb5e95cf07aa7a189e6 (diff)
Disable mount(8) canonical paths in do_mount()
By default the mount(8) command, as invoked by 'zfs mount', will try to resolve any path parameter in its canonical form: this could lead to mount failures when the cwd contains a symlink having the same name of the dataset being mounted. Fix this by explicitly disabling mount(8) path canonicalization. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: loli10K <[email protected]> Closes #1791 Closes #6429 Closes #6437
Diffstat (limited to 'lib')
-rw-r--r--lib/libzfs/libzfs_mount.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libzfs/libzfs_mount.c b/lib/libzfs/libzfs_mount.c
index 57f363f2a..b2d082e17 100644
--- a/lib/libzfs/libzfs_mount.c
+++ b/lib/libzfs/libzfs_mount.c
@@ -345,8 +345,9 @@ zfs_is_mountable(zfs_handle_t *zhp, char *buf, size_t buflen,
static int
do_mount(const char *src, const char *mntpt, char *opts)
{
- char *argv[8] = {
+ char *argv[9] = {
"/bin/mount",
+ "--no-canonicalize",
"-t", MNTTYPE_ZFS,
"-o", opts,
(char *)src,