swift/swift
Romain LE DISEZ 091157fc7f Fix encoding issue in ssync_sender.send_put()
EC object metadata can currently have a mixture of bytestrings and
unicode.  The ssync_sender.send_put() method raises an
UnicodeDecodeError when it attempts to concatenate the metadata
values, if any bytestring has non-ascii characters.

The root cause of this issue is that the object server uses unicode
for the keys of some object metadata items that are received in the
footer of an EC PUT request, whereas all other object metadata keys
and values are persisted as bytestrings.

This patch fixes the bug by changing diskfile write_metadata()
function to encode all unicode metadata keys and values as utf8
encoded bytes before writing to disk. To cope with existing objects
that have a mixture of unicode and bytestring metadata, the diskfile
read_metadata() function is also changed so that all returned unicode
metadata keys and values are utf8 encoded. This ensures that
ssync_sender.send_put() (and any other caller of diskfile
read_metadata) only reads bytestrings from object metadata.

Closes-Bug: #1678018
Co-Authored-By: Alistair Coles <alistairncoles@gmail.com>
Change-Id: Ic23c55754ee142f6f5388dcda592a3afc9845c39
2017-04-19 18:05:52 +01:00
..
account Support last modified on listing containers 2017-01-12 18:03:10 +00:00
cli fix get ring name 2017-03-18 03:43:32 +00:00
common Container drive error results double space usage on rest drives 2017-04-11 09:49:59 +02:00
container Move documented reclaim_age option to correct location 2017-01-13 03:10:47 +00:00
locale Imported Translations from Zanata 2016-07-19 08:27:04 +00:00
obj Fix encoding issue in ssync_sender.send_put() 2017-04-19 18:05:52 +01:00
proxy Merge "Update calling super class constructor style in proxy controllers" 2017-03-14 07:38:19 +00:00
__init__.py Make pbr a build-time only dependency 2013-10-29 12:29:49 -07:00