Skip to content

Commit 49936d1

Browse files
committed
Adjust open flags
1 parent fc21efc commit 49936d1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ext/opcache/modules.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,8 @@ static void zum_dir_cache_entry_dtor(zval *pDest) {
298298
}
299299
}
300300

301+
#define ZUM_OPENDIR_FLAGS O_RDONLY|O_NDELAY|O_DIRECTORY|O_LARGEFILE|O_CLOEXEC
302+
301303
static bool zum_validate_timestamps_fd(zend_user_module_desc *module_desc,
302304
int dirfd, zend_user_module_dir_cache *cache)
303305
{
@@ -322,7 +324,7 @@ static bool zum_validate_timestamps_fd(zend_user_module_desc *module_desc,
322324
return false;
323325
}
324326
} else {
325-
int fd = openat(dirfd, ZSTR_VAL(name), O_DIRECTORY);
327+
int fd = openat(dirfd, ZSTR_VAL(name), ZUM_OPENDIR_FLAGS);
326328
if (fd == -1) {
327329
ZUM_DEBUG("opendat(%s) failed: %s\n", ZSTR_VAL(name), strerror(errno));
328330
return false;
@@ -356,7 +358,7 @@ static bool zum_validate_timestamps_fd(zend_user_module_desc *module_desc,
356358
static bool zum_validate_timestamps(zend_user_module_desc *module_desc,
357359
zend_user_module_dir_cache *cache)
358360
{
359-
int fd = open(ZSTR_VAL(module_desc->root), O_DIRECTORY);
361+
int fd = open(ZSTR_VAL(module_desc->root), ZUM_OPENDIR_FLAGS);
360362
if (fd == -1) {
361363
ZUM_DEBUG("Failed opening module root directory: %s: %s\n",
362364
ZSTR_VAL(module_desc->root), strerror(errno));

0 commit comments

Comments
 (0)