]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_file: apply missed base64 try-catch 11671/head
authorMatt Benjamin <mbenjamin@redhat.com>
Thu, 27 Oct 2016 21:23:23 +0000 (17:23 -0400)
committerMatt Benjamin <mbenjamin@redhat.com>
Thu, 27 Oct 2016 21:42:55 +0000 (17:42 -0400)
Fixes a case missed in 0a4c91ec.  Affects only librgw/rgw_file
(i.e., RGW-NFS).

Fixes: http://tracker.ceph.com/issues/17663
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/rgw/rgw_file.h

index 4cec6e7d5e9576d4087fd2b3ea065d747e023aaf..6af23a9917e78fb637c19b502f31ce6cc6be88f4 100644 (file)
@@ -834,7 +834,13 @@ namespace rgw {
       } else {
        /* try external authenticators (ldap for now) */
        rgw::LDAPHelper* ldh = rgwlib.get_ldh(); /* !nullptr */
-       RGWToken token{from_base64(key.id)};
+       RGWToken token;
+       /* boost filters and/or string_ref may throw on invalid input */
+       try {
+         token = rgw::from_base64(key.id);
+       } catch(...) {
+         token = std::string("");
+       }
        if (token.valid() && (ldh->auth(token.id, token.key) == 0)) {
          /* try to store user if it doesn't already exist */
          if (rgw_get_user_info_by_uid(store, token.id, user) < 0) {