]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
This appears to fix RGW auth...
authorJesse F. Williamson <jfw@ibm.com>
Tue, 18 Mar 2025 19:35:50 +0000 (12:35 -0700)
committerJesse F. Williamson <jfw@ibm.com>
Tue, 18 Mar 2025 19:35:50 +0000 (12:35 -0700)
...but sure is a bit mysterious to me.

Signed-off-by: Jesse F. Williamson <jfw@ibm.com>
src/rgw/rgw_policy_s3.cc

index 7b8ad0452cbc5618c39b1e4ea74e90a5a0276696..d734249ed2c3bcb6d3ba847ab134922e430b6d1c 100644 (file)
@@ -248,9 +248,11 @@ int RGWPolicy::from_json(bufferlist& bl, string& err_msg)
 {
   JSONParser parser;
 
-  if (!parser.parse(bl.c_str(), bl.length())) {
-    err_msg = "Malformed JSON";
-    dout(0) << "malformed json" << dendl;
+  // Without subtracting 1, we wind up sending bad data into the
+  // parser:
+  if (!parser.parse(bl.c_str(), bl.length() - 1)) {
+    err_msg = "Malformed JSON (RGWPolicy)";
+    dout(0) << "malformed json (RGWPolicy)" << dendl;
     return -EINVAL;
   }