Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Busybox env does not show LD_LIBRARY_PATH

We are using linux on an embedded system that has busybox 1.20.2 for the various shell commands. We are having a very strange problem in that env does now show the value of LD_LIBRARY_PATH:

$ export LD_LIBRARY_PAT=/usr/bin
$ export LD_LIBRARY_PATH=/usr/bin
$ export LD_LIBRARY_PATH1=/usr/bin
$ env | sort
ENV=/etc/profile.environment
HISTFILE=/tmp/.ash_history.debug.357
HOME=/home/debug
LD_LIBRARY_PAT=/usr/bin
LD_LIBRARY_PATH1=/usr/bin
LOGNAME=debug
MAIL=/var/mail/debug
PATH=/home/debug/bin:/usr/bin:/bin:/usr/sbin:/sbin
PWD=/home/debug
PYTHONPATH=:/home/debug/tools/tools-0.0.0/common
SHELL=/bin/bash
SHLVL=1
SSH_CLIENT=10.10.10.22 58307 22
SSH_CONNECTION=10.10.10.22 58307 10.10.12.23 22
SSH_TTY=/dev/pts/0
TERM=xterm
USER=debug
_=/usr/bin/env
$ 
$ echo $LD_LIBRARY_PAT
/usr/bin
$ echo $LD_LIBRARY_PATH
/usr/bin
$ echo $LD_LIBRARY_PATH1
/usr/bin

As you can see, LD_LIBRARY_PATH is set, but it just doesn't show up in the output of env. AFAIK, it is the only environment variable that this happens.

Can anyone explain why this is happening? Thanks!

like image 713
David Avatar asked Oct 28 '14 18:10

David


People also ask

Where is LD_LIBRARY_PATH defined?

LD_LIBRARY_PATH is an environmental variable used in Linux/UNIX Systems. It is used to tell dynamic link loaders where to look for shared libraries for specific applications. It is useful until you don't mess with it. It's better to avoid the use of LD_LIBRARY_PATH and use alternatives.

What is LD_LIBRARY_PATH environment variable?

The LD_LIBRARY_PATH environment variable tells Linux applications, such as the JVM, where to find shared libraries when they are located in a different directory from the directory that is specified in the header section of the program.


1 Answers

Linux won't let you mess with the LD_LIBRARY_PATH because busybox (probably) has its setuid bit turned on. Busybox has a bunch of common linux commands built into its binary, so it needs setuid.

like image 52
ErlVolton Avatar answered Oct 11 '22 02:10

ErlVolton