Injecting Status-fd output

Patrick Brunschwig patrick at mozilla-enigmail.org
Thu Mar 8 13:57:55 CET 2007


Nicholas Cole wrote:
> The update got me thinking about using gpg in stream mode.
> 
> Usually, I read the --status-fd output and the statard output
> seperately, but obviously this has its own problems.
> 
> If the two are read together, however, as they seem to be intended to
> be, what is to stop the plaintext injecting lines that begin:
> 
> [GPG: ]
> 
> into its output and upsetting whatever parsing engine is doing the reading?

I'm not sure if it's a good idea to read --status-fd from stdout for
exactly the reason you describe.

In Enigmail I read it on a separate file descriptor, and check the
results at the end of the process, before displaying the data to the
user. This way, I can count the number of PLAINTEXT occurrences, and if
needed I can split the output according to the PLAINTEXT_LENGTH fields
(at least I hope that this is reliable information).

-Patrick





More information about the Gnupg-devel mailing list