[libvirt] [PATCH] virExec: fix logic bug

As pointed out in https://bugzilla.redhat.com/show_bug.cgi?id=659855#c9, commit c3568ec2 introduced a regression where we no longer close any fd's beyond FD_SETSIZE. * src/util/util.c (__virExec): Continue to close fd's beyond keepfd range. Reported by Stefan Praszalowicz. --- src/util/util.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/util/util.c b/src/util/util.c index d6fa81b..197c571 100644 --- a/src/util/util.c +++ b/src/util/util.c @@ -570,7 +570,7 @@ __virExec(const char *const*argv, i != null && i != childout && i != childerr && - (!keepfd || (i < FD_SETSIZE && !FD_ISSET(i, keepfd)))) { + (!keepfd || i >= FD_SETSIZE || !FD_ISSET(i, keepfd))) { tmpfd = i; VIR_FORCE_CLOSE(tmpfd); } -- 1.7.3.4

On 12/24/2010 08:42 AM, Eric Blake wrote:
As pointed out in https://bugzilla.redhat.com/show_bug.cgi?id=659855#c9, commit c3568ec2 introduced a regression where we no longer close any fd's beyond FD_SETSIZE.
* src/util/util.c (__virExec): Continue to close fd's beyond keepfd range. Reported by Stefan Praszalowicz.
Ping - this is a regression bug fix; anyone willing to review it in time for inclusion in 0.8.7?
+++ b/src/util/util.c @@ -570,7 +570,7 @@ __virExec(const char *const*argv, i != null && i != childout && i != childerr && - (!keepfd || (i < FD_SETSIZE && !FD_ISSET(i, keepfd)))) { + (!keepfd || i >= FD_SETSIZE || !FD_ISSET(i, keepfd))) { tmpfd = i; VIR_FORCE_CLOSE(tmpfd); }
-- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

2010/12/31 Eric Blake <eblake@redhat.com>:
On 12/24/2010 08:42 AM, Eric Blake wrote:
As pointed out in https://bugzilla.redhat.com/show_bug.cgi?id=659855#c9, commit c3568ec2 introduced a regression where we no longer close any fd's beyond FD_SETSIZE.
* src/util/util.c (__virExec): Continue to close fd's beyond keepfd range. Reported by Stefan Praszalowicz.
Ping - this is a regression bug fix; anyone willing to review it in time for inclusion in 0.8.7?
+++ b/src/util/util.c @@ -570,7 +570,7 @@ __virExec(const char *const*argv, i != null && i != childout && i != childerr && - (!keepfd || (i < FD_SETSIZE && !FD_ISSET(i, keepfd)))) { + (!keepfd || i >= FD_SETSIZE || !FD_ISSET(i, keepfd))) { tmpfd = i; VIR_FORCE_CLOSE(tmpfd); }
ACK. Matthias

On 12/31/2010 10:00 AM, Matthias Bolte wrote:
2010/12/31 Eric Blake <eblake@redhat.com>:
On 12/24/2010 08:42 AM, Eric Blake wrote:
As pointed out in https://bugzilla.redhat.com/show_bug.cgi?id=659855#c9, commit c3568ec2 introduced a regression where we no longer close any fd's beyond FD_SETSIZE.
ACK.
Thanks; applied. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
Matthias Bolte