-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to work with the missing LD_LIBRARY_PATH after setcap? #1091
Comments
Hello, |
Hi @igor-ivanov , thanks for the reply. I want to confirm my understanding. If we do I have tried to setup the capabilities programmatically (via libcap), but it's also not working because, by design, Linux capabilities can only be dropped, but never be raised at runtime. |
Related permissions are still needed in dlopen case too. |
To share with anyone facing similar problem, my team has evaluated a number of options and finally decided to go with According to the man-page on capabilities: https://man7.org/linux/man-pages/man7/capabilities.7.html, by setting up the ambient capabilities, the capabilities set will be preserved to the child process and this will not trigger the ld.so secure-execution mode.
Then one can easily run the target executable in a wrapper script. (PS: runtime sudo privilege is still needed.)
|
@igor-ivanov , you may consider closing this ticket Thanks for following up. |
thank you for sharing solution details that could be useful for someone else. |
Hello:
I am trying to run my project with
libvma
as non-root user, it is fine to run the samplesockperf
withlibvma
after setting up the necessary permission withsetuid
andsetcap
mentioned in the user guide.However, when I try to run it with my project, I found that
LD_LIBRARY_PATH
is missing / ignored by LD linker as it is running in a "secure-execution" mode after granting the capabilities to the executable. My project is in a structure where the executable has to link with several inhouse-built library, e.g.Then, without the
LD_LIBRARY_PATH
, I cannot start up my application due to... : error while loading shared libraries: ....
I wonder
libvma
with a wrapper script such that I don't need to runsetcap
on all the executablesPS1. Tried to bind
rpath
during compilation, but it is not perfect as the same.so
will be deployed to different account without a consistent path.PS2. It is running on RHEL 7.4
The text was updated successfully, but these errors were encountered: