[PATCH] Do not allow 'root' as a user name (#1032671)
Vratislav Podzimek
vpodzime at redhat.com
Tue Jan 7 13:56:07 UTC 2014
On Mon, 2014-01-06 at 16:37 -0500, Chris Lumens wrote:
> > diff --git a/pyanaconda/ui/gui/spokes/user.py b/pyanaconda/ui/gui/spokes/user.py
> > index d2abbaa..5686eff 100644
> > --- a/pyanaconda/ui/gui/spokes/user.py
> > +++ b/pyanaconda/ui/gui/spokes/user.py
> > @@ -22,7 +22,7 @@
> > from gi.repository import Gtk
> >
> > from pyanaconda.i18n import _, N_
> > -from pyanaconda.users import cryptPassword, validatePassword, guess_username
> > +from pyanaconda.users import cryptPassword, validatePassword, guess_username, USERNAME_VALID
> > from pwquality import PWQError
> >
> > from pyanaconda.ui.gui.spokes import NormalSpoke
> > @@ -461,12 +461,19 @@ class UserSpoke(FirstbootSpokeMixIn, NormalSpoke):
> > self.admin.set_active(self._wheel.name in self._user.groups)
> >
> > def on_back_clicked(self, button):
> > + username = self.username.get_text()
> > + # if an invalid username was given, that's the biggest issue
> > + if username and not USERNAME_VALID.match(username):
> > + self.clear_info()
> > + self.set_warning(_("Invalid username given"))
>
> Can we still do new strings in RHEL7? Anyway, the string on master is
> "Invalid username" so it'd probably be best to take that one. Then at
> the worst, we can pull the translations over manually.
I was told that adding string shouldn't be a problem. We just need to
make translators know about it.
So if the patch looks good otherwise, I'll push it with the change of
the string to match the master branch's version.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
More information about the anaconda-patches
mailing list