]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/sts: changing identity to boost::none, when role policy 59345/head
authorPritha Srivastava <prsrivas@redhat.com>
Thu, 2 Feb 2023 05:35:41 +0000 (11:05 +0530)
committerKonstantin Shalygin <k0ste@k0ste.ru>
Tue, 20 Aug 2024 12:45:20 +0000 (19:45 +0700)
is verified for putobj permissions, in case of renaming a
large file.

While renaming a large file, putobj is invoked as an intermediate
step, and role policy is verified for the source object if temp creds
are used. Since the role policy is attached to the identity (role)
itself and the role policy does not contain a Principal, there is no
need to verify the identity and hence boost::none is passed in place
of the identity.

fixes: https://tracker.ceph.com/issues/58628

Signed-off-by: Pritha Srivastava <prsrivas@redhat.com>
(cherry picked from commit c2f5716e5196073abfc50917e5f687888f6dff42)

src/rgw/rgw_op.cc

index 1056c1ea043f715499c68b565139ccf8ad9619c0..be739eefd01617901b6b6b1269c88e1265e32717 100644 (file)
@@ -3616,7 +3616,7 @@ int RGWPutObj::verify_permission(optional_yield y)
         auto usr_policy_res = Effect::Pass;
         rgw::ARN obj_arn(cs_object->get_obj());
         for (auto& user_policy : s->iam_user_policies) {
-          if (usr_policy_res = user_policy.eval(s->env, *s->auth.identity,
+          if (usr_policy_res = user_policy.eval(s->env, boost::none,
                              cs_object->get_instance().empty() ?
                              rgw::IAM::s3GetObject :
                              rgw::IAM::s3GetObjectVersion,