From 16ab79dacbf7d8e94e70d28192c945cd79c5934c Mon Sep 17 00:00:00 2001 From: Matt Benjamin Date: Mon, 8 Sep 2025 16:26:26 -0400 Subject: [PATCH] rgw: fix policy enforcement for GetObjectAttributes Per https://docs.aws.amazon.com/cli/latest/reference/s3api/get-object-attributes.html: "If the bucket is not versioned, you need the s3:GetObject and s3:GetObjectAttributes permissions." Fixes: https://tracker.ceph.com/issues/72915 Signed-off-by: Matt Benjamin --- src/rgw/rgw_op.cc | 5 +---- src/rgw/rgw_op.h | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 421c266b6d158..ad72028aeb1e1 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -6209,10 +6209,7 @@ int RGWGetObjAttrs::verify_permission(optional_yield y) rgw_iam_add_objtags(this, s, has_s3_existing_tag, has_s3_resource_tag); } - /* XXXX the following conjunction should be &&--but iam_action2 is currently not - * hooked up and always fails (but should succeed if the requestor has READ - * acess to the object) */ - perm = (verify_object_permission(this, s, iam_action1) || /* && */ + perm = (verify_object_permission(this, s, iam_action1) && verify_object_permission(this, s, iam_action2)); } diff --git a/src/rgw/rgw_op.h b/src/rgw/rgw_op.h index ed3b79a821e48..c98b98ad3ec30 100644 --- a/src/rgw/rgw_op.h +++ b/src/rgw/rgw_op.h @@ -2170,7 +2170,6 @@ public: } }; - class RGWDeleteMultiObj : public RGWOp { /** * Handles the deletion of an individual object and uses -- 2.39.5