]> granicus.if.org Git - zfs/commitdiff
Quote snapshot and mountpoint for .zfs automount
authorBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 17 Oct 2012 20:23:09 +0000 (13:23 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 17 Oct 2012 20:26:18 +0000 (13:26 -0700)
When automounting a snapshot in the .zfs/snapshot directory
make sure to quote both the dataset name and the mount point.
This ensures that if either component contains spaces, which
are allowed, they get handled correctly.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1027

module/zfs/zfs_ctldir.c

index 41d336564ebd20b6bfbe2d41ca4f30cf7a9e2dba..d139b86136b2da54d2655f33e9a9cf0e1517d1b6 100644 (file)
@@ -681,7 +681,7 @@ zfsctl_snapdir_inactive(struct inode *ip)
        "exec 0</dev/null " \
        "     1>/dev/null " \
        "     2>/dev/null; " \
-       "umount -t zfs -n %s%s"
+       "umount -t zfs -n '%s%s'"
 
 static int
 __zfsctl_unmount_snapshot(zfs_snapentry_t *sep, int flags)
@@ -781,7 +781,7 @@ zfsctl_unmount_snapshots(zfs_sb_t *zsb, int flags, int *count)
        "exec 0</dev/null " \
        "     1>/dev/null " \
        "     2>/dev/null; " \
-       "mount -t zfs -n %s %s"
+       "mount -t zfs -n '%s' '%s'"
 
 int
 zfsctl_mount_snapshot(struct path *path, int flags)