]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
client/Client.cc: prevent segfaulting 12550/head
authorMichal Jarzabek <stiopa@gmail.com>
Thu, 12 Jan 2017 21:22:20 +0000 (21:22 +0000)
committerMichal Jarzabek <stiopa@gmail.com>
Thu, 12 Jan 2017 21:31:09 +0000 (21:31 +0000)
commit6ed7f2364ae5507bab14c60b582929aa7b0ba400
tree2ae9e37111afdf319084e34237ade8abb724dd7a
parenta30d90cdc69aa6cbe7bd7ae5bc556d6c35854f3f
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>
src/client/Client.cc
src/include/filepath.h
src/test/libcephfs/test.cc