Bug 2150217
Summary: | [RFE] Descriptive error message in ipa user-add | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 8 | Reporter: | Sunny Wu <suwu> |
Component: | ipa | Assignee: | Florence Blanc-Renaud <frenaud> |
Status: | CLOSED ERRATA | QA Contact: | Ganna Kaihorodova <gkaihoro> |
Severity: | low | Docs Contact: | |
Priority: | unspecified | ||
Version: | 8.7 | CC: | ebelko, gkaihoro, rcritten, rjeffman, sumenon, tscherf |
Target Milestone: | rc | Keywords: | FutureFeature, Triaged |
Target Release: | --- | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Fixed In Version: | ipa-4.9.12-2.module+el8.9.0+18921+013c0de2 | Doc Type: | No Doc Update |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2023-11-14 15:32:50 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Sunny Wu
2022-12-02 06:32:06 UTC
Criteria of username changed in https://bugzilla.redhat.com/show_bug.cgi?id=1562396, but the error message has not been updated to reflect the change. The login name must match the following python regexp: '(?!^[0-9]+$)^[a-zA-Z0-9_.][a-zA-Z0-9_.-]*[a-zA-Z0-9_.$-]?$' (from https://pagure.io/freeipa/blob/master/f/ipalib/constants.py PATTERN_GROUPUSER_NAME) This translates into: Cannot contain only numbers Can start with letters numbers _ or . Can contain letters numbers _ . or - Can end with letters numbers _ . $ or - The fix could describe all the rules in the help for "ipa user" + replace the current message with a reference to the help, for instance: # ipa user-add _123@ ipa: ERROR: invalid 'login': refer to ipa help user for valid usernames Currently we have: ----- 8< ----- # ipa help user Users Manage user entries. All users are POSIX users. IPA supports a wide range of username formats, but you need to be aware of any restrictions that may apply to your particular environment. For example, usernames that start with a digit or usernames that exceed a certain length may cause problems for some UNIX systems. ----- 8< ----- Is the same message used in "group_name"? ~~~ # ipa group-add 123 ipa: ERROR: invalid 'group_name': may only include letters, numbers, _, -, . and $ ~~~ (In reply to Sunny Wu from comment #4) > Is the same message used in "group_name"? > > ~~~ > # ipa group-add 123 > ipa: ERROR: invalid 'group_name': may only include letters, numbers, _, -, . > and $ > ~~~ The same pattern check is applied and the same message is used. For users: https://pagure.io/freeipa/blob/2a9919afbd782326580ab52494c917b51023a1c9/f/ipaserver/plugins/baseuser.py#_212-214 Str('uid', pattern=constants.PATTERN_GROUPUSER_NAME, pattern_errmsg='may only include letters, numbers, _, -, . and $', For groups: https://pagure.io/freeipa/blob/2a9919afbd782326580ab52494c917b51023a1c9/f/ipaserver/plugins/group.py#_331-333 Str('cn', pattern=PATTERN_GROUPUSER_NAME, pattern_errmsg='may only include letters, numbers, _, -, . and $', Upstream ticket: https://pagure.io/freeipa/issue/9378 Fixed upstream master: https://pagure.io/freeipa/c/7b0ad59feaf7ad017799c89010a95c2f6f55699d Fixed upstream ipa-4-9: https://pagure.io/freeipa/c/f42a106e84c1fd609350da2540289ce945a7ecbd Fixed upstream ipa-4-10: https://pagure.io/freeipa/c/7830ab96cc295e4151ad3d86cbbaf400a7ab2016 Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (idm:client and idm:DL1 bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2023:6977 |