]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rgw: forward_iam_request_to_master() trims trailing null from response
authorCasey Bodley <cbodley@redhat.com>
Fri, 12 Jan 2024 16:08:38 +0000 (11:08 -0500)
committerCasey Bodley <cbodley@redhat.com>
Fri, 12 Jan 2024 16:08:42 +0000 (11:08 -0500)
commit9a93e9375f236379faaf0a7103ad4b74c9a72de4
treec5db537532121526186cff7898a479c8df04843f
parentd5a08ba98756d2f4eeef438d89fa1ea959e62fc3
rgw: forward_iam_request_to_master() trims trailing null from response

fix a regression from commit d3ad0efaee6a19c84b2af9b3dfa1b6c902674774
which changed how we parse the response bufferlist:

-  std::string r = response.c_str();
+  std::string r = response.to_str();

when the response contains a trailing null character, this now ends up in
`r` and breaks json parsing in `parser.parse(r.c_str(), r.length(), 1)`

replace `response.to_str()` with `rgw_bl_str(response)` which trims
trailing nulls

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_rest_role.cc