summaryrefslogtreecommitdiff
path: root/src/basic/xattr-util.c
diff options
context:
space:
mode:
authorAlexander Kuleshov <kuleshovmail@gmail.com>2016-03-02 00:25:09 +0600
committerAlexander Kuleshov <kuleshovmail@gmail.com>2016-03-02 00:42:49 +0600
commitc4b6915670ded7384795705ca9bb131da4763bac (patch)
tree0bb164e6e1f186fd954e8538bb06c9f244d7d144 /src/basic/xattr-util.c
parent6014237390d5d9a20a274d4fcd9c84669cacca83 (diff)
tree-wide: no need to pass excess flags to open()/openat() if O_PATH is passed
As described in the documentation: When O_PATH is specified in flags, flag bits other than O_CLOEXEC, O_DIRECTORY, and O_NOFOLLOW are ignored. So, we can remove unnecessary flags in a case when O_PATH is passed to the open() or openat().
Diffstat (limited to 'src/basic/xattr-util.c')
-rw-r--r--src/basic/xattr-util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/basic/xattr-util.c b/src/basic/xattr-util.c
index 8d7f14f382..8256899eda 100644
--- a/src/basic/xattr-util.c
+++ b/src/basic/xattr-util.c
@@ -110,7 +110,7 @@ ssize_t fgetxattrat_fake(int dirfd, const char *filename, const char *attribute,
/* The kernel doesn't have a fgetxattrat() command, hence let's emulate one */
- fd = openat(dirfd, filename, O_RDONLY|O_CLOEXEC|O_NOCTTY|O_PATH|(flags & AT_SYMLINK_NOFOLLOW ? O_NOFOLLOW : 0));
+ fd = openat(dirfd, filename, O_CLOEXEC|O_PATH|(flags & AT_SYMLINK_NOFOLLOW ? O_NOFOLLOW : 0));
if (fd < 0)
return -errno;