]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: false assumption on vault bucket key deletion
authorSeena Fallah <seenafallah@gmail.com>
Mon, 22 Apr 2024 21:16:28 +0000 (23:16 +0200)
committerSeena Fallah <seenafallah@gmail.com>
Thu, 19 Sep 2024 14:55:14 +0000 (16:55 +0200)
On bucket key deletion when the request to change the property of
the key for deletion_allowed to true, it is expected that the
response body be empty. But this assumption is false and there
would be a dump of the new config in the response. this condition
would prevent the key deletion to be done.

Fixes: https://tracker.ceph.com/issues/65626
Signed-off-by: Seena Fallah <seenafallah@gmail.com>
src/rgw/rgw_kms.cc

index cb6454b9fbc3efca1f9431265000ffca4cd66dd2..d9b7e8848a26edea352fbf138b6e3a5d33a77ea2 100644 (file)
@@ -651,8 +651,8 @@ public:
     }
     if (dummy_bl.length() != 0) {
       ldpp_dout(dpp, 0) << "ERROR: unexpected response from Vault making a key: "
-       << dummy_bl
-       << dendl;
+        << std::string_view(dummy_bl.c_str(), dummy_bl.length())
+        << dendl;
     }
     return 0;
   }
@@ -688,26 +688,22 @@ public:
     int res = send_request(dpp, "POST", "", config_path,
                            post_data, y, dummy_bl);
     if (res < 0) {
+      ldpp_dout(dpp, 0) << "ERROR: unexpected response from Vault marking key to delete, ret: "
+        << res << " response: "
+        << std::string_view(dummy_bl.c_str(), dummy_bl.length())
+        << dendl;
       return res;
     }
-    if (dummy_bl.length() != 0) {
-      ldpp_dout(dpp, 0) << "ERROR: unexpected response from Vault marking key to delete: "
-       << dummy_bl
-       << dendl;
-      return -EINVAL;
-    }
 
     res = send_request(dpp, "DELETE", "", delete_path,
                        string{}, y, dummy_bl);
     if (res < 0) {
+      ldpp_dout(dpp, 0) << "ERROR: unexpected response from Vault deleting key, ret: "
+        << res << " response: "
+        << std::string_view(dummy_bl.c_str(), dummy_bl.length())
+        << dendl;
       return res;
     }
-    if (dummy_bl.length() != 0) {
-      ldpp_dout(dpp, 0) << "ERROR: unexpected response from Vault deleting key: "
-       << dummy_bl
-       << dendl;
-      return -EINVAL;
-    }
     return 0;
   }
 };