]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/FileStore: only recognized valid collection names
authorSage Weil <sage@redhat.com>
Mon, 5 Jan 2015 23:26:17 +0000 (15:26 -0800)
committerSage Weil <sage@redhat.com>
Fri, 19 Jun 2015 00:02:47 +0000 (17:02 -0700)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/FileStore.cc

index 12b367661830af6b932818a60cb67674f95fcbc9..70b8525daceaa398a0fc89c02b1ff2585dde3d2f 100644 (file)
@@ -4596,7 +4596,11 @@ int FileStore::list_collections(vector<coll_t>& 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);
   }