From 4810a108e889cf18ee7151d99e63644a2d330d0a Mon Sep 17 00:00:00 2001 From: LOLi Date: Mon, 21 Aug 2017 18:31:54 +0200 Subject: 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 Reviewed-by: Brian Behlendorf Signed-off-by: loli10K Closes #1791 Closes #6429 Closes #6437 --- lib/libzfs/libzfs_mount.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/libzfs') diff --git a/lib/libzfs/libzfs_mount.c b/lib/libzfs/libzfs_mount.c index a66278627..dd1617d64 100644 --- a/lib/libzfs/libzfs_mount.c +++ b/lib/libzfs/libzfs_mount.c @@ -344,8 +344,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, -- cgit v1.2.3