summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libcutils/fs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libcutils/fs.c b/libcutils/fs.c
index 286a8eb..45c7add 100644
--- a/libcutils/fs.c
+++ b/libcutils/fs.c
@@ -212,7 +212,7 @@ int fs_mkdirs(const char* path, mode_t mode) {
/* Yay, segment is ready for us to step into */
int next_fd;
- if ((next_fd = openat(fd, segment, 0)) == -1) {
+ if ((next_fd = openat(fd, segment, O_NOFOLLOW | O_CLOEXEC)) == -1) {
ALOGE("Failed to openat(%s): %s", buf, strerror(errno));
res = -errno;
goto done_close;