Use RTLD_LAZY rather than RTLD_NOW (which apparently isn't supported

on all platforms, notably OpenBSD).

Submitted by:	Mike Petullo <mike@flyn.org>


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@216 185d5e19-27fe-0310-9dcf-9bff6b9f3609
This commit is contained in:
Dag-Erling Smørgrav 2003-05-13 14:42:04 +00:00
parent d9906b5db1
commit 98f9303b57
1 changed files with 3 additions and 3 deletions

View File

@ -31,7 +31,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $P4: //depot/projects/openpam/lib/openpam_dynamic.c#7 $
* $P4: //depot/projects/openpam/lib/openpam_dynamic.c#8 $
*/
#include <dlfcn.h>
@ -64,10 +64,10 @@ openpam_dynamic(const char *path)
/* try versioned module first, then unversioned module */
if (asprintf(&vpath, "%s.%d", path, LIB_MAJ) == -1)
goto buf_err;
if ((dlh = dlopen(vpath, RTLD_NOW)) == NULL) {
if ((dlh = dlopen(vpath, RTLD_LAZY)) == NULL) {
openpam_log(PAM_LOG_DEBUG, "%s: %s", vpath, dlerror());
*strrchr(vpath, '.') = '\0';
if ((dlh = dlopen(vpath, RTLD_NOW)) == NULL) {
if ((dlh = dlopen(vpath, RTLD_LAZY)) == NULL) {
openpam_log(PAM_LOG_DEBUG, "%s: %s", vpath, dlerror());
free(module);
return (NULL);