[Fedora-directory-commits] ldapserver/ldap/servers/slapd/test-plugins testbind.c, 1.4, 1.5 testdatainterop.c, 1.4, 1.5 testentry.c, 1.4, 1.5 testextendedop.c, 1.4, 1.5 testgetip.c, 1.4, 1.5 testpostop.c, 1.4, 1.5 testpreop.c, 1.4, 1.5 testsaslbind.c, 1.6, 1.7

Noriko Hosoi (nhosoi) fedora-directory-commits at redhat.com
Thu Jun 9 17:42:17 UTC 2005


Author: nhosoi

Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/test-plugins
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv4752

Modified Files:
	testbind.c testdatainterop.c testentry.c testextendedop.c 
	testgetip.c testpostop.c testpreop.c testsaslbind.c 
Log Message:
Added testpreop_search to verify bug 147585
Plus fixed branding/version number.



Index: testbind.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/test-plugins/testbind.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- testbind.c	19 Apr 2005 22:07:41 -0000	1.4
+++ testbind.c	9 Jun 2005 17:42:14 -0000	1.5
@@ -69,7 +69,7 @@
 #include <string.h>
 #include "slapi-plugin.h"
 
-Slapi_PluginDesc bindpdesc = { "test-bind", "Netscape", "0.5",
+Slapi_PluginDesc bindpdesc = { "test-bind", "Fedora Project", "7.1",
 	"sample bind pre-operation plugin" };
 
 static Slapi_ComponentId *plugin_id = NULL;


Index: testdatainterop.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/test-plugins/testdatainterop.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- testdatainterop.c	19 Apr 2005 22:07:41 -0000	1.4
+++ testdatainterop.c	9 Jun 2005 17:42:14 -0000	1.5
@@ -88,8 +88,8 @@
  nsslapd-pluginType: preoperation
  nsslapd-pluginEnabled: on
  nsslapd-pluginId: nullsuffix-preop
- nsslapd-pluginVersion: 6.2
- nsslapd-pluginVendor: Netscape
+ nsslapd-pluginVersion: 7.1
+ nsslapd-pluginVendor: Fedora Project
  nsslapd-pluginDescription: sample pre-operation null suffix plugin
 
  ******************************************/
@@ -113,7 +113,7 @@
 /*
  * Static variables.
  */
-static Slapi_PluginDesc plugindesc = { PLUGIN_NAME, "Netscape", "0.5",
+static Slapi_PluginDesc plugindesc = { PLUGIN_NAME, "Fedora Project", "7.1",
 	"sample pre-operation null suffix plugin" };
 
 static Slapi_ComponentId *plugin_id = NULL;


Index: testentry.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/test-plugins/testentry.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- testentry.c	19 Apr 2005 22:07:41 -0000	1.4
+++ testentry.c	9 Jun 2005 17:42:14 -0000	1.5
@@ -90,7 +90,7 @@
 #include <string.h>
 #include "slapi-plugin.h"
 
-Slapi_PluginDesc entrypdesc = { "test-entry", "Netscape", "0.5",
+Slapi_PluginDesc entrypdesc = { "test-entry", "Fedora Project", "7.1",
 	"sample entry modification plugin" };
 
 /* Entry store plug-in function */


Index: testextendedop.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/test-plugins/testextendedop.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- testextendedop.c	19 Apr 2005 22:07:41 -0000	1.4
+++ testextendedop.c	9 Jun 2005 17:42:14 -0000	1.5
@@ -83,7 +83,7 @@
 /* OID of the extended operation handled by this plug-in */
 #define MY_OID	"1.2.3.4"
 
-Slapi_PluginDesc expdesc = { "test-extendedop", "Netscape", "0.5",
+Slapi_PluginDesc expdesc = { "test-extendedop", "Fedora Project", "7.1",
 	"sample extended operation plugin" };
 
 


Index: testgetip.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/test-plugins/testgetip.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- testgetip.c	19 Apr 2005 22:07:41 -0000	1.4
+++ testgetip.c	9 Jun 2005 17:42:14 -0000	1.5
@@ -74,7 +74,7 @@
 #include "slapi-plugin.h"
 #include "nspr.h"
 
-Slapi_PluginDesc getippdesc = { "test-getip", "Netscape", "0.5",
+Slapi_PluginDesc getippdesc = { "test-getip", "Fedora Project", "7.1",
 	"sample pre-operation plugin" };
 
 static char *netaddr2str( PRNetAddr *addrp, char *buf, size_t buflen );


Index: testpostop.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/test-plugins/testpostop.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- testpostop.c	19 Apr 2005 22:07:41 -0000	1.4
+++ testpostop.c	9 Jun 2005 17:42:14 -0000	1.5
@@ -93,7 +93,7 @@
 static char *changelogfile = "/tmp/changelog";
 #endif
 
-Slapi_PluginDesc postoppdesc = { "test-postop", "Netscape", "0.5",
+Slapi_PluginDesc postoppdesc = { "test-postop", "Fedora Project", "7.1",
 	"sample post-operation plugin" };
 
 static void write_changelog( int optype, char *dn, void *change, int flag );


Index: testpreop.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/test-plugins/testpreop.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- testpreop.c	19 Apr 2005 22:07:41 -0000	1.4
+++ testpreop.c	9 Jun 2005 17:42:14 -0000	1.5
@@ -45,6 +45,7 @@
 
  * testpreop_bind (called before an LDAP bind operation)
  * testpreop_add (called before an LDAP add operation)
+ * testpreop_search (called before an LDAP search operation)
  * testpreop_abandon (called before an LDAP abandon operation)
 
  testpreop_bind logs information about the LDAP bind operation
@@ -78,7 +79,7 @@
 #include <string.h>
 #include "slapi-plugin.h"
 
-Slapi_PluginDesc preoppdesc = { "test-preop", "Netscape", "0.5",
+Slapi_PluginDesc preoppdesc = { "test-preop", "Fedora Project", "7.1",
 	"sample pre-operation plugin" };
 
 /* Pre-operation plug-in function */
@@ -159,6 +160,24 @@
 	return( 0 );	/* allow the operation to continue */
 }
 
+/* Pre-operation plug-in function */
+int
+testpreop_search( Slapi_PBlock *pb )
+{
+  char *base;
+  /* Log a message to indicate when the plug-in function starts */
+  slapi_log_error( SLAPI_LOG_FATAL, "testpreop_search",
+    "*** PREOPERATION SEARCH PLUGIN ***\n");
+  /* Get and log the base DN of the search criteria */
+  if ( slapi_pblock_get( pb, SLAPI_SEARCH_TARGET, &base ) == 0 )
+    slapi_log_error( SLAPI_LOG_FATAL, "SLAPI_SEARCH_TARGET",
+      "%s\n", base );
+  /* Get and log the original base DN */
+  if ( slapi_pblock_get( pb, SLAPI_ORIGINAL_TARGET_DN, &base ) == 0 )
+    slapi_log_error( SLAPI_LOG_FATAL, "SLAPI_ORIGINAL_TARGET_DN",
+      "%s\n", base );
+}
+
 
 /* Pre-operation plug-in function */
 int
@@ -236,9 +255,11 @@
 	    (void *) testpreop_bind ) != 0 ||
 	    slapi_pblock_set( pb, SLAPI_PLUGIN_PRE_ADD_FN,
 	    (void *) testpreop_add ) != 0 ||
+	    slapi_pblock_set( pb, SLAPI_PLUGIN_PRE_SEARCH_FN,
+	    (void *) testpreop_search ) != 0 ||
 	    slapi_pblock_set( pb, SLAPI_PLUGIN_PRE_ABANDON_FN,
 	    (void *) testpreop_abandon ) != 0 ) {
-		slapi_log_error( SLAPI_LOG_PLUGIN, "testpreop_init",
+		slapi_log_error( SLAPI_LOG_FATAL, "testpreop_init",
 			"Failed to set version and function\n" );
 		return( -1 );
 	}


Index: testsaslbind.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/test-plugins/testsaslbind.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- testsaslbind.c	19 Apr 2005 22:07:41 -0000	1.6
+++ testsaslbind.c	9 Jun 2005 17:42:14 -0000	1.7
@@ -65,7 +65,7 @@
 objectclass: nsSlapdPlugin
 objectclass: extensibleObject
 cn: test-saslbind
-nsslapd-pluginpath: /usr/fedora/servers/plugins/slapd/slapi/examples/libtest-plugin.so
+nsslapd-pluginpath: <serverroot>/plugins/slapd/slapi/examples/libtest-plugin.so
 nsslapd-plugininitfunc: testsasl_init
 nsslapd-plugintype: preoperation
 nsslapd-pluginenabled: on




More information about the Fedora-directory-commits mailing list