Skip to content

Commit 97b4b60

Browse files
committed
rgw: override perms for admin on data sync
If pipe is in user mode and the user is admin, don't check for perms and let it go. Signed-off-by: Seena Fallah <[email protected]>
1 parent 1a253ea commit 97b4b60

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/rgw/driver/rados/rgw_data_sync.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2703,6 +2703,11 @@ int RGWUserPermHandler::Bucket::init(RGWUserPermHandler *handler,
27032703

27042704
bool RGWUserPermHandler::Bucket::verify_bucket_permission(const rgw_obj_key& obj_key, const uint64_t op) const
27052705
{
2706+
if (ps->identity->is_admin()) {
2707+
ldpp_dout(dpp, 4) << "admin user, no need to check permissions" << dendl;
2708+
return true;
2709+
}
2710+
27062711
const rgw_obj obj(ps->bucket_info.bucket, obj_key);
27072712
const auto arn = rgw::ARN(obj);
27082713

@@ -2734,6 +2739,11 @@ bool RGWUserPermHandler::Bucket::verify_bucket_permission(const rgw_obj_key& obj
27342739

27352740
rgw::IAM::Effect RGWUserPermHandler::Bucket::evaluate_iam_policies(const rgw_obj_key& obj_key, const uint64_t op) const
27362741
{
2742+
if (ps->identity->is_admin()) {
2743+
ldpp_dout(dpp, 4) << "admin user, no need to check permissions" << dendl;
2744+
return rgw::IAM::Effect::Allow;
2745+
}
2746+
27372747
const rgw_obj obj(ps->bucket_info.bucket, obj_key);
27382748
const auto arn = rgw::ARN(obj);
27392749
const bool account_root = (ps->identity->get_identity_type() == TYPE_ROOT);

src/rgw/rgw_auth.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ static auto transform_old_authinfo(const RGWUserInfo& user,
216216
id(user.user_id),
217217
display_name(user.display_name),
218218
path(user.path),
219-
user_is_admin(user.admin),
219+
user_is_admin(user.admin || user.system),
220220
type(user.type),
221221
account(std::move(account)),
222222
policies(std::move(policies))

0 commit comments

Comments
 (0)