Univention Bugzilla – Bug 55620
prepare-new-instance script should enforce Alphanumeric instance naming
Last modified: 2023-01-31 12:11:51 CET
The root cause for Bug #54781: https://forge.univention.org/bugzilla/show_bug.cgi?id=54781 was, that a connector instace had a `-` in the instance name. This case was fixed but the instance name should be validated at create time in the prepare-new-instance script. Only alphanumeric and mabe `_`, `-` should be allowed in the future. Patch: diff --git services/univention-ad-connector/scripts/prepare-new-instance services/univention-ad-connector/scripts/prepare-new-instance index af5d064076..95e062cd86 100644 --- services/univention-ad-connector/scripts/prepare-new-instance +++ services/univention-ad-connector/scripts/prepare-new-instance @@ -108,6 +108,11 @@ then exit 2 fi +if [[ "$CONFIGBASENAME" =~ [^a-zA-Z0-9_-] ]]; then + echo "Error: config base name can only include the following special characters: `_` `-`" + exit 4 +fi + #CONFIGBASENAME should start with "con" to match UCR-info-templates echo "$CONFIGBASENAME" | grep -q \^con if [ "$?" = "1" ]