From: Radoslaw Zarzynski Date: Thu, 6 Apr 2017 15:08:23 +0000 (+0200) Subject: rgw: fix broken /crossdomain.xml, /info and /healthcheck of Swift API. X-Git-Tag: v12.0.3~87^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fe2afd42aaf706d38d6ed611796a181ae9e02ae8;p=ceph.git rgw: fix broken /crossdomain.xml, /info and /healthcheck of Swift API. Fixes: http://tracker.ceph.com/issues/19520 Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 393af6b4438..fff387bedf2 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -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( - 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( + new RGWAccessControlPolicy_SWIFTAcct(s->cct)); + } s->bucket_acl = new RGWAccessControlPolicy_SWIFT(s->cct); } else { s->bucket_acl = new RGWAccessControlPolicy(s->cct);