Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 307226 Details for
Bug 348961
update failed and client said to report it.
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
An updated patch to catch struct.error when parsing the update metadata.
0001-Catch-struct.error-when-parsing-the-update-metadata.patch (text/plain), 2.07 KB, created by
Luke Macken
on 2008-05-30 18:36:47 UTC
(
hide
)
Description:
An updated patch to catch struct.error when parsing the update metadata.
Filename:
MIME Type:
Creator:
Luke Macken
Created:
2008-05-30 18:36:47 UTC
Size:
2.07 KB
patch
obsolete
>From 681a21cec54669e60692411631d33999a000b4e8 Mon Sep 17 00:00:00 2001 >From: Luke Macken <lmacken@redhat.com> >Date: Fri, 30 May 2008 14:35:41 -0400 >Subject: [PATCH] Catch struct.error when parsing the update metadata (rh#348961). > >We've seen this exception get thrown when trying to parse corrupted metadata. >So, lets catch it and throw an UpdateNoticeException. > >diff --git a/yum/update_md.py b/yum/update_md.py >index b5fdeda..2d7704f 100644 >--- a/yum/update_md.py >+++ b/yum/update_md.py >@@ -23,6 +23,7 @@ Update metadata (updateinfo.xml) parsing. > > import sys > import gzip >+import struct > > from textwrap import wrap > from yum.yumRepo import YumRepository >@@ -268,16 +269,19 @@ class UpdateMetadata(object): > else: # obj is a file object > infile = obj > >- for event, elem in iterparse(infile): >- if elem.tag == 'update': >- un = UpdateNotice(elem) >- if not self._notices.has_key(un['update_id']): >- self._notices[un['update_id']] = un >- for pkg in un['pkglist']: >- for file in pkg['packages']: >- self._cache['%s-%s-%s' % (file['name'], >- file['version'], >- file['release'])] = un >+ try: >+ for event, elem in iterparse(infile): >+ if elem.tag == 'update': >+ un = UpdateNotice(elem) >+ if not self._notices.has_key(un['update_id']): >+ self._notices[un['update_id']] = un >+ for pkg in un['pkglist']: >+ for file in pkg['packages']: >+ self._cache['%s-%s-%s' % (file['name'], >+ file['version'], >+ file['release'])] = un >+ except struct.error: >+ raise UpdateNoticeException("Metadata corrupted") > > def __str__(self): > ret = '' >-- >1.5.5.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 348961
:
305194
|
305195
| 307226