ui: disallow newlines in usernames (issue1034)
authorMatt Mackall <mpm@selenic.com>
Sat, 22 Mar 2008 13:50:59 -0500
changeset 6351 eed0a6a05096
parent 6350 6aa4a3fa4e60
child 6353 04d615b2d5e9
ui: disallow newlines in usernames (issue1034)
mercurial/ui.py
--- a/mercurial/ui.py	Sat Mar 22 13:30:08 2008 -0500
+++ b/mercurial/ui.py	Sat Mar 22 13:50:59 2008 -0500
@@ -351,6 +351,8 @@
                 pass
         if not user:
             raise util.Abort(_("Please specify a username."))
+        if "\n" in user:
+            raise util.Abort(_("username %s contains a newline\n") % `user`)
         return user
 
     def shortuser(self, user):