A system user should still be able to examine suspended buckets, and
get -ENOENT instead of -EACCESS for a deleted object.
Fixes: #6616
Backport: dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit
ea816c1c2fd47eab647d6fab96c9ca4bfeecd5bb)
string oid = object;
rgw_obj obj;
- if (bucket_info.flags & BUCKET_SUSPENDED) {
+ if (!s->system_request && bucket_info.flags & BUCKET_SUSPENDED) {
ldout(s->cct, 0) << "NOTICE: bucket " << bucket_info.bucket.name << " is suspended" << dendl;
return -ERR_USER_SUSPENDED;
}
if (ret < 0)
return ret;
string& owner = bucket_policy.get_owner().get_id();
- if (owner.compare(s->user.user_id) != 0 &&
+ if (!s->system_request && owner.compare(s->user.user_id) != 0 &&
!bucket_policy.verify_permission(s->user.user_id, s->perm_mask, RGW_PERM_READ))
ret = -EACCES;
else