From eaea7aa9b28849be612b22ce84971db671319806 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 16 May 2012 14:02:26 -0700 Subject: [PATCH] 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 --- src/auth/KeyRing.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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 -- 2.39.5