From 6f6e425d1282fc83de68d4251361bda21e52a061 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Thu, 6 Jun 2013 13:44:47 -0700 Subject: [PATCH] rgw: fix json decoding for swift keys Signed-off-by: Yehuda Sadeh --- src/rgw/rgw_json_enc.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/rgw/rgw_json_enc.cc b/src/rgw/rgw_json_enc.cc index fa155043fd1bd..7b807a3e3bb79 100644 --- a/src/rgw/rgw_json_enc.cc +++ b/src/rgw/rgw_json_enc.cc @@ -238,11 +238,10 @@ void RGWAccessKey::decode_json(JSONObj *obj, bool swift) { } if (!JSONDecoder::decode_json("subuser", subuser, obj)) { - string user; - JSONDecoder::decode_json("user", user, obj, true); - int pos = user.find(':'); + JSONDecoder::decode_json("user", id, obj, true); + int pos = id.find(':'); if (pos >= 0) { - subuser = user.substr(pos + 1); + subuser = id.substr(pos + 1); } } JSONDecoder::decode_json("secret_key", key, obj, true); -- 2.39.5