Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pacific: rgw: fix UploadPartCopy error code when src object not exist and src bucket not exist #53356

Merged
merged 1 commit into from Nov 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 8 additions & 5 deletions src/rgw/rgw_op.cc
Expand Up @@ -450,10 +450,10 @@ static int read_obj_policy(const DoutPrefixProvider *dpp,
map<string, bufferlist>& bucket_attrs,
RGWAccessControlPolicy* acl,
string *storage_class,
boost::optional<Policy>& policy,
boost::optional<Policy>& policy,
rgw::sal::RGWBucket* bucket,
rgw::sal::RGWObject* object,
optional_yield y,
optional_yield y,
bool copy_src=false)
{
string upload_id;
Expand Down Expand Up @@ -3578,6 +3578,9 @@ int RGWPutObj::init_processing(optional_yield y) {
&bucket, y);
if (ret < 0) {
ldpp_dout(this, 5) << __func__ << "(): get_bucket() returned ret=" << ret << dendl;
if (ret == -ENOENT) {
ret = -ERR_NO_SUCH_BUCKET;
}
return ret;
}

Expand Down Expand Up @@ -3645,9 +3648,9 @@ int RGWPutObj::verify_permission(optional_yield y)
cs_object->set_prefetch_data(s->obj_ctx);

/* check source object permissions */
if (read_obj_policy(this, store, s, copy_source_bucket_info, cs_attrs, &cs_acl, nullptr,
policy, cs_bucket.get(), cs_object.get(), y, true) < 0) {
return -EACCES;
if (ret = read_obj_policy(this, store, s, copy_source_bucket_info, cs_attrs, &cs_acl, nullptr,
policy, cs_bucket.get(), cs_object.get(), y, true); ret < 0) {
return ret;
}

/* admin request overrides permission checks */
Expand Down