Skip to content

Commit 094bfc5

Browse files
committed
rgw: false assumption on vault bucket key deletion
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 <[email protected]>
1 parent 734c5eb commit 094bfc5

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

src/rgw/rgw_kms.cc

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -651,8 +651,8 @@ class TransitSecretEngine: public VaultSecretEngine {
651651
}
652652
if (dummy_bl.length() != 0) {
653653
ldpp_dout(dpp, 0) << "ERROR: unexpected response from Vault making a key: "
654-
<< dummy_bl
655-
<< dendl;
654+
<< std::string_view(dummy_bl.c_str(), dummy_bl.length())
655+
<< dendl;
656656
}
657657
return 0;
658658
}
@@ -688,26 +688,22 @@ class TransitSecretEngine: public VaultSecretEngine {
688688
int res = send_request(dpp, "POST", "", config_path,
689689
post_data, y, dummy_bl);
690690
if (res < 0) {
691+
ldpp_dout(dpp, 0) << "ERROR: unexpected response from Vault marking key to delete, ret: "
692+
<< res << " response: "
693+
<< std::string_view(dummy_bl.c_str(), dummy_bl.length())
694+
<< dendl;
691695
return res;
692696
}
693-
if (dummy_bl.length() != 0) {
694-
ldpp_dout(dpp, 0) << "ERROR: unexpected response from Vault marking key to delete: "
695-
<< dummy_bl
696-
<< dendl;
697-
return -EINVAL;
698-
}
699697

700698
res = send_request(dpp, "DELETE", "", delete_path,
701699
string{}, y, dummy_bl);
702700
if (res < 0) {
701+
ldpp_dout(dpp, 0) << "ERROR: unexpected response from Vault deleting key, ret: "
702+
<< res << " response: "
703+
<< std::string_view(dummy_bl.c_str(), dummy_bl.length())
704+
<< dendl;
703705
return res;
704706
}
705-
if (dummy_bl.length() != 0) {
706-
ldpp_dout(dpp, 0) << "ERROR: unexpected response from Vault deleting key: "
707-
<< dummy_bl
708-
<< dendl;
709-
return -EINVAL;
710-
}
711707
return 0;
712708
}
713709
};

0 commit comments

Comments
 (0)