Bug 55620 - prepare-new-instance script should enforce Alphanumeric instance naming
prepare-new-instance script should enforce Alphanumeric instance naming
Status: NEW
Product: UCS
Classification: Unclassified
Component: AD Connector
UCS 4.4
Other Linux
: P5 normal (vote)
: ---
Assigned To: Samba maintainers
Samba maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2023-01-31 12:11 CET by Johannes Lohmer
Modified: 2023-01-31 12:11 CET (History)
0 users

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 4: Minor Usability: Impairs usability in secondary scenarios
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.069
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): bitesize
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Lohmer univentionstaff 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" ]