]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: RGWAccessKey::decode_json() preserves default value of 'active'
authorCasey Bodley <cbodley@redhat.com>
Tue, 19 Nov 2024 19:02:02 +0000 (14:02 -0500)
committerCasey Bodley <cbodley@redhat.com>
Mon, 25 Nov 2024 13:39:05 +0000 (08:39 -0500)
squid added the new "bool active" member that defaults to true, but
RGWAccessKey::decode_json() sets it to false when "active" isn't present

this is an issue for multisite when a squid zone replicates user
metadata from a master zone running reef

Fixes: https://tracker.ceph.com/issues/68985
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 8ba6c2de830129ec0533652a3cb33391b584006d)

src/rgw/rgw_common.cc

index 4c9203093487e5fa2320cae33c2b60d584dcf7ef..f159e742225ec81b8000c04b5a94ead33e0cf64e 100644 (file)
@@ -2988,7 +2988,9 @@ void RGWAccessKey::decode_json(JSONObj *obj) {
       subuser = user.substr(pos + 1);
     }
   }
-  JSONDecoder::decode_json("active", active, obj);
+  if (bool tmp = false; JSONDecoder::decode_json("active", tmp, obj)) {
+    active = tmp; // update only if "active" is present
+  }
   JSONDecoder::decode_json("create_date", create_date, obj);
 }