summaryrefslogtreecommitdiffstats
path: root/contrib/openpam/lib
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2002-04-16 21:35:53 +0000
committerdes <des@FreeBSD.org>2002-04-16 21:35:53 +0000
commit2b150cf6ae08e7a10484a561c6bf0977378022dc (patch)
treec34e476ac05923af750c98f3cf45b5aa96cf3795 /contrib/openpam/lib
parent8161706dd9c6d9a7fb7b0c3997789ec083612a06 (diff)
downloadFreeBSD-src-2b150cf6ae08e7a10484a561c6bf0977378022dc.zip
FreeBSD-src-2b150cf6ae08e7a10484a561c6bf0977378022dc.tar.gz
Log dlopen() / dlsym() failures at the debug level (perforce change 9760)
Diffstat (limited to 'contrib/openpam/lib')
-rw-r--r--contrib/openpam/lib/openpam_dynamic.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/contrib/openpam/lib/openpam_dynamic.c b/contrib/openpam/lib/openpam_dynamic.c
index fb0f3f5..d7e05b8 100644
--- a/contrib/openpam/lib/openpam_dynamic.c
+++ b/contrib/openpam/lib/openpam_dynamic.c
@@ -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#3 $
+ * $P4: //depot/projects/openpam/lib/openpam_dynamic.c#4 $
*/
#include <dlfcn.h>
@@ -64,8 +64,10 @@ openpam_dynamic(const char *path)
if (asprintf(&vpath, "%s.%d", path, LIB_MAJ) == -1)
goto buf_err;
if ((dlh = dlopen(vpath, RTLD_NOW)) == NULL) {
+ openpam_log(PAM_LOG_DEBUG, "%s: %s", vpath, dlerror());
*strrchr(vpath, '.') = '\0';
if ((dlh = dlopen(vpath, RTLD_NOW)) == NULL) {
+ openpam_log(PAM_LOG_DEBUG, "%s: %s", vpath, dlerror());
free(module);
return (NULL);
}
@@ -74,8 +76,12 @@ openpam_dynamic(const char *path)
if ((module->path = strdup(path)) == NULL)
goto buf_err;
module->dlh = dlh;
- for (i = 0; i < PAM_NUM_PRIMITIVES; ++i)
+ for (i = 0; i < PAM_NUM_PRIMITIVES; ++i) {
module->func[i] = dlsym(dlh, _pam_sm_func_name[i]);
+ if (module->func[i] == NULL)
+ openpam_log(PAM_LOG_DEBUG, "%s: %s(): %s",
+ vpath, _pam_sm_func_name[i], dlerror());
+ }
return (module);
buf_err:
openpam_log(PAM_LOG_ERROR, "%m");
OpenPOWER on IntegriCloud