]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/dbstore: GetUser should return ENOENT if no user found 44440/head
authorSoumya Koduri <skoduri@redhat.com>
Mon, 3 Jan 2022 12:29:17 +0000 (17:59 +0530)
committerSoumya Koduri <skoduri@redhat.com>
Thu, 13 Jan 2022 11:52:11 +0000 (17:22 +0530)
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
src/rgw/store/dbstore/common/dbstore.cc

index 719ec62c074d284f1829be51cd04be1935ff2d5e..a3d82f48559ab414e88b854b2e24e06e627401be 100644 (file)
@@ -279,6 +279,12 @@ int DB::get_user(const DoutPrefixProvider *dpp,
   if (ret)
     goto out;
 
+  /* Verify if its a valid user */
+  if (params.op.user.uinfo.access_keys.empty()) {
+    ldpp_dout(dpp, 0)<<"In GetUser - No user with query(" <<query_str.c_str()<<"), user_id(" << uinfo.user_id <<") found" << dendl;
+    return -ENOENT;
+  }
+
   uinfo = params.op.user.uinfo;
 
   if (pattrs) {