Skip to content

Commit a413adc

Browse files
committed
rgw: fixing tempest ObjectTestACLs and ObjectACLsNegativeTest cases
The issue was introduced in ceph@d82ff16 and backported to Squid by: ceph@f0fb48d As a result rgw couldn't find the correct bucket in case the user from different tenant was given access to the container using ACL, because rgw started to look inside the user's tenant, but not the tenant from the request. This partial revert helps to fix the issue Signed-off-by: Alexey Odinokov <[email protected]>
1 parent 8890c0f commit a413adc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/rgw/rgw_rest_swift.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2947,7 +2947,10 @@ int RGWHandler_REST_SWIFT::postauth_init(optional_yield y)
29472947
&& s->user->get_id().id == RGW_USER_ANON_ID) {
29482948
s->bucket_tenant = s->account_name;
29492949
} else {
2950-
s->bucket_tenant = s->auth.identity->get_tenant();
2950+
/* tenant must be taken from request. Can't use auth.identity->get_tenant(),
2951+
because there are cases when users from different tenant may be granted
2952+
access via ACL to this bucket */
2953+
s->bucket_tenant = s->user->get_tenant();
29512954
}
29522955
s->bucket_name = t->url_bucket;
29532956

0 commit comments

Comments
 (0)