/* Loosely based on preauth2.c */
+#define IS_PRIMARY_INSTANCE(_module) ((_module)->client_req_init != NULL)
+
static const char *objdirs[] = {
#if TARGET_OS_MAC
KRB5_AUTHDATA_PLUGIN_BUNDLE_DIR,
continue;
/* externalize request context for the first instance only */
- if (module->client_req_init == NULL)
+ if (!IS_PRIMARY_INSTANCE(module))
continue;
if (module->ftable->size == NULL)
continue;
/* externalize request context for the first instance only */
- if (module->client_req_init == NULL)
+ if (!IS_PRIMARY_INSTANCE(module))
continue;
if (module->ftable->externalize == NULL)
continue;
/* internalize request context for the first instance only */
- if (module->client_req_init == NULL)
+ if (!IS_PRIMARY_INSTANCE(module))
continue;
/* check for name match */
return ENOENT;
/* copy request context for the first instance only */
- if (dst_module->client_req_init == NULL)
+ if (!IS_PRIMARY_INSTANCE(dst_module))
return 0;
assert(strcmp(dst_module->name, src_module->name) == 0);