]> git.ipfire.org Git - thirdparty/systemd.git/commit
fs-util: add new CHASE_NOFOLLOW flag to chase_symlinks()
authorFranck Bui <fbui@suse.com>
Thu, 26 Apr 2018 20:46:55 +0000 (22:46 +0200)
committerFranck Bui <fbui@suse.com>
Mon, 30 Jul 2018 13:54:03 +0000 (15:54 +0200)
commit1f56e4ce773f195bbdf2dfc639d967309321441c
tree48a470a5d0d4d8bf6ef3e490c6f9a3c6d3969c15
parent7ea5a87f92bbc7e30cf198bfbad2472a1ecdbf78
fs-util: add new CHASE_NOFOLLOW flag to chase_symlinks()

This flag mimics what "O_NOFOLLOW|O_PATH" does for open(2) that is
chase_symlinks() will not resolve the final pathname component if it's a
symlink and instead will return a file descriptor referring to the symlink
itself.

Note: if CHASE_SAFE is also passed, no safety checking is performed on the
transition done if the symlink would have been followed.
src/basic/fs-util.c
src/basic/fs-util.h
src/test/test-fs-util.c