From: Matt Benjamin Date: Thu, 27 Oct 2016 21:23:23 +0000 (-0400) Subject: rgw_file: apply missed base64 try-catch X-Git-Tag: v11.1.0~122^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F11671%2Fhead;p=ceph.git rgw_file: apply missed base64 try-catch 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 --- diff --git a/src/rgw/rgw_file.h b/src/rgw/rgw_file.h index 4cec6e7d5e95..6af23a9917e7 100644 --- a/src/rgw/rgw_file.h +++ b/src/rgw/rgw_file.h @@ -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) {