wsgi.make_pre_authed_request fails if path arg is None

Bug #1198149 reported by Alistair Coles
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
Undecided
Alistair Coles

Bug Description

swift/common/wsgi.py make_pre_authed_request() fails if path arg is None (default value) because value is not checked before being passed to unquote()

Jul 5 12:39:40 ubuntu proxy-server 'NoneType' object has no attribute 'split': #012Traceback (most recent call last):#012 File "/home/swift/swift/swift/common/middleware/cluster_federation.py", line 272, in __call__#012 resp = self.forward_request(req, container, obj)#012 File "/home/swift/swift/swift/common/middleware/cluster_federation.py", line 232, in forward_request#012 loc_req = make_pre_authed_request(req.environ, swift_source='CF')#012 File "/home/swift/swift/swift/common/wsgi.py", line 437, in make_pre_authed_request#012 newenv = make_pre_authed_env(env, method, path=unquote(path), agent=agent,#012 File "/usr/lib/python2.7/urllib.py", line 1186, in unquote#012 res = s.split('%')#012AttributeError: 'NoneType' object has no attribute 'split'

Changed in swift:
assignee: nobody → Alistair Coles (alistair-coles)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (master)

Fix proposed to branch: master
Review: https://review.openstack.org/35816

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (master)

Reviewed: https://review.openstack.org/35816
Committed: http://github.com/openstack/swift/commit/27dc73fe0458ae5334c4547d700f912681a4bcfd
Submitter: Jenkins
Branch: master

commit 27dc73fe0458ae5334c4547d700f912681a4bcfd
Author: anc <email address hidden>
Date: Fri Jul 5 13:18:16 2013 +0100

    Fix make_pre_authed_request function to not fail when path arg is None.

    The default value for the path arg to the function is None. However, if
    the path arg is not set or is set to None an exception is generated when
    the path value is passed to urllib.unquote(). The function doc states that
    if path is not provided then the value in the env is used, so fix is to
    implement this behaviour.

    Change-Id: I085124acb6ef3cecb2375bb97d27996e0c6fd36e
    Fixes: bug #1198149

Changed in swift:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (feature/ec)

Fix proposed to branch: feature/ec
Review: https://review.openstack.org/38552

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (feature/ec)
Download full text (15.3 KiB)

Reviewed: https://review.openstack.org/38552
Committed: http://github.com/openstack/swift/commit/f3ba55039c4caa91b71b453f2dc1f5310c2ac801
Submitter: Jenkins
Branch: feature/ec

commit f2c3e1af9cf0ad1fbf7753cd2e5caef9bd297cb5
Author: Samuel Merritt <email address hidden>
Date: Mon Jul 22 16:14:59 2013 -0700

    Fix bulk's unit tests on Mac OS.

    Turns out if your $TMPDIR is really long
    (e.g. /var/folders/vq/n32yszdn4s76z6l8dxklmwdh0000gn/T/, which is 50
    characters), then the test that drops stuff into $TMPDIR and adds it
    to a tarball and uploads it will fail due to every added file's name
    being too long.

    Change-Id: I8fcab2d95091f72b831b906bfc87a36d8be12631

commit 5c1a7871d9173db9fbd855b72a98ecd8ff163800
Author: Newptone <email address hidden>
Date: Sun Jul 21 12:18:24 2013 +0800

    Unified format of boolean params in conf files

    In swift conf files, boolean options use different
    format: some use true/false, and some use True/False.
    This patch is aim to using lowcase true/false to unify
    boolean params formats in swift conf files.

    Fix Bug #1203421

    Change-Id: I3e1bfc6e43231f51e0710aa54869f3774ee896b1

commit 63061e37ed098bf1ad509177484037544eb6b089
Author: Kun Huang <email address hidden>
Date: Tue Jul 23 13:46:51 2013 +0800

    Add notes for /srv/node in swift-object-info

    'devices' is set in object-server.conf on each node, not in ring data,
    and the things printed here is just for watching not for running, so
    just leave a note here. (this https://review.openstack.org/#/c/23951/
    is used for running, so just a note is not enough)

    mark this commit as bug fixing is because this script is the last place
    using /srv/node but not from conf as Chmouel said.

    fixes import change on read_metadata
    fixes bug #885006
    Change-Id: I727ec2d01c093af61fd3895e5701d87ef67cd9ff

commit 13bbe4b7c31b17efbebd91bd01586757600a082b
Author: Michael Barton <email address hidden>
Date: Mon Jul 22 21:12:22 2013 -0700

    fix unit tests in 2.6 by using closing(GzipFile)

    Python 2.6 doesn't support using GzipFile as a context manager.

    Change-Id: Ic12b5a916bc89ae8d4480879723201c1715285af

commit 6384b192b55b823d86078588f22b8bc847954aad
Author: Alex Gaynor <email address hidden>
Date: Mon Jul 22 14:59:30 2013 -0700

    Ensure that files are always closed explicitly.

    This is needed on Pythons without reference
    counting garbage collectors (e.g. PyPy).

    Change-Id: Ieb563ace9f65a4ad204b01be32bf7a9d5f226005

commit 0e3103c0dd3690f5e69ec7953c270430d0564d12
Author: Alex Gaynor <email address hidden>
Date: Mon Jul 22 15:27:54 2013 -0700

    Corrected a number of style violations in the tests.

    Change-Id: Ib5e81ad0476c56cf84d222d67f55b8db3eb0249e

commit fc293a750c8a83ec99d3b462b4689741c1e66a9b
Author: Peter Portante <email address hidden>
Date: Wed Jul 17 17:41:41 2013 -0400

    Move the mount checking into DiskFile constructor

    Move the mount checking into the DiskFile object constructor. The
    REPLICATE method does not use the DiskFile object currently, so that
    method st...

Thierry Carrez (ttx)
Changed in swift:
milestone: none → 1.9.1
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.