From 92ee0de8361e8ff0999999c9852b4d297ac037c1 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 8 Jun 2011 15:57:46 -0700 Subject: [PATCH] mds: drop workaround for embedded null decoding We removed the embedded null check recently, 9b37f4f, so this workaround isn't needed. Signed-off-by: Sage Weil --- src/mds/mdstypes.h | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/mds/mdstypes.h b/src/mds/mdstypes.h index da54bf07e67c..2f142d6b64a1 100644 --- a/src/mds/mdstypes.h +++ b/src/mds/mdstypes.h @@ -817,23 +817,10 @@ struct cap_reconnect_t { ::encode_nohead(flockbl, bl); } void decode(bufferlist::iterator& bl) { - decode_path(path, bl); + ::decode(path, bl); ::decode(capinfo, bl); ::decode_nohead(capinfo.flock_len, flockbl, bl); } -private: - void decode_path(std::string &path, bufferlist::iterator& p) { - // Bypass the check for embedded NULLs by decoding into a raw byte buffer. - // We sometimes get paths with embedded NULLs from old kernel clients. - __u32 len; - ::decode(len, p); - if (len > PATH_MAX) - throw buffer::malformed_input("cap_reconnect_t::decode_path: PATH too long!"); - char str[len + 1]; - memset(str, 0, sizeof(str)); - p.copy(len, str); - path = str; - } }; WRITE_CLASS_ENCODER(cap_reconnect_t) -- 2.47.3