]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: both princ and nonprinc will not coexist in a single statement
authorAbhishek Lekshmanan <abhishek@suse.com>
Fri, 30 Aug 2019 09:35:34 +0000 (11:35 +0200)
committerAbhishek Lekshmanan <abhishek@suse.com>
Mon, 3 Feb 2020 16:53:31 +0000 (17:53 +0100)
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
src/rgw/rgw_iam_policy.cc

index c33db62149cb0ac57ab163157b205e6124f61f92..86bc8ac9be32612a47437ef471cad826cdd73f29 100644 (file)
@@ -1443,14 +1443,13 @@ struct IsPublicStatement
     if (s.effect == Effect::Allow) {
       for (const auto& p : s.princ) {
        if (p.is_wildcard()) {
-         if (s.eval_conditions(iam_all_env) == Effect::Allow)
-           return true;
+         return s.eval_conditions(iam_all_env) == Effect::Allow;
        }
       }
       // no princ should not contain fixed values
-      return std::all_of(s.noprinc.begin(), s.noprinc.end(), [](const rgw::auth::Principal& p) {
-                                                               return !p.is_wildcard();
-                                                            });
+      return std::none_of(s.noprinc.begin(), s.noprinc.end(), [](const rgw::auth::Principal& p) {
+                                                               return p.is_wildcard();
+                                                             });
     }
     return false;
   }