[PATCH] Revert "Fix up username checking regex a bit."

Samantha N. Bueno sbueno+anaconda at redhat.com
Tue Jan 28 20:05:12 UTC 2014


Ack.

On Tue, Jan 28, 2014 at 02:58:24PM -0500, David Shea wrote:
> This re-enables usernames with capital-letters. I'm not saying they're a
> good idea, but there's nothing that says you can't, and
> system-config-users and adduser both allow them.
> 
> This reverts commit 2a8208c97e35f8287912a86bc593fe27b36a5e92.
> ---
>  pyanaconda/regexes.py              | 2 +-
>  tests/regex_tests/username_test.py | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/pyanaconda/regexes.py b/pyanaconda/regexes.py
> index 79136f9..5d8fd9b 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-z0-9._](([a-z0-9._-]{0,2})|([a-z0-9._-]{3}(?<!root))|([a-z0-9._-]{4,31})|([a-z0-9._-]{,30}\$))'
> +_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_VALID = re.compile(r'^' + _USERNAME_BASE + '$')
>  GROUPNAME_VALID = USERNAME_VALID
> diff --git a/tests/regex_tests/username_test.py b/tests/regex_tests/username_test.py
> index 7195788..0c0d5d2 100644
> --- a/tests/regex_tests/username_test.py
> +++ b/tests/regex_tests/username_test.py
> @@ -65,6 +65,7 @@ class UsernameRegexTestCase(unittest.TestCase):
>          """Test a list of possible username values."""
>          good_tests = [
>                  'gburdell',
> +                'GBurdell',
>                  'gburdell$',
>                  'g_burdell',
>                  '_burdell',
> @@ -89,7 +90,6 @@ class UsernameRegexTestCase(unittest.TestCase):
>                  ' gburdell',
>                  ':gburdell',
>                  'root',
> -                'GBurdell',
>                  '$',
>                  '-'
>                  ]
> -- 
> 1.8.5.3
> 
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches


More information about the anaconda-patches mailing list