From acbbd50abe4dca5369a7f1be3fe488fb5040f2d4 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 5 Jan 2015 15:26:17 -0800 Subject: [PATCH] os/FileStore: only recognized valid collection names Signed-off-by: Sage Weil --- src/os/FileStore.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index 12b367661830a..70b8525daceaa 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -4596,7 +4596,11 @@ int FileStore::list_collections(vector& ls, bool include_temp) (de->d_name[1] == '.' && de->d_name[2] == '\0'))) continue; - coll_t cid(coll_t::make_string_coll(de->d_name)); + coll_t cid; + if (!cid.parse(de->d_name)) { + derr << "ignoging invalid collection '" << de->d_name << "'" << dendl; + continue; + } if (!cid.is_temp() || include_temp) ls.push_back(cid); } -- 2.39.5