]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix for EINVAL errors on forwarded bucket put_acl requests 14376/head
authorCasey Bodley <cbodley@redhat.com>
Thu, 6 Apr 2017 17:13:54 +0000 (13:13 -0400)
committerCasey Bodley <cbodley@redhat.com>
Thu, 6 Apr 2017 17:16:18 +0000 (13:16 -0400)
PutACL rejects request that include both a canned_acl and a request
body. when forwarding requests with canned_acls, we were also including
the generated policy in the body

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_op.cc

index b7ee212ca492af3f20774e1d04791b06afa5ca76..ddc46665630d2062e46c8cca6ada41a9b193fde5 100644 (file)
@@ -4200,9 +4200,13 @@ void RGWPutACLs::execute()
     return;
   }
 
+  // forward bucket acl requests to meta master zone
   if (s->object.empty() && !store->is_meta_master()) {
     bufferlist in_data;
-    in_data.append(data, len);
+    // include acl data unless it was generated from a canned_acl
+    if (s->canned_acl.empty()) {
+      in_data.append(data, len);
+    }
     op_ret = forward_request_to_master(s, NULL, store, in_data, NULL);
     if (op_ret < 0) {
       ldout(s->cct, 20) << __func__ << "forward_request_to_master returned ret=" << op_ret << dendl;