LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-15-2013, 01:00 PM   #1
jyunker
Member
 
Registered: Aug 2009
Posts: 167

Rep: Reputation: 0
using LD_PRELOAD and changing LD_LIBRARY_PATH


I am not sure where to place this thread. I am new to this forum. I have a question about
an IBM example in one of their technical reports.

In that example they are demonstrating how to override a function in a gnu library. The code is

export LD_PRELOAD=libfuncs.so
export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH
./setresgid-tester
It's me the shim. Hi there!

I know about preoload files, but I thought that you had to put not only the file name, but its path into the PRE_LOAD command.

Also. what is gong on on the next line? It seems to be nonsense. I know it is not.

export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH

What is with the .: in the command. It is needed because the output of ./setresgid-tester is different if it is left out.

Is it a good idea to change the LD_LIBRARY_PATH by adding an additional path?

Any help appreciated. Thanks in advance.

Respectfully,


jyunker
 
Old 10-16-2013, 06:24 AM   #2
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 875

Rep: Reputation: 282Reputation: 282Reputation: 282
The . is the current directory, by adding it in they have enabled the ability to PRELOAD the library from the current directory which is why they have not given it's path.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Differences between LD_LIBRARY_PATH and LD_PRELOAD Nerox Linux - General 1 05-12-2012 07:51 PM
ERROR: ld.so: LD_PRELOAD cannot be preloaded xombboxer Linux - Newbie 2 05-12-2011 11:16 AM
LD_PRELOAD not working kamransoomro84 Programming 3 07-28-2010 06:09 PM
Should we trust on LD_PRELOAD (library preload) ? barunparichha Programming 2 07-13-2006 09:42 PM
Differences between LD_LIBRARY_PATH and LD_PRELOAD Nerox Linux - Newbie 1 10-01-2004 08:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration