[Enigmail] xulrunner-ipc leaves file descriptors open in child process?

Jean-David Beyer jeandavid8 at verizon.net
Mon Mar 23 08:32:06 PDT 2009


Daniel Kahn Gillmor wrote:
> On 03/23/2009 04:58 AM, Patrick Brunschwig wrote:
>> The problem is that IPC relies on standard Mozilla platform
>> functionality for executing files. Unfortunately the platform always
>> passes all file descriptors to the child process and doesn't allow to
>> specify different behavior. I was already trying to implement
>> workarounds for it, but I haven't found anything apart from either
>> fixing Mozilla or re-implementing the complete functionality to execute
>> files within IPC. Unfortunately I'm not good enough at these low-level
>> operations, especially as you have to do it differently for Windows,
>> Unix, and other OSes.

For any UNIX platform, perhaps you could put something between the Mozilla
(I assume you do not wish to tinker with Mozilla) and the file you wish to
execute, that you do not wish to tinker with either.

What you could do, I suppose, is write a program that passes all its
arguments to a subprogram, the one Mozilla wants to run. What your program
should do is close all the files you do not wish to pass through (which
would get passed through otherwise), and then execute the processes Mozilla
wants.

Probably what happens in Mozilla is that it does a fork() and an execl() (or
one of its variants). So look up fork() and execl() to see what you need to
do in the intermediate process.
> 
> Yuck.  That does sound like a hairy problem.  I'm glad it's on your
> radar, but i'm afraid i don't have any constructive technical approach
> to offer (you're way more experienced with this stuff than i am).
> 
> Have you raised the concern anywhere in bugzilla?  I'd happily +1 any
> relevant bug if you point me to it, for whatever that's worth.
> 
> Thanks for all your work on this, Patrick.
> 


-- 
   .~.  Jean-David Beyer          Registered Linux User 85642.
   /V\  PGP-Key: 9A2FC99A         Registered Machine   241939.
  /( )\ Shrewsbury, New Jersey    http://counter.li.org
  ^^-^^ 11:20:01 up 7 days, 4:36, 3 users, load average: 4.36, 4.25, 4.30


More information about the Enigmail mailing list