The functions allow to query and update the values of some LD_XXX environment variables affecting the dynamic linker behavior.
The var names must be provided without the LD_ (LD_32_ or any other ABI-specific) prefix.
Differential D47351
rtld: add rtld_{get,set}_var kib on Thu, Oct 31, 6:07 AM. Authored by Tags None Referenced Files
Details
The functions allow to query and update the values of some LD_XXX environment variables affecting the dynamic linker behavior. The var names must be provided without the LD_ (LD_32_ or any other ABI-specific) prefix.
Diff Detail
Event Timeline
Comment Actions Are there any security implications? Should we see if there's an opportunity in glibc/musl to provide the same interface? Also check the URLs in your commits - I looked your repo and one referenced D4735 (missing final digit).
Comment Actions Just a few minor nits on the roff syntax reported by mandoc -Tlint. Thanks for tagging @manpages!
Comment Actions I do not believe so. You need to have a code in the process to be able to call the functions, and then you might as well open-code what rtld does. Also, there is a check for setuid/setgid and then rtld refuses to change even white-listed variables. This might be an overkill.
I am not sure how to answer this.
Fixed.
Comment Actions
Put another way, should we encourage other rtld implementations to adopt this interface (or simply make them aware of it)?
Comment Actions Perhaps make them aware part, but I do not want to post to libc list with this.
Comment Actions Looks good. One final thought on the interface names - how about rtld_get_var and rtld_set_var? My thought is they're not quite env vars based on the discussion we had above and also the fact that the LD_ prefix is not part of the names. So what if we just consider them rtld variables initialized from the environment?
Comment Actions Use vararg trick for filling env var description array. Comment Actions Add explanatory text about env vars into rtld.1.
|