From d86ce057971dadb57bc4a7fc7ed9cbfa83d87d5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Thu, 6 Jan 2011 21:23:36 +0100 Subject: [PATCH] commandtest: avoid printing loader-control variables from commandhelper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This avoids throwing the tests off if LD_LIBRARY_PATH or LD_PRELOAD or other variables are set. Signed-off-by: Diego Elio Pettenò --- tests/commandhelper.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/commandhelper.c b/tests/commandhelper.c index f400e8d2f6..46c00f4f90 100644 --- a/tests/commandhelper.c +++ b/tests/commandhelper.c @@ -1,7 +1,7 @@ /* * commandhelper.c: Auxiliary program for commandtest * - * Copyright (C) 2010 Red Hat, Inc. + * Copyright (C) 2010-2011 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -81,7 +81,10 @@ int main(int argc, char **argv) { qsort(newenv, n, sizeof(newenv[0]), envsort); for (i = 0 ; i < n ; i++) { - fprintf(log, "ENV:%s\n", newenv[i]); + /* Ignore the variables used to instruct the loader into + * behaving differently, as they could throw the tests off. */ + if (!STRPREFIX(newenv[i], "LD_")) + fprintf(log, "ENV:%s\n", newenv[i]); } for (i = 0 ; i < sysconf(_SC_OPEN_MAX) ; i++) {