[Libguestfs] [nbdkit PATCH v2 2/3] server: Sanitize stdin/out before running plugin code

Richard W.M. Jones rjones at redhat.com
Tue Apr 14 07:52:31 UTC 2020


On Mon, Apr 13, 2020 at 07:29:00PM -0500, Eric Blake wrote:
> For that to happen, we need to flush any buffered read-ahead
> data from stdin.  POSIX says fflush(NULL) is supposed to be sufficient
> for the task, but in practice, glibc still has a bug that requires an
> additional fflush(stdin).

Is there a link to the bug?

> @@ -132,6 +132,8 @@ extern bool tls_verify_peer;
>  extern char *unixsocket;
>  extern const char *user, *group;
>  extern bool verbose;
> +extern int orig_in;
> +extern int orig_out;

Personally I think it would be clearer if these were called orig_stdin
& orig_stdout, or saved_stdin & saved_stdout.

But the patch overall looks fine, so ACK.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW




More information about the Libguestfs mailing list