|
From: | Kyle Sallee |
Subject: | Re: a minor bug |
Date: | Tue, 10 Nov 2015 09:04:25 -0800 |
> findutils-4.4.2.o_cloexec.patchOn 11/06/2015 10:31 PM, Kyle Sallee wrote:
> By xargs a file descriptor is leaked.
> Within find; the omission might or might not exist.
> A patch is attached.
>
>
>
>
> diff -r -U2 findutils-4.4.2/xargs/xargs.c findutils-4.4.2/xargs/xargs.c
> --- findutils-4.4.2/xargs/xargs.c 0000-00-00 00:00:00.000000000 -0000
> +++ findutils-4.4.2/xargs/xargs.c 0000-00-00 00:00:00.000000000 -0000
> @@ -647,5 +647,5 @@
> {
> keep_stdin = 1; /* see prep_child_for_exec() */
> - input_stream = fopen (input_file, "r");
> + input_stream = fopen (input_file, "re");
fopen(,"re") is not (yet) POSIX; we'd have to guarantee that it is first
supported by gnulib before we could rely on it. But the idea of marking
fds close-on-exec in xargs so that they are not leaked to the child
process makes sense.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
findutils-4.4.2-fclose_leak.patch
Description: Binary data
[Prev in Thread] | Current Thread | [Next in Thread] |