Example Of An Initialization Function - Netscape DIRECTORY SERVER 6.2 - PLUG-IN Manual

Table of Contents

Advertisement

Writing a Pre-Operation Bind Plug-in
Code Example 8-1
/* This plug-in does not support any other method of
authentication */
case LDAP_AUTH_SASL:
default:
}
if ( searchpb ) {
}
slapi_send_ldap_result( pb, rc, NULL, NULL, 0, NULL );
return( 1 );
}

Example of an Initialization Function

To initialize your plug-in, write an initialization function to do the following:
Call
to the name of your pre-operation bind function. (For details, see "Registering
Your Plug-In Functions" on page 34.)
If you are using SASL as the authentication method, call the
Syntax Plug-In
Server.
The following is an example of an initialization function that registers the
pre-operation bind function.
Code Example 8-2
#include <stdio.h>
#include <string.h>
#include "slapi-plugin.h"
Slapi_PluginDesc bindpdesc = { "test-bind", "Netscape", "0.5",
"sample bind pre-operation plugin" };
/* Initialization function */
#ifdef _WIN32
__declspec(dllexport)
#endif
int
testbind_init( Slapi_PBlock *pb )
{
104
Netscape Directory Server Plug-In Programmer's Guide • December 2003
Sample Pre-Operation Bind Function (Continued)
break;
slapi_log_error( SLAPI_LOG_PLUGIN, "test_bind",
"Unsupported authentication method requested: %d\n",
method );
rc = LDAP_AUTH_METHOD_NOT_SUPPORTED;
break;
slapi_free_search_results_internal( searchpb );
slapi_ch_free( ( void ** )&searchpb );
slapi_pblock_set()
function to register your SASL mechanism with the Directory
Sample Function for Registering Pre-Operation Bind Function
to set the
SLAPI_PLUGIN_PRE_BIND_FN
parameter
Functions for

Advertisement

Table of Contents
loading

This manual is also suitable for:

Directory server 6.2

Table of Contents