diff --git a/core/base.module.sh b/core/base.module.sh index 4aacf72..9c89e94 100755 --- a/core/base.module.sh +++ b/core/base.module.sh @@ -194,7 +194,7 @@ function prepare.setREGEX() { REGEX[COMMAND]='^([]a-zA-Z0-9[|/_:,." -]+)$' #WARNING: Escaping does not work properly here, so we need to position the special characters in a clever way. REGEX[COMPOSITION]='^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$' REGEX[DOMAIN]='^([a-zA-Z][a-zA-Z0-9\.-]*)?[a-zA-Z]{2,}$' - REGEX[FULLDIRPATH]='^/([a-zA-Z0-9\._-]+/)*$' + REGEX[DIRPATH]='/([a-zA-Z0-9._-]+/)*' REGEX[SNAPSHOT]='^@[a-zA-Z]([a-zA-Z0-9\.:_-]*[a-zA-Z0-9])?$' REGEX[SYNCSNAPSHOT]='^@SYNC_[a-zA-Z0-9\.:_-]*[a-zA-Z0-9]$' REGEX[USER]='^[a-zA-Z]([-a-zA-Z0-9\._]*[a-zA-Z0-9])?$' diff --git a/module/composition.module.sh b/module/composition.module.sh index fcb87d9..6122b50 100755 --- a/module/composition.module.sh +++ b/module/composition.module.sh @@ -102,7 +102,7 @@ function composition.start() { _COMPOSITION_HOME_FILE="${CIS[COMPOSITIONS]:?"Missing CIS_COMPOSITIONS"}${_COMPOSITION}/home" # The regex should ensure a path starts and ends with a '/' and it should limit the allowed set of characters - base.set _COMPOSITION_HOME "$(head -n 1 "${_COMPOSITION_HOME_FILE}" 2> /dev/null)" "${REGEX[FULLDIRPATH]}" optional + base.set _COMPOSITION_HOME "$(head -n 1 "${_COMPOSITION_HOME_FILE}" 2> /dev/null)" "${REGEX[DIRPATH]}" optional readonly _COMPOSITION _COMPOSITION_FILE_BACKUP _COMPOSITION_HOME _COMPOSITION_HOME_FILE local _COMPOSITION_FILE