From: Jeffrey Altman Date: Wed, 23 Aug 2006 02:17:12 +0000 (+0000) Subject: * Fix auto-registration of plug-in modules X-Git-Tag: krb5-1.6-alpha1~167 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=78ed38bd8bc1e74aedea35deff3cc598ae1c79e4;p=krb5.git * Fix auto-registration of plug-in modules if there is no plug-in list specified ticket: 4172 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18496 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/windows/identity/kmm/kmm_reg.c b/src/windows/identity/kmm/kmm_reg.c index dcc75d13e..60159df37 100644 --- a/src/windows/identity/kmm/kmm_reg.c +++ b/src/windows/identity/kmm/kmm_reg.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2005 Massachusetts Institute of Technology + * Copyright (c) 2006 Secure Endpoints Inc. * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -198,8 +199,20 @@ kmm_register_plugin(kmm_plugin_reg * plugin, khm_int32 config_flags) size_t scb = 0; rv = khc_read_multi_string(csp_module, L"PluginList", NULL, &cb); - if(rv != KHM_ERROR_TOO_LONG) - goto _exit; + if(rv != KHM_ERROR_TOO_LONG) { + if (rv == KHM_ERROR_NOT_FOUND) { + + scb = cb = cch * sizeof(wchar_t); + pl = PMALLOC(cb); + multi_string_init(pl, cb); + rv = KHM_ERROR_SUCCESS; + + goto add_plugin_to_list; + + } else { + goto _exit; + } + } cb += cch * sizeof(wchar_t); scb = cb; @@ -213,6 +226,8 @@ kmm_register_plugin(kmm_plugin_reg * plugin, khm_int32 config_flags) goto _exit; } + add_plugin_to_list: + if(!multi_string_find(pl, plugin->name, 0)) { multi_string_append(pl, &scb, plugin->name); rv = khc_write_multi_string(csp_module, L"PluginList", pl);