mirror of
https://github.com/ceph/ceph
synced 2024-12-19 01:46:00 +00:00
rgw: fail if parts not specified on complete-multipart-upload
Fixes: #11435 A complete multipart upload should not succeed if parts were not specified. Also, adjust return codes. Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
This commit is contained in:
parent
1e912b79f5
commit
6ee4f64973
@ -145,6 +145,7 @@ using ceph::crypto::MD5;
|
||||
#define ERR_QUOTA_EXCEEDED 2026
|
||||
#define ERR_SIGNATURE_NO_MATCH 2027
|
||||
#define ERR_INVALID_ACCESS_KEY 2028
|
||||
#define ERR_MALFORMED_XML 2029
|
||||
#define ERR_USER_SUSPENDED 2100
|
||||
#define ERR_INTERNAL_ERROR 2200
|
||||
|
||||
|
@ -34,6 +34,7 @@ const static struct rgw_http_errors RGW_HTTP_ERRORS[] = {
|
||||
{ ERR_TOO_LARGE, 400, "EntityTooLarge" },
|
||||
{ ERR_TOO_SMALL, 400, "EntityTooSmall" },
|
||||
{ ERR_TOO_MANY_BUCKETS, 400, "TooManyBuckets" },
|
||||
{ ERR_MALFORMED_XML, 400, "MalformedXML" },
|
||||
{ ERR_LENGTH_REQUIRED, 411, "MissingContentLength" },
|
||||
{ EACCES, 403, "AccessDenied" },
|
||||
{ EPERM, 403, "AccessDenied" },
|
||||
|
@ -2968,24 +2968,24 @@ void RGWCompleteMultipart::execute()
|
||||
return;
|
||||
}
|
||||
|
||||
if (!data) {
|
||||
ret = -EINVAL;
|
||||
if (!data || !len) {
|
||||
ret = -ERR_MALFORMED_XML;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!parser.init()) {
|
||||
ret = -EINVAL;
|
||||
ret = -EIO;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!parser.parse(data, len, 1)) {
|
||||
ret = -EINVAL;
|
||||
ret = -ERR_MALFORMED_XML;
|
||||
return;
|
||||
}
|
||||
|
||||
parts = static_cast<RGWMultiCompleteUpload *>(parser.find_first("CompleteMultipartUpload"));
|
||||
if (!parts) {
|
||||
ret = -EINVAL;
|
||||
if (!parts || parts->parts.size() == 0) {
|
||||
ret = -ERR_MALFORMED_XML;
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user