]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: don't use req_state::bucket_name in TempURL of Swift API.
authorRadoslaw Zarzynski <rzarzynski@mirantis.com>
Thu, 18 Feb 2016 15:13:09 +0000 (16:13 +0100)
committerRadoslaw Zarzynski <rzarzynski@mirantis.com>
Fri, 4 Mar 2016 21:52:52 +0000 (22:52 +0100)
Fixes: #14806
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
src/rgw/rgw_swift.cc

index 54e598c7e3f3e70118d57ee196d5f883fccd519c..7c01461229815a6af4f175162cd7e9f123c43af5 100644 (file)
@@ -536,8 +536,11 @@ static void temp_url_make_content_disp(req_state * const s)
 
 int authenticate_temp_url(RGWRados *store, req_state *s)
 {
+  /* We cannot use req_state::bucket_name because it isn't available
+   * now. It will be initialized in RGWHandler_REST_SWIFT::postauth_init(). */
+  const string& bucket_name = s->init_state.url_bucket;
   /* temp url requires bucket and object specified in the requets */
-  if (s->bucket_name.empty())
+  if (bucket_name.empty())
     return -EPERM;
 
   if (s->object.empty())
@@ -569,7 +572,7 @@ int authenticate_temp_url(RGWRados *store, req_state *s)
   /* Need to get user info of bucket owner. */
   RGWBucketInfo bucket_info;
   int ret = store->get_bucket_info(*static_cast<RGWObjectCtx *>(s->obj_ctx),
-                                   bucket_tenant, s->bucket_name,
+                                   bucket_tenant, bucket_name,
                                    bucket_info, NULL);
   if (ret < 0) {
     return -EPERM;