genfstab: canonicalize root dir

Avoids problems with users passing weird inputs (such as including a
trailing slash).

ref: https://bugs.archlinux.org/task/45753
This commit is contained in:
Dave Reisner 2016-06-12 10:48:26 -04:00
parent 585b1f790f
commit daa2fac5b2

View File

@ -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"