]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix the return type is wrong 19773/head
authorhechuang <hechuang@xsky.com>
Wed, 3 Jan 2018 07:45:53 +0000 (15:45 +0800)
committerhechuang <hechuang@xsky.com>
Thu, 4 Jan 2018 06:48:55 +0000 (14:48 +0800)
invalid acl header will also be successful

Signed-off-by: hechuang <hechuang@xsky.com>
src/rgw/rgw_acl_s3.cc

index 43a961d18606be38a56d47a9caaed7eb607ca016..5f026ff35471396964243ead6aa602a028496f80 100644 (file)
@@ -454,14 +454,17 @@ static const s3_acl_header acl_header_perms[] = {
 int RGWAccessControlPolicy_S3::create_from_headers(RGWRados *store, const RGWEnv *env, ACLOwner& _owner)
 {
   std::list<ACLGrant> grants;
+  int r = 0;
 
   for (const struct s3_acl_header *p = acl_header_perms; p->rgw_perm; p++) {
-    if (parse_acl_header(store, env, p, grants) < 0)
-      return false;
+    r = parse_acl_header(store, env, p, grants);
+    if (r < 0) {
+      return r;
+    }
   }
 
   RGWAccessControlList_S3& _acl = static_cast<RGWAccessControlList_S3 &>(acl);
-  int r = _acl.create_from_grants(grants);
+  r = _acl.create_from_grants(grants);
 
   owner = _owner;