Advice whether pointing LD_LIBRARY_PATH to PATH is a problem

Made a mistake while installing the shared library path while attempting to install CUDA as follows

export LD_LIBRARY_PATH=$PATH:/usr/local/cuda/lib

The result of course is that

  1. LD_LIBRARY_PATH points to PATH
  2. /usr/local/cuda/lib is now added as a normal path(not specifically shared library)

This got me to thinking… What are the consequences of this?

Considering paths for shared libraries and the regular paths, I wonder if there is any kind of security issue when an app or User is looking for a shared library and is given access to the regular path(aren’t regular paths already accessible?)

What might be the consequence of giving any app or User access to a shared libary when I think when properly configured the shared library path is accessible only by specific apps? In the case of the CUDA shared library I assume hardly anything that’s not CUDA could utilize the code.

Hoping for some thoughts,
TIA,
Tony

The two have nothing in common. LD_LIBRARY_PATH is for shared libraries. Executables should not be kept in those directories, and vice versa.

Thx for crystalizing something that was bouncing unclearly around in my mind…

Path = Easily launch executable
LD_LIBRARY_PATH = path to libraries shared between executables

Tony

long ago i gave up on doing that by hand
add the paths you need to
/etc/bash.bashrc.local

if you do not have a *.local make one
and example for a 64 bit system


PATH=$PATH:/usr/opt:/usr/opt/bin:/usr/cuda/bin:/usr/opt/lib64:/usr/opt/include:/usr/opt/lib:/DATA/cspice:/usr/opt/QT_Celestia:$HOME/bin
export PATH 

PKG_CONFIG_PATH="/usr/lib64/pkgconfig:/usr/opt/lib/pkgconfig"
export PKG_CONFIG_PATH

LD_LIBRARY_PATH="/usr/lib64:/usr/lib:/usr/opt/lib64:/usr/opt/lib:/usr/cuda/lib64:/usr/cuda/lib:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH

the order is very VERY important

i do not want the 32 bit /usr/lib searched first ( not on a 64 bit os )