#9378 [RFE] Descriptive error message in ipa user-add
Closed: fixed by frenaud. Opened by frenaud.

Ticket was cloned from Red Hat Bugzilla (product Red Hat Enterprise Linux 8): Bug 2150217

Description of problem:
Run "ipa user-add" to add a username without a letter.
The error message is not very descriptive. In below examples, all input strings meet the requirements specified in error message. i.e. The strings contains numbers, -, _, . and/or $. (letter is absence in all provided strings).
The error message should clear indicates that username must contain at least a letter.
# ipa user-add '$_-1234567' --first=User --last=Last
ipa: ERROR: invalid 'login': may only include letters, numbers, _, -, . and $
# ipa user-add '$_1234567' --first=User --last=Last
ipa: ERROR: invalid 'login': may only include letters, numbers, _, -, . and $
# ipa user-add '$1234567' --first=User --last=Last
ipa: ERROR: invalid 'login': may only include letters, numbers, _, -, . and $
# ipa user-add '1234567' --first=User --last=Last
ipa: ERROR: invalid 'login': may only include letters, numbers, _, -, . and $
# ipa user-add '$_1234567.' --first=User --last=Last
ipa: ERROR: invalid 'login': may only include letters, numbers, _, -, . and $
Version-Release number of selected component (if applicable):
ipa-client-4.9.8-8.module+el8.6.0+16878+6c033536.x86_64
ipa-client-common-4.9.8-8.module+el8.6.0+16878+6c033536.noarch
ipa-common-4.9.8-8.module+el8.6.0+16878+6c033536.noarch
ipa-healthcheck-0.7-10.module+el8.6.0+14292+18b36d36.noarch
ipa-healthcheck-core-0.7-10.module+el8.6.0+14292+18b36d36.noarch
ipa-selinux-4.9.8-8.module+el8.6.0+16878+6c033536.noarch
ipa-server-4.9.8-8.module+el8.6.0+16878+6c033536.x86_64
ipa-server-common-4.9.8-8.module+el8.6.0+16878+6c033536.noarch
ipa-server-dns-4.9.8-8.module+el8.6.0+16878+6c033536.noarch
ipa-server-trust-ad-4.9.8-8.module+el8.6.0+16878+6c033536.x86_64

Metadata Update from @frenaud:
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=2150217

Issue linked to bug 2150217

Metadata Update from @frenaud:
- Issue assigned to frenaud

Metadata Update from @frenaud:
- Custom field on_review adjusted to https://github.com/freeipa/freeipa/pull/6829

master:

  • 7b0ad59feaf7ad017799c89010a95c2f6f55699d user or group name: explain the supported format

ipa-4-9:

  • f42a106e84c1fd609350da2540289ce945a7ecbd user or group name: explain the supported format

ipa-4-10:

  • 7830ab96cc295e4151ad3d86cbbaf400a7ab2016 user or group name: explain the supported format

Metadata Update from @frenaud:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

master:

  • 4a3e3efb84cee9e3784246f3bc47f1f56b266bc0 test: add tests for descriptive error message in ipa user-add

ipa-4-10:

  • 3bacdf248adadb6acece6061e935ec7104a69914 test: add tests for descriptive error message in ipa user-add

ipa-4-9:

  • 4d55ee3033641c772c2a8cc8625f7b133ab8416b test: add tests for descriptive error message in ipa user-add

Metadata Update from @abbra:
- Custom field changelog adjusted to The commands ipa user-add or ipa group-add validate the format of the user/group name and display an error message. In this release, the message is expanded for better clarity.

Metadata