Only call dlerror() after dlsym() failed.
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@520 185d5e19-27fe-0310-9dcf-9bff6b9f3609
This commit is contained in:
parent
31e9142afc
commit
34c9fb6fd3
|
@ -143,11 +143,15 @@ openpam_dynamic(const char *path)
|
||||||
module->dlh = dlh;
|
module->dlh = dlh;
|
||||||
dlmodule = dlsym(dlh, "_pam_module");
|
dlmodule = dlsym(dlh, "_pam_module");
|
||||||
for (i = 0; i < PAM_NUM_PRIMITIVES; ++i) {
|
for (i = 0; i < PAM_NUM_PRIMITIVES; ++i) {
|
||||||
module->func[i] = dlmodule ? dlmodule->func[i] :
|
if (dlmodule) {
|
||||||
(pam_func_t)dlsym(dlh, pam_sm_func_name[i]);
|
module->func[i] = dlmodule->func[i];
|
||||||
if (module->func[i] == NULL)
|
} else {
|
||||||
openpam_log(PAM_LOG_DEBUG, "%s: %s(): %s",
|
module->func[i] =
|
||||||
path, pam_sm_func_name[i], dlerror());
|
(pam_func_t)dlsym(dlh, pam_sm_func_name[i]);
|
||||||
|
if (module->func[i] == NULL)
|
||||||
|
openpam_log(PAM_LOG_DEBUG, "%s: %s(): %s",
|
||||||
|
path, pam_sm_func_name[i], dlerror());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return (module);
|
return (module);
|
||||||
buf_err:
|
buf_err:
|
||||||
|
|
Loading…
Reference in New Issue