Skip to content

Commit

Permalink
rgw: RGWAccessKey::decode_json() preserves default value of 'active'
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
cbodley committed Nov 19, 2024
1 parent c5eacfc commit 8ba6c2d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/rgw/rgw_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2994,7 +2994,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);
}

Expand Down

0 comments on commit 8ba6c2d

Please sign in to comment.