svn rev #24177: branches/plugins/src/ include/ kdc/ lib/kadm5/srv/ plugin_core/ ...
tsitkova@MIT.EDU
tsitkova at MIT.EDU
Thu Jul 8 09:40:11 EDT 2010
http://src.mit.edu/fisheye/changelog/krb5/?cs=24177
Commit By: tsitkova
Log Message:
Changed return types of the plugin related functions per "Plugin support improvements" Project Proposal review.
Introduced plugin_version and removed plugin_id config attr.
Changed Files:
U branches/plugins/src/include/k5-int.h
U branches/plugins/src/kdc/enc_challenge.c
U branches/plugins/src/lib/kadm5/srv/server_misc.c
U branches/plugins/src/plugin_core/impl/plugin_default_loader.c
U branches/plugins/src/plugin_core/impl/plugin_default_manager.c
U branches/plugins/src/plugin_core/impl/plugin_default_manager.h
U branches/plugins/src/plugin_core/libplugin_core.exports
U branches/plugins/src/plugin_core/plugin_loader.c
U branches/plugins/src/plugin_core/plugin_loader.h
U branches/plugins/src/plugin_core/plugin_manager.c
U branches/plugins/src/plugin_core/plugin_manager.h
U branches/plugins/src/plugins/pwd_qlty/plugin_pwd_qlty.h
U branches/plugins/src/plugins/pwd_qlty/plugin_pwd_qlty_DYN/plugin_pwd_qlty_DYN_impl.c
U branches/plugins/src/plugins/pwd_qlty/plugin_pwd_qlty_X/plugin_pwd_qlty_X_impl.c
U branches/plugins/src/plugins/pwd_qlty/plugin_pwd_qlty_krb/plugin_pwd_qlty_krb_impl.c
Modified: branches/plugins/src/include/k5-int.h
===================================================================
--- branches/plugins/src/include/k5-int.h 2010-07-07 20:52:06 UTC (rev 24176)
+++ branches/plugins/src/include/k5-int.h 2010-07-08 13:40:11 UTC (rev 24177)
@@ -1426,8 +1426,9 @@
struct _kdb_log_context;
/* Plugin API ---- PLUGIN HANDLE */
+#define MAX_PL_NAME_LEN 64
typedef struct _plhandle{
- int plugin_id;
+ char plugin_name[MAX_PL_NAME_LEN];
void *api;
struct _plhandle *next;
} plhandle;
@@ -1454,7 +1455,7 @@
void (*configure)(manager_data * data, const char*);
void (*start)(manager_data * data);
void (*stop)(manager_data * data);
- plhandle (*getService)(manager_data * data, const char*, const int pl_id);
+ plhandle (*getService)(manager_data * data, const char*, const char pl_id[MAX_PL_NAME_LEN]);
} plugin_manager;
/* Plugin API ---- PLUGIN HANDLE ----- END*/
Modified: branches/plugins/src/kdc/enc_challenge.c
===================================================================
--- branches/plugins/src/kdc/enc_challenge.c 2010-07-07 20:52:06 UTC (rev 24176)
+++ branches/plugins/src/kdc/enc_challenge.c 2010-07-08 13:40:11 UTC (rev 24177)
@@ -10,7 +10,7 @@
preauth_flags(krb5_context context, krb5_preauthtype pa_type)
{
int flags = 0;
- plhandle handle = plugin_manager_get_service(context->pl_manager, "plugin_pa", 0);
+ plhandle handle;// = plugin_manager_get_service(context->pl_manager, "plugin_pa", 0);
flags = plugin_preauth_flags(handle, context, pa_type);
return flags;
@@ -30,7 +30,7 @@
krb5_pa_data ***out_padata)
{
krb5_error_code ret = 0;
- plhandle handle = plugin_manager_get_service(context->pl_manager, "plugin_pa", 0);
+ plhandle handle ;//= plugin_manager_get_service(context->pl_manager, "plugin_pa", 0);
ret = plugin_process_preauth(handle, context, plugin_context,
request_context, opt,
@@ -52,7 +52,7 @@
void *pa_module_context, krb5_pa_data *data)
{
krb5_error_code retval = 0;
- plhandle handle = plugin_manager_get_service(context->pl_manager, "plugin_pa", 0);
+ plhandle handle;// = plugin_manager_get_service(context->pl_manager, "plugin_pa", 0);
retval = plugin_kdc_include_padata(handle, context, request,
client,
server,
@@ -69,7 +69,7 @@
krb5_data **e_data, krb5_authdata ***authz_data)
{
krb5_error_code retval = 0;
- plhandle handle = plugin_manager_get_service(context->pl_manager, "plugin_pa", 0);
+ plhandle handle ;//= plugin_manager_get_service(context->pl_manager, "plugin_pa", 0);
retval = plugin_kdc_verify_preauth(handle, context, client,
req_pkt, request,
enc_tkt_reply, data,
@@ -89,7 +89,7 @@
void *pa_module_context, void **pa_request_context)
{
krb5_error_code retval = 0;
- plhandle handle = plugin_manager_get_service(context->pl_manager, "plugin_pa", 0);
+ plhandle handle;// = plugin_manager_get_service(context->pl_manager, "plugin_pa", 0);
retval = plugin_kdc_return_preauth(handle, context, padata,
client, req_pkt,
request, reply,
@@ -106,7 +106,7 @@
void **pa_request_context)
{
krb5_error_code retval = 0;
- plhandle handle = plugin_manager_get_service(kcontext->pl_manager, "plugin_pa", 0);
+ plhandle handle;// = plugin_manager_get_service(kcontext->pl_manager, "plugin_pa", 0);
retval = plugin_server_free_reqctx(handle, kcontext,
pa_module_context,
pa_request_context);
@@ -116,14 +116,14 @@
server_init(krb5_context kcontext, void **module_context, const char **realmnames)
{
krb5_error_code retval = 0;
- plhandle handle = plugin_manager_get_service(kcontext->pl_manager, "plugin_pa", 0);
+ plhandle handle;// = plugin_manager_get_service(kcontext->pl_manager, "plugin_pa", 0);
retval = plugin_server_init(handle, kcontext, module_context, realmnames);
return retval;
}
void
server_fini(krb5_context kcontext, void *module_context)
{
- plhandle handle = plugin_manager_get_service(kcontext->pl_manager, "plugin_pa", 0);
+ plhandle handle;// = plugin_manager_get_service(kcontext->pl_manager, "plugin_pa", 0);
plugin_server_fini(handle, kcontext, module_context);
return;
}
Modified: branches/plugins/src/lib/kadm5/srv/server_misc.c
===================================================================
--- branches/plugins/src/lib/kadm5/srv/server_misc.c 2010-07-07 20:52:06 UTC (rev 24176)
+++ branches/plugins/src/lib/kadm5/srv/server_misc.c 2010-07-08 13:40:11 UTC (rev 24177)
@@ -44,10 +44,6 @@
/* some of this is stolen from gatekeeper ... */
/* passwd_check - returns KADM5_OK if password passes the validation.*/
-#define PWD_QLTY_KRB 0
-#define PWD_QLTY_X 1
-#define PWD_QLTY_DYN 33
-
kadm5_ret_t
passwd_check(kadm5_server_handle_t srv_handle,
char *password, int use_policy, kadm5_policy_ent_t pol,
@@ -59,20 +55,20 @@
if (srv_handle != NULL && srv_handle->context != NULL &&
srv_handle->context->pl_manager != NULL ){
- plugin_handle = plugin_manager_get_service(srv_handle->context->pl_manager,
- "plugin_pwd_qlty", PWD_QLTY_KRB);
+ ret = plugin_manager_get_service(srv_handle->context->pl_manager,
+ "plugin_pwd_qlty", PWD_QLTY_KRB, &plugin_handle);
ret = plugin_pwd_qlty_check(plugin_handle,
srv_handle, password, use_policy, pol, principal);
- plugin_handle = plugin_manager_get_service(srv_handle->context->pl_manager,
- "plugin_pwd_qlty", PWD_QLTY_X);
+ ret = plugin_manager_get_service(srv_handle->context->pl_manager,
+ "plugin_pwd_qlty", PWD_QLTY_X, &plugin_handle);
ret = plugin_pwd_qlty_check(plugin_handle,
srv_handle, password, use_policy, pol, principal);
- plugin_handle = plugin_manager_get_service(srv_handle->context->pl_manager,
- "plugin_pwd_qlty", PWD_QLTY_DYN);
+ ret = plugin_manager_get_service(srv_handle->context->pl_manager,
+ "plugin_pwd_qlty", PWD_QLTY_DYN, &plugin_handle);
ret = plugin_pwd_qlty_check(plugin_handle,
srv_handle, password, use_policy, pol, principal);
Modified: branches/plugins/src/plugin_core/impl/plugin_default_loader.c
===================================================================
--- branches/plugins/src/plugin_core/impl/plugin_default_loader.c 2010-07-07 20:52:06 UTC (rev 24176)
+++ branches/plugins/src/plugin_core/impl/plugin_default_loader.c 2010-07-08 13:40:11 UTC (rev 24177)
@@ -17,8 +17,6 @@
static plugin_descr plugin_default_loader_table[] = {
{"plugin_pwd_qlty_X", plugin_pwd_qlty_X_create},
{"plugin_pwd_qlty_krb", plugin_pwd_qlty_krb_create},
- {"plugin_encrypted_challenge_pa", plugin_encrypted_challenge_pa_create},
- {"plugin_ldap_audit", NULL},
{NULL,NULL}
};
Modified: branches/plugins/src/plugin_core/impl/plugin_default_manager.c
===================================================================
--- branches/plugins/src/plugin_core/impl/plugin_default_manager.c 2010-07-07 20:52:06 UTC (rev 24176)
+++ branches/plugins/src/plugin_core/impl/plugin_default_manager.c 2010-07-08 13:40:11 UTC (rev 24177)
@@ -122,7 +122,7 @@
}
static plhandle
-_create_api(const char* plugin_name, const char* plugin_id,
+_create_api(const char* plugin_name,
const char* loader_name, const char* loader_type, const char* loader_path
/*, config_node* properties*/)
{
@@ -131,8 +131,7 @@
#ifdef DEBUG_PLUGINS
printf("plugins: _create_api\n");
#endif
- p_handle = create_api(f_handle, plugin_name);
- p_handle.plugin_id = atoi(plugin_id);
+ plugin_loader_create_api(f_handle, plugin_name, &p_handle);
return(p_handle);
}
@@ -181,7 +180,7 @@
next = (plhandle*) malloc(sizeof(plhandle));
memset(next, 0, sizeof(plhandle));
next->api = handle.api;
- next->plugin_id = handle.plugin_id;
+ strncpy(next->plugin_name, handle.plugin_name, strlen(handle.plugin_name));
if(entry->first == NULL) {
entry->first = next;
entry->last = next;
@@ -207,7 +206,6 @@
const char* loader_path = NULL;
const char* plugin_name = NULL;
const char* plugin_type = NULL;
- const char* plugin_id = NULL;
plhandle handle;
int ret = API_REGISTER_FAILED;
@@ -227,8 +225,6 @@
loader_path = q->node_value.str_value;
} else if(strcmp(q->node_name, "plugin_name") == 0) {
plugin_name = q->node_value.str_value;
- } else if(strcmp(q->node_name, "plugin_id") == 0) {
- plugin_id = q->node_value.str_value;
}
}
@@ -244,11 +240,10 @@
printf("plugin_name=%s\n", plugin_name);
printf("plugin_type=%s\n", plugin_type);
printf("plugin_path=%s\n", plugin_path);
- printf("plugin_id=%s\n", plugin_id);
printf("**End**\n");
#endif
- handle = _create_api(plugin_name, plugin_id,
+ handle = _create_api(plugin_name,
loader_name, loader_type, loader_path /*, properties*/);
if(handle.api != NULL) {
ret = _register_api(mdata->registry,plugin_api, plugin_type, handle);
@@ -302,26 +297,18 @@
{
manager_data* mdata = (manager_data*) data;
krb5_error_code retval;
- char *plugin;
void *iter;
int i = 0;
profile_filespec_t *files = NULL;
profile_t profile;
const char *hierarchy[4];
- char **loader_name, **loader_type, **loader_path, **plugin_name, **plugin_type;
- char** plugin_id;
+ char **loader_name, **loader_type, **loader_path, **plugin_name, **plugin_type, **plugin_version;
char** plugin_api;
char *f_path = NULL;
plhandle handle;
char **pl_list, *pl_l;
retval = krb5_get_default_config_files(&files);
-#if 0
- if (files)
- free_filespecs(files);
- if (retval)
- ctx->profile = 0;
-#endif
if (retval == ENOENT)
return; // KRB5_CONFIG_CANTOPEN;
@@ -344,16 +331,6 @@
return;
}
-#if 0
- while (iter && pl_list[i]) {
- if ((retval = krb5_plugin_iterator(profile, &iter, &plugin))) {
- com_err("krb5_PLUGIN_iterator", retval, 0);
- krb5_plugin_iterator_free(profile, &iter);
- return;
- }
- if (plugin) {
-#endif
-
i=0;
while ((pl_l = pl_list[i++])){
@@ -362,7 +339,6 @@
#endif
hierarchy[0] = "plugins";
hierarchy[1] = pl_l;
- //hierarchy[1] = plugin;
/* plugin_name */
hierarchy[2] = "plugin_api";
@@ -379,10 +355,10 @@
hierarchy[3] = 0;
retval = profile_get_values(profile, hierarchy, &plugin_type);
- /* plugin_id */
- hierarchy[2] = "plugin_id";
+ /* plugin_version */
+ hierarchy[2] = "plugin_version";
hierarchy[3] = 0;
- retval = profile_get_values(profile, hierarchy, &plugin_id);
+ retval = profile_get_values(profile, hierarchy, &plugin_version);
/* loader_name */
hierarchy[2] = "plugin_loader_name";
@@ -405,18 +381,17 @@
#ifdef DEBUG_PLUGINS
- printf("ZH plugins: >>>\n");
+ printf("plugins: >>>\n");
printf("api=%s\n", *plugin_api);
printf("loader=%s\n", *loader_name);
printf("loader_type=%s\n", *loader_type);
if (f_path) printf("loader_path=%s\n", f_path);
printf("plugin_name=%s\n", *plugin_name);
printf("plugin_type=%s\n",*plugin_type);
- printf("plugin_id=%s\n", *plugin_id);
printf("<<< plugins\n");
#endif
- handle = _create_api(*plugin_name, *plugin_id,
+ handle = _create_api(*plugin_name,
*loader_name, *loader_type, f_path /*, properties*/);
if(handle.api != NULL) {
retval = _register_api(mdata->registry,*plugin_api, *plugin_type, handle);
@@ -456,7 +431,7 @@
}
static plhandle
-_getService(manager_data* data, const char* service_name, int plugin_id)
+_getService(manager_data* data, const char* service_name, const char* plugin_name)
{
plhandle *handle;
manager_data* mdata = (manager_data*) data;
@@ -465,12 +440,12 @@
memset(&handle, 0, sizeof handle);
if(entry) {
for(handle = entry->first; handle != NULL; handle = handle->next) {
- if (handle->plugin_id == plugin_id)
+ if (!strncmp(handle->plugin_name, plugin_name, strlen(plugin_name)))
break;
}
if (handle == NULL) {
#ifdef DEBUG_PLUGINS
- printf("service %s:%d is not registered \n", service_name, plugin_id);
+ printf("service %s:%s is not registered \n", service_name, plugin_name);
#endif
}
@@ -493,7 +468,7 @@
return data;
}
-plugin_manager*
+krb5_error_code
plugin_default_manager_get_instance(plugin_manager** plugin_mngr_instance)
{
plugin_manager* instance = NULL;
@@ -519,5 +494,5 @@
instance->getService = _getService;
*plugin_mngr_instance = instance;
}
- return (*plugin_mngr_instance);
+ return 0;
}
Modified: branches/plugins/src/plugin_core/impl/plugin_default_manager.h
===================================================================
--- branches/plugins/src/plugin_core/impl/plugin_default_manager.h 2010-07-07 20:52:06 UTC (rev 24176)
+++ branches/plugins/src/plugin_core/impl/plugin_default_manager.h 2010-07-08 13:40:11 UTC (rev 24177)
@@ -8,6 +8,6 @@
#include <plugin_manager.h>
-plugin_manager* plugin_default_manager_get_instance(plugin_manager** plugin_mngr_instance);
+krb5_error_code plugin_default_manager_get_instance(plugin_manager** plugin_mngr_instance);
#endif /* PLUGIN_DEFAULT_MANAGER_H_ */
Modified: branches/plugins/src/plugin_core/libplugin_core.exports
===================================================================
--- branches/plugins/src/plugin_core/libplugin_core.exports 2010-07-07 20:52:06 UTC (rev 24176)
+++ branches/plugins/src/plugin_core/libplugin_core.exports 2010-07-08 13:40:11 UTC (rev 24177)
@@ -1,9 +1,8 @@
-get_loader_content
plugin_manager_configure
plugin_manager_get_service
plugin_manager_start
plugin_manager_stop
-create_api
+plugin_loader_create_api
krb5_plugin_iterator_create
krb5_plugin_iterator
krb5_plugin_iterator_free
Modified: branches/plugins/src/plugin_core/plugin_loader.c
===================================================================
--- branches/plugins/src/plugin_core/plugin_loader.c 2010-07-07 20:52:06 UTC (rev 24176)
+++ branches/plugins/src/plugin_core/plugin_loader.c 2010-07-08 13:40:11 UTC (rev 24177)
@@ -6,22 +6,12 @@
#include <string.h>
#include "plugin_loader.h"
-void
-get_loader_content (loader_handle handle, const char* container[])
+krb5_error_code
+plugin_loader_create_api (loader_handle handle, const char* plugin_name, plhandle *pl_handle)
{
plugin_loader* loader = (plugin_loader*) handle.api;
if (loader != NULL) {
- return loader->get_loader_content(container);
+ *pl_handle = loader->create_api(plugin_name);
}
- return;
+ return 0;
}
-
-plhandle
-create_api (loader_handle handle, const char* plugin_name)
-{
- plugin_loader* loader = (plugin_loader*) handle.api;
- if (loader != NULL) {
- return loader->create_api(plugin_name);
- }
- return;
-}
Modified: branches/plugins/src/plugin_core/plugin_loader.h
===================================================================
--- branches/plugins/src/plugin_core/plugin_loader.h 2010-07-07 20:52:06 UTC (rev 24176)
+++ branches/plugins/src/plugin_core/plugin_loader.h 2010-07-08 13:40:11 UTC (rev 24177)
@@ -27,8 +27,6 @@
plhandle (*create_api)(const char*);
} plugin_loader;
-/* Utility functions */
-void get_loader_content(loader_handle handle, const char* container[]);
-plhandle create_api(loader_handle handle, const char* plugin_name);
+krb5_error_code plugin_loader_create_api(loader_handle handle, const char* plugin_name, plhandle *);
#endif /* PLUGIN_LOADER_H_ */
Modified: branches/plugins/src/plugin_core/plugin_manager.c
===================================================================
--- branches/plugins/src/plugin_core/plugin_manager.c 2010-07-07 20:52:06 UTC (rev 24176)
+++ branches/plugins/src/plugin_core/plugin_manager.c 2010-07-08 13:40:11 UTC (rev 24177)
@@ -5,7 +5,7 @@
#include "plugin_manager.h"
#include <k5-int.h>
-int
+krb5_error_code
plugin_manager_configure(plugin_manager* instance,const char* path)
{
if (instance != NULL) {
@@ -14,22 +14,26 @@
return 0;
}
-void plugin_manager_start(plugin_manager* instance)
+krb5_error_code
+plugin_manager_start(plugin_manager* instance)
{
if (instance != NULL) {
instance->start(instance->data);
}
+ return 0;
}
-void plugin_manager_stop(plugin_manager* instance)
+krb5_error_code
+plugin_manager_stop(plugin_manager* instance)
{
if (instance != NULL) {
instance->stop(instance->data);
}
+ return 0;
}
-plhandle
-plugin_manager_get_service(plugin_manager* instance, const char* service_name, const int pl_id)
+krb5_error_code
+plugin_manager_get_service(plugin_manager* instance, const char* service_name, const char *pl_id, plhandle *pl_handle)
{
plhandle handle;
if (instance != NULL) {
@@ -37,5 +41,6 @@
} else {
handle.api = NULL;
}
- return handle;
+ *pl_handle = handle;
+ return 0;
}
Modified: branches/plugins/src/plugin_core/plugin_manager.h
===================================================================
--- branches/plugins/src/plugin_core/plugin_manager.h 2010-07-07 20:52:06 UTC (rev 24176)
+++ branches/plugins/src/plugin_core/plugin_manager.h 2010-07-08 13:40:11 UTC (rev 24177)
@@ -8,9 +8,9 @@
#include <k5-int.h>
-plhandle plugin_manager_get_service(plugin_manager* instance,const char*, const int);
-int plugin_manager_configure(plugin_manager* instance,const char*);
-void plugin_manager_start(plugin_manager* instance);
-void plugin_manager_stop(plugin_manager* instance);
+krb5_error_code plugin_manager_get_service(plugin_manager* instance,const char*, const char*, plhandle* );
+krb5_error_code plugin_manager_configure(plugin_manager* instance,const char*);
+krb5_error_code plugin_manager_start(plugin_manager* instance);
+krb5_error_code plugin_manager_stop(plugin_manager* instance);
#endif /* PLUGIN_MANAGER_H_ */
Modified: branches/plugins/src/plugins/pwd_qlty/plugin_pwd_qlty.h
===================================================================
--- branches/plugins/src/plugins/pwd_qlty/plugin_pwd_qlty.h 2010-07-07 20:52:06 UTC (rev 24176)
+++ branches/plugins/src/plugins/pwd_qlty/plugin_pwd_qlty.h 2010-07-08 13:40:11 UTC (rev 24177)
@@ -11,9 +11,17 @@
#include <admin.h>
#include <server_internal.h>
+#define PWD_QLTY_KRB "plugin_pwd_qlty_krb"
+#define PWD_QLTY_KRB_LEN 19
+#define PWD_QLTY_X "plugin_pwd_qlty_X"
+#define PWD_QLTY_X_LEN 17
+#define PWD_QLTY_DYN "plugin_pwd_qlty_DYN"
+#define PWD_QLTY_DYN_LEN 19
+
/* PWD_QLTY API */
typedef struct {
int version;
+ char plugin_id[MAX_PL_NAME_LEN];
kadm5_ret_t (*pwd_qlty_init)(kadm5_server_handle_t);
void (*pwd_qlty_cleanup)();
kadm5_ret_t (*pwd_qlty_check)(kadm5_server_handle_t, char*,
Modified: branches/plugins/src/plugins/pwd_qlty/plugin_pwd_qlty_DYN/plugin_pwd_qlty_DYN_impl.c
===================================================================
--- branches/plugins/src/plugins/pwd_qlty/plugin_pwd_qlty_DYN/plugin_pwd_qlty_DYN_impl.c 2010-07-07 20:52:06 UTC (rev 24176)
+++ branches/plugins/src/plugins/pwd_qlty/plugin_pwd_qlty_DYN/plugin_pwd_qlty_DYN_impl.c 2010-07-08 13:40:11 UTC (rev 24177)
@@ -16,9 +16,9 @@
{
-//#ifdef DEBUG_PLUGINS
- printf("Plugin pwd qlty DYNAMIC >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n");
-// #endif
+#ifdef DEBUG_PLUGINS
+ printf("Plugin pwd qlty DYNAMIC >>\n");
+#endif
return 0;
}
@@ -38,15 +38,19 @@
plhandle
plugin_pwd_qlty_DYN_create()
{
- plhandle handle;
- plugin_pwd_qlty* api = malloc(sizeof(plugin_pwd_qlty));
+ plhandle handle;
+ plugin_pwd_qlty* api = malloc(sizeof(plugin_pwd_qlty));
- memset(api, 0, sizeof(plugin_pwd_qlty));
- api->version = 1;
- api->pwd_qlty_init = _plugin_pwd_qlty_init;
- api->pwd_qlty_check = _plugin_pwd_qlty_check;
- api->pwd_qlty_cleanup = _plugin_pwd_qlty_clean;
- handle.api = api;
+ memset(&handle, 0, sizeof(handle));
+ strncpy(handle.plugin_name, PWD_QLTY_DYN, PWD_QLTY_DYN_LEN);
- return handle;
+ memset(api, 0, sizeof(plugin_pwd_qlty));
+ api->version = 1;
+ strncpy(api->plugin_id, PWD_QLTY_DYN, PWD_QLTY_DYN_LEN);
+ api->pwd_qlty_init = _plugin_pwd_qlty_init;
+ api->pwd_qlty_check = _plugin_pwd_qlty_check;
+ api->pwd_qlty_cleanup = _plugin_pwd_qlty_clean;
+ handle.api = api;
+
+ return handle;
}
Modified: branches/plugins/src/plugins/pwd_qlty/plugin_pwd_qlty_X/plugin_pwd_qlty_X_impl.c
===================================================================
--- branches/plugins/src/plugins/pwd_qlty/plugin_pwd_qlty_X/plugin_pwd_qlty_X_impl.c 2010-07-07 20:52:06 UTC (rev 24176)
+++ branches/plugins/src/plugins/pwd_qlty/plugin_pwd_qlty_X/plugin_pwd_qlty_X_impl.c 2010-07-08 13:40:11 UTC (rev 24177)
@@ -157,15 +157,20 @@
plhandle
plugin_pwd_qlty_X_create()
{
- plhandle handle;
- plugin_pwd_qlty* api = malloc(sizeof(plugin_pwd_qlty));
+ plhandle handle;
+ plugin_pwd_qlty* api = malloc(sizeof(plugin_pwd_qlty));
- memset(api, 0, sizeof(plugin_pwd_qlty));
- api->version = 1;
- api->pwd_qlty_init = _plugin_pwd_qlty_init;
- api->pwd_qlty_check = _plugin_pwd_qlty_check;
- api->pwd_qlty_cleanup = _plugin_pwd_qlty_clean;
- handle.api = api;
+ memset(&handle, 0, sizeof(handle));
+ strncpy(handle.plugin_name, PWD_QLTY_X, PWD_QLTY_X_LEN);
- return handle;
+ memset(api, 0, sizeof(plugin_pwd_qlty));
+ api->version = 1;
+ strncpy(api->plugin_id, PWD_QLTY_X, PWD_QLTY_X_LEN);
+ api->pwd_qlty_init = _plugin_pwd_qlty_init;
+ api->pwd_qlty_check = _plugin_pwd_qlty_check;
+ api->pwd_qlty_cleanup = _plugin_pwd_qlty_clean;
+ handle.api = api;
+
+ return handle;
}
+
Modified: branches/plugins/src/plugins/pwd_qlty/plugin_pwd_qlty_krb/plugin_pwd_qlty_krb_impl.c
===================================================================
--- branches/plugins/src/plugins/pwd_qlty/plugin_pwd_qlty_krb/plugin_pwd_qlty_krb_impl.c 2010-07-07 20:52:06 UTC (rev 24176)
+++ branches/plugins/src/plugins/pwd_qlty/plugin_pwd_qlty_krb/plugin_pwd_qlty_krb_impl.c 2010-07-08 13:40:11 UTC (rev 24177)
@@ -157,15 +157,19 @@
plhandle
plugin_pwd_qlty_krb_create()
{
- plhandle handle;
- plugin_pwd_qlty* api = malloc(sizeof(plugin_pwd_qlty));
+ plhandle handle;
+ plugin_pwd_qlty* api = malloc(sizeof(plugin_pwd_qlty));
- memset(api, 0, sizeof(plugin_pwd_qlty));
- api->version = 1;
- api->pwd_qlty_init = _plugin_pwd_qlty_init;
- api->pwd_qlty_check = _plugin_pwd_qlty_check;
- api->pwd_qlty_cleanup = _plugin_pwd_qlty_clean;
- handle.api = api;
+ memset(&handle, 0, sizeof(handle));
+ strncpy(handle.plugin_name, PWD_QLTY_KRB, PWD_QLTY_KRB_LEN);
- return handle;
+ memset(api, 0, sizeof(plugin_pwd_qlty));
+ api->version = 1;
+ strncpy(api->plugin_id, PWD_QLTY_KRB, PWD_QLTY_KRB_LEN);
+ api->pwd_qlty_init = _plugin_pwd_qlty_init;
+ api->pwd_qlty_check = _plugin_pwd_qlty_check;
+ api->pwd_qlty_cleanup = _plugin_pwd_qlty_clean;
+ handle.api = api;
+
+ return handle;
}
More information about the cvs-krb5
mailing list