A S3 subuser having no permissions was able to do a normal user ops,
from aws docs there's no functionality for a s3 subuser as we do have
with swift. The fix here is to check the "subuser perm mask" before going
forward with "no_acl" check.
Fixes: https://tracker.ceph.com/issues/63791
Signed-off-by: Shreyansh Sancheti <ssanchet@redhat.com>
if (s->identity->get_identity_type() == TYPE_ROLE)
return false;
- /* S3 doesn't support account ACLs, so user_acl will be uninitialized. */
- if (user_acl.get_owner().id.empty())
- return true;
-
+ /* S3 doesn't have a subuser, it takes user permissions */
if ((perm & (int)s->perm_mask) != perm)
return false;
+ /* S3 doesn't support account ACLs, so user_acl will be uninitialized. */
+ if (user_acl.get_owner().id.empty())
+ return true;
+
return user_acl.verify_permission(dpp, *s->identity, perm, perm);
}