From e80ed3fd3bd6d6d100b46f06474b8cb8406cdfc5 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Fri, 24 Dec 2010 08:40:42 -0700 Subject: [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 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/util.c b/src/util/util.c index d6fa81b4af..197c57126c 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); } -- GitLab