}
if (S_ISREG(st.st_mode)) {
- int fd = open(path, O_RDONLY);
+ int fd = open(path, O_RDONLY|O_CLOEXEC);
DBG(ctx, "parsing file '%s': %d\n", path, fd);
if (fd >= 0)
kmod_config_parse(config, fd, path);
d = conf_files_list(ctx, &list, path);
for (; list != NULL; list = kmod_list_remove(list)) {
- int fd = openat(dirfd(d), list->data, O_RDONLY);
+ int fd = openat(dirfd(d), list->data, O_RDONLY|O_CLOEXEC);
DBG(ctx, "parsing file '%s/%s': %d\n", path,
(const char *) list->data, fd);
if (fd >= 0)
continue;
}
- fd = openat(dfd, de.d_name, O_RDONLY);
+ fd = openat(dfd, de.d_name, O_RDONLY|O_CLOEXEC);
if (fd < 0) {
ERR(mod->ctx, "could not open '%s/%s': %m\n",
dname, de.d_name);