Skip to content

Commit

Permalink
13207: Rados Gateway: Anonymous user is able to read bucket with auth…
Browse files Browse the repository at this point in the history
…enticated read ACL

Signed-off-by: root <rahul.1aggarwal@gmail.com>
(cherry picked from commit 99ba661)
  • Loading branch information
rahul1aggarwal authored and smithfarm committed Sep 11, 2016
1 parent 8f66abd commit 09f2f06
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/rgw/rgw_acl_s3.cc
Expand Up @@ -540,7 +540,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

0 comments on commit 09f2f06

Please sign in to comment.