summaryrefslogtreecommitdiff
path: root/src/basic/stat-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-12-08 19:35:05 +0100
committerSven Eden <yamakuzure@gmx.net>2017-07-17 17:58:35 +0200
commit2ab3c9b133f3a79f940593cc40b4555f6bfd7f4a (patch)
treeb6a4dbd7d3df454cecc9106a4dc5b4efeaeef34e /src/basic/stat-util.c
parentb9a2add4c257e40e60e49eb4edaf7925ba569c78 (diff)
util-lib: make sure fd_check_fstype() opens files with O_CLOEXEC
Also, O_NOCTTY is a safer bet, let's add that too.
Diffstat (limited to 'src/basic/stat-util.c')
-rw-r--r--src/basic/stat-util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/basic/stat-util.c b/src/basic/stat-util.c
index 2a6e89b75..b62acdb7a 100644
--- a/src/basic/stat-util.c
+++ b/src/basic/stat-util.c
@@ -212,7 +212,7 @@ int fd_check_fstype(int fd, statfs_f_type_t magic_value) {
int path_check_fstype(const char *path, statfs_f_type_t magic_value) {
_cleanup_close_ int fd = -1;
- fd = open(path, O_RDONLY);
+ fd = open(path, O_RDONLY|O_CLOEXEC|O_NOCTTY);
if (fd < 0)
return -errno;