From: Or Friedmann Date: Tue, 31 Mar 2020 14:30:52 +0000 (+0300) Subject: rgw: fix rgw tries to fetch anonymous user X-Git-Tag: v15.2.4~10^2~5^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6e79b3c2dc0c94bcc1d7527f58b2f492d7999207;p=ceph.git rgw: fix rgw tries to fetch anonymous user rgw tries to fetch the anonymous user although it does not exist. Fixes: https://tracker.ceph.com/issues/44772 Signed-off-by: Or Friedmann (cherry picked from commit a221274ffce356d776010706deb1005ef1d68ee5) --- diff --git a/src/rgw/services/svc_user_rados.cc b/src/rgw/services/svc_user_rados.cc index d89a02eadc058..04671bb323250 100644 --- a/src/rgw/services/svc_user_rados.cc +++ b/src/rgw/services/svc_user_rados.cc @@ -115,6 +115,10 @@ int RGWSI_User_RADOS::read_user_info(RGWSI_MetaBackend::Context *ctx, map * const pattrs, optional_yield y) { + if(user.id == RGW_USER_ANON_ID) { + ldout(svc.meta_be->ctx(), 20) << "RGWSI_User_RADOS::read_user_info(): anonymous user" << dendl; + return -ENOENT; + } bufferlist bl; RGWUID user_id; @@ -738,7 +742,11 @@ int RGWSI_User_RADOS::list_buckets(RGWSI_MetaBackend::Context *ctx, int ret; buckets->clear(); - + if (user.id == RGW_USER_ANON_ID) { + ldout(cct, 20) << "RGWSI_User_RADOS::list_buckets(): anonymous user" << dendl; + *is_truncated = false; + return 0; + } rgw_raw_obj obj = get_buckets_obj(user); bool truncated = false;