[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: shared library loading flags



On Thu, 6 Dec 2012 12:38:50 -0800
Steve Langasek <vorlon debian org> wrote:

> On Thu, Dec 06, 2012 at 09:23:55PM +0200, Artur Artamonov wrote:
> > Is there some specific explanations why modules is loaded with flags
> > RTLD_NOW?
> 
> > pam_dynamic.c:67:       return dlopen(mod_path, RTLD_NOW);
> 
> Because if you're missing a dependency symbol, you want this to be
> discovered and reported at load time, not when you're deep in the
> middle of the stack.
> 
> > There was issue when i was using myown PAM module that uses others
> > shared libraries. I was calling this module from dropbear and there
> > allways was some unresolved symbols from shared librarires after i
> > added flag RTLD_GLOBAL 
> 
> > pam_dynamic.c:67:       return dlopen(mod_path,
> > RTLD_NOW|RTLD_GLOBAL);
> 
> > Is there possible that this flag will added in next LinuxPAM
> > realise?
> 
> Certainly not.  RTLD_GLOBAL means:
> 
>             The symbols defined by this library will be made
> available for symbol resolution of subsequently loaded libraries.
> 
> There is no reason that you should need the symbols from the PAM
> module dumped into the global namespace; and doing so can cause
> crashes due to symbol collisions.
> 
> If you find yourself needing this, then you have missing library
> dependency declarations somewhere else in your setup.
> 

Shared libraries was used only by PAMmodule and only PAM module was
responsable for loading dynamic symbols. And PAM module have different
so defined then application that using it.
If you saying that there is no need of such symbol i will make more
testing and trying to resolve it.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]