Did some testing on the patch and checked with jbowes, we're going to skip this patch as it looks like it's not an issue in Satellite. rhn_register with a blank profile name will succeed, you'll end up with a NULL in rhnServer and the webui will show it as "unknown". You can then still edit it from the SDC without issue. No errors were encountered.
Would put it in just the same but I suspect the "unknown" we display in
the UI is probably i18n'ized so we're likely better leaving it as is.
Thanks for submission just the same!
On Fri Jul 03/2009 @ 12:07:P -0400 asdasd, James Bowes wrote:
> There is no client side logic stopping an empty profile name from being
> set, so it's possible for someone to try and set empty system profile
> names during registration. The automatic profile name as determined by
> rhn_register might also fail and give an empty profile name (as can
> happen with KVM guests).
>
> Add some server-side logic to set a reasonable default profile name
> ("unknown") if one is not provided, rather than causing an ISE due to a
> schema constraint.
>
> Patch attached.
>
> -James
> From a6dc848d048a1a706635c09ca5e9cf34222172c9 Mon Sep 17 00:00:00 2001
> From: James Bowes <[email protected]>
> Date: Fri, 3 Jul 2009 12:18:24 -0400
> Subject: [PATCH] Set a default system profile name if one isn't given
>
> There is no client side logic stopping an empty profile name from being
> set, so it's possible for someone to try and set empty system profile
> names during registration. The automatic profile name as determined by
> rhn_register might also fail and give an empty profile name (as can
> happen with KVM guests).
>
> Add some server-side logic to set a reasonable default profile name
> ("unknown") if one is not provided, rather than causing an ISE due to a
> schema constraint.
> ---
> backend/server/handlers/xmlrpc/registration.py | 9 ++++++---
> 1 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/backend/server/handlers/xmlrpc/registration.py
> b/backend/server/handlers/xmlrpc/registration.py
> index 3172143..6001fe6 100644
> --- a/backend/server/handlers/xmlrpc/registration.py
> +++ b/backend/server/handlers/xmlrpc/registration.py
> @@ -303,9 +303,12 @@ class Registration(rhnHandler):
> for hw in data['hardware_profile']:
> newserv.add_hardware(hw)
> # fill in the other details from the data dictionary
> - if profile_name is not None and not \
> - rhnFlags.test("re_registration_token"):
> - newserv.server["name"] = profile_name[:128]
> + if not rhnFlags.test("re_registration_token"):
> + if profile_name not in [None, ""]:
> + newserv.server["name"] = profile_name[:128]
> + else:
> + # some clients can send up an empty profile name.
> + newserv.server["name"] = "unknown"
> if data.has_key("os"):
> newserv.server["os"] = data["os"][:64]
> if data.has_key("description"):
> --
> 1.6.2.5
>
> _______________________________________________
> Spacewalk-devel mailing list
> [email protected]
> https://www.redhat.com/mailman/listinfo/spacewalk-devel
pgpK5Pm4GINFQ.pgp
Description: PGP signature
_______________________________________________ Spacewalk-devel mailing list [email protected] https://www.redhat.com/mailman/listinfo/spacewalk-devel
