Skip to content

Commit 67c7e37

Browse files
authored
Merge pull request ceph#61271 from clwluvw/datasync-usermode-err
rgw: set retcode on verify_bucket_permission in RGWObjFetchCR Reviewed-by: Casey Bodley <[email protected]>
2 parents 3b5dc13 + f288861 commit 67c7e37

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/rgw/driver/rados/rgw_data_sync.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3021,7 +3021,7 @@ class RGWObjFetchCR : public RGWCoroutine {
30213021

30223022
if (!dest_bucket_perms.verify_bucket_permission(dest_key.value_or(key), rgw::IAM::s3PutObject)) {
30233023
ldout(cct, 0) << "ERROR: " << __func__ << ": permission check failed: user not allowed to write into bucket (bucket=" << sync_pipe.info.dest_bucket.get_key() << ")" << dendl;
3024-
return -EPERM;
3024+
return set_cr_error(-EPERM);
30253025
}
30263026
}
30273027

@@ -4520,7 +4520,7 @@ class RGWBucketSyncSingleEntryCR : public RGWCoroutine {
45204520
}
45214521
tn->set_resource_name(SSTR(bucket_str_noinstance(bs.bucket) << "/" << key));
45224522
}
4523-
if (retcode == -ERR_PRECONDITION_FAILED || retcode == -EPERM) {
4523+
if (retcode == -ERR_PRECONDITION_FAILED || retcode == -EPERM || retcode == -EACCES) {
45244524
pretty_print(sc->env, "Skipping object s3://{}/{} in sync from zone {}\n",
45254525
bs.bucket.name, key, zone_name);
45264526
set_status("Skipping object sync: precondition failed (object contains newer change or policy doesn't allow sync)");

0 commit comments

Comments
 (0)