Bug 238471 - Handle unknown package names on registration.update_packages
Handle unknown package names on registration.update_packages
Status: CLOSED CURRENTRELEASE
Product: Red Hat Network
Classification: Red Hat
Component: RHN/Backend (Show other bugs)
rhn500
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bryan Kearney
Bret McMillan
:
Depends On:
Blocks: 239809
  Show dependency treegraph
 
Reported: 2007-04-30 15:06 EDT by James Bowes
Modified: 2013-01-10 04:52 EST (History)
2 users (show)

See Also:
Fixed In Version: 5.0.2
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-07-25 16:29:00 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description James Bowes 2007-04-30 15:06:26 EDT
If you do this xml call with packages that RHN doesn't know about, It will cause
a  nasty traceback. Instead, send some meaningful info to the client, and log
the error in our logs.
Comment 1 Bret McMillan 2007-05-11 11:52:51 EDT
Adding to rhn502, this'll reduce tracebacks which will make it easier for the
hosted team to find & debug production issues.
Comment 2 James Bowes 2007-05-22 13:31:58 EDT
If an unknown package name is given in a profile, we will now raise fault 23.
Comment 3 James Bowes 2007-06-04 11:22:36 EDT
I've examined this further, and it only happens for empty package names. So
instead of throwing a fault, the packages are now filtered on empty package name
(like other fields on the package)
Comment 4 James Bowes 2007-06-19 10:52:54 EDT
A quick n' dirty way to test this (like bz 235214) is to append a package with
no name to
your package profile, like:
   pkg_list.append(['', '1', '1', '', 'i386'])
at line 173 in /usr/share/rhn/up2date_client/rpmUtils.py

Then use rhnreg_ks and note that things don't blow up. Your package profile
should be uploaded, and not include any packages with empty names.
Comment 5 Bret McMillan 2007-06-22 13:26:01 EDT
Tested using:

./test_up2date_checks.py --verbose --server=qa --test=update_packages
--username=lethallemur --password=[censored] --os-release=5Client
--os-arch=x86_64 --package-profile=./package-profiles/profile-emptyname-x86_64


profile-emptyname-x86_64 looks like:
[bretm@potential test]$ cat package-profiles/profile-emptyname-x86_64
(none) 1.0 3 (none) x86_64
a2ps 4.13b 41 (none) x86_64
acl 2.2.23 5 (none) x86_64
[bretm@potential test]$ 


test harness registers w/out fault, logs show:
2007/06/22 13:07:53 -04:00 30272 172.16.57.213:
rhnServer/server_packages.add_package(1007420128, ['', '1.0', '3', ''])
2007/06/22 13:07:53 -04:00 30272 172.16.57.213:
rhnServer/server_packages.add_package(1007420128, ['a2ps', '4.13b', '41', ''])
2007/06/22 13:07:53 -04:00 30272 172.16.57.213:
rhnServer/server_packages.add_package(1007420128, ['acl', '2.2.23', '5', ''])


sqlplus shows:

select name from rhnpackagename where id in (select name_id from
rhnserverpackage where server_id = 1007420128)
SQL> /

NAME
--------------------------------------------------------------------------------
a2ps
acl

SQL> 


Comment 6 Bret McMillan 2007-06-22 13:26:30 EDT
Also, simulated runs for rhel 4as system registration show nothing odd in webqa.
Comment 7 James Bowes 2007-07-25 11:18:02 EDT
rhn502 released.

Note You need to log in before you can comment on or make changes to this bug.