[libvirt] commandtest fails when executed with preloaded libraries

Eric Blake eblake at redhat.com
Thu Jan 6 15:31:29 UTC 2011


On 01/06/2011 07:11 AM, Daniel P. Berrange wrote:
> On Thu, Jan 06, 2011 at 02:56:21PM +0100, Diego Elio Pettenò wrote:
>> In Gentoo we sandbox software installation with a software called
>> sandbox, which basically is a preloaded library that wraps around a
>> number of file access functions.
>>
>> This method seems to break commandtest because the environment now has a
>> LD_PRELOAD variable in it, which is not accounted for in the
>> pre-generated log files.
>>
>> Any idea how I should go about to solve this beside adding LD_PRELOAD to
>> the log files themselves for Gentoo?
> 
> We should add
> 
>   unsetenv(LD_PRELOAD)
>   unsetenv(LD_LIBRARY_PATH)
> 
> to commandtest.c, because although we want these env variables
> in normal usage of the virCommandPtr APIs, they're not desirable
> in this test case. Since commandtesthelper doesn't do anything
> to the system beyond creating a logfile, I imagine it'd work
> fine without gentoo's LD_PRELOAD

Another alternative might be to keep LD_PRELOAD and LD_LIBRARY_PATH
untouched (in case they do prove to be important for figuring out how to
run the child process), but patch commandhelper.c to omit outputting
those two environment variables (they are too unpredictable, and enough
other envvars are tested to make us feel confident that virCommand is
doing the right thing).

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110106/072c9d4d/attachment-0001.sig>


More information about the libvir-list mailing list