コード例 #1
0
static void *
try_dlopen(const char *modfn)
{

	if (openpam_check_path_owner_perms(modfn) != 0)
		return (NULL);
	return (dlopen(modfn, RTLD_NOW));
}
コード例 #2
0
static void *
try_dlopen(const char *modfn)
{
	int check_module_file;
	void *dlh;

	openpam_get_feature(OPENPAM_VERIFY_MODULE_FILE,
	    &check_module_file);
	if (check_module_file &&
	    openpam_check_path_owner_perms(modfn) != 0)
		return (NULL);
	if ((dlh = dlopen(modfn, RTLD_NOW)) == NULL) {
		openpam_log(PAM_LOG_ERROR, "%s: %s", modfn, dlerror());
		errno = 0;
		return (NULL);
	}
	return (dlh);
}