From daa2fac5b27cee8dca404b03d9cf41c328574ba7 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sun, 12 Jun 2016 10:48:26 -0400 Subject: [PATCH] genfstab: canonicalize root dir Avoids problems with users passing weird inputs (such as including a trailing slash). ref: https://bugs.archlinux.org/task/45753 --- genfstab.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/genfstab.in b/genfstab.in index 053292b..7d3c18b 100644 --- a/genfstab.in +++ b/genfstab.in @@ -119,7 +119,7 @@ done shift $(( OPTIND - 1 )) (( $# )) || die "No root directory specified" -root=$1; shift +root=$(realpath -mL "$1"); shift if ! mountpoint -q "$root"; then die "$root is not a mountpoint"