backend/satellite_tools/xmlSource.py | 26 ++++++++++++++++++++++++++
backend/server/importlib/channelImport.py | 8 --------
backend/spacewalk-backend.spec | 8 +++++++-
rel-eng/packages/spacewalk-backend | 2 +-
4 files changed, 34 insertions(+), 10 deletions(-)
New commits:
commit 920fb76c70575c8e3b4b7454855972d7606a0124
Author: Stephen Herr <sherr(a)redhat.com>
Date: Fri Mar 30 13:48:19 2012 -0400
Automatic commit of package [spacewalk-backend] release [1.8.10-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index 5263b46..c7cc80f 100644
--- a/backend/spacewalk-backend.spec
+++ b/backend/spacewalk-backend.spec
@@ -12,7 +12,7 @@ Name: spacewalk-backend
Summary: Common programs needed to be installed on the Spacewalk servers/proxies
Group: Applications/Internet
License: GPLv2
-Version: 1.8.9
+Version: 1.8.10
Release: 1%{?dist}
URL:
https://fedorahosted.org/spacewalk
Source0:
https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -688,6 +688,12 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$
%changelog
+* Fri Mar 30 2012 Stephen Herr <sherr(a)redhat.com> 1.8.10-1
+- 808516 - When importing channeldumps from Sat 5.3 or older we should assume
+ sha1 checksum type (sherr(a)redhat.com)
+- 805012 - check channel permissions when unsubscribing a channel
+ (mzazrivec(a)redhat.com)
+
* Fri Mar 30 2012 Jan Pazdziora 1.8.9-1
- CVE-2012-1145, 800688 - check the result of parseServ operation.
- Truncate data which are longer than db allows (slukasik(a)redhat.com)
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend
index a81faa8..a36b232 100644
--- a/rel-eng/packages/spacewalk-backend
+++ b/rel-eng/packages/spacewalk-backend
@@ -1 +1 @@
-1.8.9-1 backend/
+1.8.10-1 backend/
commit 0fb9604f7b7c01113e23718977d8f79afedcc112
Author: Stephen Herr <sherr(a)redhat.com>
Date: Fri Mar 30 13:46:43 2012 -0400
808516 - When importing channeldumps from Sat 5.3 or older we should assume sha1
checksum type
diff --git a/backend/satellite_tools/xmlSource.py b/backend/satellite_tools/xmlSource.py
index e3d16ff..75c645c 100644
--- a/backend/satellite_tools/xmlSource.py
+++ b/backend/satellite_tools/xmlSource.py
@@ -27,6 +27,9 @@ from spacewalk.common.rhnConfig import CFG
from spacewalk.common.rhnTB import Traceback
from spacewalk.server.importlib import importLib, backendLib
+import re
+RHEL234_REGEX = re.compile("rhel-[^-]*-[aew]s-(4|3|2.1)")
+
# Terminology used throughout this file:
# Item: an atomic entity from the database's perspective.
# A channel, or a package, or an erratum is an item.
@@ -458,9 +461,32 @@ class ChannelItem(BaseItem):
'rhn-channel-comps-last-modified' : 'comps_last_modified',
}
def populateFromElements(self, obj, elements):
+ # bz 808516, to retain compatibility with Satellite <= 5.3 we
+ # need to assume sha1 checksum type unless we explicitly see
+ # 'rhn-null' in the xml
+ checksum_type_really_null = False
+ for element in elements:
+ if (not _is_string(element)
+ and element.name == 'rhn-channel-checksum-type'):
+ for subelement in element.subelements:
+ if (not _is_string(subelement)
+ and subelement.name == 'rhn-null'):
+ checksum_type_really_null = True
+
BaseItem.populateFromElements(self, obj, elements)
+
if obj['checksum_type'] == 'sha':
obj['checksum_type'] = 'sha1'
+ if not obj['checksum_type'] and not checksum_type_really_null:
+ obj['checksum_type'] = 'sha1'
+
+ # if using versions of rhel that doesn't use yum, set
+ # checksum_type to None
+ if (RHEL234_REGEX.match(obj['label'])
+ or (obj['parent_channel']
+ and RHEL234_REGEX.match(obj['parent_channel']))):
+ obj['checksum_type'] = None
+
addItem(ChannelItem)
class BaseChecksummedItem(BaseItem):
diff --git a/backend/server/importlib/channelImport.py
b/backend/server/importlib/channelImport.py
index 1351f10..ff99eb6 100644
--- a/backend/server/importlib/channelImport.py
+++ b/backend/server/importlib/channelImport.py
@@ -20,9 +20,6 @@ from importLib import Import, InvalidArchError, \
from spacewalk.common.rhnConfig import CFG
from spacewalk.satellite_tools.syncLib import log
-import re
-RHEL5_REGEXP = re.compile("rhel-[^-]*-(server|client)-5")
-
class ChannelImport(Import):
def __init__(self, batch, backend):
Import.__init__(self, batch, backend)
@@ -58,11 +55,6 @@ class ChannelImport(Import):
if not channel.has_key('receiving_updates') or
channel['receiving_updates'] is None:
channel['receiving_updates'] = 'N'
# Yum repo checksum type
- if (not channel['checksum_type']
- and (RHEL5_REGEXP.match(channel['label'])
- or (channel['parent_channel']
- and RHEL5_REGEXP.match(channel['parent_channel'])))):
- channel['checksum_type'] = 'sha1'
if (channel['checksum_type']
and channel['checksum_type'] not in self.checksum_types):
self.checksum_types[channel['checksum_type']] = None