diff options
author | Kevin Coffman <kwc@citi.umich.edu> | 2006-11-29 00:17:52 +0000 |
---|---|---|
committer | Kevin Coffman <kwc@citi.umich.edu> | 2006-11-29 00:17:52 +0000 |
commit | 31470c7c55ade500a0e420642798d1261de61d6a (patch) | |
tree | aae86f87fdba6bf55b664a0ed0dcbd497ea576e1 | |
parent | fdfc73ab2aa0a381610f6cd7ae6fbe7246ec53f4 (diff) | |
download | krb5-31470c7c55ade500a0e420642798d1261de61d6a.zip krb5-31470c7c55ade500a0e420642798d1261de61d6a.tar.gz krb5-31470c7c55ade500a0e420642798d1261de61d6a.tar.bz2 |
skip all modules in plugin if init function fails
If the plugin initialization function fails, skip all modules in
the plugin, not just the first. Also, print the error message from
the plugin if supplied.
ticket: new
Target_Version: 1.6
Tags: pullup
Component: krb5-kdc
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18873 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r-- | src/kdc/kdc_preauth.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/kdc/kdc_preauth.c b/src/kdc/kdc_preauth.c index 9994ae3..6c362d9 100644 --- a/src/kdc/kdc_preauth.c +++ b/src/kdc/kdc_preauth.c @@ -394,10 +394,22 @@ load_preauth_plugins(krb5_context context) * from the list of modules we'll be using. */ if (j == 0) { server_init_proc = ftable->init_proc; - if ((server_init_proc != NULL) && - ((*server_init_proc)(context, &plugin_context) != 0)) { - memset(&preauth_systems[k], 0, sizeof(preauth_systems[k])); - continue; + if (server_init_proc != NULL) { + krb5_error_code initerr; + initerr = (*server_init_proc)(context, &plugin_context); + if (initerr) { + const char *emsg; + emsg = krb5_get_error_message(context, initerr); + if (emsg) { + krb5_klog_syslog(LOG_ERR, + "preauth %s failed to initialize: %s", + ftable->name, emsg); + krb5_free_error_message(context, emsg); + } + memset(&preauth_systems[k], 0, sizeof(preauth_systems[k])); + + break; /* skip all modules in this plugin */ + } } } preauth_systems[k].name = ftable->name; |