[PATCH] Forbid "root" as a user or group name. (#968451)
Brian C. Lane
bcl at redhat.com
Fri Sep 20 23:50:24 UTC 2013
On Fri, Sep 20, 2013 at 09:13:06AM -0400, David Shea wrote:
> On 09/18/2013 04:15 PM, David Shea wrote:
> >+_USERNAME_BASE = r'[a-zA-Z0-9._](([a-zA-Z0-9._-]{1,2})|([a-zA-Z0-9._-]{3}(?<!root))|([a-zA-Z0-9._-]{,30}\$)|([a-zA-Z0-9._-]{4,31}))?'
> So, looking at this thing, I think it'd be slightly better to
> rearrange the choices in the part of the expression after the first
> character.
>
> _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}\$))'
>
>
> That way it reads as an expression matching 0-2 characters, an
> expression matching 3 characters that isn't "root", an expression
> matching 4-31 characters, or an expression matching 0-30 characters
> followed by a dollar sign. It reads a little better (lol), and
> having the empty string matched by the first part means we don't
> need the question mark at the end.
I guess if that works... But I'd be more inclined to just add a separate
check wherever we use it.
--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 482 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/anaconda-patches/attachments/20130920/e0e8d12f/attachment.sig>
More information about the anaconda-patches
mailing list