]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
13207: Rados Gateway: Anonymous user is able to read bucket with authenticated read ACL 6057/head
authorroot <rahul.1aggarwal@gmail.com>
Wed, 23 Sep 2015 18:51:13 +0000 (00:21 +0530)
committerroot <rahul.1aggarwal@gmail.com>
Thu, 19 Nov 2015 19:22:19 +0000 (00:52 +0530)
Signed-off-by: root <rahul.1aggarwal@gmail.com>
src/rgw/rgw_acl_s3.cc
src/rgw/rgw_op.cc

index f0ed08118dfaa66e2d3dca4efa2dec77c5feee85..490bf98221aa301f369373da7fdd03725209f563 100644 (file)
@@ -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:
index ff84aba0b064e14812225a03918ad5fea5a60685..91f5229c6cbe93b3942e9b814e97c487aa554554 100644 (file)
@@ -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"
@@ -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;