Hi,
I need to run a program from a no root user, this program defend from some shared library .so .
This library is located in the dir /home/lupin/lib,
i try to do:
but i always have this message: “error while loading shared libraries: libsched.so: cannot open shared object file: No such file or directory”
libsched.so is in the /home/lupin/lib directory.
if i do the same operation with root user all work properly.
What is the problem?
i don’t want to use LD_RUN_PATH environmental variable.
Which kind of environmental variable i have to set???
Your second export is wrong… you have a semicolon instead of a colon
(the first export is correct).
Try posting the output from the ‘ldd’ command using your binary/executable
as a parameter, or use chkbin (Novell tool, part of the supportutils
package) to do ‘ldd’ plus a bunch of other stuff.
Good luck.
lupin982 wrote:
> Hi,
> I need to run a program from a no root user, this program defend from
> some shared library .so .
> This library is located in the dir /home/lupin/lib,
> i try to do:
>
> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/lupin/lib
> export LD_LIBRARYN32_PATH=$LD_LIBRARYN32_PATH;/home/lupin/lib
>
> but i always have this message: “error while loading shared libraries:
> libsched.so: cannot open shared object file: No such file or directory”
>
> libsched.so is in the /home/lupin/lib directory.
> if i do the same operation with root user all work properly.
> What is the problem?
> i don’t want to use LD_RUN_PATH environmental variable.
> Which kind of environmental variable i have to set???
>
> Thanks
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
The problem is probably that you are becoming root and that is trashing
your environment variable. Try using sudo with ldd after exporting your
variables and see if libsched.so is no longer found:
sudo ldd ./my_process
Good luck.
lupin982 wrote:
> yes, sorry the semicolon is an error of copy from shell.
>
> i have the problem of LD_LIBRARY_PATH after execution of setcap for the
> process
>
> i do this:
>
> -sudo /sbin/setcap all=eip my_process
>
> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/lupin/lib
> export LD_LIBRARYN32_PATH=$LD_LIBRARYN32_PATH:/home/lupin/lib-
>
> and when i execute my_process i,ve a problem of shred library.
>
> this is the output of ldd my_process:
> -
> linux-vdso.so.1 => (0x00007fff67fff000)
> libGLU.so.1 => /usr/lib64/libGLU.so.1 (0x00007fcc5fb94000)
> libGL.so.1 => /usr/lib64/libGL.so.1 (0x00007fcc5f9a1000)
> libXmu.so.6 => /usr/lib64/libXmu.so.6 (0x00007fcc5f787000)
> libXext.so.6 => /usr/lib64/libXext.so.6 (0x00007fcc5f575000)
> libX11.so.6 => /usr/lib64/libX11.so.6 (0x00007fcc5f237000)
> libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fcc5f01b000)
> librt.so.1 => /lib64/librt.so.1 (0x00007fcc5ee12000)
> libsched.so => /home/lupin/lib/libsched.so
> (0x00007fcc5ec0e000)
> libshm.so => /home/lupin/lib/libshm.so (0x00007fcc5ea0a000)
> libradar.so => /home/lupin/lib/libradar.so
> (0x00007fcc5aaf2000)
> libpager.so => /home/lupin/lib/libpager.so
> (0x00007fcc48c78000)
> libstdc++.so.6 => /usr/local/gnat/lib64/libstdc++.so.6
> (0x00007fcc48971000)
> libm.so.6 => /lib64/libm.so.6 (0x00007fcc4871b000)
> libgcc_s.so.1 => /usr/local/gnat/lib64/libgcc_s.so.1
> (0x00007fcc48503000)
> libc.so.6 => /lib64/libc.so.6 (0x00007fcc481aa000)
> libGLcore.so.1 => /usr/lib64/libGLcore.so.1
> (0x00007fcc46ec0000)
> libnvidia-tls.so.1 => /usr/lib64/tls/libnvidia-tls.so.1
> (0x00007fcc46dbd000)
> libdl.so.2 => /lib64/libdl.so.2 (0x00007fcc46bb9000)
> libXt.so.6 => /usr/lib64/libXt.so.6 (0x00007fcc46953000)
> libSM.so.6 => /usr/lib64/libSM.so.6 (0x00007fcc46749000)
> libICE.so.6 => /usr/lib64/libICE.so.6 (0x00007fcc4652c000)
> libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007fcc46328000)
> libxcb-xlib.so.0 => /usr/lib64/libxcb-xlib.so.0
> (0x00007fcc46125000)
> libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007fcc45f09000)
> /lib64/ld-linux-x86-64.so.2 (0x00007fcc5fe58000)
> libuuid.so.1 => /lib64/libuuid.so.1 (0x00007fcc45d03000)-
>
> and this is tho output of echo $LD_LIBRARY_PATH
>
> -/usr/lib/qt3/lib:/usr/lib64/mpi/gcc/openmpi/lib64:/usr/local/gnat/lib64:/home/lupin/lib:/home/lupin/lib-
>
> and this is the output when i try to execute my_process:
>
> -./my_process: error while loading shared libraries: libsched.so:
> cannot open shared object file: No such file or directory-
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
many thanks for your reply,
this is true, with sudo ldd my_process
the library libshm.so is not foud.
I think, after i use setcap for my_process, if i execute it, it is execute with root root.
But now the problem is how to set LD_LIBRARY_PATH for root from user lupin, i try sudo export, but i have the message sudo: export: not found
Is there a way to set this environmental variable for root, from a not root user?
I would probably do it by creating a script which sets it and then calls
the executable, and then I would call the script with ‘sudo’. Another
option may be to set the SUID bit on your binary so you can call it
without sudo at all, though that means anybody with execute rights to the
file can use it with root permissions.
Good luck.
lupin982 wrote:
> many thanks for your reply,
> this is true, with
> -sudo ldd my_process-
> the library libshm.so is not foud.
> I think, after i use setcap for my_process, if i execute it, it is
> execute with root root.
> But now the problem is how to set LD_LIBRARY_PATH for root from user
> lupin, i try -sudo export-, but i have the message
> -sudo: export: not found-
>
> Is there a way to set this environmental variable for root, from a not
> root user?
>
> thanks
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
thanks for your fast reply,
i try with script that export LD_LIBRARY_PATH and execute the process, but when i execute the script with sudo i have an error, because in the script i execute my_process in a xterm.
the error is the follow:
Use ‘gnomesu’ or ‘kdesu’ for X-ish apps if you are not familiar with the
process to allow apps to access your desktop as another user manually.
Good luck.
lupin982 wrote:
> thanks for your fast reply,
> i try with script that export LD_LIBRARY_PATH and execute the process,
> but when i execute the script with sudo i have an error, because in the
> script i execute my_process in a xterm.
> the error is the follow:
>
> -xterm Xt error: Can,t open display:%s-
>
> i try also from shell the command:
> -sudo xterm-
>
> and i have the same error.
>
> do you have any suggestion?
>
> many Thanks
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/