Skip to content

Commit

Permalink
Quote snapshot and mountpoint for .zfs automount
Browse files Browse the repository at this point in the history
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 openzfs#1027
  • Loading branch information
behlendorf authored and unya committed Dec 13, 2013
1 parent da2b549 commit ea0fb70
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions module/zfs/zfs_ctldir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit ea0fb70

Please sign in to comment.