[python-boto/el6] Fix auth for anonymous S3 requests

gholms gholms at fedoraproject.org
Tue Jan 21 02:19:09 UTC 2014


commit 24bffb1d10b04d98362f587381dcaab789238fce
Author: Garrett Holmstrom <gholms at devzero.com>
Date:   Mon Jan 20 16:56:38 2014 -0800

    Fix auth for anonymous S3 requests
    
    https://github.com/boto/boto/issues/1988

 boto-2.23.0-s3-anon.patch |   15 +++++++++++++++
 python-boto.spec          |    5 +++++
 2 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/boto-2.23.0-s3-anon.patch b/boto-2.23.0-s3-anon.patch
new file mode 100644
index 0000000..fdc6ceb
--- /dev/null
+++ b/boto-2.23.0-s3-anon.patch
@@ -0,0 +1,15 @@
+Index: boto/boto/connection.py
+===================================================================
+--- boto.orig/boto/connection.py
++++ boto/boto/connection.py
+@@ -891,8 +891,8 @@ class AWSAuthConnection(object):
+                 # the port info. All others should be now be up to date and
+                 # not include the port.
+                 if 's3' not in self._required_auth_capability():
+-                    self.set_host_header(request)
+-
++                    if not getattr(self, 'anon', False):
++                        self.set_host_header(request)
+                 if callable(sender):
+                     response = sender(connection, request.method, request.path,
+                                       request.body, request.headers)
diff --git a/python-boto.spec b/python-boto.spec
index e61396d..fe1a42b 100644
--- a/python-boto.spec
+++ b/python-boto.spec
@@ -14,6 +14,9 @@ BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 # Fix auto-scaling get_all_adjustment_types
 # https://github.com/boto/boto/pull/1538
 Patch2:         boto-2.9.9-adjtype.patch
+# Fix auth for anonymous S3 requests
+# https://github.com/boto/boto/issues/1988
+Patch3:         boto-2.23.0-s3-anon.patch
 
 
 %description
@@ -26,6 +29,7 @@ use, lightweight wrapper around the Amazon services.
 %prep
 %setup -q -n boto-%{version}
 %patch2 -p1
+%patch3 -p1
 
 rm -r boto.egg-info
 
@@ -63,6 +67,7 @@ rm -r boto.egg-info
 %changelog
 * Mon Jan 20 2014 Garrett Holmstrom <gholms at fedoraproject.org> - 2.23.0-1
 - Updated to 2.23.0
+- Fixed auth for anonymous S3 requests (boto #1988)
 
 * Thu Sep 26 2013 Garrett Holmstrom <gholms at fedoraproject.org> - 2.13.3-1
 - Updated to 2.13.3


More information about the scm-commits mailing list