Bug 15561 - keine UCR keys mit : (Doppelpunkt) möglich, was IPv6 static hosts verhindert
keine UCR keys mit : (Doppelpunkt) möglich, was IPv6 static hosts verhindert
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UCR
UCS 2.3
Other Linux
: P5 normal (vote)
: UCS 2.3-1
Assigned To: Andreas Büsching
Tim Petersen
:
Depends on:
Blocks: 14697 17387
  Show dependency treegraph
 
Reported: 2009-09-02 16:27 CEST by Kai Bolte
Modified: 2010-02-18 14:36 CET (History)
2 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kai Bolte 2009-09-02 16:27:57 CEST
Das Anlegen eines UCR keys für einen IPv6 static host schlägt wegen des Doppelpunkts fehl:

# ucr set hosts/static/2001:db8:100::2=2m6
Please fix invalid char ":" in config registry key "hosts/static/2001:db8:100::2"
Not setting hosts/static/2001:db8:100::2
#
Comment 1 Kai Bolte 2009-09-02 16:37:19 CEST
Man kann den entsprechenden hosts-Eintrag natürlich am Ende der Datei

/etc/univention/templates/files/etc/hosts.d/00-base

anfügen.
Comment 2 Daniel Hofmann univentionstaff 2009-11-10 16:13:14 CET
History der Ausschluss-regex für Keys:

r11783: (#14565) Newlines verboten (seither unverändert)
re.compile ('[\\r\\n\!\"\§\$\%\&\(\)\[\]\{\}\=\?\`\+\#\'\,\;\:\<\>\\\]')

r7521: (#12501) Punkt erlaubt
re.compile('[\!\"\§\$\%\&\(\)\[\]\{\}\=\?\`\+\#\'\,\;\:\<\>\\\]');

r4672: - und _ doch wieder erlauben
re.compile('[\!\"\§\$\%\&\(\)\[\]\{\}\=\?\`\+\#\'\,\;\.\:\<\>\\\]');

r4670: - und _ verbieten
re.compile('[\!\"\§\$\%\&\(\)\[\]\{\}\=\?\`\+\#\'\,\;\.\:\<\>\-\_\\\]');

r321: Encoding fixes
re.compile('[\!\"\§\$\%\&\(\)\[\]\{\}\=\?\`\+\#\'\,\;\.\:\<\>\\\]');

r3: import aus cvs
re.compile('[\!\"\<A7>\$\%\&\(\)\[\]\{\}\=\?\`\+\#\'\,\;\.\:\<\>\\\]');

Hieraus schonmal keine Begründung ablesbar, warum ':' nicht erlaubt.

Seit r11766 wird das Shellescaping für das Umwandeln von ucr-keys in shell-variablennamen per character-whitelisting gemacht. In der zuvor verwendeten Version war der Doppelpunkt nicht geblacklistet, d.h. die Blacklist hat sich wohl darauf verlassen, dass Doppelpunkte ohnehin nicht in Keys sein können.
Das wiederum legt die Vermutung nahe, dass das großzügige generelle blacklisten anfangs wohl schon im Hinblick auf Shellabbildbarkeit der Keys eingeführt wurde und es keinen weiteren Grund gibt, warum ':' momentan verboten ist: 

-def shellEscape(line):
-       escapes = { '/': '_',
-                   '-': '_',
-                   '@':'_',
-                   '.':'_',
-                   '*':'\*',
-                   ' ': '_', }
-       return replaceDict(line, escapes)
+def keyShellEscape(line):
+       if not line:
+               raise Exception ('got empty line')
+       new_line = []
+       if line[0] in string.digits:
+               new_line.append ('_')
+       for letter in line:
+               if letter in shell_valid_chars:
+                       new_line.append (letter)
+               else:
+                       new_line.append ('_')
+       return ''.join (new_line)
Comment 3 Daniel Hofmann univentionstaff 2009-11-10 16:19:09 CET
Da ein Zeichen erlaubt werden soll, und nicht verboten, sollte es auch keine Probleme mit bestehenden Keys geben.

Warte trotzdem noch auf grünes Licht.
Comment 4 Stefan Gohmann univentionstaff 2009-11-11 11:38:35 CET
Das sollte nicht mehr zur 2.3 gemacht werden.
Comment 5 Andreas Büsching univentionstaff 2009-12-29 15:10:22 CET
Doppelpunkte sind jetzt erlaubt. ChangeLog-Eintrag ist hinzugefügt
Comment 6 Tim Petersen univentionstaff 2010-01-14 10:50:20 CET
~$ ucr set hosts/static/foo:foo:bar=22:44:33
Create hosts/static/foo:foo:bar
Multifile: /etc/hosts
~$ ucr get hosts/static/foo:foo:bar 
22:44:33
~$ 

Changelogeintrag für 2.3-1 vorhanden - verified
Comment 7 Arvid Requate univentionstaff 2010-02-18 14:32:57 CET
UCS 2.3-1 wurde veröffentlicht. Sollte der hier beschriebene Bug mit einer
neueren Version von UCS erneut auftreten, so sollte der Bug dupliziert werden:
"Clone This Bug".