<p>This pull request is not sufficient to fix the problem. For one there is no io.open in rpm's lua so far. Also we probably do not want random scriptlets to mess with with the file descriptors of the rpm process. So this would need some kind of protection (as we already added to exec and exit).</p>

<p>It might need to be a bit more complex, though, as permitting file operations only after forking is kinda strange.</p>

<p>Also your proposed script relies on io.open("/dev/null") returning 2 as it assumes that this is the lowest free file descriptor. This is really ugly and probably unreliable. A proper solution would be to use dup2 (also not available).</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/rpm-software-management/rpm/pull/44#issuecomment-176179051">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ANb806gcwhHBTn7IF1yI26Svetj64xjtks5peguzgaJpZM4HFPFo.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/rpm-software-management/rpm/pull/44#issuecomment-176179051"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>