backend/common/rhnException.py | 2 ++
backend/server/handlers/xmlrpc/registration.py | 5 +++++
2 files changed, 7 insertions(+)
New commits:
commit b2d16d3b7e195e11a53a97b3383480f5011f63af
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Oct 7 16:25:40 2011 +0200
433325 - do not allow to register system with profile name less then 3 characters
diff --git a/backend/common/rhnException.py b/backend/common/rhnException.py
index 81c98b2..de3b05c 100644
--- a/backend/common/rhnException.py
+++ b/backend/common/rhnException.py
@@ -239,6 +239,8 @@ maximum membership exceeded"),
700: _("Maximum username length violation"),
701: _("Maximum password length violation"),
+ 800: _("System Name cannot be less than 3 characters"),
+
# 1000-1999: RHN Proxy specific errors:
# issued by an RHN Proxy to the client
1000: _("RHN Proxy error."),
diff --git a/backend/server/handlers/xmlrpc/registration.py b/backend/server/handlers/xmlrpc/registration.py
index daa7722..a593ed2 100644
--- a/backend/server/handlers/xmlrpc/registration.py
+++ b/backend/server/handlers/xmlrpc/registration.py
@@ -218,6 +218,11 @@ class Registration(rhnHandler):
and new_system_user_pass | new_system_activation_key (>= rhel5)
"""
+ if profile_name is not None and not \
+ rhnFlags.test("re_registration_token") and \
+ len(profile_name) < 3:
+ raise rhnFault(800)
+
# log entry point
if data.has_key("token"):
log_item = "token = '%s'" % data["token"]