On Tue, Nov 08, 2005 at 04:31:31PM -0500, Joey Hess wrote:
> 
> The use of PERL_DL_NONLAZY in a conditional is broken. The confmodule
> sets PERL_DL_NONLAZY to work around a bug in perl; it can be set
> externally for other reasons; depending on it to decide whether to mess
> with file descriptors links two unrelated things and will surely cause
> bugs. Besides, it's ugly and impossible to understand (at least,
> impossible for me to understand why you'd ever consider using it in the
> conditional).

Fair enough.  I've changed it to use a new variable DEBCONF_TEMP_REDIR.

> I don't understand the 9>&- part.

The idea is that we save stdout in fd 9 before the frontend is invoked.
After we regain control in confmodule we move fd 9 back to stdout.  The
operator 9>&- closes fd 9.

> Still highly sceptical that this change wouldn't break something.

I'm not saying that this won't break anything.  However, I am pretty
confident that this will not break any more than the existing redirection
of fd 3.

When it will break is if the calling shell script is already making use
of fd 9 before it calls confmodule AND the same file descriptor is meant
to survive across the call to confmodule.  In that case fd 9 will end up
getting closed.  The same thing affects fd 3 of course (although given
the fact that people have been using debconf for years one would presume
that no one would be doing that now).

I don't consider this to be a likely scenario because the typical usage
of /usr/share/debconf/confmodule is at or near the top of a shell script.
This means that fd 9 redirection is unlikely because

1) The use of fd 9 is rare to begin with (I grepped for it in my
   /var/lib/dpkg/info and found no occurence of this at all).
2) When it is used it is likely to occur after the call to
   /usr/share/debconf/confmodule.  At this point fd 9 is no longer
   in use by DEBCONF which means that it is perfectly safe for the
   shell script to redirect it again.

In the rare even that it does break the fix to the script is trivial.
Simply move the call to confmodule before any redirection to fd 9 is
made and it will work.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to