]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_rest_s3: apply missed base64 try-catch 11672/head
authorMatt Benjamin <mbenjamin@redhat.com>
Thu, 27 Oct 2016 22:34:01 +0000 (18:34 -0400)
committerMatt Benjamin <mbenjamin@redhat.com>
Thu, 27 Oct 2016 22:50:47 +0000 (18:50 -0400)
Fixes a case missed in 0a4c91e, in Jewel backport only.

Fixes: http://tracker.ceph.com/issues/17663
(cherry picked from commit 87ed19e4019e17ea95b27d9c8854027969b445a3)

Resolves: rhbz#1381694

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/rgw/rgw_rest_s3.cc

index da93a9551d21c0949b417c1e61717cef34517063..00b7fd46cd8c5bd1898e8fa98f4b13be2f545e67 100644 (file)
@@ -3953,7 +3953,13 @@ int RGW_Auth_S3::authorize_v2(RGWRados *store, struct req_state *s)
       << store->ctx()->_conf->rgw_ldap_uri
       << dendl;
 
-    RGWToken token{from_base64(auth_id)};
+    RGWToken token;
+    /* boost filters and/or string_ref may throw on invalid input */
+    try {
+      token = rgw::from_base64(auth_id);
+    } catch(...) {
+      token = std::string("");
+    }
 
     if (! token.valid())
       external_auth_result = -EACCES;