RGWUserInfo encode/decode

2015-08-13 Thread Pete Zaitcev
Hi,

I stumpbled upon a code like this in src/rgw/rgw_common.h:

struct RGWUserInfo {
  mapstring, RGWAccessKey swift_keys;  // not one swift_key, a whole map
  void decode(bufferlist::iterator bl) {
string swift_key;
if (struct_v = 4) ::decode(swift_key, bl);
// that's all, folks
  }
}

Looks like swift_key is never set when RGWUserInfo is deserialized.
It looks like a bug on the surface, but nobody cared thus far, so maybe
it's not actually a problem.

Do you happen to recall where this is used... Does radosgw-admin send
a whole RGWUserInfo to RADOS, ever? It appears to go the other way, in
show_user_info(), but strangely enough the tool shows Swift keys just fine.

-- Pete
--
To unsubscribe from this list: send the line unsubscribe ceph-devel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: RGWUserInfo encode/decode

2015-08-13 Thread Yehuda Sadeh-Weinraub
On Thu, Aug 13, 2015 at 11:50 AM, Pete Zaitcev zait...@redhat.com wrote:
 Hi,

 I stumpbled upon a code like this in src/rgw/rgw_common.h:

 struct RGWUserInfo {
   mapstring, RGWAccessKey swift_keys;  // not one swift_key, a whole map
   void decode(bufferlist::iterator bl) {
 string swift_key;
 if (struct_v = 4) ::decode(swift_key, bl);
 // that's all, folks
   }
 }

 Looks like swift_key is never set when RGWUserInfo is deserialized.
 It looks like a bug on the surface, but nobody cared thus far, so maybe
 it's not actually a problem.

It's a backward compatibility issue, we used to keep a single key as a
string, later changed it into a map (decoded later). What I'd expect
to see here is populating the map with the string we read here (if not
empty), however, I'm pretty sure no one will hit this issue as it'd
require a *real* old structure (circa 2009) that no one would have.

 Do you happen to recall where this is used... Does radosgw-admin send
 a whole RGWUserInfo to RADOS, ever? It appears to go the other way, in
 show_user_info(), but strangely enough the tool shows Swift keys just fine.


Whenever we read user's info (e.g., when authenticating user) this is
getting decoded.

Yehuda
--
To unsubscribe from this list: send the line unsubscribe ceph-devel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html