comparison sbin/ftjail @ 561:d173161a3a0f

FIX: SC2295: expansions inside ${..} need to be quoted separately, otherwise they will match as a pattern. All our prefixes should be without shell pattern matching (?, *, [ et al.).
author Franz Glasner <fzglas.hg@dom66.de>
date Wed, 11 Sep 2024 18:19:41 +0200
parents 3afebbaf613b
children 17209ce80536
comparison
equal deleted inserted replaced
560:56ae2b21da67 561:d173161a3a0f
423 # Handle only mountpoints that have a mountpoint below 423 # Handle only mountpoints that have a mountpoint below
424 # the parent datasets mountpoint 424 # the parent datasets mountpoint
425 # 425 #
426 426
427 # Determine the mountpoint relative to the parent mountpoint 427 # Determine the mountpoint relative to the parent mountpoint
428 _relative_mp="${_mp#${_rootds_mountpoint}}" 428 _relative_mp="${_mp#"${_rootds_mountpoint}"}"
429 # Eventually remove a trailing slash 429 # Eventually remove a trailing slash
430 _relative_mp="${_relative_mp%/}" 430 _relative_mp="${_relative_mp%/}"
431 # The real effective full mountpoint 431 # The real effective full mountpoint
432 _real_mp="${_mountpoint}${_relative_mp}" 432 _real_mp="${_mountpoint}${_relative_mp}"
433 433
717 | { 717 | {
718 while IFS=$'\t' read -r _name ; do 718 while IFS=$'\t' read -r _name ; do
719 if [ "${_name}" = "${_name%@*}@${_snapshot_name}" ]; then 719 if [ "${_name}" = "${_name%@*}@${_snapshot_name}" ]; then
720 echo "FOUND: $_name" 720 echo "FOUND: $_name"
721 # Determine the relative name of the dataset 721 # Determine the relative name of the dataset
722 _relative_name="${_name#${_ds_source}}" 722 _relative_name="${_name#"${_ds_source}"}"
723 _relative_name="${_relative_name%@*}" 723 _relative_name="${_relative_name%@*}"
724 echo " -> $_relative_name" 724 echo " -> $_relative_name"
725 if [ -z "${_relative_name}" ]; then 725 if [ -z "${_relative_name}" ]; then
726 # 726 #
727 # Root 727 # Root