 803efebca5
			
		
	
	803efebca5
	
	
	
		
			
			Refactor plugin framework to use a single list of loaded plugins; add a new plugin API where DSOs export a load function that can declare dependencies and export multiple plugins; refactor kadm5 hook API to use krb5 plugin framework. More information in krb5-plugin(7).
		
			
				
	
	
		
			42 lines
		
	
	
		
			888 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			42 lines
		
	
	
		
			888 B
		
	
	
	
		
			C
		
	
	
	
	
	
| /*
 | |
|  */
 | |
| 
 | |
| #include "krb5_locl.h"
 | |
| #include "db_plugin.h"
 | |
| 
 | |
| /* Default plugin (DB using binary search of sorted text file) follows */
 | |
| static heim_base_once_t db_plugins_once = HEIM_BASE_ONCE_INIT;
 | |
| 
 | |
| static krb5_error_code KRB5_LIB_CALL
 | |
| db_plugins_plcallback(krb5_context context, const void *plug, void *plugctx,
 | |
| 		      void *userctx)
 | |
| {
 | |
|     return 0;
 | |
| }
 | |
| 
 | |
| static const char *db_plugin_deps[] = { "krb5", NULL };
 | |
| 
 | |
| static struct krb5_plugin_data
 | |
| db_plugin_data = {
 | |
|     "krb5",
 | |
|     KRB5_PLUGIN_DB,
 | |
|     KRB5_PLUGIN_DB_VERSION_0,
 | |
|     db_plugin_deps,
 | |
|     krb5_get_instance
 | |
| };
 | |
| 
 | |
| static void
 | |
| db_plugins_init(void *arg)
 | |
| {
 | |
|     krb5_context context = arg;
 | |
|     (void)_krb5_plugin_run_f(context, &db_plugin_data, 0, NULL,
 | |
| 			     db_plugins_plcallback);
 | |
| }
 | |
| 
 | |
| KRB5_LIB_FUNCTION void KRB5_LIB_CALL
 | |
| _krb5_load_db_plugins(krb5_context context)
 | |
| {
 | |
|     heim_base_once_f(&db_plugins_once, context, db_plugins_init);
 | |
| }
 | |
| 
 |