Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug #13207: Rados Gateway: Anonymous user is able to read bucket with authenticated read ACL #6057

Merged
merged 1 commit into from Nov 19, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/rgw/rgw_acl_s3.cc
Expand Up @@ -568,7 +568,7 @@ bool RGWAccessControlPolicy_S3::compare_group_name(string& id, ACLGroupTypeEnum
{
switch (group) {
case ACL_GROUP_ALL_USERS:
return (id.compare(rgw_uri_all_users) == 0);
return (id.compare(RGW_USER_ANON_ID) == 0);
case ACL_GROUP_AUTHENTICATED_USERS:
return (id.compare(rgw_uri_auth_users) == 0);
default:
Expand Down
9 changes: 8 additions & 1 deletion src/rgw/rgw_op.cc
Expand Up @@ -17,6 +17,7 @@
#include "rgw_rest.h"
#include "rgw_acl.h"
#include "rgw_acl_s3.h"
#include "rgw_acl_swift.h"
#include "rgw_user.h"
#include "rgw_bucket.h"
#include "rgw_log.h"
Expand Down Expand Up @@ -356,7 +357,13 @@ static int rgw_build_policies(RGWRados *store, struct req_state *s, bool only_bu
}
}

s->bucket_acl = new RGWAccessControlPolicy(s->cct);
if(s->dialect.compare("s3") == 0) {
s->bucket_acl = new RGWAccessControlPolicy_S3(s->cct);
} else if(s->dialect.compare("swift") == 0) {
s->bucket_acl = new RGWAccessControlPolicy_SWIFT(s->cct);
} else {
s->bucket_acl = new RGWAccessControlPolicy(s->cct);
}

if (s->copy_source) { /* check if copy source is within the current domain */
const char *src = s->copy_source;
Expand Down