This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
RE: problem with running a direct command
- From: Cor-paul Bezemer - EWI <C dot Bezemer at tudelft dot nl>
- To: Josh Stone <jistone at redhat dot com>
- Cc: "systemtap at sourceware dot org" <systemtap at sourceware dot org>
- Date: Wed, 15 May 2013 07:26:54 +0000
- Subject: RE: problem with running a direct command
- References: <1368536245460-231745 dot post at n7 dot nabble dot com>,<51926BDF dot 3020609 at redhat dot com>
Works excellent, thanks!
--CP
________________________________________
From: Josh Stone [jistone@redhat.com]
Sent: Tuesday, May 14, 2013 6:52 PM
To: Cor-paul Bezemer - EWI
Cc: systemtap@sourceware.org
Subject: Re: problem with running a direct command
On 05/14/2013 05:57 AM, corpaul wrote:
> Does Systemtap make a change in the LD_LIBRARY_PATH or something?
Yes, this is a consequence of going through our staprun loader, which is
a setuid executable. LD_LIBRARY_PATH, LD_PRELOAD, and several others
are removed and ignored from all setuid/setgid executables for security
reasons.
We could possibly backup these variables somehow, and restore them after
we've dropped privileges, but I'm always hesitant to mess with
security-sensitive code.
Since you're already using a script, tribler.sh, can you set the
relevant environment in there? Or another option is to set this in the
command invocation, like:
stap .... -c "env 'LD_LIBRARY_PATH=$LD_LIBRARY_PATH' ./tribler.sh"
Note the double-quotes to let it expand early, and single-quotes to
preserve any spacing when it runs.