Bug 1020540

Summary: yum.update_md.UpdateNotice.xml() does not sanitize pkg['epoch'] with the to_xml() function
Product: [Fedora] Fedora Reporter: Randy Barlow <rbarlow>
Component: yumAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 19CC: admiller, ffesti, firas.alkafri, mhrivnak, packaging-team-maint, zpavlas
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: yum-3.4.3-120.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-10 06:11:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1005282    
Attachments:
Description Flags
Patch
none
Patch zpavlas: review+

Description Randy Barlow 2013-10-17 21:08:04 UTC
Created attachment 813552 [details]
Patch

In yum-3.4.3-111.fc19.noarch, the yum.update_md.UpdateNotice.xml() method wraps all of the pkg attributes with the to_xml() function, except for the epoch. This causes a regression as it used to be possible to use unicode strings for all of the attributes of a package, but now that epoch is included and not wrapped, the string concatenation causes a traceback if the errata itself contains non-ASCII characters.

I believe the fix is very simple: wrapping line 395 with the to_xml() function should solve the problem.

Comment 1 Randy Barlow 2013-10-17 21:11:53 UTC
This bug is related to two bugs I reported in RHEL 6 and Fedora 19 about the Epoch having been omitted:

https://bugzilla.redhat.com/show_bug.cgi?id=1005282
https://bugzilla.redhat.com/show_bug.cgi?id=1005288

Thanks, and let me know if you need any more information!

Comment 2 Randy Barlow 2013-10-17 21:13:04 UTC
Created attachment 813553 [details]
Patch

Comment 3 Zdeněk Pavlas 2013-10-18 07:48:46 UTC
Comment on attachment 813553 [details]
Patch

Ack. For completeness and consistency we should probably also add attrib=True, but quotes never appear in epoch so nevermind. A simple str(pkg['epoch'] or '0') would work, too.

Comment 4 Fedora Update System 2013-12-04 16:32:12 UTC
yum-3.4.3-119.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/yum-3.4.3-119.fc19

Comment 5 Fedora Update System 2013-12-04 16:34:39 UTC
yum-3.4.3-119.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/yum-3.4.3-119.fc20

Comment 6 Fedora Update System 2013-12-05 00:38:29 UTC
Package yum-3.4.3-119.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing yum-3.4.3-119.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-22706/yum-3.4.3-119.fc20
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2013-12-06 14:24:38 UTC
yum-3.4.3-120.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/yum-3.4.3-120.fc19

Comment 8 Fedora Update System 2013-12-06 14:32:59 UTC
yum-3.4.3-120.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/yum-3.4.3-120.fc20

Comment 9 Fedora Update System 2013-12-10 06:11:49 UTC
yum-3.4.3-120.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2013-12-14 03:30:35 UTC
yum-3.4.3-120.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.