summaryrefslogtreecommitdiff
path: root/src/basic/fs-util.h
diff options
context:
space:
mode:
authorFranck Bui <fbui@suse.com>2018-04-26 22:46:55 +0200
committerFranck Bui <fbui@suse.com>2018-07-30 15:54:03 +0200
commit1f56e4ce773f195bbdf2dfc639d967309321441c (patch)
tree48a470a5d0d4d8bf6ef3e490c6f9a3c6d3969c15 /src/basic/fs-util.h
parent7ea5a87f92bbc7e30cf198bfbad2472a1ecdbf78 (diff)
downloadsystemd-1f56e4ce773f195bbdf2dfc639d967309321441c.tar.gz
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.
Diffstat (limited to 'src/basic/fs-util.h')
-rw-r--r--src/basic/fs-util.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/basic/fs-util.h b/src/basic/fs-util.h
index b1a366ae49..4b65625861 100644
--- a/src/basic/fs-util.h
+++ b/src/basic/fs-util.h
@@ -73,6 +73,7 @@ enum {
CHASE_OPEN = 1 << 4, /* If set, return an O_PATH object to the final component */
CHASE_TRAIL_SLASH = 1 << 5, /* If set, any trailing slash will be preserved */
CHASE_STEP = 1 << 6, /* If set, just execute a single step of the normalization */
+ CHASE_NOFOLLOW = 1 << 7, /* Only valid with CHASE_OPEN: when the path's right-most component refers to symlink return O_PATH fd of the symlink, rather than following it. */
};
/* How many iterations to execute before returning -ELOOP */