diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-07-18 13:18:36 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-07-26 15:29:11 +0200 |
commit | 22f62b1274ba120ebc0d7de95bf3241982ddb840 (patch) | |
tree | 5c09bf47ae3f44230d6a16c950e60dece20a882b /src | |
parent | 4b486ee8b15e4c5487838f590dd025fe9a969d40 (diff) | |
download | systemd-22f62b1274ba120ebc0d7de95bf3241982ddb840.tar.gz |
fs-util: CHASE_NOFOLLOW is not limited to CHASE_OPEN
$ build/test-chase-symlinks /etc/os-release
/etc/os-release → /usr/lib/os-release
$ build/test-chase-symlinks --nofollow /etc/os-release /etc/../etc/os-release /etc/../etc/./././os-release
/etc/os-release → /etc/os-release
/etc/../etc/os-release → /etc/os-release
/etc/../etc/./././os-release → /etc/os-release
Diffstat (limited to 'src')
-rw-r--r-- | src/basic/fs-util.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/basic/fs-util.h b/src/basic/fs-util.h index a35c3b6f31..9a242ce3c5 100644 --- a/src/basic/fs-util.h +++ b/src/basic/fs-util.h @@ -81,8 +81,9 @@ enum { CHASE_OPEN = 1 << 4, /* Return an O_PATH object to the final component */ CHASE_TRAIL_SLASH = 1 << 5, /* Any trailing slash will be preserved */ CHASE_STEP = 1 << 6, /* 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. */ + CHASE_NOFOLLOW = 1 << 7, /* Do not follow the path's right-most compontent. With CHASE_OPEN, when + * the path's right-most component refers to symlink, return O_PATH fd of + * the symlink. */ CHASE_WARN = 1 << 8, /* Emit an appropriate warning when an error is encountered */ }; |