client: does not respect O_NOFOLLOW
It looks like doing an open() always implicitly follows symlinks, because we call path_walk() with followsym set to the default "true". There's an O_SYMLINK flag that lets you open symlinks themselves, rather than the file it points to.
#3 Updated by Greg Farnum over 4 years ago
Hmm, I don't remember where this came from but it might have been somebody cross-compiling for OS X. As marked, it's not terribly important but I'll merge in patches which fix it! :)
(I personally have a lot of interest in Ceph on OS X, and making the client usable on that platform is likely to extend CephFS' footprint quite a lot in the future.)
#4 Updated by Radoslaw Zarzynski over 4 years ago
I have added support for O_NOFOLLOW in Client::open and extended unittest as well. It works for me. Patch in attachment.
Unfortunately, I have no access to any system implementing the O_SYMLINK. :-( Anyway, the O_NOFOLLOW should be also available on Mac OS X.
#6 Updated by Radoslaw Zarzynski over 4 years ago
Thank you for your review. You are right, on Linux the call should not fail with ELOOP if there was O_PATH present in the flags too. I am attaching the link to branch with support for O_PATH below, but currently only in Client::open. The full implementation should add checks based on Fh::mode field in many descriptor-accepting methods (like Client::read, Client::write, ...) to just return EBADF, I think. May we split the work into two tasks?
#8 Updated by Radoslaw Zarzynski over 4 years ago
I added the support for O_PATH in several places as well as unit test. The commit is on my github. Feel free to comment.