]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: don't error out on empty owner when setting acls
authorYehuda Sadeh <yehuda@inktank.com>
Wed, 27 Nov 2013 21:34:00 +0000 (13:34 -0800)
committerSage Weil <sage@inktank.com>
Tue, 3 Dec 2013 05:57:35 +0000 (21:57 -0800)
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 <yehuda@inktank.com>
(cherry picked from commit 14cf4caff58cc2c535101d48c53afd54d8632104)

src/rgw/rgw_acl_s3.cc

index 6007d41077a0ea15757c652aebf50590f5a7f252..71c868266762a3a1dde542426706e732b23ac9c2 100644 (file)
@@ -454,8 +454,10 @@ int RGWAccessControlPolicy_S3::rebuild(RGWRados *store, ACLOwner *owner, RGWAcce
     return -EINVAL;
 
   ACLOwner *requested_owner = static_cast<ACLOwner_S3 *>(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;