[PATCH 1/2] Fix up username checking regex a bit.
Vratislav Podzimek
vpodzime at redhat.com
Fri Dec 13 14:36:57 UTC 2013
On Fri, 2013-12-13 at 09:12 -0500, Samantha N. Bueno wrote:
> Users shouldn't be able to create usernames with capital letters.
> ---
> pyanaconda/regexes.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/pyanaconda/regexes.py b/pyanaconda/regexes.py
> index 5d8fd9b..79136f9 100644
> --- a/pyanaconda/regexes.py
> +++ b/pyanaconda/regexes.py
> @@ -44,7 +44,7 @@ GECOS_VALID = re.compile(r'^[^:]*$')
> # a base expression without anchors, helpful for building other expressions
> # If the string is the right length to match "root", use a lookback expression
> # to make sure it isn't.
> -_USERNAME_BASE = r'[a-zA-Z0-9._](([a-zA-Z0-9._-]{0,2})|([a-zA-Z0-9._-]{3}(?<!root))|([a-zA-Z0-9._-]{4,31})|([a-zA-Z0-9._-]{,30}\$))'
> +_USERNAME_BASE = r'[a-z0-9._](([a-z0-9._-]{0,2})|([a-z0-9._-]{3}(?<!root))|([a-z0-9._-]{4,31})|([a-z0-9._-]{,30}\$))'
Adding/modifying test would be nice.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
More information about the anaconda-patches
mailing list