<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - opens files without CLOEXEC"
href="https://bugs.freedesktop.org/show_bug.cgi?id=107597">107597</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>opens files without CLOEXEC
</td>
</tr>
<tr>
<th>Product</th>
<td>poppler
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Other
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Component</th>
<td>general
</td>
</tr>
<tr>
<th>Assignee</th>
<td>poppler-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>chpe@gnome.org
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=141150" name="attach_141150" title="patch">attachment 141150</a> <a href="attachment.cgi?id=141150&action=edit" title="patch">[details]</a></span> <a href='page.cgi?id=splinter.html&bug=107597&attachment=141150'>[review]</a>
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.)</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>