From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1955 invoked by alias); 21 Feb 2020 14:51:48 -0000 Mailing-List: contact libc-help-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: libc-help-owner@sourceware.org Received: (qmail 1945 invoked by uid 89); 21 Feb 2020 14:51:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=wwwgooglecom, UD:www.google.com, www.google.com, wellknown X-HELO: us-smtp-1.mimecast.com Received: from us-smtp-delivery-1.mimecast.com (HELO us-smtp-1.mimecast.com) (205.139.110.120) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 21 Feb 2020 14:51:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582296705; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=R23+fTyvUM3nJnEu2StYRZ0WCp1KycQD5IclxtuPUCs=; b=ilTGVr7r0DlH8n7gnXJ5ksnCjNAXWgzZshyO8HWiOko77aH+3wXuzttEOIrSGBdA8p9Em6 FGl/urffdbobq58Z9woFBcjowJRBb77DTNBYXQO8hK1WyWyZq8ss8urBmmbqeLJTIWjIgx YsyebqjaXGQF3lKiV2JOaAOv3Z29MTI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-456-7U2Py6pwP7KNZjSExVCXFA-1; Fri, 21 Feb 2020 09:51:37 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5C2DF801E5C for ; Fri, 21 Feb 2020 14:51:36 +0000 (UTC) Received: from localhost (unknown [10.36.118.78]) by smtp.corp.redhat.com (Postfix) with ESMTP id 745EF1001281; Fri, 21 Feb 2020 14:51:33 +0000 (UTC) Date: Fri, 21 Feb 2020 14:51:00 -0000 From: "Richard W.M. Jones" To: Florian Weimer Cc: Eric Blake , libc-help@sourceware.org, "libguestfs@redhat.com" Subject: Re: [Libguestfs] alternatives for hooking dlopen() without LD_LIBRARY_PATH or LD_AUDIT? Message-ID: <20200221145132.GK7304@redhat.com> References: <8cf57641-c31e-3db5-49af-d9d7407a9cb8@redhat.com> <39d94f06-5793-16b5-1372-df3248924671@redhat.com> <3ee96b3f-231b-737f-299a-4406f108c30f@redhat.com> <87d0adnt84.fsf@oldenburg2.str.redhat.com> <8736b4jfop.fsf@oldenburg2.str.redhat.com> MIME-Version: 1.0 In-Reply-To: <8736b4jfop.fsf@oldenburg2.str.redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-SW-Source: 2020-02/txt/msg00024.txt.bz2 On Fri, Feb 21, 2020 at 01:19:34PM +0100, Florian Weimer wrote: > I think what confuses me is that keep talking about a single binary, but > clearly there is this separate vddk DSO, and there is talk of plugins. > So it seems to me that multiple files are involved already? nbdkit is a standalone binary that happens to be able to load plugins from a well-known path, eg nbdkit-vddk-plugin.so. nbdkit knows the path for plugins, and there's a wrapper allowing it to get local plugins even when it's still in the build directory. Adding another file would mean another path (or overloading the meaning of the plugin path) and just makes the whole thing more fragile and complex. Having said all that, what would also solve this is either an API for updating LD_LIBRARY_PATH after the program has started; or making setenv ("LD_LIBRARY_PATH",...) DTRT*; or some kind of dlopen() variant which takes a library path as an extra parameter. Rich. * =E2=80=9CWhy does setenv ("LD_LIBRARY_PATH") not work?=E2=80=9D has sever= al stackoverflow answers. Apparently even the JDK has to work around this by re-execing. https://www.google.com/search?q=3Dsetenv+%22LD_LIBRARY_PATH%22+site:stackov= erflow.com --=20 Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjon= es Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html