From: Yehuda Sadeh Date: Wed, 27 Nov 2013 21:34:00 +0000 (-0800) Subject: rgw: don't error out on empty owner when setting acls X-Git-Tag: v0.67.9~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fced0562f6b80035cd522cc81bdc844ccc92d9bc;p=ceph.git rgw: don't error out on empty owner when setting acls Fixes: #6892 Backport: dumpling, emperor s3cmd specifies empty owner field when trying to set acls on object / bucket. We errored out as it didn't match the current owner name, but with this change we ignore it. Signed-off-by: Yehuda Sadeh (cherry picked from commit 14cf4caff58cc2c535101d48c53afd54d8632104) --- diff --git a/src/rgw/rgw_acl_s3.cc b/src/rgw/rgw_acl_s3.cc index 6007d41077a..71c86826676 100644 --- a/src/rgw/rgw_acl_s3.cc +++ b/src/rgw/rgw_acl_s3.cc @@ -454,8 +454,10 @@ int RGWAccessControlPolicy_S3::rebuild(RGWRados *store, ACLOwner *owner, RGWAcce return -EINVAL; ACLOwner *requested_owner = static_cast(find_first("Owner")); - if (requested_owner && requested_owner->get_id().compare(owner->get_id()) != 0) { - return -EPERM; + if (requested_owner) { + const string& requested_id = requested_owner->get_id(); + if (!requested_id.empty() && requested_id.compare(owner->get_id()) != 0) + return -EPERM; } RGWUserInfo owner_info;