Nicolas Williams wrote: > rpcsec_gss_if.c has: > > - rpcgss_calls_init(), which tries to dlopen("rpcsec.so.1", RTLD_LAZY) > and, if successful, tries to dlsym() a variety of symbols and places > them in a global variable. > > - Stubs for rpc_gss_*() that call rpcgss_calls_init() and then call the > corresponding function pointer saved by rpcgss_calls_init(). > > The function names in rpcsec.so.1 are the same as in rpcsec_gss_if.c, > but prefixed with "__". > > It seems to me that the Right Thing to do here is to use auxiliary > filters. Or even to just fold "rpcsec.so.1" into libnsl (unless we > think this filter approach is desirable for minimization).
If rpcsec.so.1 is always delivered by the OS, then testing for its existence, either with dlopen() or filtering, would seem an unnecessary overhead. If you still want to program as if rpcsec.so.1 is optional, then a filter would provide the necessary indirection. Each routine in libnsl would be something like: rpc_gss_seccreate(.....) { return (NULL); } with a corresponding mapfile entry: rpc_gss_seccreate = AUXILIARY rpcsec.so.1; If ld.so.1 finds rpcsec.so.1, then a caller will be bound to rpcsec.so.1's version of rpc_gss_seccreate(). Otherwise, you fall back to libnsl's version which returns NULL. -- Rod.