Bug 238677

Summary: devel/efl: Leaks event monitor fds into child processes
Product: Ports & Packages Reporter: Conrad Meyer <cem>
Component: Individual Port(s)Assignee: freebsd-enlightenment (Nobody) <enlightenment>
Status: New ---    
Severity: Affects Many People Keywords: patch
Priority: --- Flags: bugzilla: maintainer-feedback? (enlightenment)
Version: Latest   
Hardware: Any   
OS: Any   

Description Conrad Meyer freebsd_committer freebsd_triage 2019-06-18 02:36:24 UTC
Please see the full report text in this upstream issue: https://phab.enlightenment.org/T7486

The fix is trivial -- add O_CLOEXEC to an open.  I thought upstream might fix it, but it does not appear they will.  So we might consider patching it in ports.

The patch to fix is totally trivial:

--- ./eio_monitor_kevent.c.orig 2019-06-17 19:34:47.015700000 -0700
+++ ./eio_monitor_kevent.c      2019-06-17 19:35:04.938381000 -0700
@@ -271,7 +271,7 @@
    res = stat(monitor->path, &st);
    if (res) goto error;

-   fd = open(monitor->path, O_RDONLY);
+   fd = open(monitor->path, O_RDONLY | O_CLOEXEC);
    if (fd < 0) goto error;

    backend->fd = fd;
Comment 1 Conrad Meyer freebsd_committer freebsd_triage 2019-10-13 17:29:23 UTC
Fyi, this was addressed upstream:

https://phab.enlightenment.org/rEFL3d5e73570455b19f75c1ba8223956ea15657c009