This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: problem with running a direct command
- From: Josh Stone <jistone at redhat dot com>
- To: corpaul <c dot bezemer at tudelft dot nl>
- Cc: systemtap at sourceware dot org
- Date: Tue, 14 May 2013 09:52:47 -0700
- Subject: Re: problem with running a direct command
- References: <1368536245460-231745 dot post at n7 dot nabble dot com>
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.