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

David Shea dshea at redhat.com
Wed Sep 18 18:21:59 UTC 2013


---
 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



More information about the anaconda-patches mailing list