]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Guard against malformed bucket URLs 47194/head
authorAdam C. Emerson <aemerson@redhat.com>
Fri, 8 Jul 2022 18:58:16 +0000 (14:58 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Wed, 20 Jul 2022 18:48:04 +0000 (14:48 -0400)
Misplaced colons can result in radosgw thinking is has a bucket URL
but with no bucket name, leading to a crash later on.

Fixes: https://tracker.ceph.com/issues/55765
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
(cherry picked from commit 3ee9a3b41a289a926fed8b8927ca2a93b4f120a6)
Fixes: https://tracker.ceph.com/issues/56586
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/rgw/rgw_common.cc

index b44d4bfa784fba28cd03a146efad192cb16423fc..3d09a1e001fa45e9b56e533f957e3612af5c87eb 100644 (file)
@@ -1279,6 +1279,11 @@ bool verify_bucket_permission_no_policy(const DoutPrefixProvider* dpp, struct re
 
 bool verify_bucket_permission(const DoutPrefixProvider* dpp, struct req_state * const s, const uint64_t op)
 {
+  if (rgw::sal::RGWBucket::empty(s->bucket)) {
+    // request is missing a bucket name
+    return false;
+  }
+
   perm_state_from_req_state ps(s);
 
   return verify_bucket_permission(dpp,