From ebc8e360d5cc19b1d7cc47095f19456651bb7907 Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Thu, 13 Feb 2020 13:55:59 -0600 Subject: [PATCH] zfs-mount-generator: Fix escaping for / The correct name for the mount unit for / is "-.mount", not ".mount". Reviewed-by: InsanePrawn Reviewed-by: Brian Behlendorf Co-authored-by: Antonio Russo Signed-off-by: Richard Laager Closes #9970 --- etc/systemd/system-generators/zfs-mount-generator.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/systemd/system-generators/zfs-mount-generator.in b/etc/systemd/system-generators/zfs-mount-generator.in index 066896009e..b79ce5482e 100755 --- a/etc/systemd/system-generators/zfs-mount-generator.in +++ b/etc/systemd/system-generators/zfs-mount-generator.in @@ -156,7 +156,7 @@ ExecStop=@sbindir@/zfs unload-key '${dataset}'" > "${dest_norm}/${keyloadunit} fi # Escape the mountpoint per systemd policy. - mountfile="$(systemd-escape "${p_mountpoint#?}").mount" + mountfile="$(systemd-escape --path --suffix=mount "${p_mountpoint}")" # Parse options # see lib/libzfs/libzfs_mount.c:zfs_add_options