Merge pull request #60579 from clwluvw/empty-multidelete

rgw: return MalformedXML for empty objects list in DeleteObjects

Reviewed-by: Casey Bodley <cbodley@redhat.com>
This commit is contained in:
J. Eric Ivancich 2024-12-18 08:55:45 -05:00 committed by GitHub
commit ec81d4a454
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7356,6 +7356,12 @@ void RGWDeleteMultiObj::execute(optional_yield y)
return;
}
if (multi_delete->objects.empty()) {
s->err.message = "Missing required element Object";
op_ret = -ERR_MALFORMED_XML;
return;
}
constexpr int DEFAULT_MAX_NUM = 1000;
int max_num = s->cct->_conf->rgw_delete_multi_obj_max_num;
if (max_num < 0) {