mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Use constant for user and group patterns
User and groups regexp are the same and constant should be used to avoid any future misconfigurations. https://fedorahosted.org/freeipa/ticket/5822 Reviewed-By: Stanislav Laznicka <slaznick@redhat.com> Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
committed by
Martin Babinsky
parent
3720080611
commit
8f8e3d008f
@@ -29,7 +29,11 @@ from .baseldap import (LDAPQuery, LDAPObject, LDAPCreate,
|
||||
from .hostgroup import get_complete_hostgroup_member_list
|
||||
from .service import validate_certificate
|
||||
from ipalib import api, Str, Int, Bytes, Flag, _, ngettext, errors, output
|
||||
from ipalib.constants import IPA_ANCHOR_PREFIX, SID_ANCHOR_PREFIX
|
||||
from ipalib.constants import (
|
||||
IPA_ANCHOR_PREFIX,
|
||||
SID_ANCHOR_PREFIX,
|
||||
PATTERN_GROUPUSER_NAME,
|
||||
)
|
||||
from ipalib.plugable import Registry
|
||||
from ipalib.util import (normalize_sshpubkey, validate_sshpubkey,
|
||||
convert_sshpubkey_post)
|
||||
@@ -841,7 +845,7 @@ class idoverrideuser(baseidoverride):
|
||||
|
||||
takes_params = baseidoverride.takes_params + (
|
||||
Str('uid?',
|
||||
pattern='^[a-zA-Z0-9_.][a-zA-Z0-9_.-]*[a-zA-Z0-9_.$-]?$',
|
||||
pattern=PATTERN_GROUPUSER_NAME,
|
||||
pattern_errmsg='may only include letters, numbers, _, -, . and $',
|
||||
maxlength=255,
|
||||
cli_name='login',
|
||||
@@ -944,7 +948,7 @@ class idoverridegroup(baseidoverride):
|
||||
|
||||
takes_params = baseidoverride.takes_params + (
|
||||
Str('cn?',
|
||||
pattern='^[a-zA-Z0-9_.][a-zA-Z0-9_.-]*[a-zA-Z0-9_.$-]?$',
|
||||
pattern=PATTERN_GROUPUSER_NAME,
|
||||
pattern_errmsg='may only include letters, numbers, _, -, . and $',
|
||||
maxlength=255,
|
||||
cli_name='group_name',
|
||||
|
||||
Reference in New Issue
Block a user