Unable to load libsctp.so for non root users

I have a Linux application that uses the libsctp.so library. When I run it as root, it works fine.

But when I run it as a regular user, it gives the following error:

when loading shared libraries: libsctp.so.1: cannot open shared objects file: no such file or directory

But when I do ldd as a regular user, he can see the library:

[sanjeev @ devtest6 src] $ ldd myapp

  ...
   ...
  libsctp.so.1 => /usr/local/lib/libsctp.so.1 (0x00d17000)

[sanjeev @ devtest6 src] $ ls -lL / usr / local / lib / libsctp.so.1

-rwxrwxrwx 1 root root 27430 2009-06-29 11: 26 / usr / local / lib / libsctp.so.1

[sanjeev @ devtest6 src] $

What could be wrong? How can ldd find libsctp.so, but when starting the application it cannot find the same library?

EDIT: , , setuid myapp.

+3
4

​​. /etc/ld.so.conf.d followng:

libsctp.so.1.conf

libsctp.so.1.conf :

/USR//Library/

/SBIN/LDCONFIG

.

: setuid , root, LD_LIBRARY_PATH . , libsctp.so. , , root, .bashrc LD_LIBRARY_PATH.

+1

- .

/usr/local/lib/ LIBRARY_PATH .

+1

, , libsctp.so (, ). ldd :

ldd /usr/local/lib/libsctp.so.1
0

LD_LIBRARY_PATH , root ? ldd root, ?

dmitry@debian:~$ echo $LD_LIBRARY_PATH

dmitry@debian:~$ export LD_LIBRARY_PATH=/usr/local/lib
dmitry@debian:~$ echo $LD_LIBRARY_PATH
/usr/local/lib
dmitry@debian:~$ su
Password:
debian: / home / dmitry # echo $ LD_LIBRARY_PATH

debian: / home / dmitry #
0
source

Source: https://habr.com/ru/post/1739448/


All Articles