Bug 33656 - UDM syntax for group names does not allow german umlauts
UDM syntax for group names does not allow german umlauts
Status: CLOSED WORKSFORME
Product: UCS
Classification: Unclassified
Component: UDM - CLI
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 3.2-x
Assigned To: UMC maintainers
:
: 11503 18476 24746 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-12-04 17:42 CET by Arvid Requate
Modified: 2022-03-25 10:30 CET (History)
9 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 Arvid Requate univentionstaff 2013-12-04 17:42:29 CET
The current UDM syntax for group names does not allow german umlaut characters.

So it's currently impossible to use UDM cli to rename a group to a name with these chracters. It's possible via UMC since UMC-modules-udm does not use the syntax.py.
Comment 1 Stefan Gohmann univentionstaff 2013-12-04 21:48:14 CET
(In reply to Arvid Requate from comment #0)
> It's possible via UMC since UMC-modules-udm does not use the syntax.py.

What does UMC-modules-umc use?
Comment 2 Alexander Kläser univentionstaff 2013-12-05 13:44:11 CET
(In reply to Stefan Gohmann from comment #1)
> (In reply to Arvid Requate from comment #0)
> > It's possible via UMC since UMC-modules-udm does not use the syntax.py.
> 
> What does UMC-modules-umc use?

Well, in both cases the syntax classes are evaluated! Either this could be an encoding problem or this might be an issue with the used local in combination with regular expressions, i.e., in en_US, umlauts are not considered to match \w.
Comment 3 Florian Best univentionstaff 2013-12-05 15:09:25 CET
To check if it is an encoding problem:
if the syntax class gets a str object instead of unicode it will fail if the string is UTF-8 encoded:

>>> auml_utf8 = u'ä'.encode('UTF-8')
>>> regex = import re; re.compile( '(?u)^\w([\w -.]*\w)?$' ) # RE of gid syntax
>>> regex.match(auml_utf8) is None
True
Comment 4 Philipp Hahn univentionstaff 2017-03-29 10:04:25 CEST
*** Bug 18476 has been marked as a duplicate of this bug. ***
Comment 5 Philipp Hahn univentionstaff 2017-03-29 10:04:56 CEST
*** Bug 24746 has been marked as a duplicate of this bug. ***
Comment 6 Philipp Hahn univentionstaff 2017-03-29 10:08:26 CEST
*** Bug 11503 has been marked as a duplicate of this bug. ***
Comment 7 Frank Greif 2019-11-11 17:35:15 CET
Currently (4.4.1.239) the regexp of class 'gid' is somewhat weird:

1334         regex = re.compile(ur"(?u)^\w([\w -.’]*\w)?$")

The bracketed character class would match (left to right):

* anything deemed a 'word character' in Unicode
* the range of characters between 0x20 (space) and 0x2E (dot)
* the Unicode char with codepoint U+2019 (right single quotation mark)

I'd propose to change:

* position the minus at the right end (so it can't be misunderstood as a range)
* remove the spurious U+2019 char

This would not solve this bug, but at least it would make the regexp really match what the description says.
Comment 8 Ingo Steuwer univentionstaff 2020-07-03 20:52:37 CEST
This issue has been filed against UCS 4.2.

UCS 4.2 is out of maintenance and many UCS components have changed in later releases. Thus, this issue is now being closed.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or reopen it and update the UCS version. In this case please provide detailed information on how this issue is affecting you.
Comment 9 Florian Best univentionstaff 2022-03-25 10:18:56 CET

*** This bug has been marked as a duplicate of bug 54589 ***
Comment 10 Florian Best univentionstaff 2022-03-25 10:30:54 CET
UCS 4.4:

# udm groups/group create --set name='foobär'
E: Invalid Syntax: Name: A group name must start and end with a letter, number or underscore. In between additionally spaces, dashes and dots are allowed.

# udm groups/group create --set name='foobär'
WARNING: The object is not going to be created underneath of its default containers.
Object created: cn=foobär,l=school,l=dev


→ The Python 3 migration fixed it. See comment #3.