From: Sage Weil Date: Wed, 16 May 2012 21:02:26 +0000 (-0700) Subject: keyring: drop binary encoder X-Git-Tag: v0.48argonaut~137^2~44^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=eaea7aa9b28849be612b22ce84971db671319806;p=ceph.git keyring: drop binary encoder Drop the keyring encode method, and binary encoder. Don't just encode in plaintext because we assume we get the whole bufferlist, and encoding something like list would thus fail. Fixes: #2435 Signed-off-by: Sage Weil --- diff --git a/src/auth/KeyRing.h b/src/auth/KeyRing.h index cfac054b28f86..44a657c70d9a6 100644 --- a/src/auth/KeyRing.h +++ b/src/auth/KeyRing.h @@ -71,15 +71,16 @@ public: void import(CephContext *cct, KeyRing& other); // encoders - void encode(bufferlist& bl) const { - __u8 struct_v = 1; - ::encode(struct_v, bl); - ::encode(keys, bl); - } void decode(bufferlist::iterator& bl); void encode_plaintext(bufferlist& bl); }; -WRITE_CLASS_ENCODER(KeyRing) + +// don't use WRITE_CLASS_ENCODER macro because we don't have an encode +// macro. don't juse encode_plaintext in that case because it is not +// wrappable; it assumes it gets the entire bufferlist. +static inline void decode(KeyRing& kr, bufferlist::iterator& p) { + kr.decode(p); +} #endif