]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/sts: fix for encoding/decoding user namespace 40257/head
authorPritha Srivastava <prsrivas@redhat.com>
Tue, 23 Feb 2021 15:19:08 +0000 (20:49 +0530)
committersinguliere <singuliere@autistici.org>
Fri, 19 Mar 2021 18:21:46 +0000 (19:21 +0100)
in RGWUserInfo, to fetch the user details correctly
for OIDC users which are created in 'oidc' namespace.

Fixes: https://tracker.ceph.com/issues/49444
Signed-off-by: Pritha Srivastava <prsrivas@redhat.com>
(cherry picked from commit dce12afea2cd4126542d876cde96e28f45cd610c)

src/rgw/rgw_common.h

index 4a96a86492760044275e060034a0266b8b4d731c..2593bcfcc39d436ddbbabf4a4befbfc1316787ed 100644 (file)
@@ -707,7 +707,7 @@ struct RGWUserInfo
   }
 
   void encode(bufferlist& bl) const {
-     ENCODE_START(21, 9, bl);
+     ENCODE_START(22, 9, bl);
      encode((uint64_t)0, bl); // old auid
      string access_key;
      string secret_key;
@@ -750,10 +750,11 @@ struct RGWUserInfo
      encode(type, bl);
      encode(mfa_ids, bl);
      encode(assumed_role_arn, bl);
+     encode(user_id.ns, bl);
      ENCODE_FINISH(bl);
   }
   void decode(bufferlist::const_iterator& bl) {
-     DECODE_START_LEGACY_COMPAT_LEN_32(21, 9, 9, bl);
+     DECODE_START_LEGACY_COMPAT_LEN_32(22, 9, 9, bl);
      if (struct_v >= 2) {
        uint64_t old_auid;
        decode(old_auid, bl);
@@ -834,6 +835,11 @@ struct RGWUserInfo
     if (struct_v >= 21) {
       decode(assumed_role_arn, bl);
     }
+    if (struct_v >= 22) {
+      decode(user_id.ns, bl);
+    } else {
+      user_id.ns.clear();
+    }
     DECODE_FINISH(bl);
   }
   void dump(Formatter *f) const;