summaryrefslogtreecommitdiffstats
path: root/ldap/servers/slapd/slapi-plugin.h
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2008-08-05 20:26:22 +0000
committerRich Megginson <rmeggins@redhat.com>2008-08-05 20:26:22 +0000
commitbe459a234db6aca79b08f438a6ec5afb47581b72 (patch)
tree20d29b61fc1a1d82843a58c0a13258bd1a069e0c /ldap/servers/slapd/slapi-plugin.h
parente0e27852ef4127538d16a7571411b96e9b0d5ca6 (diff)
downloadds-be459a234db6aca79b08f438a6ec5afb47581b72.tar.gz
ds-be459a234db6aca79b08f438a6ec5afb47581b72.tar.xz
ds-be459a234db6aca79b08f438a6ec5afb47581b72.zip
Resolves: bug 457846
Bug Description: The Windows Sync API should have plug-in points Reviewed by: nkinder (Thanks!) Fix Description: Several plug-in points have been added to the windows sync code, available to regular plug-ins that register with the winsync api via the slapi api broker interface. winsync-plugin.h documents the use of these along with some example plug-in code. The windows private data structure has been extended to add two additional fields: raw_entry - the raw entry read from AD - this is passed to several plug-in callbacks to allow them to have access to all of the attributes and values in the entry in case further processing is needed. This required a change to the function that reads the entry, to have it save the raw entry read each time from AD, in addition to the "cooked" entry it passes back to the caller. api_cookie - this is the plug-in private data passed back to each plug-in callback and allows the plug-in to specify some additional context Both of these are stored in the private data field in the agreement, so some of the existing functions had to be changed to pass in the connection object or the protocol object in order to gain access to the agreement object. There were several small memory leaks in the existing code that have been fixed - these are the places where a free() function of some sort has been added. Also the usage of slapi_sdn_init_dn_byval leaked - slapi_sdn_new_dn_byval must be used here instead - cannot mix slapi_sdn_new with slapi_sdn_init* I also cleaned up several compiler warnings. The slapi changes are not strictly necessary, but they provide some conveniences to the winsync code and to plug-in writers. The good thing is that they were already private functions, so mostly just needed to have public api wrappers. Platforms tested: RHEL5 Flag Day: no Doc impact: no
Diffstat (limited to 'ldap/servers/slapd/slapi-plugin.h')
-rw-r--r--ldap/servers/slapd/slapi-plugin.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/ldap/servers/slapd/slapi-plugin.h b/ldap/servers/slapd/slapi-plugin.h
index 56959b3d..23fa2af9 100644
--- a/ldap/servers/slapd/slapi-plugin.h
+++ b/ldap/servers/slapd/slapi-plugin.h
@@ -835,6 +835,24 @@ int slapi_build_control( char *oid, BerElement *ber,
int slapi_build_control_from_berval( char *oid, struct berval *bvp,
char iscritical, LDAPControl **ctrlp );
+/* Given an array of controls e.g. LDAPControl **ctrls, add the given
+ control to the end of the array, growing the array with realloc
+ e.g. slapi_add_control_ext(&ctrls, newctrl, 1);
+ if ctrls is NULL, the array will be created with malloc
+ if copy is true, the given control will be copied
+ if copy is false, the given control will be used and owned by the array
+ if copy is false, make sure the control can be freed by ldap_controls_free
+*/
+void slapi_add_control_ext( LDAPControl ***ctrlsp, LDAPControl *newctrl, int copy );
+
+/* Given an array of controls e.g. LDAPControl **ctrls, add all of the given
+ controls in the newctrls array to the end of ctrls, growing the array with realloc
+ if ctrls is NULL, the array will be created with malloc
+ if copy is true, each given control will be copied
+ if copy is false, each given control will be used and owned by the array
+ if copy is false, make sure each control can be freed by ldap_controls_free
+*/
+void slapi_add_controls( LDAPControl ***ctrlsp, LDAPControl **newctrls, int copy );
/*
* routines for dealing with extended operations
@@ -865,6 +883,13 @@ int slapi_pwpolicy_make_response_control (Slapi_PBlock *pb, int seconds, int log
* routine for freeing the ch_arrays returned by the slapi_get*_copy functions above
*/
void slapi_ch_array_free( char **array );
+/*
+ * Add the given string to the given null terminated array.
+ * s is not copied, so if you want to add a copy of s to the
+ * array, use slapi_ch_strdup(s)
+ * if *a is NULL, a new array will be created
+ */
+void slapi_ch_array_add( char ***array, char *string );
/*