From: Jiri Denemark Date: Tue, 30 Jul 2013 08:41:50 +0000 (+0200) Subject: tests: Put a mock library at the start of LD_PRELOAD X-Git-Tag: CVE-2013-4239~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df166a611ba9cf8696e126190317f5d29ec2bab8;p=thirdparty%2Flibvirt.git tests: Put a mock library at the start of LD_PRELOAD This fixes vircgrouptest when run in a sandbox which already overrides open() and others. --- diff --git a/tests/testutils.h b/tests/testutils.h index 27af5da69c..8583747bfa 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -87,8 +87,9 @@ int virtTestMain(int argc, perror(lib); \ return EXIT_FAILURE; \ } \ - if (virAsprintf(&newenv, "%s%s%s", preload ? preload : "", \ - preload ? ":" : "", lib) < 0) { \ + if (!preload) { \ + newenv = (char *) lib; \ + } else if (virAsprintf(&newenv, "%s:%s", lib, preload) < 0) { \ perror("virAsprintf"); \ return EXIT_FAILURE; \ } \