]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix multi-delete query param parsing. 10189/head
authorRobin H. Johnson <robin.johnson@dreamhost.com>
Thu, 7 Jul 2016 21:14:36 +0000 (14:14 -0700)
committerRobin H. Johnson <robin.johnson@dreamhost.com>
Thu, 7 Jul 2016 21:21:01 +0000 (14:21 -0700)
Multi-delete is triggered by a query parameter on POST, but there are
multiple valid ways of representing it, and Ceph should accept ANY way
that has the query parameter set, regardless of what value or absence of
value.

This caused the RubyGem aws-sdk-v1 to break, and has been present since
multi-delete was first added in commit 0a1f4a97da, for the bobtail
release.

Fixes: http://tracker.ceph.com/issues/16618
Signed-off-by: Robin H. Johnson <robin.johnson@dreamhost.com>
(cherry picked from commit a7016e1b67e82641f0702fda4eae799e953063e6)

src/rgw/rgw_rest.cc
src/rgw/rgw_rest_s3.cc

index 859e34a770b6e09ea4cdb9fce236e669c34daeb2..eb5e67eca5cbba1c84880fd697e911593eff7d1b 100644 (file)
@@ -1228,7 +1228,7 @@ int RGWHandler_ObjStore::read_permissions(RGWOp *op_obj)
   case OP_POST:
   case OP_COPY:
     /* is it a 'multi-object delete' request? */
-    if (s->info.request_params == "delete") {
+    if (s->info.args.exists("delete")) {
       only_bucket = true;
       break;
     }
index 49ff617efab5d6bcc3c8839aa3c96ba8829f2d87..b548532442981491a2c2c3a8ea6280d80609e21c 100644 (file)
@@ -2016,7 +2016,7 @@ RGWOp *RGWHandler_ObjStore_Bucket_S3::op_delete()
 
 RGWOp *RGWHandler_ObjStore_Bucket_S3::op_post()
 {
-  if ( s->info.request_params == "delete" ) {
+  if (s->info.args.exists("delete")) {
     return new RGWDeleteMultiObj_ObjStore_S3;
   }