mirror of
https://github.com/ceph/ceph
synced 2024-12-19 01:46:00 +00:00
77230d434a
The long_name variable is not initialized. When the append_oname function is called, it will strlen(long_name) and get a result that depends on the stack content. The long_name is truncated to a zero length string to prevent this unexpected behavior. There is no sure way to trigger the problem by writing a unit test. Unit tests are added for all public methods of the FlatIndex class. Most of the time the tests fail if the long_name variable is not properly initialized. * uint32_t collection_version() * coll_t coll() const * void set_ref(std::tr1::shared_ptr<CollectionIndex> ref) * int cleanup() * int init() * int created(const hobject_t &hoid, const char *path) * int unlink(const hobject_t &hoid) * int lookup(const hobject_t &hoid, IndexedPath *path, int *exist) * int collection_list(vector<hobject_t> *ls) * int collection_list_partial(const hobject_t &start, int min_count, int max_count, snapid_t seq, vector<hobject_t> *ls, hobject_t *next) There are a number of border cases that cannot be tested, such as the logic of the lfn_get static function. Since FlatIndex code is designed to transition from older namespace conventions, it is difficult to figure out. The tests rely on xattr(2) and their availability is checked before running them. http://tracker.ceph.com/issues/4542 refs #4542 Signed-off-by: Loic Dachary <loic@dachary.org> |
||
---|---|---|
.. | ||
btrfs_ioctl.h | ||
chain_xattr.cc | ||
chain_xattr.h | ||
CollectionIndex.h | ||
DBObjectMap.cc | ||
DBObjectMap.h | ||
FileJournal.cc | ||
FileJournal.h | ||
FileStore.cc | ||
FileStore.h | ||
FlatIndex.cc | ||
FlatIndex.h | ||
HashIndex.cc | ||
HashIndex.h | ||
hobject.cc | ||
hobject.h | ||
IndexManager.cc | ||
IndexManager.h | ||
Journal.h | ||
JournalingObjectStore.cc | ||
JournalingObjectStore.h | ||
KeyValueDB.h | ||
LevelDBStore.cc | ||
LevelDBStore.h | ||
LFNIndex.cc | ||
LFNIndex.h | ||
ObjectMap.h | ||
ObjectStore.cc | ||
ObjectStore.h | ||
SequencerPosition.h |