[PATCH] Check the validity of generated usernames in TUI (#965543)

Brian C. Lane bcl at redhat.com
Wed Sep 18 19:07:40 UTC 2013


On Wed, Sep 18, 2013 at 02:21:59PM -0400, David Shea wrote:
> ---
>  pyanaconda/ui/tui/spokes/user.py | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/pyanaconda/ui/tui/spokes/user.py b/pyanaconda/ui/tui/spokes/user.py
> index 6185f80..6ece776 100644
> --- a/pyanaconda/ui/tui/spokes/user.py
> +++ b/pyanaconda/ui/tui/spokes/user.py
> @@ -108,7 +108,9 @@ class UserSpoke(FirstbootSpokeMixIn, EditTUISpoke):
>  
>      def apply(self):
>          if self.args.gecos and not self.args.name:
> -            self.args.name = guess_username(self.args.gecos)
> +            username = guess_username(self.args.gecos)
> +            if USERNAME_VALID.match(username):
> +                self.args.name = guess_username(self.args.gecos)
>  
>          self.args.groups = [g.strip() for g in self.args._groups.split(",") if g]
>  
> -- 
> 1.8.3.1

Ack

-- 
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/20130918/16966e60/attachment.sig>


More information about the anaconda-patches mailing list