]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix broken /crossdomain.xml, /info and /healthcheck of Swift API. 14373/head
authorRadoslaw Zarzynski <rzarzynski@mirantis.com>
Thu, 6 Apr 2017 15:08:23 +0000 (17:08 +0200)
committerRadoslaw Zarzynski <rzarzynski@mirantis.com>
Thu, 6 Apr 2017 19:31:26 +0000 (21:31 +0200)
Fixes: http://tracker.ceph.com/issues/19520
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
src/rgw/rgw_op.cc

index 393af6b44385f7cb26561e8b4148aae3120c5330..fff387bedf26b30f4bcba6e320fb914d2eb6397b 100644 (file)
@@ -374,8 +374,13 @@ int rgw_build_bucket_policies(RGWRados* store, struct req_state* s)
   if(s->dialect.compare("s3") == 0) {
     s->bucket_acl = new RGWAccessControlPolicy_S3(s->cct);
   } else if(s->dialect.compare("swift")  == 0) {
-    s->user_acl = std::unique_ptr<RGWAccessControlPolicy>(
-        new RGWAccessControlPolicy_SWIFTAcct(s->cct));
+    /* We aren't allocating the account policy for those operations using
+     * the Swift's infrastructure that don't really need req_state::user.
+     * Typical example here is the implementation of /info. */
+    if (!s->user->user_id.empty()) {
+      s->user_acl = std::unique_ptr<RGWAccessControlPolicy>(
+          new RGWAccessControlPolicy_SWIFTAcct(s->cct));
+    }
     s->bucket_acl = new RGWAccessControlPolicy_SWIFT(s->cct);
   } else {
     s->bucket_acl = new RGWAccessControlPolicy(s->cct);