[Bug][gpgme] mess with file descriptors

Werner Koch wk at gnupg.org
Thu Nov 6 15:55:59 CET 2014


can you please explain what you are doing.  Best with some code.

On Thu,  6 Nov 2014 12:10, jeanjacquesbrucker at gmail.com said:

> I found a workaround to that bug, by assigning the STDOUT_FILENO fd
> (the n°1) to /dev/null, instead of closing it and so using it later for
> a listening socket.

It is not a good idea to re-use the standard sockets.  See this comment
from GnuPG:

/* Make sure that the standard file descriptors are opened. Obviously
   some folks close them before an exec and the next file we open will
   get one of them assigned and thus any output (i.e. diagnostics) end
   up in that file (e.g. the trustdb).  Not actually a gpg problem as
   this will hapen with almost all utilities when called in a wrong
   way.  However we try to minimize the damage here and raise
   awareness of the problem.

   Must be called before we open any files! */

>  In the documentation maybe can you also cite now GPGME_DEBUG
>  environment variable and that STDERR_FILENO is used to display TRACEs
>  when GPGME_DEBUG > 0. :-)

That is for what stderr is there.  But okay, I add a comment.

> To finish, i hope i am not out-of-topic, but BIG CONGRATULATION for
> GnuPG 2.1.0 ! ^^

No.  Thanks.



Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.

More information about the Gnupg-devel mailing list