]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix rgw tries to fetch anonymous user 34988/head
authorOr Friedmann <ofriedma@redhat.com>
Tue, 31 Mar 2020 14:30:52 +0000 (17:30 +0300)
committerNathan Cutler <ncutler@suse.com>
Mon, 11 May 2020 15:20:28 +0000 (17:20 +0200)
rgw tries to fetch the anonymous user although it does not exist.
Fixes: https://tracker.ceph.com/issues/44772
Signed-off-by: Or Friedmann <ofriedma@redhat.com>
(cherry picked from commit a221274ffce356d776010706deb1005ef1d68ee5)

src/rgw/services/svc_user_rados.cc

index d89a02eadc05802e43b86d3f24e53efd59a14b0c..04671bb323250bc832c196e16f13ae28eaaa0708 100644 (file)
@@ -115,6 +115,10 @@ int RGWSI_User_RADOS::read_user_info(RGWSI_MetaBackend::Context *ctx,
                                map<string, bufferlist> * 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;