]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw.iam: change '1' to '1ULL' in function print_actions 18900/head
authorBingyin Zhang <zhangbingyin@cloudin.cn>
Mon, 13 Nov 2017 10:47:46 +0000 (18:47 +0800)
committerBingyin Zhang <zhangbingyin@cloudin.cn>
Mon, 13 Nov 2017 10:47:46 +0000 (18:47 +0800)
* IAM has 54 operations corresponding to 54 bits. 1 is a signed integer
* which can cover 31 operations, so we need 1ULL here.

Signed-off-by: Bingyin Zhang <zhangbingyin@cloudin.cn>
src/rgw/rgw_iam_policy.cc

index e07c7c02a9f2d1c8976358f137ec9c1c741c9e58..6e732b3ca89ca277e9343c8e033774b5743ea25f 100644 (file)
@@ -1416,13 +1416,13 @@ ostream& print_actions(ostream& m, const uint64_t a) {
   bool begun = false;
   m << "[ ";
   for (auto i = 0U; i < s3Count; ++i) {
-    if (a & (1 << i)) {
+    if (a & (1ULL << i)) {
       if (begun) {
-       m << ", ";
+        m << ", ";
       } else {
-       begun = true;
+        begun = true;
       }
-      m << action_bit_string(1 << i);
+      m << action_bit_string(1ULL << i);
     }
   }
   if (begun) {