From faf5b88f4b1822ae436a84317ccf3a8f8268d67c Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Wed, 23 Aug 2006 18:38:30 +0000 Subject: [PATCH] pull up r18496 from trunk r18496@cathode-dark-space: jaltman | 2006-08-22 22:17:12 -0400 ticket: 4172 * 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/branches/krb5-1-5@18508 dc483132-0cff-0310-8789-dd5450dbe970 --- src/windows/identity/kmm/kmm_reg.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) 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); -- 2.26.2