[Poppler-bugs] [Bug 107597] New: opens files without CLOEXEC

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Aug 16 20:22:06 UTC 2018


https://bugs.freedesktop.org/show_bug.cgi?id=107597

            Bug ID: 107597
           Summary: opens files without CLOEXEC
           Product: poppler
           Version: unspecified
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: general
          Assignee: poppler-bugs at lists.freedesktop.org
          Reporter: chpe at gnome.org

Created attachment 141150
  --> https://bugs.freedesktop.org/attachment.cgi?id=141150&action=edit
patch

Poppler opens files without O_CLOEXEC.

The attached patch fixes this in the libraries (but not the utils, since it
doesn't matter there).

Since there already is a fopen() wrapper in goo/gfile, I changed invocations of
fopen() to use openFile instead, and made a macro wrapper around openFile that
adds the "e" mode (meaning CLOEXEC).

In the few places where open() is used instead of fopen(), I added O_CLOEXEC
(with a fallback #define O_CLOEXEC 0 for those systems where O_CLOEXEC isn't
defined).

(There was a problem in glib/ where including gfile.h leads to a conflict with
glib.h in that both define a "GDir" type; I resolved this by making gfile.h not
define its GDir if GFILE_NO_GDIR is #define'd before inclusion. I would have
renamed GDir -> GooDir, for example, but it appears that header is installed
and thus would have been an API change.)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/poppler-bugs/attachments/20180816/bccedbee/attachment.html>


More information about the Poppler-bugs mailing list