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 863543 Details for
Bug 1065576
Add additional patches to urllib2_kerberos
[?]
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]
suggested patch
0001-First-attempt-to-add-additional-patches.patch (text/plain), 7.59 KB, created by
Matěj Cepl
on 2014-02-15 00:57:40 UTC
(
hide
)
Description:
suggested patch
Filename:
MIME Type:
Creator:
Matěj Cepl
Created:
2014-02-15 00:57:40 UTC
Size:
7.59 KB
patch
obsolete
>From 972dd3bafcd80f023a3051989e46873f94e12a80 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= <mcepl@redhat.com> >Date: Sat, 15 Feb 2014 01:19:22 +0100 >Subject: [PATCH] First attempt to add additional patches. > >--- > allow_client_apps_to_configure_loggers.patch | 29 +++++++++++++++++++++ > dont-panick-if-we-succeed.patch | 20 +++++++++++++++ > multiple-auth-headers.patch | 38 ++++++++++++++++++++++++++++ > port-to-python-2.4.patch | 32 +++++++++++++++++++++++ > python-urllib2_kerberos.spec | 28 +++++++++++++++++--- > 5 files changed, 144 insertions(+), 3 deletions(-) > create mode 100644 allow_client_apps_to_configure_loggers.patch > create mode 100644 dont-panick-if-we-succeed.patch > create mode 100644 multiple-auth-headers.patch > create mode 100644 port-to-python-2.4.patch > >diff --git a/allow_client_apps_to_configure_loggers.patch b/allow_client_apps_to_configure_loggers.patch >new file mode 100644 >index 0000000..f882501 >--- /dev/null >+++ b/allow_client_apps_to_configure_loggers.patch >@@ -0,0 +1,29 @@ >+--- a/urllib2_kerberos.py >++++ b/urllib2_kerberos.py >+@@ -24,15 +24,7 @@ import urllib2 as u2 >+ >+ import kerberos as k >+ >+-def getLogger(): >+- log = logging.getLogger("http_kerberos_auth_handler") >+- handler = logging.StreamHandler() >+- formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s') >+- handler.setFormatter(formatter) >+- log.addHandler(handler) >+- return log >+- >+-log = getLogger() >++log = logging.getLogger("http_kerberos_auth_handler") >+ >+ class AbstractKerberosAuthHandler: >+ """auth handler for urllib2 that does Kerberos HTTP Negotiate Authentication >+@@ -179,7 +171,8 @@ class HTTPKerberosAuthHandler(u2.BaseHan >+ return retry >+ >+ def test(): >+- log.setLevel(logging.DEBUG) >++ logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', >++ level=logging.DEBUG) >+ log.info("starting test") >+ opener = u2.build_opener() >+ opener.add_handler(HTTPKerberosAuthHandler()) >diff --git a/dont-panick-if-we-succeed.patch b/dont-panick-if-we-succeed.patch >new file mode 100644 >index 0000000..9792963 >--- /dev/null >+++ b/dont-panick-if-we-succeed.patch >@@ -0,0 +1,20 @@ >+--- a/urllib2_kerberos.py >++++ b/urllib2_kerberos.py >+@@ -34,6 +34,7 @@ class AbstractKerberosAuthHandler: >+ """checks for "Negotiate" in proper auth header >+ """ >+ authreqs = headers.getheaders(self.auth_header) >++ log.debug('authreqs = {}'.format(authreqs)) >+ >+ if authreqs: >+ >+@@ -126,7 +127,8 @@ class AbstractKerberosAuthHandler: >+ req.add_unredirected_header(self.authz_header, neg_hdr) >+ resp = self.parent.open(req) >+ >+- self.authenticate_server(resp.info()) >++ if resp.getcode() != 200: >++ self.authenticate_server(resp.info()) >+ >+ return resp >+ >diff --git a/multiple-auth-headers.patch b/multiple-auth-headers.patch >new file mode 100644 >index 0000000..0448563 >--- /dev/null >+++ b/multiple-auth-headers.patch >@@ -0,0 +1,38 @@ >+# HG changeset patch >+# User Wagner Bruna <wbruna@softwareexpress.com.br> >+# Date 1338402998 10800 >+# Node ID 5e53d94fdf9cb73304790a38ba24b19415de73ea >+# Parent 08f4f4f83058d9896a0debc2ff3899a9a358f942 >+deal with multiple WWW-Authenticate headers >+ >+A server supporting both Negotiate and Basic authentication methods >+could send both headers at once, but the get() method returns only >+the last one. >+ >+--- a/urllib2_kerberos.py >++++ b/urllib2_kerberos.py >+@@ -41,15 +41,17 @@ class AbstractKerberosAuthHandler: >+ def negotiate_value(self, headers): >+ """checks for "Negotiate" in proper auth header >+ """ >+- authreq = headers.get(self.auth_header, None) >++ authreqs = headers.getheaders(self.auth_header) >++ >++ if authreqs: >+ >+- if authreq: >+ rx = re.compile('(?:.*,)*\s*Negotiate\s*([^,]*),?', re.I) >+- mo = rx.search(authreq) >+- if mo: >+- return mo.group(1) >+- else: >+- log.debug("regex failed on: %s" % authreq) >++ for authreq in authreqs: >++ mo = rx.search(authreq) >++ if mo: >++ return mo.group(1) >++ else: >++ log.debug("regex failed on: %s" % authreq) >+ >+ else: >+ log.debug("%s header not found" % self.auth_header) >diff --git a/port-to-python-2.4.patch b/port-to-python-2.4.patch >new file mode 100644 >index 0000000..24bf6c2 >--- /dev/null >+++ b/port-to-python-2.4.patch >@@ -0,0 +1,32 @@ >+--- a/urllib2_kerberos.py >++++ b/urllib2_kerberos.py >+@@ -62,8 +62,8 @@ class AbstractKerberosAuthHandler: >+ host = req.get_host() >+ log.debug("req.get_host() returned %s" % host) >+ >+- tail, sep, head = host.rpartition(':') >+- domain = tail if tail else head >++ cindex = host.rfind(':') >++ domain = (cindex == -1) and host or host[:cindex] >+ >+ result, self.context = k.authGSSClientInit("HTTP@%s" % domain) >+ >+@@ -130,15 +130,15 @@ class AbstractKerberosAuthHandler: >+ if resp.getcode() != 200: >+ self.authenticate_server(resp.info()) >+ >++ self.clean_context() >++ self.retried = 0 >+ return resp >+ >+ except k.GSSError, e: >+ log.critical("GSSAPI Error: %s/%s" % (e[0][0], e[1][0])) >+- return None >+- >+- finally: >+ self.clean_context() >+ self.retried = 0 >++ return None >+ >+ class ProxyKerberosAuthHandler(u2.BaseHandler, AbstractKerberosAuthHandler): >+ """Kerberos Negotiation handler for HTTP proxy auth >diff --git a/python-urllib2_kerberos.spec b/python-urllib2_kerberos.spec >index 2a08e03..b94a186 100644 >--- a/python-urllib2_kerberos.spec >+++ b/python-urllib2_kerberos.spec >@@ -2,13 +2,21 @@ > > Name: python-%{srcname} > Version: 0.1.6 >-Release: 9%{?dist} >+Release: 10%{?dist} > Summary: Kerberos over HTTP Negotiate/SPNEGO support for urllib2 > > Group: Development/Languages > License: ASL 2.0 > URL: http://pypi.python.org/pypi/%{srcname}/ > Source0: http://pypi.python.org/packages/source/u/%{srcname}/%{srcname}-%{version}.tar.gz >+# From https://bitbucket.org/tolsen/urllib2_kerberos/issue/1/ >+Patch0: multiple-auth-headers.patch >+# From https://bitbucket.org/tolsen/urllib2_kerberos/pull-request/2/ >+Patch1: allow_client_apps_to_configure_loggers.patch >+# From https://github.com/mcepl/urllib2_kerberos/commit/7b52c4c749 >+Patch2: dont-panick-if-we-succeed.patch >+# From https://bugzilla.redhat.com/show_bug.cgi?id=578711 >+Patch3: port-to-python-2.4.patch > > BuildArch: noarch > BuildRequires: python-setuptools-devel >@@ -19,9 +27,19 @@ urllib2 with kerberos authentication. > > %prep > %setup -q -n %{srcname}-%{version} >+ >+%patch0 -p1 >+%patch1 -p1 >+%patch2 -p1 >+ >+%if 0%{?rhel} == 5 >+%patch3 -p1 >+%endif >+ > # Remove "#!/usr/bin/python\n" >-tail -n +2 urllib2_kerberos.py >patched-urllib2_kerberos.py >-mv patched-urllib2_kerberos.py urllib2_kerberos.py >+lib=urllib2_kerberos.py >+sed '1{\@^#!/usr/bin/python@d}' $lib > $lib.new && \ >+touch -r $lib $lib.new && mv $lib.new $lib > > > %build >@@ -37,6 +55,10 @@ mv patched-urllib2_kerberos.py urllib2_kerberos.py > > > %changelog >+* Sat Feb 15 2014 MatÄj Cepl <mcepl@redhat.com> - 0.1.6-10 >+- Add all patches I could find. >+- Also add RHEL5 patch porting to python 2.4 (RHBZ# 578711) >+ > * Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.6-9 > - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild > >-- >1.8.5.2.192.g7794a68 >
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 1065576
: 863543 |
938499