]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
client/Client.cc: prevent segfaulting 13029/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:15:41 +0000 (18:15 +0100)
commit7a341a8886c93a8c4f266f8035784dd2e9528e3f
tree9c8a32e8137168dd6b5fffb6c64669ae4ba2e46d
parent01ff6751e1705094fe1c8057685fa7216bd56118
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)

Conflicts:
src/client/Client.cc (Client.cc - path_walk(), may_create(), and
                              _link() take fewer parameters in jewel)
src/test/libcephfs/test.cc (preceding tests are missing in jewel)
src/client/Client.cc
src/include/filepath.h
src/test/libcephfs/test.cc