]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
client/Client.cc: prevent segfaulting 13030/head
authorMichal Jarzabek <stiopa@gmail.com>
Thu, 12 Jan 2017 21:22:20 +0000 (21:22 +0000)
committerNathan Cutler <ncutler@suse.com>
Fri, 20 Jan 2017 17:35:33 +0000 (18:35 +0100)
commit8d0eb6e2870593b94cb71f29bcac7a1f422cd101
tree734dafecadad6e4c0c9a18d1e84ac56d418c6abf
parentf223e27eeb35991352ebc1f67423d4ebc252adb7
client/Client.cc: prevent segfaulting

The segfaulting in the rmdir function is caused by calling
filepath::last_dentry() function.
last_dentry() function assumes that the bits vector has always at
least one element, which is not the case for the the filepath object
created with "/" input.
This commit also fixes other functions affected by this bug:
link, unlink, rename, mkdir, mknod and symlink.

Fixes: http://tracker.ceph.com/issues/9935
Signed-off-by: Michal Jarzabek <stiopa@gmail.com>
(cherry picked from commit 6ed7f2364ae5507bab14c60b582929aa7b0ba400)
src/client/Client.cc
src/include/filepath.h
src/test/libcephfs/test.cc