You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
(56) |
Apr
(109) |
May
(15) |
Jun
(3) |
Jul
(37) |
Aug
(96) |
Sep
(40) |
Oct
(4) |
Nov
(54) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(47) |
Feb
(30) |
Mar
(102) |
Apr
(120) |
May
(68) |
Jun
(54) |
Jul
(53) |
Aug
(122) |
Sep
(190) |
Oct
(71) |
Nov
(85) |
Dec
(108) |
2007 |
Jan
(72) |
Feb
(190) |
Mar
(53) |
Apr
(101) |
May
(145) |
Jun
(148) |
Jul
(167) |
Aug
(143) |
Sep
(23) |
Oct
(198) |
Nov
(223) |
Dec
(195) |
2008 |
Jan
(100) |
Feb
(129) |
Mar
(79) |
Apr
(77) |
May
(34) |
Jun
(95) |
Jul
(112) |
Aug
(160) |
Sep
(82) |
Oct
(124) |
Nov
(199) |
Dec
(355) |
2009 |
Jan
(436) |
Feb
(89) |
Mar
(298) |
Apr
(189) |
May
(33) |
Jun
(88) |
Jul
(105) |
Aug
(44) |
Sep
(181) |
Oct
(87) |
Nov
(75) |
Dec
(1) |
2010 |
Jan
(63) |
Feb
(21) |
Mar
(3) |
Apr
(1) |
May
(1) |
Jun
(3) |
Jul
(26) |
Aug
(37) |
Sep
(26) |
Oct
(15) |
Nov
(13) |
Dec
|
From: <svn...@op...> - 2009-03-26 15:15:11
|
Author: bellmich Date: Thu Mar 26 16:15:02 2009 New Revision: 1020 URL: http://libsyncml.opensync.org/changeset/1020 Log: more details for segfaults Modified: trunk/libsyncml/sml_support.c Modified: trunk/libsyncml/sml_support.c ============================================================================== --- trunk/libsyncml/sml_support.c Wed Mar 25 16:52:44 2009 (r1019) +++ trunk/libsyncml/sml_support.c Thu Mar 26 16:15:02 2009 (r1020) @@ -547,7 +547,7 @@ gpointer data, SmlError **error) { - smlTrace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __func__, thread, func, data, error); + smlTrace(TRACE_ENTRY, "%s(%p => %p, %p, %p, %p)", __func__, thread, thread?thread->context:NULL, func, data, error); CHECK_ERROR_REF smlAssert(func); |
From: <svn...@op...> - 2009-03-26 14:18:29
|
Author: ianmartin Date: Thu Mar 26 15:18:09 2009 New Revision: 5350 URL: http://www.opensync.org/changeset/5350 Log: Updated python wrapper to match api change in r5349 Modified: trunk/wrapper/opensync-plugin.i Modified: trunk/wrapper/opensync-plugin.i ============================================================================== --- trunk/wrapper/opensync-plugin.i Thu Mar 26 14:25:12 2009 (r5349) +++ trunk/wrapper/opensync-plugin.i Thu Mar 26 15:18:09 2009 (r5350) @@ -385,32 +385,32 @@ } */ - void get_changes(void *plugindata, PluginInfo *info, Context *ctx) { - osync_objtype_sink_get_changes(self, plugindata, info, ctx); + void get_changes(PluginInfo *info, Context *ctx) { + osync_objtype_sink_get_changes(self, info, ctx); } - void read_change(void *plugindata, PluginInfo *info, Change *change, Context *ctx) { - osync_objtype_sink_read_change(self, plugindata, info, change, ctx); + void read_change(PluginInfo *info, Change *change, Context *ctx) { + osync_objtype_sink_read_change(self, info, change, ctx); } - void connect(void *plugindata, PluginInfo *info, Context *ctx) { - osync_objtype_sink_connect(self, plugindata, info, ctx); + void connect(PluginInfo *info, Context *ctx) { + osync_objtype_sink_connect(self, info, ctx); } - void disconnect(void *plugindata, PluginInfo *info, Context *ctx) { - osync_objtype_sink_disconnect(self, plugindata, info, ctx); + void disconnect(PluginInfo *info, Context *ctx) { + osync_objtype_sink_disconnect(self, info, ctx); } - void sync_done(void *plugindata, PluginInfo *info, Context *ctx) { - osync_objtype_sink_sync_done(self, plugindata, info, ctx); + void sync_done(PluginInfo *info, Context *ctx) { + osync_objtype_sink_sync_done(self, info, ctx); } - void commit_change(void *plugindata, PluginInfo *info, Change *change, Context *ctx) { - osync_objtype_sink_commit_change(self, plugindata, info, change, ctx); + void commit_change(PluginInfo *info, Change *change, Context *ctx) { + osync_objtype_sink_commit_change(self, info, change, ctx); } - void committed_all(void *plugindata, PluginInfo *info, Context *ctx) { - osync_objtype_sink_committed_all(self, plugindata, info, ctx); + void committed_all(PluginInfo *info, Context *ctx) { + osync_objtype_sink_committed_all(self, info, ctx); } bool is_enabled() { |
From: <svn...@op...> - 2009-03-26 13:25:25
|
Author: ianmartin Date: Thu Mar 26 14:25:12 2009 New Revision: 5349 URL: http://www.opensync.org/changeset/5349 Log: Move sync function userdata determination into osync_objtype_sink_<sink_function>. This forces all callers of pluing sync functions to pass the user data the plugin set for the sink. Fixes bug with osyncplugin passing plugindata to plugin sync functions Modified: trunk/opensync/client/opensync_client.c trunk/opensync/plugin/opensync_objtype_sink.c trunk/opensync/plugin/opensync_objtype_sink.h trunk/tools/osyncplugin.c Modified: trunk/opensync/client/opensync_client.c ============================================================================== --- trunk/opensync/client/opensync_client.c Thu Mar 26 04:20:31 2009 (r5348) +++ trunk/opensync/client/opensync_client.c Thu Mar 26 14:25:12 2009 (r5349) @@ -967,7 +967,7 @@ goto error; osync_plugin_info_set_sink(client->plugin_info, sink); - osync_objtype_sink_connect(sink, osync_objtype_sink_get_userdata(sink), client->plugin_info, context); + osync_objtype_sink_connect(sink, client->plugin_info, context); osync_context_unref(context); } @@ -1022,7 +1022,7 @@ goto error; osync_plugin_info_set_sink(client->plugin_info, sink); - osync_objtype_sink_connect_done(sink, osync_objtype_sink_get_userdata(sink), client->plugin_info, context); + osync_objtype_sink_connect_done(sink, client->plugin_info, context); osync_context_unref(context); } @@ -1076,7 +1076,7 @@ goto error; osync_plugin_info_set_sink(client->plugin_info, sink); - osync_objtype_sink_disconnect(sink, osync_objtype_sink_get_userdata(sink), client->plugin_info, context); + osync_objtype_sink_disconnect(sink, client->plugin_info, context); osync_context_unref(context); } @@ -1141,7 +1141,7 @@ osync_plugin_info_set_sink(client->plugin_info, sink); - osync_objtype_sink_get_changes(sink, osync_objtype_sink_get_userdata(sink), client->plugin_info, context); + osync_objtype_sink_get_changes(sink, client->plugin_info, context); osync_context_unref(context); } @@ -1200,7 +1200,7 @@ osync_plugin_info_set_sink(client->plugin_info, sink); - osync_objtype_sink_read_change(sink, osync_objtype_sink_get_userdata(sink), client->plugin_info, change, context); + osync_objtype_sink_read_change(sink, client->plugin_info, change, context); osync_context_unref(context); } @@ -1247,7 +1247,7 @@ goto error; osync_plugin_info_set_sink(client->plugin_info, sink); - osync_objtype_sink_commit_change(sink, osync_objtype_sink_get_userdata(sink), client->plugin_info, change, context); + osync_objtype_sink_commit_change(sink, client->plugin_info, change, context); osync_change_unref(change); osync_context_unref(context); @@ -1300,7 +1300,7 @@ goto error; osync_plugin_info_set_sink(client->plugin_info, sink); - osync_objtype_sink_committed_all(sink, osync_objtype_sink_get_userdata(sink), client->plugin_info, context); + osync_objtype_sink_committed_all(sink, client->plugin_info, context); osync_context_unref(context); } @@ -1354,7 +1354,7 @@ goto error; osync_plugin_info_set_sink(client->plugin_info, sink); - osync_objtype_sink_sync_done(sink, osync_objtype_sink_get_userdata(sink), client->plugin_info, context); + osync_objtype_sink_sync_done(sink, client->plugin_info, context); osync_context_unref(context); } Modified: trunk/opensync/plugin/opensync_objtype_sink.c ============================================================================== --- trunk/opensync/plugin/opensync_objtype_sink.c Thu Mar 26 04:20:31 2009 (r5348) +++ trunk/opensync/plugin/opensync_objtype_sink.c Thu Mar 26 14:25:12 2009 (r5349) @@ -257,10 +257,10 @@ return sink->userdata; } -void osync_objtype_sink_get_changes(OSyncObjTypeSink *sink, void *plugindata, OSyncPluginInfo *info, OSyncContext *ctx) +void osync_objtype_sink_get_changes(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx) { OSyncObjTypeSinkFunctions functions; - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __func__, sink, plugindata, info, ctx); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, sink, info, ctx); osync_assert(sink); osync_assert(ctx); @@ -272,16 +272,16 @@ } else if (!functions.get_changes) { osync_context_report_success(ctx); } else { - functions.get_changes(sink, info, ctx, osync_objtype_sink_get_slowsync(sink), plugindata); + functions.get_changes(sink, info, ctx, osync_objtype_sink_get_slowsync(sink), osync_objtype_sink_get_userdata(sink)); } osync_trace(TRACE_EXIT, "%s", __func__); } -void osync_objtype_sink_read_change(OSyncObjTypeSink *sink, void *plugindata, OSyncPluginInfo *info, OSyncChange *change, OSyncContext *ctx) +void osync_objtype_sink_read_change(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncChange *change, OSyncContext *ctx) { OSyncObjTypeSinkFunctions functions; - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p, %p)", __func__, sink, plugindata, info, change, ctx); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __func__, sink, info, change, ctx); osync_assert(sink); osync_assert(ctx); osync_assert(change); @@ -296,16 +296,16 @@ } else if (!functions.read) { osync_context_report_success(ctx); } else { - functions.read(sink, info, ctx, change, plugindata); + functions.read(sink, info, ctx, change, osync_objtype_sink_get_userdata(sink)); } osync_trace(TRACE_EXIT, "%s", __func__); } -void osync_objtype_sink_connect(OSyncObjTypeSink *sink, void *plugindata, OSyncPluginInfo *info, OSyncContext *ctx) +void osync_objtype_sink_connect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx) { OSyncObjTypeSinkFunctions functions; - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __func__, sink, plugindata, info, ctx); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, sink, info, ctx); osync_assert(sink); osync_assert(ctx); @@ -313,16 +313,16 @@ if (!functions.connect) { osync_context_report_success(ctx); } else { - functions.connect(sink, info, ctx, plugindata); + functions.connect(sink, info, ctx, osync_objtype_sink_get_userdata(sink)); } osync_trace(TRACE_EXIT, "%s", __func__); } -void osync_objtype_sink_disconnect(OSyncObjTypeSink *sink, void *plugindata, OSyncPluginInfo *info, OSyncContext *ctx) +void osync_objtype_sink_disconnect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx) { OSyncObjTypeSinkFunctions functions; - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __func__, sink, plugindata, info, ctx); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, sink, info, ctx); osync_assert(sink); osync_assert(ctx); @@ -330,16 +330,16 @@ if (!functions.disconnect) { osync_context_report_success(ctx); } else { - functions.disconnect(sink, info, ctx, plugindata); + functions.disconnect(sink, info, ctx, osync_objtype_sink_get_userdata(sink)); } osync_trace(TRACE_EXIT, "%s", __func__); } -void osync_objtype_sink_sync_done(OSyncObjTypeSink *sink, void *plugindata, OSyncPluginInfo *info, OSyncContext *ctx) +void osync_objtype_sink_sync_done(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx) { OSyncObjTypeSinkFunctions functions; - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __func__, sink, plugindata, info, ctx); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, sink, info, ctx); osync_assert(sink); osync_assert(ctx); @@ -347,15 +347,15 @@ if (!functions.sync_done) osync_context_report_success(ctx); else - functions.sync_done(sink, info, ctx, plugindata); + functions.sync_done(sink, info, ctx, osync_objtype_sink_get_userdata(sink)); osync_trace(TRACE_EXIT, "%s", __func__); } -void osync_objtype_sink_connect_done(OSyncObjTypeSink *sink, void *plugindata, OSyncPluginInfo *info, OSyncContext *ctx) +void osync_objtype_sink_connect_done(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx) { OSyncObjTypeSinkFunctions functions; - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __func__, sink, plugindata, info, ctx); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, sink, info, ctx); osync_assert(sink); osync_assert(ctx); @@ -363,15 +363,15 @@ if (!functions.connect_done) osync_context_report_success(ctx); else - functions.connect_done(sink, info, ctx, plugindata); + functions.connect_done(sink, info, ctx, osync_objtype_sink_get_userdata(sink)); osync_trace(TRACE_EXIT, "%s", __func__); } -void osync_objtype_sink_commit_change(OSyncObjTypeSink *sink, void *plugindata, OSyncPluginInfo *info, OSyncChange *change, OSyncContext *ctx) +void osync_objtype_sink_commit_change(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncChange *change, OSyncContext *ctx) { OSyncObjTypeSinkFunctions functions; - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p, %p)", __func__, sink, plugindata, info, change, ctx); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __func__, sink, info, change, ctx); g_assert(sink); g_assert(change); g_assert(ctx); @@ -398,14 +398,14 @@ } else if (!functions.commit) { osync_context_report_success(ctx); } else { - functions.commit(sink, info, ctx, change, plugindata); + functions.commit(sink, info, ctx, change, osync_objtype_sink_get_userdata(sink)); } } osync_trace(TRACE_EXIT, "%s", __func__); } -void osync_objtype_sink_committed_all(OSyncObjTypeSink *sink, void *plugindata, OSyncPluginInfo *info, OSyncContext *ctx) +void osync_objtype_sink_committed_all(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx) { OSyncObjTypeSinkFunctions functions; int i = 0; @@ -415,7 +415,7 @@ OSyncChange *change = NULL; OSyncContext *context = NULL; - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __func__, sink, plugindata, info, ctx); + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, sink, info, ctx); osync_assert(sink); osync_assert(ctx); @@ -444,12 +444,12 @@ osync_list_free(sink->commit_changes); osync_list_free(sink->commit_contexts); - functions.batch_commit(sink, info, ctx, contexts, changes, plugindata); + functions.batch_commit(sink, info, ctx, contexts, changes, osync_objtype_sink_get_userdata(sink)); osync_free(changes); osync_free(contexts); } else if (functions.committed_all) { - functions.committed_all(sink, info, ctx, plugindata); + functions.committed_all(sink, info, ctx, osync_objtype_sink_get_userdata(sink)); } else { osync_context_report_success(ctx); } Modified: trunk/opensync/plugin/opensync_objtype_sink.h ============================================================================== --- trunk/opensync/plugin/opensync_objtype_sink.h Thu Mar 26 04:20:31 2009 (r5348) +++ trunk/opensync/plugin/opensync_objtype_sink.h Thu Mar 26 14:25:12 2009 (r5349) @@ -358,86 +358,79 @@ * Calls the get_changes function on a sink * * @param sink Pointer to the sink - * @param plugindata User data that will be passed on to the callback function * @param info Pointer to the plugin info object * @param ctx The sync context * */ -OSYNC_EXPORT void osync_objtype_sink_get_changes(OSyncObjTypeSink *sink, void *plugindata, OSyncPluginInfo *info, OSyncContext *ctx); +OSYNC_EXPORT void osync_objtype_sink_get_changes(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx); /** @brief Reads a single object by its uid * * Calls the read_change function on the sink * * @param sink Pointer to the sink - * @param plugindata User data that will be passed on to the callback function * @param info Pointer to the plugin info object * @param change The change to read. The change must have the uid set * @param ctx The sync context * */ -OSYNC_EXPORT void osync_objtype_sink_read_change(OSyncObjTypeSink *sink, void *plugindata, OSyncPluginInfo *info, OSyncChange *change, OSyncContext *ctx); +OSYNC_EXPORT void osync_objtype_sink_read_change(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncChange *change, OSyncContext *ctx); /** @brief Connects a sink to its device * * Calls the connect function on a sink * * @param sink Pointer to the sink - * @param plugindata User data that will be passed on to the callback function * @param info Pointer to the plugin info object * @param ctx The sync context * */ -OSYNC_EXPORT void osync_objtype_sink_connect(OSyncObjTypeSink *sink, void *plugindata, OSyncPluginInfo *info, OSyncContext *ctx); +OSYNC_EXPORT void osync_objtype_sink_connect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx); /** @brief Disconnects a sink from its device * * Calls the disconnect function on a sink * * @param sink Pointer to the sink - * @param plugindata User data that will be passed on to the callback function * @param info Pointer to the plugin info object * @param ctx The sync context * */ -OSYNC_EXPORT void osync_objtype_sink_disconnect(OSyncObjTypeSink *sink, void *plugindata, OSyncPluginInfo *info, OSyncContext *ctx); +OSYNC_EXPORT void osync_objtype_sink_disconnect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx); /** @brief Tells the sink that the sync was successfully completed * * Calls the sync_done function on a sink * * @param sink Pointer to the sink - * @param plugindata User data that will be passed on to the callback function * @param info Pointer to the plugin info object * @param ctx The sync context * */ -OSYNC_EXPORT void osync_objtype_sink_sync_done(OSyncObjTypeSink *sink, void *plugindata, OSyncPluginInfo *info, OSyncContext *ctx); +OSYNC_EXPORT void osync_objtype_sink_sync_done(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx); /** @brief Tells the sink that the connection was successfully completed * * Calls the connect_done function on a sink * * @param sink Pointer to the sink - * @param plugindata User data that will be passed on to the callback function * @param info Pointer to the plugin info object * @param ctx The sync context * */ -OSYNC_EXPORT void osync_objtype_sink_connect_done(OSyncObjTypeSink *sink, void *plugindata, OSyncPluginInfo *info, OSyncContext *ctx); +OSYNC_EXPORT void osync_objtype_sink_connect_done(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx); /** @brief Commits a change to the device * * Calls the commit_change function on a sink * * @param sink Pointer to the sink - * @param plugindata User data that will be passed on to the callback function * @param info Pointer to the plugin info object * @param change The change to write * @param ctx The sync context * */ -OSYNC_EXPORT void osync_objtype_sink_commit_change(OSyncObjTypeSink *sink, void *plugindata, OSyncPluginInfo *info, OSyncChange *change, OSyncContext *ctx); +OSYNC_EXPORT void osync_objtype_sink_commit_change(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncChange *change, OSyncContext *ctx); /** @brief Tells the sink that all changes have been committed * @@ -445,12 +438,11 @@ * depending on which function the sink wants to use. * * @param sink Pointer to the sink - * @param plugindata User data that will be passed on to the callback function * @param info Pointer to the plugin info object * @param ctx The sync context * */ -OSYNC_EXPORT void osync_objtype_sink_committed_all(OSyncObjTypeSink *sink, void *plugindata, OSyncPluginInfo *info, OSyncContext *ctx); +OSYNC_EXPORT void osync_objtype_sink_committed_all(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx); /** @brief Sets the connect timeout in seconds for the OSyncObjTypeSink Modified: trunk/tools/osyncplugin.c ============================================================================== --- trunk/tools/osyncplugin.c Thu Mar 26 04:20:31 2009 (r5348) +++ trunk/tools/osyncplugin.c Thu Mar 26 14:25:12 2009 (r5349) @@ -35,7 +35,6 @@ #include <opensync/opensync-plugin.h> #include <opensync/opensync-format.h> - #include <opensync/opensync-context.h> char *pluginpath = NULL; @@ -558,7 +557,7 @@ } -static osync_bool get_changes_sink(Command *cmd, OSyncObjTypeSink *sink, SyncType type, void *plugin_data, OSyncError **error) +static osync_bool get_changes_sink(Command *cmd, OSyncObjTypeSink *sink, SyncType type, OSyncError **error) { OSyncContext *context = NULL; assert(sink); @@ -583,7 +582,7 @@ osync_plugin_info_set_sink(plugin_info, sink); - osync_objtype_sink_get_changes(sink, plugin_data, plugin_info, context); + osync_objtype_sink_get_changes(sink, plugin_info, context); osync_context_unref(context); @@ -594,7 +593,7 @@ return FALSE; } -static osync_bool get_changes(Command *cmd, SyncType type, void *plugin_data, OSyncError **error) +static osync_bool get_changes(Command *cmd, SyncType type, OSyncError **error) { int num, i; OSyncObjTypeSink *sink = NULL; @@ -606,7 +605,7 @@ goto error; cmd->sink = sink; - if (!get_changes_sink(cmd, sink, type, plugin_data, error)) + if (!get_changes_sink(cmd, sink, type, error)) goto error; } else { @@ -616,14 +615,14 @@ sink = osync_plugin_info_nth_objtype(plugin_info, i); cmd->sink = sink; - if (!get_changes_sink(cmd, sink, type, plugin_data, error)) + if (!get_changes_sink(cmd, sink, type, error)) goto error; } /* last but not least - the main sink */ if (get_main_sink()) - if (!get_changes_sink(cmd, get_main_sink(), type, plugin_data, error)) + if (!get_changes_sink(cmd, get_main_sink(), type, error)) goto error; } @@ -668,7 +667,7 @@ return; } -static osync_bool connect_sink(Command *cmd, OSyncObjTypeSink *sink, void *plugin_data, OSyncError **error) { +static osync_bool connect_sink(Command *cmd, OSyncObjTypeSink *sink, OSyncError **error) { OSyncContext *context = NULL; assert(sink); assert(cmd); @@ -683,7 +682,7 @@ osync_plugin_info_set_sink(plugin_info, sink); - osync_objtype_sink_connect(sink, plugin_data, plugin_info, context); + osync_objtype_sink_connect(sink, plugin_info, context); osync_context_unref(context); @@ -693,7 +692,7 @@ return FALSE; } -static osync_bool connect_plugin(Command *cmd, void *plugin_data, OSyncError **error) +static osync_bool connect_plugin(Command *cmd, OSyncError **error) { unsigned int i, num; OSyncObjTypeSink *sink = NULL; @@ -704,20 +703,20 @@ if (!sink) goto error; - if (!connect_sink(cmd, sink, plugin_data, error)) + if (!connect_sink(cmd, sink, error)) goto error; } else { num = osync_plugin_info_num_objtypes(plugin_info); for (i=0; i < num; i++) { sink = osync_plugin_info_nth_objtype(plugin_info, i); - if (!connect_sink(cmd, sink, plugin_data, error)) + if (!connect_sink(cmd, sink, error)) goto error; } /* last but not least - the main sink */ if (get_main_sink()) - if (!connect_sink(cmd, get_main_sink(), plugin_data, error)) + if (!connect_sink(cmd, get_main_sink(), error)) goto error; } @@ -760,7 +759,7 @@ return; } -static osync_bool disconnect_sink(Command *cmd, OSyncObjTypeSink *sink, void *plugin_data, OSyncError **error) { +static osync_bool disconnect_sink(Command *cmd, OSyncObjTypeSink *sink, OSyncError **error) { OSyncContext *context = osync_context_new(error); assert(sink); assert(cmd); @@ -774,7 +773,7 @@ osync_plugin_info_set_sink(plugin_info, sink); - osync_objtype_sink_disconnect(sink, plugin_data, plugin_info, context); + osync_objtype_sink_disconnect(sink, plugin_info, context); osync_context_unref(context); @@ -784,7 +783,7 @@ return FALSE; } -static osync_bool disconnect(Command *cmd, void *plugin_data, OSyncError **error) +static osync_bool disconnect(Command *cmd, OSyncError **error) { int i, num; @@ -796,20 +795,20 @@ if (!sink) goto error; - if (!disconnect_sink(cmd, sink, plugin_data, error)) + if (!disconnect_sink(cmd, sink, error)) goto error; } else { num = osync_plugin_info_num_objtypes(plugin_info); for (i=0; i < num; i++) { sink = osync_plugin_info_nth_objtype(plugin_info, i); - if (!disconnect_sink(cmd, sink, plugin_data, error)) + if (!disconnect_sink(cmd, sink, error)) goto error; } /* last but not least - the main sink */ if (get_main_sink()) - if (!disconnect_sink(cmd, get_main_sink(), plugin_data, error)) + if (!disconnect_sink(cmd, get_main_sink(), error)) goto error; } @@ -846,7 +845,7 @@ } -static osync_bool commit_sink(Command *cmd, OSyncObjTypeSink *sink, OSyncChange *change, void *plugin_data, OSyncError **error) { +static osync_bool commit_sink(Command *cmd, OSyncObjTypeSink *sink, OSyncChange *change, OSyncError **error) { OSyncContext *context = NULL; assert(sink); assert(change); @@ -866,7 +865,7 @@ osync_data_get_objtype(osync_change_get_data(change)), osync_change_get_uid(change)); - osync_objtype_sink_commit_change(sink, plugin_data, plugin_info, change, context); + osync_objtype_sink_commit_change(sink, plugin_info, change, context); osync_context_unref(context); @@ -876,7 +875,7 @@ return FALSE; } -static osync_bool commit(Command *cmd, OSyncChange *change, void *plugin_data, OSyncError **error) +static osync_bool commit(Command *cmd, OSyncChange *change, OSyncError **error) { int i, num; OSyncObjTypeSink *sink = NULL; @@ -889,20 +888,20 @@ if (!sink) goto error; - if (!commit_sink(cmd, sink, change, plugin_data, error)) + if (!commit_sink(cmd, sink, change, error)) goto error; } else { num = osync_plugin_info_num_objtypes(plugin_info); for (i=0; i < num; i++) { sink = osync_plugin_info_nth_objtype(plugin_info, i); - if (!commit_sink(cmd, sink, change, plugin_data, error)) + if (!commit_sink(cmd, sink, change, error)) goto error; } /* last but not least - the main sink */ if (get_main_sink()) - if (!commit_sink(cmd, get_main_sink(), change, plugin_data, error)) + if (!commit_sink(cmd, get_main_sink(), change, error)) goto error; } @@ -911,14 +910,14 @@ return FALSE; } -static osync_bool empty(Command *cmd, void *plugin_data, OSyncError **error) +static osync_bool empty(Command *cmd, OSyncError **error) { int i; GList *c; //const char *objtype = cmd->arg; /* Perform slowync - if objtype is set for this objtype, otherwise slowsync for ALL */ - if (!get_changes(cmd, SYNCTYPE_FORCE_SLOWSYNC, plugin_data, error)) + if (!get_changes(cmd, SYNCTYPE_FORCE_SLOWSYNC, error)) goto error; @@ -926,7 +925,7 @@ OSyncChange *change = c->data; osync_change_set_changetype(change, OSYNC_CHANGE_TYPE_DELETED); - if (!commit(cmd, change, plugin_data, error)) + if (!commit(cmd, change, error)) goto error; } @@ -963,7 +962,7 @@ return; } -static osync_bool syncdone_sink(Command *cmd, OSyncObjTypeSink *sink, void *plugin_data, OSyncError **error) { +static osync_bool syncdone_sink(Command *cmd, OSyncObjTypeSink *sink, OSyncError **error) { OSyncContext *context = NULL; assert(sink); assert(cmd); @@ -978,7 +977,7 @@ osync_plugin_info_set_sink(plugin_info, sink); - osync_objtype_sink_sync_done(sink, plugin_data, plugin_info, context); + osync_objtype_sink_sync_done(sink, plugin_info, context); osync_context_unref(context); @@ -988,7 +987,7 @@ return FALSE; } -static osync_bool syncdone(Command *cmd, void *plugin_data, OSyncError **error) +static osync_bool syncdone(Command *cmd, OSyncError **error) { int i, num; @@ -1000,20 +999,20 @@ if (!sink) goto error; - if (!syncdone_sink(cmd, sink, plugin_data, error)) + if (!syncdone_sink(cmd, sink, error)) goto error; } else { num = osync_plugin_info_num_objtypes(plugin_info); for (i=0; i < num; i++) { sink = osync_plugin_info_nth_objtype(plugin_info, i); - if (!syncdone_sink(cmd, sink, plugin_data, error)) + if (!syncdone_sink(cmd, sink, error)) goto error; } /* last but not least - the main sink */ if (get_main_sink()) - if (!syncdone_sink(cmd, get_main_sink(), plugin_data, error)) + if (!syncdone_sink(cmd, get_main_sink(), error)) goto error; } @@ -1047,7 +1046,7 @@ return; } -static osync_bool committedall_sink(Command *cmd, OSyncObjTypeSink *sink, void *plugin_data, OSyncError **error) { +static osync_bool committedall_sink(Command *cmd, OSyncObjTypeSink *sink, OSyncError **error) { OSyncContext *context = NULL; assert(sink); assert(cmd); @@ -1062,7 +1061,7 @@ osync_plugin_info_set_sink(plugin_info, sink); - osync_objtype_sink_committed_all(sink, plugin_data, plugin_info, context); + osync_objtype_sink_committed_all(sink, plugin_info, context); osync_context_unref(context); @@ -1072,7 +1071,7 @@ return FALSE; } -static osync_bool committedall(Command *cmd, void *plugin_data, OSyncError **error) +static osync_bool committedall(Command *cmd, OSyncError **error) { int i, num; OSyncObjTypeSink *sink = NULL; @@ -1083,20 +1082,20 @@ if (!sink) goto error; - if (!committedall_sink(cmd, sink, plugin_data, error)) + if (!committedall_sink(cmd, sink, error)) goto error; } else { num = osync_plugin_info_num_objtypes(plugin_info); for (i=0; i < num; i++) { sink = osync_plugin_info_nth_objtype(plugin_info, i); - if (!committedall_sink(cmd, sink, plugin_data, error)) + if (!committedall_sink(cmd, sink, error)) goto error; } /* last but not least - the main sink */ if (get_main_sink()) - if (!committedall_sink(cmd, get_main_sink(), plugin_data, error)) + if (!committedall_sink(cmd, get_main_sink(), error)) goto error; } @@ -1120,7 +1119,7 @@ switch (cmd->cmd) { case CMD_EMPTY: - if (!empty(cmd, *plugin_data, error)) + if (!empty(cmd, error)) goto error; break; case CMD_INITIALIZE: @@ -1131,23 +1130,23 @@ finalize_plugin(plugin_data); break; case CMD_CONNECT: - if (!connect_plugin(cmd, *plugin_data, error)) + if (!connect_plugin(cmd, error)) goto error; break; case CMD_DISCONNECT: - if (!disconnect(cmd, *plugin_data, error)) + if (!disconnect(cmd, error)) goto error; break; case CMD_SLOWSYNC: - if (!get_changes(cmd, SYNCTYPE_FORCE_SLOWSYNC, *plugin_data, error)) + if (!get_changes(cmd, SYNCTYPE_FORCE_SLOWSYNC, error)) goto error; break; case CMD_FASTSYNC: - if (!get_changes(cmd, SYNCTYPE_FORCE_FASTSYNC, *plugin_data, error)) + if (!get_changes(cmd, SYNCTYPE_FORCE_FASTSYNC, error)) goto error; break; case CMD_SYNC: - if (!get_changes(cmd, SYNCTYPE_NORMAL, *plugin_data, error)) + if (!get_changes(cmd, SYNCTYPE_NORMAL, error)) goto error; break; case CMD_COMMIT: @@ -1157,7 +1156,7 @@ fprintf(stderr, "BATCHCOMMIT not yet implemented\n"); break; case CMD_COMMITTEDALL: - if (!committedall(cmd, *plugin_data, error)) + if (!committedall(cmd, error)) goto error; break; case CMD_READ: @@ -1167,7 +1166,7 @@ fprintf(stderr, "WRITE not yet implemented\n"); break; case CMD_SYNCDONE: - if (!syncdone(cmd, *plugin_data, error)) + if (!syncdone(cmd, error)) goto error; break; case CMD_DISCOVER: @@ -1287,7 +1286,7 @@ error_disconnect_and_finalize: if (plugin_data) - disconnect(NULL, plugin_data, NULL); + disconnect(NULL, NULL); //error_finalize: finalize_plugin(&plugin_data); //error_free_plugin_env: |
From: <svn...@op...> - 2009-03-26 03:20:37
|
Author: dgollub Date: Thu Mar 26 04:20:31 2009 New Revision: 5348 URL: http://www.opensync.org/changeset/5348 Log: Reenable testcase engine_error_dual_commit_timeout. Not failing after 30 test cycles. fixes #1041 Modified: trunk/tests/CMakeLists.txt Modified: trunk/tests/CMakeLists.txt ============================================================================== --- trunk/tests/CMakeLists.txt Thu Mar 26 04:14:03 2009 (r5347) +++ trunk/tests/CMakeLists.txt Thu Mar 26 04:20:31 2009 (r5348) @@ -175,7 +175,7 @@ OSYNC_TESTCASE( engine-error engine_error_single_commit_error) OSYNC_TESTCASE( engine-error engine_error_dual_commit_error) OSYNC_TESTCASE( engine-error engine_error_single_commit_timeout) -OSYNC_TESTCASE_DISABLED( engine-error engine_error_dual_commit_timeout "1041") +OSYNC_TESTCASE( engine-error engine_error_dual_commit_timeout) OSYNC_TESTCASE( engine-error engine_error_commit_timeout_and_error) OSYNC_TESTCASE( engine-error engine_error_commit_timeout_and_error2) OSYNC_TESTCASE( engine-error engine_error_commit_error_modify) |
From: <svn...@op...> - 2009-03-26 03:14:07
|
Author: dgollub Date: Thu Mar 26 04:14:03 2009 New Revision: 5347 URL: http://www.opensync.org/changeset/5347 Log: Reduced engine_sync_stress number of iterrations from 1000 to 250. Profiling is scheduled after 0.40 release refs #1040 Modified: trunk/tests/CMakeLists.txt trunk/tests/engine-tests/check_engine.c Modified: trunk/tests/CMakeLists.txt ============================================================================== --- trunk/tests/CMakeLists.txt Thu Mar 26 04:08:45 2009 (r5346) +++ trunk/tests/CMakeLists.txt Thu Mar 26 04:14:03 2009 (r5347) @@ -144,7 +144,7 @@ OSYNC_TESTCASE( engine engine_sync_multi_obj ) OSYNC_TESTCASE( engine engine_sync_out_of_order ) OSYNC_TESTCASE( engine engine_sync_reuse ) -OSYNC_TESTCASE_DISABLED( engine engine_sync_stress "1040" ) +OSYNC_TESTCASE( engine engine_sync_stress ) OSYNC_TESTCASE( engine engine_sync_read_write ) OSYNC_TESTCASE( engine engine_sync_read_write_stress ) OSYNC_TESTCASE( engine engine_sync_read_write_stress2 ) Modified: trunk/tests/engine-tests/check_engine.c ============================================================================== --- trunk/tests/engine-tests/check_engine.c Thu Mar 26 04:08:45 2009 (r5346) +++ trunk/tests/engine-tests/check_engine.c Thu Mar 26 04:14:03 2009 (r5347) @@ -1341,7 +1341,7 @@ START_TEST (engine_sync_stress) { - int n = 1000; + int n = 250; /* FIXME: Used to be 1000 - #1040 */ int i = 0; char *testbed = setup_testbed("sync_setup"); |
From: <svn...@op...> - 2009-03-26 03:08:49
|
Author: dgollub Date: Thu Mar 26 04:08:45 2009 New Revision: 5346 URL: http://www.opensync.org/changeset/5346 Log: Reenabled engine_error_dual_connect_timeout. Not reproducible. 100% pass after 60 test cycles on Linux Host x86_64 SMP. fixes #1038 Modified: trunk/tests/CMakeLists.txt Modified: trunk/tests/CMakeLists.txt ============================================================================== --- trunk/tests/CMakeLists.txt Thu Mar 26 03:57:56 2009 (r5345) +++ trunk/tests/CMakeLists.txt Thu Mar 26 04:08:45 2009 (r5346) @@ -162,7 +162,7 @@ OSYNC_TESTCASE( engine-error engine_error_one_of_three_connect_error) OSYNC_TESTCASE( engine-error engine_error_no_connect_error) OSYNC_TESTCASE( engine-error engine_error_single_connect_timeout) -OSYNC_TESTCASE_DISABLED( engine-error engine_error_dual_connect_timeout "1038") +OSYNC_TESTCASE( engine-error engine_error_dual_connect_timeout) OSYNC_TESTCASE( engine-error engine_error_one_of_three_timeout) OSYNC_TESTCASE( engine-error engine_error_timeout_and_error) OSYNC_TESTCASE( engine-error engine_error_single_get_changes_error) |
From: <svn...@op...> - 2009-03-26 02:58:00
|
Author: dgollub Date: Thu Mar 26 03:57:56 2009 New Revision: 5345 URL: http://www.opensync.org/changeset/5345 Log: Ignore new changes messages from plugins if they delayed/timedout. fixes #1030 Modified: trunk/opensync/client/opensync_client_proxy.c trunk/opensync/client/opensync_client_proxy_private.h trunk/tests/CMakeLists.txt trunk/tests/engine-tests/check_engine_error.c Modified: trunk/opensync/client/opensync_client_proxy.c ============================================================================== --- trunk/opensync/client/opensync_client_proxy.c Thu Mar 26 02:48:16 2009 (r5344) +++ trunk/opensync/client/opensync_client_proxy.c Thu Mar 26 03:57:56 2009 (r5345) @@ -626,6 +626,7 @@ } else if (osync_message_get_cmd(message) == OSYNC_MESSAGE_ERRORREPLY) { osync_demarshal_error(message, &error); ctx->get_changes_callback(proxy, ctx->get_changes_callback_data, error); + osync_client_proxy_set_error(proxy, error); osync_error_unref(&error); } else { osync_error_set(&locerror, OSYNC_ERROR_GENERIC, "Unexpected reply"); @@ -761,6 +762,11 @@ case OSYNC_MESSAGE_READ_CHANGE: osync_assert(proxy->change_callback); + + if (proxy->error) { + osync_trace(TRACE_INTERNAL, "WARNING: Proxy error taintend! Ignoring incoming changes!"); + break; + } if (!osync_demarshal_change(message, &change, proxy->formatenv, &error)) goto error; @@ -841,6 +847,9 @@ if (proxy->formatenv) osync_format_env_unref(proxy->formatenv); + + if (proxy->error) + osync_error_unref(&proxy->error); osync_free(proxy); } @@ -1759,3 +1768,17 @@ osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error)); return FALSE; } + +void osync_client_proxy_set_error(OSyncClientProxy *proxy, OSyncError *error) +{ + osync_assert(proxy); + if (proxy->error) { + osync_error_stack(&error, &proxy->error); + osync_error_unref(&proxy->error); + } + + proxy->error = error; + if (error) + osync_error_ref(&error); +} + Modified: trunk/opensync/client/opensync_client_proxy_private.h ============================================================================== --- trunk/opensync/client/opensync_client_proxy_private.h Thu Mar 26 02:48:16 2009 (r5344) +++ trunk/opensync/client/opensync_client_proxy_private.h Thu Mar 26 03:57:56 2009 (r5345) @@ -72,6 +72,11 @@ change_cb change_callback; void *change_callback_data; + + /** Proxy specific error struct */ + OSyncError *error; }; +void osync_client_proxy_set_error(OSyncClientProxy *proxy, OSyncError *error); + #endif /*OSYNC_CLIENT_PROXY_PRIVATE_H_*/ Modified: trunk/tests/CMakeLists.txt ============================================================================== --- trunk/tests/CMakeLists.txt Thu Mar 26 02:48:16 2009 (r5344) +++ trunk/tests/CMakeLists.txt Thu Mar 26 03:57:56 2009 (r5345) @@ -171,7 +171,7 @@ OSYNC_TESTCASE( engine-error engine_error_one_of_three_get_changes_error) OSYNC_TESTCASE( engine-error engine_error_one_of_three_get_changes_timeout) OSYNC_TESTCASE( engine-error engine_error_get_changes_timeout_and_error) -OSYNC_TESTCASE_DISABLED( engine-error engine_error_get_changes_timeout_sleep "1030") +OSYNC_TESTCASE( engine-error engine_error_get_changes_timeout_sleep) OSYNC_TESTCASE( engine-error engine_error_single_commit_error) OSYNC_TESTCASE( engine-error engine_error_dual_commit_error) OSYNC_TESTCASE( engine-error engine_error_single_commit_timeout) Modified: trunk/tests/engine-tests/check_engine_error.c ============================================================================== --- trunk/tests/engine-tests/check_engine_error.c Thu Mar 26 02:48:16 2009 (r5344) +++ trunk/tests/engine-tests/check_engine_error.c Thu Mar 26 03:57:56 2009 (r5345) @@ -1455,9 +1455,11 @@ END_TEST -/* FIXME: If get_changes delays and got timed out .. set change_callback to NULL. - Make sure changes from the plugin got completely ignored by the engine when the timout handler got called. - Even better would be to abort the get_changes call from the plugin process... +/* If get_changes delays and got timed out ... tainted proxy with an error. + * + * Make sure changes from the plugin got completely ignored by the engine when the timout handler got called. + * Even better would be to abort the get_changes call from the plugin process... + * */ START_TEST (engine_error_get_changes_timeout_sleep) { @@ -1506,7 +1508,9 @@ fail_unless(num_client_read == 0, NULL); fail_unless(num_client_written == 0, NULL); - // FIXME: If get_changes delays and get timed out .. set change_callback to NULL. To make sure changes got completely ignored by the engine + /* If get_changes delays and get timed out .. proxy get tainted with an error. + * To make sure changes got completely ignored by the engine. + */ fail_unless(num_change_read == 0, NULL); fail_unless(num_change_written == 0, NULL); |
From: <svn...@op...> - 2009-03-26 01:48:19
|
Author: dgollub Date: Thu Mar 26 02:48:16 2009 New Revision: 5344 URL: http://www.opensync.org/changeset/5344 Log: Fixed #994 with r5342, r5343 Tested engine_sync_read_write_stress with 10 cycles - 10 passed. Reduced the number of stress commits in engine_sync_read_write_stress from 1000 to 250 to "workaround" #1040 Profiling to fix #1040 will be done after 0.40 fixes #994 Modified: trunk/tests/CMakeLists.txt trunk/tests/engine-tests/check_engine.c Modified: trunk/tests/CMakeLists.txt ============================================================================== --- trunk/tests/CMakeLists.txt Thu Mar 26 02:32:27 2009 (r5343) +++ trunk/tests/CMakeLists.txt Thu Mar 26 02:48:16 2009 (r5344) @@ -146,7 +146,7 @@ OSYNC_TESTCASE( engine engine_sync_reuse ) OSYNC_TESTCASE_DISABLED( engine engine_sync_stress "1040" ) OSYNC_TESTCASE( engine engine_sync_read_write ) -OSYNC_TESTCASE_DISABLED( engine engine_sync_read_write_stress "994" ) +OSYNC_TESTCASE( engine engine_sync_read_write_stress ) OSYNC_TESTCASE( engine engine_sync_read_write_stress2 ) BUILD_CHECK_TEST( engine-error engine-tests/check_engine_error.c ${TEST_TARGET_LIBRARIES} ) Modified: trunk/tests/engine-tests/check_engine.c ============================================================================== --- trunk/tests/engine-tests/check_engine.c Thu Mar 26 02:32:27 2009 (r5343) +++ trunk/tests/engine-tests/check_engine.c Thu Mar 26 02:48:16 2009 (r5344) @@ -1612,6 +1612,8 @@ } END_TEST +#define COMMIT_STRESS_GROUP6 250 + static void get_changes6(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, osync_bool slow_sync, void *data) { mock_env *env = data; @@ -1626,7 +1628,7 @@ OSyncError *error = NULL; - for (i = 0; i < 1000; i++) { + for (i = 0; i < COMMIT_STRESS_GROUP6; i++) { OSyncChange *change = osync_change_new(&error); osync_assert(change != NULL); osync_assert(error == NULL); @@ -1708,7 +1710,7 @@ osync_assert(env->num_connect == 1); osync_assert(env->num_disconnect == 1); osync_assert(env->num_get_changes == 1); - osync_assert(env->num_commit_changes == 1000); + osync_assert(env->num_commit_changes == COMMIT_STRESS_GROUP6); osync_assert(env->main_connect == 0); osync_assert(env->main_disconnect == 0); osync_assert(env->main_get_changes == 0); @@ -1783,7 +1785,7 @@ return debug; } -OSYNC_UNUSED START_TEST (engine_sync_read_write_stress) +START_TEST (engine_sync_read_write_stress) { char *testbed = setup_testbed("sync_setup"); char *formatdir = g_strdup_printf("%s/formats", testbed); @@ -2032,11 +2034,7 @@ OSYNC_TESTCASE_ADD(engine_sync_stress) OSYNC_TESTCASE_ADD(engine_sync_read_write) -/* Disabled due to randomly failing - #994 - * -*/ OSYNC_TESTCASE_ADD(engine_sync_read_write_stress) - OSYNC_TESTCASE_ADD(engine_sync_read_write_stress2) //batch commit |
From: <svn...@op...> - 2009-03-26 01:45:46
|
Author: dgollub Date: Thu Mar 26 02:32:27 2009 New Revision: 5343 URL: http://www.opensync.org/changeset/5343 Log: Fix UID conflict issue of engine_sync_read_write_stress Got broken from previous commit r5342 Modified: trunk/tests/engine-tests/check_engine.c Modified: trunk/tests/engine-tests/check_engine.c ============================================================================== --- trunk/tests/engine-tests/check_engine.c Thu Mar 26 02:07:12 2009 (r5342) +++ trunk/tests/engine-tests/check_engine.c Thu Mar 26 02:32:27 2009 (r5343) @@ -1632,9 +1632,11 @@ osync_assert(error == NULL); osync_change_set_changetype(change, OSYNC_CHANGE_TYPE_ADDED); - char *uid = osync_rand_str(16); + char *rand = osync_rand_str(16); + char *uid = osync_strdup_printf("uid_%s_%u", rand, i); osync_change_set_uid(change, uid); - g_free(uid); + osync_free(uid); + osync_free(rand); OSyncFileFormat *file = osync_try_malloc0(sizeof(OSyncFileFormat), &error); osync_assert(file != NULL); |
From: <svn...@op...> - 2009-03-26 01:07:16
|
Author: dgollub Date: Thu Mar 26 02:07:12 2009 New Revision: 5342 URL: http://www.opensync.org/changeset/5342 Log: Fix random fails of testcases: engine_sync_read_write, engine_sync_read_write_stress, engine_sync_read_write_stress2 Testcases failed randomly due to "random" assembled uid using %p pointer address. %p got replace by osync_rand_str(). fixes #943 Modified: trunk/tests/engine-tests/check_engine.c Modified: trunk/tests/engine-tests/check_engine.c ============================================================================== --- trunk/tests/engine-tests/check_engine.c Thu Mar 26 01:27:49 2009 (r5341) +++ trunk/tests/engine-tests/check_engine.c Thu Mar 26 02:07:12 2009 (r5342) @@ -1421,7 +1421,7 @@ osync_change_set_changetype(change, OSYNC_CHANGE_TYPE_ADDED); - char *uid = g_strdup_printf("uid_%p", change); + char *uid = osync_rand_str(16); osync_change_set_uid(change, uid); g_free(uid); @@ -1632,7 +1632,7 @@ osync_assert(error == NULL); osync_change_set_changetype(change, OSYNC_CHANGE_TYPE_ADDED); - char *uid = g_strdup_printf("uid_%p_%i", change, i); + char *uid = osync_rand_str(16); osync_change_set_uid(change, uid); g_free(uid); @@ -1836,7 +1836,7 @@ osync_assert(error == NULL); osync_change_set_changetype(change, OSYNC_CHANGE_TYPE_ADDED); - char *uid = g_strdup_printf("uid_%p_%i", change, i); + char *uid = osync_rand_str(16); osync_change_set_uid(change, uid); g_free(uid); |
From: <svn...@op...> - 2009-03-26 00:27:59
|
Author: scriptor Date: Thu Mar 26 01:27:49 2009 New Revision: 5341 URL: http://www.opensync.org/changeset/5341 Log: Initial version of the LDAP plugin having been ported to libopensync-0.3x. Added: branches/3rd-party-cmake-modules/modules/FindLibGCrypt.cmake Added: branches/3rd-party-cmake-modules/modules/FindLibGCrypt.cmake ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/3rd-party-cmake-modules/modules/FindLibGCrypt.cmake Thu Mar 26 01:27:49 2009 (r5341) @@ -0,0 +1,37 @@ +# Try and find libgcrypt. +# As soon as libgcrypt has been found, the following variables will be defined: +# +# LIBGCRYPT_FOUND +# GCRYPT_INCLUDE_DIR +# GCRYPT_LIBRARY:FILEPATH +# +# Copyright (c) 2009 Juergen Leising <jle...@us...> +# +# Redistribution and use is allowed according to the terms of the New +# BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# + +MESSAGE(STATUS "checking for libgcrypt...") + +FIND_PATH(GCRYPT_INCLUDE_DIR NAMES gcrypt.h + PATHS /include /usr/include /usr/local/include /usr/share/include /opt/include + DOC "Try and find the header file gcrypt.h") + +FIND_LIBRARY(GCRYPT_LIBRARY NAMES gcrypt + PATHS /usr/lib /lib /usr/local/lib /usr/share/lib /opt/lib /opt/share/lib /var/lib + DOC "Try and find libgcrypt") + +IF (GCRYPT_INCLUDE_DIR AND GCRYPT_LIBRARY) + SET (LIBGCRYPT_FOUND 1) + get_filename_component(GCRYPT_LIBRARY_DIRS ${GCRYPT_LIBRARY} PATH) + MESSAGE(STATUS " Found ${GCRYPT_LIBRARY}") +ELSE (GCRYPT_INCLUDE_DIR AND GCRYPT_LIBRARY) + IF ( LibGCrypt_FIND_REQUIRED ) + MESSAGE( FATAL_ERROR " Could NOT find libgcrypt. The ldap plugin needs this library." ) + ELSE ( LibGCrypt_FIND_REQUIRED ) + MESSAGE ( STATUS " Could NOT find libgcrypt.") + ENDIF ( LibGCrypt_FIND_REQUIRED ) +ENDIF (GCRYPT_INCLUDE_DIR AND GCRYPT_LIBRARY) + + |
From: <svn...@op...> - 2009-03-26 00:27:48
|
Author: scriptor Date: Thu Mar 26 01:27:36 2009 New Revision: 5340 URL: http://www.opensync.org/changeset/5340 Log: Initial version of the LDAP plugin having been ported to libopensync-0.3x. Added: branches/3rd-party-cmake-modules/modules/FindLibLdap.cmake Added: branches/3rd-party-cmake-modules/modules/FindLibLdap.cmake ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/3rd-party-cmake-modules/modules/FindLibLdap.cmake Thu Mar 26 01:27:36 2009 (r5340) @@ -0,0 +1,38 @@ +# Try and find libldap. +# As soon as libldap has been found, the following variables will be defined: +# +# LIBLDAP_FOUND +# LDAP_INCLUDE_DIR +# LDAP_LIBRARY:FILEPATH +# +# +# Copyright (c) 2009 Juergen Leising <jle...@us...> +# +# Redistribution and use is allowed according to the terms of the New +# BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# + + +MESSAGE(STATUS "checking for libldap...") + +FIND_PATH(LDAP_INCLUDE_DIR NAMES ldap.h + PATHS /include /usr/include /usr/local/include /usr/share/include /opt/include + DOC "Try and find the header file ldap.h") + +FIND_LIBRARY(LDAP_LIBRARY NAMES ldap + PATHS /usr/lib /lib /usr/local/lib /usr/share/lib /opt/lib /opt/share/lib /var/lib + DOC "Try and find libldap") + +IF (LDAP_INCLUDE_DIR AND LDAP_LIBRARY) + SET( LIBLDAP_FOUND 1 ) + get_filename_component(LDAP_LIBRARY_DIRS ${LDAP_LIBRARY} PATH) + MESSAGE(STATUS " Found ${LDAP_LIBRARY}") +ELSE (LDAP_INCLUDE_DIR AND LDAP_LIBRARY) + IF ( LibLdap_FIND_REQUIRED ) + MESSAGE( FATAL_ERROR " Could NOT find libldap. The ldap plugin needs this library.") + ELSE ( LibLdap_FIND_REQUIRED ) + MESSAGE( STATUS " Could NOT find libldap.") + ENDIF ( LibLdap_FIND_REQUIRED ) +ENDIF (LDAP_INCLUDE_DIR AND LDAP_LIBRARY) + |
From: <svn...@op...> - 2009-03-26 00:27:26
|
Author: scriptor Date: Thu Mar 26 01:27:23 2009 New Revision: 5339 URL: http://www.opensync.org/changeset/5339 Log: Initial version of the LDAP plugin having been ported to libopensync-0.3x. Added: branches/3rd-party-cmake-modules/modules/FindLibSASL2.cmake Added: branches/3rd-party-cmake-modules/modules/FindLibSASL2.cmake ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/3rd-party-cmake-modules/modules/FindLibSASL2.cmake Thu Mar 26 01:27:23 2009 (r5339) @@ -0,0 +1,37 @@ +# Try and find libsasl2. +# As soon as libsasl2 has been found, the following variables will be defined: +# +# LIBSASL2_FOUND +# SASL2_INCLUDE_DIR +# SASL2_LIBRARY:FILEPATH +# +# Copyright (c) 2009 Juergen Leising <jle...@us...> +# +# Redistribution and use is allowed according to the terms of the New +# BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# + +MESSAGE(STATUS "checking for libsasl2...") + +FIND_PATH(SASL2_INCLUDE_DIR NAMES sasl/sasl.h + PATHS /include /usr/include /usr/local/include /usr/share/include /opt/include + DOC "Try and find the header file sasl/sasl.h") + +FIND_LIBRARY(SASL2_LIBRARY NAMES sasl2 + PATHS /usr/lib /lib /usr/local/lib /usr/share/lib /opt/lib /opt/share/lib /var/lib + DOC "Try and find libsasl2") + +IF (SASL2_INCLUDE_DIR AND SASL2_LIBRARY) + SET (LIBSASL2_FOUND 1) + get_filename_component(SASL2_LIBRARY_DIRS ${SASL2_LIBRARY} PATH) + MESSAGE(STATUS " Found ${SASL2_LIBRARY}") +ELSE (SASL2_INCLUDE_DIR AND SASL2_LIBRARY) + IF ( LibSASL2_FIND_REQUIRED ) + MESSAGE( FATAL_ERROR " Could NOT find libsasl2. The ldap plugin needs this library." ) + ELSE ( LibSASL2_FIND_REQUIRED ) + MESSAGE( STATUS " Could NOT find libsasl2.") + ENDIF ( LibSASL2_FIND_REQUIRED ) +ENDIF (SASL2_INCLUDE_DIR AND SASL2_LIBRARY) + + |
From: <svn...@op...> - 2009-03-26 00:27:10
|
Author: scriptor Date: Thu Mar 26 01:27:07 2009 New Revision: 5338 URL: http://www.opensync.org/changeset/5338 Log: Initial version of the LDAP plugin having been ported to libopensync-0.3x. Added: branches/3rd-party-cmake-modules/modules/FindLibGSSAPIV2.cmake Added: branches/3rd-party-cmake-modules/modules/FindLibGSSAPIV2.cmake ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/3rd-party-cmake-modules/modules/FindLibGSSAPIV2.cmake Thu Mar 26 01:27:07 2009 (r5338) @@ -0,0 +1,34 @@ +# Try and find libgssapiv2. +# As soon as libgssapiv2 has been found, the following variables will be defined: +# +# LIBGSSAPIV2_FOUND +# GSSAPIV2_LIBRARY:FILEPATH +# +# Copyright (c) 2009 Juergen Leising <jle...@us...> +# +# Redistribution and use is allowed according to the terms of the New +# BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# + + +MESSAGE(STATUS "checking for libgssapiv2...") + +# No header files required for the ldap plugin. + +FIND_LIBRARY(GSSAPIV2_LIBRARY NAMES gssapiv2 + PATHS /usr/lib /lib /usr/local/lib /usr/share/lib /opt/lib /opt/share/lib /var/lib /usr/lib/sasl2 /lib/sasl2 /usr/local/lib/sasl2 /usr/share/lib/sasl2 /opt/lib/sasl2 /opt/share/lib/sasl2 /var/lib/sasl2 + DOC "Try and find libgssapiv2") + +IF (GSSAPIV2_LIBRARY) + SET (LIBGSSAPIV2_FOUND 1) + get_filename_component(GSSAPIV2_LIBRARY_DIRS ${GSSAPIV2_LIBRARY} PATH) + MESSAGE(STATUS " Found ${GSSAPIV2_LIBRARY}") +ELSE (GSSAPIV2_LIBRARY) + IF ( LibGSSAPIV2_FIND_REQUIRED ) + MESSAGE( FATAL_ERROR " Could NOT find libgssapiv2. The ldap plugin needs this library.") + ELSE ( LibGSSAPIV2_FIND_REQUIRED ) + MESSAGE( STATUS " Could NOT find libgssapiv2. The SASL authentication mechanism GSSAPI (and KERBEROS V5) won't work, therefore. Not a fatal error, however. The ldap plugin itself does NOT need it.") + ENDIF ( LibGSSAPIV2_FIND_REQUIRED ) +ENDIF (GSSAPIV2_LIBRARY) + |
From: <svn...@op...> - 2009-03-26 00:17:42
|
Author: scriptor Date: Thu Mar 26 01:17:22 2009 New Revision: 5337 URL: http://www.opensync.org/changeset/5337 Log: Initial version of the LDAP plugin having been ported to libopensync-0.3x. Added: plugins/ldap-sync/tests/ plugins/ldap-sync/tests/CMakeLists.txt (contents, props changed) plugins/ldap-sync/tests/check_add_modify_delete_and_sync (contents, props changed) plugins/ldap-sync/tests/check_add_modify_delete_and_valgrind_and_sync (contents, props changed) plugins/ldap-sync/tests/check_add_modify_delete_four_ldifs_and_sync (contents, props changed) plugins/ldap-sync/tests/check_add_modify_delete_four_ldifs_and_valgrind_and_sync (contents, props changed) plugins/ldap-sync/tests/check_connect (contents, props changed) plugins/ldap-sync/tests/check_delete_and_fastsync (contents, props changed) plugins/ldap-sync/tests/check_fastsync (contents, props changed) plugins/ldap-sync/tests/check_init (contents, props changed) plugins/ldap-sync/tests/check_ldap_add_entry (contents, props changed) plugins/ldap-sync/tests/check_ldap_base_entries_objtype (contents, props changed) plugins/ldap-sync/tests/check_ldap_delete_entry (contents, props changed) plugins/ldap-sync/tests/check_ldap_modify_entry (contents, props changed) plugins/ldap-sync/tests/check_ldap_read_entryCSN (contents, props changed) plugins/ldap-sync/tests/check_modify_and_fastsync (contents, props changed) plugins/ldap-sync/tests/check_plugin1 (contents, props changed) plugins/ldap-sync/tests/check_plugin2 (contents, props changed) plugins/ldap-sync/tests/check_plugin3 (contents, props changed) plugins/ldap-sync/tests/check_slowsync (contents, props changed) plugins/ldap-sync/tests/check_stylesheet1 (contents, props changed) plugins/ldap-sync/tests/check_stylesheet2 (contents, props changed) plugins/ldap-sync/tests/check_stylesheet3 (contents, props changed) plugins/ldap-sync/tests/check_stylesheet4 (contents, props changed) plugins/ldap-sync/tests/check_stylesheet5 (contents, props changed) plugins/ldap-sync/tests/check_sync (contents, props changed) plugins/ldap-sync/tests/contact1.ldif (contents, props changed) plugins/ldap-sync/tests/contact1.xml (contents, props changed) plugins/ldap-sync/tests/contact1_entrymods (contents, props changed) plugins/ldap-sync/tests/contact2.ldif (contents, props changed) plugins/ldap-sync/tests/contact2.xml (contents, props changed) plugins/ldap-sync/tests/contact2_entrymods (contents, props changed) plugins/ldap-sync/tests/event1.ldif (contents, props changed) plugins/ldap-sync/tests/event1.xml (contents, props changed) plugins/ldap-sync/tests/event1_entrymods (contents, props changed) plugins/ldap-sync/tests/ldap_event1.xml (contents, props changed) plugins/ldap-sync/tests/ldap_evolutionperson1.xml (contents, props changed) plugins/ldap-sync/tests/ldap_evolutionperson2.xml (contents, props changed) plugins/ldap-sync/tests/ldap_inetorgperson1.xml (contents, props changed) plugins/ldap-sync/tests/ldap_inetorgperson2.xml (contents, props changed) plugins/ldap-sync/tests/ldap_note1.xml (contents, props changed) plugins/ldap-sync/tests/ldap_todo1.xml (contents, props changed) plugins/ldap-sync/tests/note1.ldif (contents, props changed) plugins/ldap-sync/tests/note1.xml (contents, props changed) plugins/ldap-sync/tests/note1_entrymods (contents, props changed) plugins/ldap-sync/tests/opensync.suppr (contents, props changed) plugins/ldap-sync/tests/remove_test_ldifs (contents, props changed) plugins/ldap-sync/tests/test.conf (contents, props changed) plugins/ldap-sync/tests/todo1.ldif plugins/ldap-sync/tests/todo1.xml plugins/ldap-sync/tests/todo1_entrymods Added: plugins/ldap-sync/tests/CMakeLists.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/tests/CMakeLists.txt Thu Mar 26 01:17:22 2009 (r5337) @@ -0,0 +1,440 @@ + +# CTEST_CUSTOM_TESTS_IGNORE does not work as expected. Even not +# in any CTestCustom.cmake, be it located here or in cmake/modules or whereever. +# So I have simply commented out those tests, where some data is missing +# or where the errors are known to me. + +SET ( TESTDIR "${CMAKE_CURRENT_SOURCE_DIR}" CACHE STRING "Path where the test scripts are located.") +SET ( XSLDIR "${CMAKE_SOURCE_DIR}/src/xslt" CACHE STRING "Path where the stylesheeets are located.") +SET ( XMLDIR "${CMAKE_SOURCE_DIR}/tests" CACHE STRING "Path where any *.xml files are located.") +SET ( SCHEMADIR "${LDAP_PLUGIN_OPENSYNC_SCHEMASDIR}" CACHE STRING "Path where any *.xml files are located.") + + +MESSAGE(STATUS "checking for xmllint...") +FIND_PROGRAM( XMLLINT_EXECUTABLE xmllint ) +IF (XMLLINT_EXECUTABLE) + MESSAGE( STATUS " Found ${XMLLINT_EXECUTABLE}") +ELSE (XMLLINT_EXECUTABLE) + MESSAGE( STATUS " Could NOT find xmllint. Corresponding tests will be ignored.") +ENDIF (XMLLINT_EXECUTABLE) + + +MESSAGE(STATUS "checking for ldapsearch...") +FIND_PROGRAM( LDAPSEARCH_EXECUTABLE ldapsearch ) +IF (LDAPSEARCH_EXECUTABLE) + MESSAGE( STATUS " Found ${LDAPSEARCH_EXECUTABLE}") +ELSE (LDAPSEARCH_EXECUTABLE) + MESSAGE( STATUS " Could NOT find ldapsearch. Corresponding tests will be ignored.") +ENDIF (LDAPSEARCH_EXECUTABLE) + + +MESSAGE(STATUS "checking for xsltproc...") +FIND_PROGRAM( XSLTPROC_EXECUTABLE xsltproc ) +IF (XSLTPROC_EXECUTABLE) + MESSAGE( STATUS " Found ${XSLTPROC_EXECUTABLE}") +ELSE (XSLTPROC_EXECUTABLE) + MESSAGE( STATUS " Could NOT find xsltproc. Corresponding tests will be ignored.") +ENDIF (XSLTPROC_EXECUTABLE) + + +MESSAGE(STATUS "checking for ldapadd...") +FIND_PROGRAM( LDAPADD_EXECUTABLE ldapadd ) +IF (LDAPADD_EXECUTABLE) + MESSAGE( STATUS " Found ${LDAPADD_EXECUTABLE}") +ELSE (LDAPADD_EXECUTABLE) + MESSAGE( STATUS " Could NOT find ldapadd. Corresponding tests will be ignored.") +ENDIF (LDAPADD_EXECUTABLE) + + +MESSAGE(STATUS "checking for ldapmodify...") +FIND_PROGRAM( LDAPMODIFY_EXECUTABLE ldapmodify ) +IF (LDAPMODIFY_EXECUTABLE) + MESSAGE( STATUS " Found ${LDAPMODIFY_EXECUTABLE}") +ELSE (LDAPMODIFY_EXECUTABLE) + MESSAGE( STATUS " Could NOT find ldapmodify. Corresponding tests will be ignored.") +ENDIF (LDAPMODIFY_EXECUTABLE) + + +MESSAGE(STATUS "checking for ldapdelete...") +FIND_PROGRAM( LDAPDELETE_EXECUTABLE ldapdelete ) +IF (LDAPDELETE_EXECUTABLE) + MESSAGE( STATUS " Found ${LDAPDELETE_EXECUTABLE}") +ELSE (LDAPDELETE_EXECUTABLE) + MESSAGE( STATUS " Could NOT find ldapdelete. Corresponding tests will be ignored.") +ENDIF (LDAPDELETE_EXECUTABLE) + + +MESSAGE(STATUS "checking for valgrind...") +FIND_PROGRAM( VALGRIND_EXECUTABLE valgrind ) +IF (VALGRIND_EXECUTABLE) + MESSAGE( STATUS " Found ${VALGRIND_EXECUTABLE}") +ELSE (VALGRIND_EXECUTABLE) + MESSAGE( STATUS " Could NOT find valgrind. Corresponding tests will be ignored.") +ENDIF (VALGRIND_EXECUTABLE) + + + +MESSAGE(STATUS "TESTDIR = ${TESTDIR}") +MESSAGE(STATUS "XSLDIR = ${XSLDIR}") +MESSAGE(STATUS "XMLDIR = ${XMLDIR}") +MESSAGE(STATUS "SCHEMADIR = ${SCHEMADIR}") + + + +##################################################### +# Check just the stylesheets themselves for validity using external tools: +IF (XMLLINT_EXECUTABLE) + + ADD_TEST( stylesheet1.1 ${TESTDIR}/check_stylesheet1 ${XSLDIR}/ldap_evolutionperson2xmlformat_contact.xsl) + + ADD_TEST( stylesheet1.2 ${TESTDIR}/check_stylesheet1 ${XSLDIR}/ldap_inetorgperson2xmlformat_contact.xsl) + + ADD_TEST( stylesheet1.3 ${TESTDIR}/check_stylesheet1 ${XSLDIR}/ldap_event2xmlformat_event.xsl) + + ADD_TEST( stylesheet1.4 ${TESTDIR}/check_stylesheet1 ${XSLDIR}/ldap_evolutionperson2xmlformat_contact.xsl) + + ADD_TEST( stylesheet1.5 ${TESTDIR}/check_stylesheet1 ${XSLDIR}/ldap_evolutionperson2xmlformat_contact.xsl) + + ADD_TEST( stylesheet1.6 ${TESTDIR}/check_stylesheet1 ${XSLDIR}/xmlformat_contact2ldap_evolutionperson.xsl) + + ADD_TEST( stylesheet1.7 ${TESTDIR}/check_stylesheet1 ${XSLDIR}/xmlformat_contact2ldap_inetorgperson.xsl) + + ADD_TEST( stylesheet1.8 ${TESTDIR}/check_stylesheet1 ${XSLDIR}/xmlformat_event2ldap_event.xsl) + + ADD_TEST( stylesheet1.9 ${TESTDIR}/check_stylesheet1 ${XSLDIR}/xmlformat_todo2ldap_todo.xsl) + + ADD_TEST( stylesheet1.10 ${TESTDIR}/check_stylesheet1 ${XSLDIR}/xmlformat_note2ldap_note.xsl) + +ENDIF (XMLLINT_EXECUTABLE) + + + +################################################### +# Try and apply all the stylesheets to an XML file using external tools: +IF (XMLLINT_EXECUTABLE) + IF (XSLTPROC_EXECUTABLE) + + ADD_TEST( stylesheet2.1 ${TESTDIR}/check_stylesheet2 ${XSLDIR}/ldap_evolutionperson2xmlformat_contact.xsl ${TESTDIR}/ldap_evolutionperson1.xml ) + + ADD_TEST( stylesheet2.2 ${TESTDIR}/check_stylesheet2 ${XSLDIR}/ldap_evolutionperson2xmlformat_contact.xsl ${TESTDIR}/ldap_evolutionperson2.xml ) + + ADD_TEST( stylesheet2.3 ${TESTDIR}/check_stylesheet2 ${XSLDIR}/ldap_inetorgperson2xmlformat_contact.xsl ${TESTDIR}/ldap_inetorgperson1.xml ) + + ADD_TEST( stylesheet2.4 ${TESTDIR}/check_stylesheet2 ${XSLDIR}/ldap_inetorgperson2xmlformat_contact.xsl ${TESTDIR}/ldap_inetorgperson2.xml ) + + ADD_TEST( stylesheet2.5 ${TESTDIR}/check_stylesheet2 ${XSLDIR}/ldap_event2xmlformat_event.xsl ${TESTDIR}/ldap_event1.xml ) + + ADD_TEST( stylesheet2.6 ${TESTDIR}/check_stylesheet2 ${XSLDIR}/ldap_todo2xmlformat_todo.xsl ${TESTDIR}/ldap_todo1.xml ) + + ADD_TEST( stylesheet2.7 ${TESTDIR}/check_stylesheet2 ${XSLDIR}/ldap_note2xmlformat_note.xsl ${TESTDIR}/ldap_note1.xml ) + + ADD_TEST( stylesheet2.8 ${TESTDIR}/check_stylesheet2 ${XSLDIR}/xmlformat_contact2ldap_evolutionperson.xsl ${TESTDIR}/contact1.xml ) + + ADD_TEST( stylesheet2.9 ${TESTDIR}/check_stylesheet2 ${XSLDIR}/xmlformat_contact2ldap_inetorgperson.xsl ${TESTDIR}/contact1.xml ) + + ADD_TEST( stylesheet2.10 ${TESTDIR}/check_stylesheet2 ${XSLDIR}/xmlformat_event2ldap_event.xsl ${TESTDIR}/event1.xml ) + + ADD_TEST( stylesheet2.11 ${TESTDIR}/check_stylesheet2 ${XSLDIR}/xmlformat_todo2ldap_todo.xsl ${TESTDIR}/todo1.xml ) + + ADD_TEST( stylesheet2.12 ${TESTDIR}/check_stylesheet2 ${XSLDIR}/xmlformat_note2ldap_note.xsl ${TESTDIR}/note1.xml) + + ENDIF (XSLTPROC_EXECUTABLE) +ENDIF (XMLLINT_EXECUTABLE) + + +############################################ +# Apply schema files to conversion from ldap_... to xmlformat_... +# using external tools: +IF (XMLLINT_EXECUTABLE) + IF (XSLTPROC_EXECUTABLE) + + ADD_TEST( stylesheet3.1 ${TESTDIR}/check_stylesheet3 ${XSLDIR}/ldap_evolutionperson2xmlformat_contact.xsl ${SCHEMADIR}/xmlformat-contact.xsd ${XMLDIR}/ldap_evolutionperson1.xml) + + ADD_TEST( stylesheet3.2 ${TESTDIR}/check_stylesheet3 ${XSLDIR}/ldap_evolutionperson2xmlformat_contact.xsl ${SCHEMADIR}/xmlformat-contact.xsd ${XMLDIR}/ldap_evolutionperson2.xml) + + ADD_TEST( stylesheet3.3 ${TESTDIR}/check_stylesheet3 ${XSLDIR}/ldap_inetorgperson2xmlformat_contact.xsl ${SCHEMADIR}/xmlformat-contact.xsd ${XMLDIR}/ldap_inetorgperson1.xml) + + ADD_TEST( stylesheet3.4 ${TESTDIR}/check_stylesheet3 ${XSLDIR}/ldap_inetorgperson2xmlformat_contact.xsl ${SCHEMADIR}/xmlformat-contact.xsd ${XMLDIR}/ldap_inetorgperson2.xml) + + ADD_TEST( stylesheet3.5 ${TESTDIR}/check_stylesheet3 ${XSLDIR}/ldap_event2xmlformat_event.xsl ${SCHEMADIR}/xmlformat-event.xsd ${XMLDIR}/ldap_event1.xml) + + ADD_TEST( stylesheet3.6 ${TESTDIR}/check_stylesheet3 ${XSLDIR}/ldap_todo2xmlformat_todo.xsl ${SCHEMADIR}/xmlformat-todo.xsd ${XMLDIR}/ldap_todo1.xml) + + ADD_TEST( stylesheet3.7 ${TESTDIR}/check_stylesheet3 ${XSLDIR}/ldap_note2xmlformat_note.xsl ${SCHEMADIR}/xmlformat-note.xsd ${XMLDIR}/ldap_note1.xml) + + ENDIF (XSLTPROC_EXECUTABLE) +ENDIF (XMLLINT_EXECUTABLE) + + + +############################################# +# Check validity of conversion and reconversion against XML schema files (*.xsd) +# using external tools +IF (XMLLINT_EXECUTABLE) + IF (XSLTPROC_EXECUTABLE) + + ADD_TEST( stylesheet4.1 ${TESTDIR}/check_stylesheet4 ${XSLDIR}/xmlformat_contact2ldap_evolutionperson.xsl ${XSLDIR}/ldap_evolutionperson2xmlformat_contact.xsl ${SCHEMADIR}/xmlformat-contact.xsd ${XMLDIR}/contact1.xml) + + ADD_TEST( stylesheet4.2 ${TESTDIR}/check_stylesheet4 ${XSLDIR}/xmlformat_contact2ldap_inetorgperson.xsl ${XSLDIR}/ldap_inetorgperson2xmlformat_contact.xsl ${SCHEMADIR}/xmlformat-contact.xsd ${XMLDIR}/contact1.xml) + + ADD_TEST( stylesheet4.3 ${TESTDIR}/check_stylesheet4 ${XSLDIR}/xmlformat_contact2ldap_evolutionperson.xsl ${XSLDIR}/ldap_evolutionperson2xmlformat_contact.xsl ${SCHEMADIR}/xmlformat-contact.xsd ${XMLDIR}/contact2.xml) + + ADD_TEST( stylesheet4.4 ${TESTDIR}/check_stylesheet4 ${XSLDIR}/xmlformat_contact2ldap_inetorgperson.xsl ${XSLDIR}/ldap_inetorgperson2xmlformat_contact.xsl ${SCHEMADIR}/xmlformat-contact.xsd ${XMLDIR}/contact2.xml) + + ADD_TEST( stylesheet4.5 ${TESTDIR}/check_stylesheet4 ${XSLDIR}/xmlformat_event2ldap_event.xsl ${XSLDIR}/ldap_event2xmlformat_event.xsl ${SCHEMADIR}/xmlformat-event.xsd ${XMLDIR}/event1.xml) + + ADD_TEST( stylesheet4.6 ${TESTDIR}/check_stylesheet4 ${XSLDIR}/xmlformat_todo2ldap_todo.xsl ${XSLDIR}/ldap_todo2xmlformat_todo.xsl ${SCHEMADIR}/xmlformat-todo.xsd ${XMLDIR}/todo1.xml) + + ADD_TEST( stylesheet4.7 ${TESTDIR}/check_stylesheet4 ${XSLDIR}/xmlformat_note2ldap_note.xsl ${XSLDIR}/ldap_note2xmlformat_note.xsl ${SCHEMADIR}/xmlformat-note.xsd ${XMLDIR}/note1.xml) + + ENDIF (XSLTPROC_EXECUTABLE) +ENDIF (XMLLINT_EXECUTABLE) + + + +################################################ +# Check whether the result after conversion and reconversion is identical +# to the original file +IF (XMLLINT_EXECUTABLE) + IF (XSLTPROC_EXECUTABLE) + + ADD_TEST( stylesheet5.1 ${TESTDIR}/check_stylesheet5 ${XMLDIR}/contact1.xml ${XSLDIR}/xmlformat_contact2ldap_evolutionperson.xsl ${XSLDIR}/ldap_evolutionperson2xmlformat_contact.xsl ) + + ADD_TEST( stylesheet5.2 ${TESTDIR}/check_stylesheet5 ${XMLDIR}/contact2.xml ${XSLDIR}/xmlformat_contact2ldap_evolutionperson.xsl ${XSLDIR}/ldap_evolutionperson2xmlformat_contact.xsl ) + + ADD_TEST( stylesheet5.3 ${TESTDIR}/check_stylesheet5 ${XMLDIR}/contact1.xml ${XSLDIR}/xmlformat_contact2ldap_inetorgperson.xsl ${XSLDIR}/ldap_inetorgperson2xmlformat_contact.xsl ) + + ADD_TEST( stylesheet5.4 ${TESTDIR}/check_stylesheet5 ${XMLDIR}/contact2.xml ${XSLDIR}/xmlformat_contact2ldap_inetorgperson.xsl ${XSLDIR}/ldap_inetorgperson2xmlformat_contact.xsl ) + + # ADD_TEST( stylesheet5.5 ${TESTDIR}/check_stylesheet5 ${XMLDIR}/ldap_evolutionperson1.xml ${XSLDIR}/ldap_evolutionperson2xmlformat_contact.xsl ${XSLDIR}/xmlformat_contact2ldap_evolutionperson.xsl ) + + # ADD_TEST( stylesheet5.6 ${TESTDIR}/check_stylesheet5 ${XMLDIR}/ldap_evolutionperson2.xml ${XSLDIR}/ldap_evolutionperson2xmlformat_contact.xsl ${XSLDIR}/xmlformat_contact2ldap_evolutionperson.xsl ) + + ADD_TEST( stylesheet5.7 ${TESTDIR}/check_stylesheet5 ${XMLDIR}/ldap_inetorgperson1.xml ${XSLDIR}/ldap_inetorgperson2xmlformat_contact.xsl ${XSLDIR}/xmlformat_contact2ldap_inetorgperson.xsl ) + + ADD_TEST( stylesheet5.8 ${TESTDIR}/check_stylesheet5 ${XMLDIR}/ldap_inetorgperson2.xml ${XSLDIR}/ldap_inetorgperson2xmlformat_contact.xsl ${XSLDIR}/xmlformat_contact2ldap_inetorgperson.xsl ) + + ADD_TEST( stylesheet5.9 ${TESTDIR}/check_stylesheet5 ${XMLDIR}/event1.xml ${XSLDIR}/xmlformat_event2ldap_event.xsl ${XSLDIR}/ldap_event2xmlformat_event.xsl ) + + ADD_TEST( stylesheet5.10 ${TESTDIR}/check_stylesheet5 ${XMLDIR}/ldap_event1.xml ${XSLDIR}/ldap_event2xmlformat_event.xsl ${XSLDIR}/xmlformat_event2ldap_event.xsl ) + + # ADD_TEST( stylesheet5.11 ${TESTDIR}/check_stylesheet5 ${XMLDIR}/todo1.xml ${XSLDIR}/xmlformat_todo2ldap_todo.xsl ${XSLDIR}/ldap_todo2xmlformat_todo.xsl ) + + # ADD_TEST( stylesheet5.12 ${TESTDIR}/check_stylesheet5 ${XMLDIR}/ldap_todo1.xml ${XSLDIR}/ldap_todo2xmlformat_todo.xsl ${XSLDIR}/xmlformat_todo2ldap_todo.xsl ) + + ADD_TEST( stylesheet5.13 ${TESTDIR}/check_stylesheet5 ${XMLDIR}/note1.xml ${XSLDIR}/xmlformat_note2ldap_note.xsl ${XSLDIR}/ldap_note2xmlformat_note.xsl ) + + # ADD_TEST( stylesheet5.14 ${TESTDIR}/check_stylesheet5 ${XMLDIR}/ldap_note1.xml ${XSLDIR}/ldap_note2xmlformat_note.xsl ${XSLDIR}/xmlformat_note2ldap_note.xsl ) + + ENDIF (XSLTPROC_EXECUTABLE) +ENDIF (XMLLINT_EXECUTABLE) + + + + + +########################################################## +# Can the plugin be found, at all? +# Using osyncplugin and osynctool from libopensync. +ADD_TEST( plugin1 ${TESTDIR}/check_plugin1 ) +ADD_TEST( plugin2 ${TESTDIR}/check_plugin2 ) +ADD_TEST( plugin3 ${TESTDIR}/check_plugin3 ) + + + +########################################################## +# Interact with the LDAP server using external tools only... +# This set of tests checks whether the LDAP server is sufficiently +# configured to allow read and write access. This is, of course, +# prerequisite for the opensync plugin to do anything useful. +IF (LDAPSEARCH_EXECUTABLE) + + ADD_TEST( ldap_objtypes ${TESTDIR}/check_ldap_base_entries_objtype) + + # This is a critical test: The current implementation of getting + # hash values is based on the operational attribute "entryCSN". + # If this can not be found, the whole plugin does not work. + ADD_TEST( ldap_entryCSN ${TESTDIR}/check_ldap_read_entryCSN) + +ENDIF (LDAPSEARCH_EXECUTABLE) + + +# This is not a real test in the strict sense of the word. +# It is a script that makes sure, that the DN's of the *.ldif files +# used by the following tests are not present, yet. If they are +# present, the script removes them. +# Otherwise the first test trying to add an already exising DN will fail +# just because of "Already exists (68)" error. +ADD_TEST( remove_test_ldifs ${TESTDIR}/remove_test_ldifs ) + + +IF (LDAPADD_EXECUTABLE) + ADD_TEST( ldap_add_contact1 ${TESTDIR}/check_ldap_add_entry ${TESTDIR}/contact1.ldif ) +ENDIF (LDAPADD_EXECUTABLE) + +IF (LDAPMODIFY_EXECUTABLE) + ADD_TEST( ldap_modify_contact1 ${TESTDIR}/check_ldap_modify_entry ${TESTDIR}/contact1_entrymods) +ENDIF (LDAPMODIFY_EXECUTABLE) + +IF (LDAPDELETE_EXECUTABLE) + ADD_TEST( ldap_delete_contact1 ${TESTDIR}/check_ldap_delete_entry ${TESTDIR}/contact1.ldif ) +ENDIF (LDAPDELETE_EXECUTABLE) + + + +IF (LDAPADD_EXECUTABLE) + ADD_TEST( ldap_add_contact2 ${TESTDIR}/check_ldap_add_entry ${TESTDIR}/contact2.ldif ) +ENDIF (LDAPADD_EXECUTABLE) + +IF (LDAPMODIFY_EXECUTABLE) + ADD_TEST( ldap_modify_contact2 ${TESTDIR}/check_ldap_modify_entry ${TESTDIR}/contact2_entrymods) +ENDIF (LDAPMODIFY_EXECUTABLE) + +IF (LDAPDELETE_EXECUTABLE) + ADD_TEST( ldap_delete_contact2 ${TESTDIR}/check_ldap_delete_entry ${TESTDIR}/contact2.ldif ) +ENDIF (LDAPDELETE_EXECUTABLE) + + + +IF (LDAPADD_EXECUTABLE) + ADD_TEST( ldap_add_event ${TESTDIR}/check_ldap_add_entry ${TESTDIR}/event1.ldif ) +ENDIF (LDAPADD_EXECUTABLE) + +IF (LDAPMODIFY_EXECUTABLE) + ADD_TEST( ldap_modify_event ${TESTDIR}/check_ldap_modify_entry ${TESTDIR}/event1_entrymods) +ENDIF (LDAPMODIFY_EXECUTABLE) + +IF (LDAPDELETE_EXECUTABLE) + ADD_TEST( ldap_delete_event ${TESTDIR}/check_ldap_delete_entry ${TESTDIR}/event1.ldif ) +ENDIF (LDAPDELETE_EXECUTABLE) + + + +IF (LDAPADD_EXECUTABLE) + ADD_TEST( ldap_add_todo ${TESTDIR}/check_ldap_add_entry ${TESTDIR}/todo1.ldif ) +ENDIF (LDAPADD_EXECUTABLE) + +IF (LDAPMODIFY_EXECUTABLE) + ADD_TEST( ldap_modify_todo ${TESTDIR}/check_ldap_modify_entry ${TESTDIR}/todo1_entrymods) +ENDIF (LDAPMODIFY_EXECUTABLE) + +IF (LDAPDELETE_EXECUTABLE) + ADD_TEST( ldap_delete_todo ${TESTDIR}/check_ldap_delete_entry ${TESTDIR}/todo1.ldif ) +ENDIF (LDAPDELETE_EXECUTABLE) + + + +IF (LDAPADD_EXECUTABLE) + ADD_TEST( ldap_add_note ${TESTDIR}/check_ldap_add_entry ${TESTDIR}/note1.ldif ) +ENDIF (LDAPADD_EXECUTABLE) + +IF (LDAPMODIFY_EXECUTABLE) + ADD_TEST( ldap_modify_note ${TESTDIR}/check_ldap_modify_entry ${TESTDIR}/note1_entrymods ) +ENDIF (LDAPMODIFY_EXECUTABLE) + +IF (LDAPDELETE_EXECUTABLE) + ADD_TEST( ldap_delete_note ${TESTDIR}/check_ldap_delete_entry ${TESTDIR}/note1.ldif ) +ENDIF (LDAPDELETE_EXECUTABLE) + + + + + + + + +########################################################### +# Interact with the LDAP server using osyncplugin... +# Requires the LDAP server being configured in a way, that the +# default settings in ldap-sync lead to 1. authentication, 2. write access. +# +ADD_TEST( check_init ${TESTDIR}/check_init ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ) + +ADD_TEST( check_connect ${TESTDIR}/check_connect ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ) + +ADD_TEST( check_slowsync ${TESTDIR}/check_slowsync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ) + +ADD_TEST( check_sync ${TESTDIR}/check_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ) + +ADD_TEST( check_fastsync ${TESTDIR}/check_fastsync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ) + + + +IF (LDAPADD_EXECUTABLE) + IF (LDAPMODIFY_EXECUTABLE) + IF (LDAPDELETE_EXECUTABLE) + + ADD_TEST( add_modify_delete_contact1_and_fastsync ${TESTDIR}/check_add_modify_delete_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ${TESTDIR}/contact1.ldif ${TESTDIR}/contact1_entrymods "--fastsync") + + ADD_TEST( add_modify_delete_contact2_and_fastsync ${TESTDIR}/check_add_modify_delete_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ${TESTDIR}/contact2.ldif ${TESTDIR}/contact2_entrymods "--fastsync") + + ADD_TEST( add_modify_delete_event_and_fastsync ${TESTDIR}/check_add_modify_delete_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ${TESTDIR}/event1.ldif ${TESTDIR}/event1_entrymods "--fastsync") + + ADD_TEST( add_modify_delete_todo_and_fastsync ${TESTDIR}/check_add_modify_delete_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ${TESTDIR}/todo1.ldif ${TESTDIR}/todo1_entrymods "--fastsync" ) + + ADD_TEST( add_modify_delete_note_and_fastsync ${TESTDIR}/check_add_modify_delete_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ${TESTDIR}/note1.ldif ${TESTDIR}/note1_entrymods "-fastsync") + + + ADD_TEST( add_modify_delete_contact1_and_sync ${TESTDIR}/check_add_modify_delete_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ${TESTDIR}/contact1.ldif ${TESTDIR}/contact1_entrymods "--sync") + + ADD_TEST( add_modify_delete_contact2_and_sync ${TESTDIR}/check_add_modify_delete_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ${TESTDIR}/contact2.ldif ${TESTDIR}/contact2_entrymods "--sync") + + ADD_TEST( add_modify_delete_event_and_sync ${TESTDIR}/check_add_modify_delete_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ${TESTDIR}/event1.ldif ${TESTDIR}/event1_entrymods "--sync") + + ADD_TEST( add_modify_delete_todo_and_sync ${TESTDIR}/check_add_modify_delete_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ${TESTDIR}/todo1.ldif ${TESTDIR}/todo1_entrymods "--sync" ) + + ADD_TEST( add_modify_delete_note_and_sync ${TESTDIR}/check_add_modify_delete_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ${TESTDIR}/note1.ldif ${TESTDIR}/note1_entrymods "-sync") + + + ADD_TEST( add_modify_delete_contact1_and_slowsync ${TESTDIR}/check_add_modify_delete_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ${TESTDIR}/contact1.ldif ${TESTDIR}/contact1_entrymods "--slowsync") + + ADD_TEST( add_modify_delete_contact2_and_slowsync ${TESTDIR}/check_add_modify_delete_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ${TESTDIR}/contact2.ldif ${TESTDIR}/contact2_entrymods "--slowsync") + + ADD_TEST( add_modify_delete_event_and_slowsync ${TESTDIR}/check_add_modify_delete_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ${TESTDIR}/event1.ldif ${TESTDIR}/event1_entrymods "--slowsync") + + ADD_TEST( add_modify_delete_todo_and_slowsync ${TESTDIR}/check_add_modify_delete_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ${TESTDIR}/todo1.ldif ${TESTDIR}/todo1_entrymods "--slowsync" ) + + ADD_TEST( add_modify_delete_note_and_slowsync ${TESTDIR}/check_add_modify_delete_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ${TESTDIR}/note1.ldif ${TESTDIR}/note1_entrymods "-slowsync") + + + ADD_TEST( add_modify_delete_all_four_objtypes_and_fastsync ${TESTDIR}/check_add_modify_delete_four_ldifs_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ${TESTDIR}/contact1.ldif ${TESTDIR}/event1.ldif ${TESTDIR}/todo1.ldif ${TESTDIR}/note1.ldif ${TESTDIR}/contact1_entrymods ${TESTDIR}/event1_entrymods ${TESTDIR}/todo1_entrymods ${TESTDIR}/note1_entrymods "--fastsync") + + ADD_TEST( add_modify_delete_all_four_objtypes_and_fastsync ${TESTDIR}/check_add_modify_delete_four_ldifs_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ${TESTDIR}/contact1.ldif ${TESTDIR}/event1.ldif ${TESTDIR}/todo1.ldif ${TESTDIR}/note1.ldif ${TESTDIR}/contact1_entrymods ${TESTDIR}/event1_entrymods ${TESTDIR}/todo1_entrymods ${TESTDIR}/note1_entrymods "--sync") + + ADD_TEST( add_modify_delete_all_four_objtypes_and_fastsync ${TESTDIR}/check_add_modify_delete_four_ldifs_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ${TESTDIR}/contact1.ldif ${TESTDIR}/event1.ldif ${TESTDIR}/todo1.ldif ${TESTDIR}/note1.ldif ${TESTDIR}/contact1_entrymods ${TESTDIR}/event1_entrymods ${TESTDIR}/todo1_entrymods ${TESTDIR}/note1_entrymods "--slowsync") + + ENDIF (LDAPDELETE_EXECUTABLE) + ENDIF (LDAPMODIFY_EXECUTABLE) +ENDIF (LDAPADD_EXECUTABLE) + + + +############################ +# Now with valgrind... +IF (LDAPADD_EXECUTABLE) + IF (LDAPMODIFY_EXECUTABLE) + IF (LDAPDELETE_EXECUTABLE) + IF (VALGRIND_EXECUTABLE) + + ADD_TEST( valgrind_add_modify_delete_contact1_and_fastsync ${TESTDIR}/check_add_modify_delete_and_valgrind_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ${TESTDIR}/contact1.ldif ${TESTDIR}/contact1_entrymods "--fastsync" ${TESTDIR}/opensync.suppr ) + + ADD_TEST( valgrind_add_modify_delete_contact2_and_fastsync ${TESTDIR}/check_add_modify_delete_and_valgrind_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ${TESTDIR}/contact2.ldif ${TESTDIR}/contact2_entrymods "--fastsync" ${TESTDIR}/opensync.suppr ) + + ADD_TEST( valgrind_add_modify_delete_event_and_fastsync ${TESTDIR}/check_add_modify_delete_and_valgrind_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ${TESTDIR}/event1.ldif ${TESTDIR}/event1_entrymods "--fastsync" ${TESTDIR}/opensync.suppr ) + + ADD_TEST( valgrind_add_modify_delete_todo_and_fastsync ${TESTDIR}/check_add_modify_delete_and_valgrind_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ${TESTDIR}/todo1.ldif ${TESTDIR}/todo1_entrymods "--fastsync" ${TESTDIR}/opensync.suppr ) + + ADD_TEST( valgrind_add_modify_delete_note_and_fastsync ${TESTDIR}/check_add_modify_delete_and_valgrind_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ${TESTDIR}/note1.ldif ${TESTDIR}/note1_entrymods "-fastsync" ${TESTDIR}/opensync.suppr ) + + + ADD_TEST( valgrind_add_modify_delete_all_four_objtypes_and_fastsync ${TESTDIR}/check_add_modify_delete_four_ldifs_and_valgrind_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ${TESTDIR}/contact1.ldif ${TESTDIR}/event1.ldif ${TESTDIR}/todo1.ldif ${TESTDIR}/note1.ldif ${TESTDIR}/contact1_entrymods ${TESTDIR}/event1_entrymods ${TESTDIR}/todo1_entrymods ${TESTDIR}/note1_entrymods "--fastsync") + + ENDIF (VALGRIND_EXECUTABLE) + ENDIF (LDAPDELETE_EXECUTABLE) + ENDIF (LDAPMODIFY_EXECUTABLE) +ENDIF (LDAPADD_EXECUTABLE) + + + + +# vim:tw=0:nowrap Added: plugins/ldap-sync/tests/check_add_modify_delete_and_sync ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/tests/check_add_modify_delete_and_sync Thu Mar 26 01:17:22 2009 (r5337) @@ -0,0 +1,225 @@ +#!/bin/bash + +# Call as check_add_modify_delete_and_sync /path/to/ldap-sync/build/dir /path/to/ldap-sync/src/dir /path/to/ldif /path/to/entrymods +# +# E.g.: +# ./check_add_modify_delete_and_sync /home/user1/dev/plugins/ldap-sync/build /home/user1/dev/plugins/ldap-sync contact2.ldif contact_entrymods1 + +set -x + +FILE=$0 +PLUGINNAME="ldap-sync" +PLUGINPATH="$1/src" +CFG="$2/src/$PLUGINNAME" +LDIF=$3 +ENTRYMODS=$4 +SYNCMETHOD=$5 + + +echo "PLUGINPATH = \"$PLUGINPATH\"" +echo "CFG = \"$CFG\"" +echo "LDIF = \"$LDIF\"" +echo "ENTRYMODS = \"$ENTRYMODS\"" +echo "SYNCMETHOD = \"$SYNCMETHOD\"" + +SOURCE_DIR=`dirname $FILE` +if test ! -d "$SOURCE_DIR"; then + echo "$FILE:$LINENO: ERROR: \"$SOURCE_DIR\" is not a directory. Exiting." + exit 1 +fi + +if test ! -r "$SOURCE_DIR/test.conf"; then + echo "$FILE:$LINENO: ERROR: \"$SOURCE_DIR/test.conf\" could not be read. Exiting." + exit 1 +fi + +source "$SOURCE_DIR/test.conf" + +if test -z "$AUTH"; then + echo "$FILE:$LINENO: ERROR: \$AUTH is empty. Exiting."; + exit 1 +fi + +if test "$SYNCMETHOD" != "--fastsync"; then + if test "$SYNCMETHOD" != "--slowsync"; then + if test "$SYNCMETHOD" != "--sync"; then + echo "$FILE:$FILENO: WARNING: Syncronization method \"$SYNCMETHOD\" is unknown. Forcebly falling back to \"--fastsync\"." + SYNCMETHOD="--fastsync" + fi + fi +fi + + +b=$(echo $SYNCMETHOD | cut -c "1-2") +if test "$b" != "--"; then + echo "$FILE:$LINENO: WARNING: Prepending \"--\" to SYNCMETHOD." + $SYNCMETHOD = "--${SYNCMETHOD}" +fi + + +LDAPADD=$(which ldapadd 2>/dev/null) + +if test ! -f "$LDAPADD"; then + echo "$FILE:$LINENO: ERROR: ldapadd could not be found. Exiting." + exit 1 +fi + +if test ! -x "$LDAPADD"; then + echo "$FILE:$LINENO: ERROR: ldapadd could be found, but is not executable. Exiting." + exit 1 +fi + + + + + +LDAPMODIFY=$(which ldapmodify 2>/dev/null) + +if test ! -f "$LDAPMODIFY"; then + echo "$FILE:$LINENO: ERROR: ldapmodify could not be found. Exiting." + exit 1 +fi + +if test ! -x "$LDAPMODIFY"; then + echo "$FILE:$LINENO: ERROR: ldapmodify could be found, but is not executable. Exiting." + exit 1 +fi + + + +LDAPDELETE=$(which ldapdelete 2>/dev/null) + +if test ! -f "$LDAPDELETE"; then + echo "$FILE:$LINENO: ERROR: ldapdelete could not be found. Exiting." + exit 1 +fi + +if test ! -x "$LDAPDELETE"; then + echo "$FILE:$LINENO: ERROR: ldapdelete could be found, but is not executable. Exiting." + exit 1 +fi + + + + + + + +OSYNCPLUGIN=$(which osyncplugin 2>/dev/null) +if test ! -f "$OSYNCPLUGIN"; then + echo "$FILE:$LINENO: ERROR: osyncplugin could not be found. Exiting." + exit 1 +fi + +if test ! -x "$OSYNCPLUGIN"; then + echo "$FILE:$LINENO: ERROR: osyncplugin could be found, but it is not executable. Exiting." + exit 1 +fi + + + +WHOAMI=$(which whoami 2>/dev/null) +if test -n "$WHOAMI"; then + if test -x "$WHOAMI"; then + echo -n "This script $FILE is running under the login name: "; + $WHOAMI; + fi +fi + +echo "AUTH = \"$AUTH\"" + + +if test ! -f "$LDIF"; then + echo "$FILE:$LINENO: ERROR: \"$LDIF\" could not be found. Exiting."; + exit 1; +fi + +if test ! -r "$LDIF"; then + echo "$FILE:$LINENO: ERROR: \"$LDIF\" could be found, but it is not readable. Exiting."; + exit 1; +fi + + + +if test ! -f "$ENTRYMODS"; then + echo "$FILE:$LINENO: ERROR: \"$ENTRYMODS\" could not be found. Exiting."; + exit 1; +fi + +if test ! -r "$ENTRYMODS"; then + echo "$FILE:$LINENO: ERROR: \"$ENTRYMODS\" could be found, but it is not readable. Exiting."; + exit 1; +fi + + + + + + + + +echo "Command: $LDAPADD $AUTH -a -f $LDIF" + +$LDAPADD $AUTH -a -f $LDIF +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: ldapadd has failed. Exiting." + exit $rv; +fi + + +echo "${PLUGINPATH} ${CFG}" + +TMPDIR=`mktemp -d /tmp/ldap_sync_test.XXXXXX` || exit 1 + +$OSYNCPLUGIN --plugin $PLUGINNAME --pluginpath $PLUGINPATH --config $CFG --configdir $TMPDIR --initialize --connect $SYNCMETHOD --syncdone --disconnect --finalize || exit 1 + + + + + +echo "Command: $LDAPMODIFY $AUTH -f $ENTRYMODS" + +$LDAPMODIFY $AUTH -f $ENTRYMODS +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: ldapmodify has failed. Exiting." + exit $rv; +fi + + +$OSYNCPLUGIN --plugin $PLUGINNAME --pluginpath $PLUGINPATH --config $CFG --configdir $TMPDIR --initialize --connect $SYNCMETHOD --syncdone --disconnect --finalize || exit 1 + + + + + + +DN_FULL=$(head -n 1 $LDIF) +if test -z "$DN_FULL"; then + echo "$FILE:$LINENO: ERROR: \$DN_FULL is empty. Exiting." + exit 1; +fi + +DN=${DN_FULL#dn:} +if test -z "$DN"; then + echo "$FILE:$LINENO: ERROR: \$DN is empty. Exiting." + exit 1; +fi + +echo "To be deleted: \"$DN\"" +echo "Command: $LDAPDELETE $AUTH -r $DN" + +$LDAPDELETE $AUTH -r $DN +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: ldapdelete has failed. Exiting." + exit $rv; +fi + + + +$OSYNCPLUGIN --plugin $PLUGINNAME --pluginpath $PLUGINPATH --config $CFG --configdir $TMPDIR --initialize --connect $SYNCMETHOD --syncdone --disconnect --finalize || exit 1 + + + Added: plugins/ldap-sync/tests/check_add_modify_delete_and_valgrind_and_sync ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/tests/check_add_modify_delete_and_valgrind_and_sync Thu Mar 26 01:17:22 2009 (r5337) @@ -0,0 +1,280 @@ +#!/bin/bash + +# Call as check_add_modify_delete_and_sync /path/to/ldap-sync/build/dir /path/to/ldap-sync/src/dir ldif entrymods suppressions +# +# E.g.: +# ./check_add_modify_delete_and_sync /home/user1/dev/plugins/ldap-sync/build /home/user1/dev/plugins/ldap-sync contact2.ldif contact_entrymods1 opensync.suppr + +set -x + +FILE=$0 +PLUGINNAME="ldap-sync" +PLUGINPATH="$1/src" +CFG="$2/src/$PLUGINNAME" +LDIF=$3 +ENTRYMODS=$4 +SYNCMETHOD=$5 +SUPPRESSION_FILE=$6 + + +SOURCE_DIR=`dirname $FILE` +if test ! -d "$SOURCE_DIR"; then + echo "$FILE:$LINENO: ERROR: \"$SOURCE_DIR\" is not a directory. Exiting." + exit 1 +fi + +if test ! -r "$SOURCE_DIR/test.conf"; then + echo "$FILE:$LINENO: ERROR: \"$SOURCE_DIR/test.conf\" could not be read. Exiting." + exit 1 +fi + + +source "$SOURCE_DIR/test.conf" + +if test -z "$AUTH"; then + echo "$FILE:$LINENO: ERROR: \$AUTH is empty. Exiting."; + exit 1 +fi + +if test -z "$VALGRIND"; then + echo "$FILE:$LINENO: ERROR: \$VALGRIND is empty. Exiting."; + exit 1; +fi + + +if test -n "$SUPPRESSION_FILE" -a -f "$SUPPRESSION_FILE" -a -r "$SUPPRESSION_FILE"; then + VALGRIND="$VALGRIND --suppressions=$SUPPRESSION_FILE" +fi + + + +echo "PLUGINPATH = \"$PLUGINPATH\"" +echo "CFG = \"$CFG\"" +echo "LDIF = \"$LDIF\"" +echo "ENTRYMODS = \"$ENTRYMODS\"" +echo "SYNCMETHOD = \"$SYNCMETHOD\"" +echo "VALGRIND = \"$VALGRIND\"" + + +if test "$SYNCMETHOD" != "--fastsync"; then + if test "$SYNCMETHOD" != "--slowsync"; then + if test "$SYNCMETHOD" != "--sync"; then + echo "$FILE:$FILENO: WARNING: Syncronization method \"$SYNCMETHOD\" is unknown. Forcebly falling back to \"--fastsync\"." + SYNCMETHOD="--fastsync" + fi + fi +fi + + +b=$(echo $SYNCMETHOD | cut -c "1-2") +if test "$b" != "--"; then + echo "$FILE:$LINENO: WARNING: Prepending \"--\" to SYNCMETHOD." + $SYNCMETHOD = "--${SYNCMETHOD}" +fi + + +LDAPADD=$(which ldapadd 2>/dev/null) + +if test ! -f "$LDAPADD"; then + echo "$FILE:$LINENO: ERROR: ldapadd could not be found. Exiting." + exit 1 +fi + +if test ! -x "$LDAPADD"; then + echo "$FILE:$LINENO: ERROR: ldapadd could be found, but is not executable. Exiting." + exit 1 +fi + + + + + +LDAPMODIFY=$(which ldapmodify 2>/dev/null) + +if test ! -f "$LDAPMODIFY"; then + echo "$FILE:$LINENO: ERROR: ldapmodify could not be found. Exiting." + exit 1 +fi + +if test ! -x "$LDAPMODIFY"; then + echo "$FILE:$LINENO: ERROR: ldapmodify could be found, but is not executable. Exiting." + exit 1 +fi + + + +LDAPDELETE=$(which ldapdelete 2>/dev/null) + +if test ! -f "$LDAPDELETE"; then + echo "$FILE:$LINENO: ERROR: ldapdelete could not be found. Exiting." + exit 1 +fi + +if test ! -x "$LDAPDELETE"; then + echo "$FILE:$LINENO: ERROR: ldapdelete could be found, but is not executable. Exiting." + exit 1 +fi + + + + + + + +OSYNCPLUGIN=$(which osyncplugin 2>/dev/null) +if test ! -f "$OSYNCPLUGIN"; then + echo "$FILE:$LINENO: ERROR: osyncplugin could not be found. Exiting." + exit 1 +fi + +if test ! -x "$OSYNCPLUGIN"; then + echo "$FILE:$LINENO: ERROR: osyncplugin could be found, but it is not executable. Exiting." + exit 1 +fi + + + +WHOAMI=$(which whoami 2>/dev/null) +if test -n "$WHOAMI"; then + if test -x "$WHOAMI"; then + echo -n "This script $FILE is running under the login name: "; + $WHOAMI; + fi +fi + +echo "AUTH = \"$AUTH\"" + + +if test ! -f "$LDIF"; then + echo "$FILE:$LINENO: ERROR: \"$LDIF\" could not be found. Exiting."; + exit 1; +fi + +if test ! -r "$LDIF"; then + echo "$FILE:$LINENO: ERROR: \"$LDIF\" could be found, but it is not readable. Exiting."; + exit 1; +fi + + + +if test ! -f "$ENTRYMODS"; then + echo "$FILE:$LINENO: ERROR: \"$ENTRYMODS\" could not be found. Exiting."; + exit 1; +fi + +if test ! -r "$ENTRYMODS"; then + echo "$FILE:$LINENO: ERROR: \"$ENTRYMODS\" could be found, but it is not readable. Exiting."; + exit 1; +fi + + + + + + + + +echo "Command: $LDAPADD $AUTH -a -f $LDIF" + +$LDAPADD $AUTH -a -f $LDIF +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: ldapadd has failed. Exiting." + exit $rv; +fi + + +echo "${PLUGINPATH} ${CFG}" + +TMPDIR=`mktemp -d /tmp/ldap_sync_test.XXXXXX` || exit 1 + +echo +echo +echo + + +$VALGRIND $OSYNCPLUGIN --plugin $PLUGINNAME --pluginpath $PLUGINPATH --config $CFG --configdir $TMPDIR --initialize --connect $SYNCMETHOD --syncdone --disconnect --finalize +add_rv=$? + + +echo +echo +echo + + + +echo "Command: $LDAPMODIFY $AUTH -f $ENTRYMODS" + +$LDAPMODIFY $AUTH -f $ENTRYMODS +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: ldapmodify has failed. Exiting." + exit $rv; +fi + + +echo +echo +echo + + +$VALGRIND $OSYNCPLUGIN --plugin $PLUGINNAME --pluginpath $PLUGINPATH --config $CFG --configdir $TMPDIR --initialize --connect $SYNCMETHOD --syncdone --disconnect --finalize +modify_rv=$? + + +echo +echo +echo + + + +DN_FULL=$(head -n 1 $LDIF) +if test -z "$DN_FULL"; then + echo "$FILE:$LINENO: ERROR: \$DN_FULL is empty. Exiting." + exit 1; +fi + +DN=${DN_FULL#dn:} +if test -z "$DN"; then + echo "$FILE:$LINENO: ERROR: \$DN is empty. Exiting." + exit 1; +fi + +echo "To be deleted: \"$DN\"" +echo "Command: $LDAPDELETE $AUTH -r $DN" + +$LDAPDELETE $AUTH -r $DN +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: ldapdelete has failed. Exiting." + exit $rv; +fi + + +echo +echo +echo + +$VALGRIND $OSYNCPLUGIN --plugin $PLUGINNAME --pluginpath $PLUGINPATH --config $CFG --configdir $TMPDIR --initialize --connect $SYNCMETHOD --syncdone --disconnect --finalize +delete_rv=$? + +echo +echo +echo + +echo "add_rv = $add_rv"; +echo "modify_rv = $modify_rv"; +echo "delete_rv = $delete_rv"; + +echo +echo +echo + +if test $add_rv -ne 0 -o $modify_rv -ne 0 -o $delete_rv -ne 0; then + echo "Valgrind has reported memory errors." + exit 1 +fi + +echo +echo +echo Added: plugins/ldap-sync/tests/check_add_modify_delete_four_ldifs_and_sync ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/tests/check_add_modify_delete_four_ldifs_and_sync Thu Mar 26 01:17:22 2009 (r5337) @@ -0,0 +1,414 @@ +#!/bin/bash + +# Call as check_add_modify_delete_four_ldifs_and_sync /path/to/ldap-sync/build/dir /path/to/ldap-sync/src/dir /path/to/ldif1 path/to/ldif2 path/to/ldif3 path/to/ldif4 /path/to/entry1mods /path/to/entry2mods /path/to/entry3mods /path/to/entry4mods + +set -x + +FILE=$0 +PLUGINNAME="ldap-sync" +PLUGINPATH="$1/src" +CFG="$2/src/$PLUGINNAME" +LDIF1=$3 +LDIF2=$4 +LDIF3=$5 +LDIF4=$6 +ENTRY1MODS=$7 +ENTRY2MODS=$8 +ENTRY3MODS=$9 +ENTRY4MODS=${10} +SYNCMETHOD=${11} + + +echo "PLUGINPATH = \"$PLUGINPATH\"" +echo "CFG = \"$CFG\"" +echo "LDIF = \"$LDIF\"" +echo "ENTRYMODS = \"$ENTRYMODS\"" +echo "SYNCMETHOD = \"$SYNCMETHOD\"" + +SOURCE_DIR=`dirname $FILE` +if test ! -d "$SOURCE_DIR"; then + echo "$FILE:$LINENO: ERROR: \"$SOURCE_DIR\" is not a directory. Exiting." + exit 1 +fi + +if test ! -r "$SOURCE_DIR/test.conf"; then + echo "$FILE:$LINENO: ERROR: \"$SOURCE_DIR/test.conf\" could not be read. Exiting." + exit 1 +fi + +source "$SOURCE_DIR/test.conf" + +if test -z "$AUTH"; then + echo "$FILE:$LINENO: ERROR: \$AUTH is empty. Exiting."; + exit 1 +fi + +if test "$SYNCMETHOD" != "--fastsync"; then + if test "$SYNCMETHOD" != "--slowsync"; then + if test "$SYNCMETHOD" != "--sync"; then + echo "$FILE:$FILENO: WARNING: Syncronization method \"$SYNCMETHOD\" is unknown. Forcebly falling back to \"--fastsync\"." + SYNCMETHOD="--fastsync" + fi + fi +fi + + +b=$(echo $SYNCMETHOD | cut -c "1-2") +if test "$b" != "--"; then + echo "$FILE:$LINENO: WARNING: Prepending \"--\" to SYNCMETHOD." + $SYNCMETHOD = "--${SYNCMETHOD}" +fi + + +LDAPADD=$(which ldapadd 2>/dev/null) + +if test ! -f "$LDAPADD"; then + echo "$FILE:$LINENO: ERROR: ldapadd could not be found. Exiting." + exit 1 +fi + +if test ! -x "$LDAPADD"; then + echo "$FILE:$LINENO: ERROR: ldapadd could be found, but is not executable. Exiting." + exit 1 +fi + + + + + +LDAPMODIFY=$(which ldapmodify 2>/dev/null) + +if test ! -f "$LDAPMODIFY"; then + echo "$FILE:$LINENO: ERROR: ldapmodify could not be found. Exiting." + exit 1 +fi + +if test ! -x "$LDAPMODIFY"; then + echo "$FILE:$LINENO: ERROR: ldapmodify could be found, but is not executable. Exiting." + exit 1 +fi + + + +LDAPDELETE=$(which ldapdelete 2>/dev/null) + +if test ! -f "$LDAPDELETE"; then + echo "$FILE:$LINENO: ERROR: ldapdelete could not be found. Exiting." + exit 1 +fi + +if test ! -x "$LDAPDELETE"; then + echo "$FILE:$LINENO: ERROR: ldapdelete could be found, but is not executable. Exiting." + exit 1 +fi + + + + + + + +OSYNCPLUGIN=$(which osyncplugin 2>/dev/null) +if test ! -f "$OSYNCPLUGIN"; then + echo "$FILE:$LINENO: ERROR: osyncplugin could not be found. Exiting." + exit 1 +fi + +if test ! -x "$OSYNCPLUGIN"; then + echo "$FILE:$LINENO: ERROR: osyncplugin could be found, but it is not executable. Exiting." + exit 1 +fi + + + +WHOAMI=$(which whoami 2>/dev/null) +if test -n "$WHOAMI"; then + if test -x "$WHOAMI"; then + echo -n "This script $FILE is running under the login name: "; + $WHOAMI; + fi +fi + +echo "AUTH = \"$AUTH\"" + + +if test ! -f "$LDIF1"; then + echo "$FILE:$LINENO: ERROR: \"$LDIF1\" could not be found. Exiting."; + exit 1; +fi + +if test ! -r "$LDIF1"; then + echo "$FILE:$LINENO: ERROR: \"$LDIF1\" could be found, but it is not readable. Exiting."; + exit 1; +fi + + + +if test ! -f "$LDIF2"; then + echo "$FILE:$LINENO: ERROR: \"$LDIF2\" could not be found. Exiting."; + exit 1; +fi + +if test ! -r "$LDIF2"; then + echo "$FILE:$LINENO: ERROR: \"$LDIF2\" could be found, but it is not readable. Exiting."; + exit 1; +fi + + + +if test ! -f "$LDIF3"; then + echo "$FILE:$LINENO: ERROR: \"$LDIF3\" could not be found. Exiting."; + exit 1; +fi + +if test ! -r "$LDIF3"; then + echo "$FILE:$LINENO: ERROR: \"$LDIF3\" could be found, but it is not readable. Exiting."; + exit 1; +fi + + + +if test ! -f "$LDIF4"; then + echo "$FILE:$LINENO: ERROR: \"$LDIF4\" could not be found. Exiting."; + exit 1; +fi + +if test ! -r "$LDIF4"; then + echo "$FILE:$LINENO: ERROR: \"$LDIF4\" could be found, but it is not readable. Exiting."; + exit 1; +fi + + + + + + +if test ! -f "$ENTRY1MODS"; then + echo "$FILE:$LINENO: ERROR: \"$ENTRY1MODS\" could not be found. Exiting."; + exit 1; +fi + +if test ! -r "$ENTRY1MODS"; then + echo "$FILE:$LINENO: ERROR: \"$ENTRY1MODS\" could be found, but it is not readable. Exiting."; + exit 1; +fi + + + + +if test ! -f "$ENTRY2MODS"; then + echo "$FILE:$LINENO: ERROR: \"$ENTRY2MODS\" could not be found. Exiting."; + exit 1; +fi + +if test ! -r "$ENTRY2MODS"; then + echo "$FILE:$LINENO: ERROR: \"$ENTRY2MODS\" could be found, but it is not readable. Exiting."; + exit 1; +fi + + + +if test ! -f "$ENTRY3MODS"; then + echo "$FILE:$LINENO: ERROR: \"$ENTRY3MODS\" could not be found. Exiting."; + exit 1; +fi + +if test ! -r "$ENTRY3MODS"; then + echo "$FILE:$LINENO: ERROR: \"$ENTRY3MODS\" could be found, but it is not readable. Exiting."; + exit 1; +fi + + + + +if test ! -f "$ENTRY4MODS"; then + echo "$FILE:$LINENO: ERROR: \"$ENTRY4MODS\" could not be found. Exiting."; + exit 1; +fi + +if test ! -r "$ENTRY4MODS"; then + echo "$FILE:$LINENO: ERROR: \"$ENTRY4MODS\" could be found, but it is not readable. Exiting."; + exit 1; +fi + + + + + + + + +############# Add all the four *.ldif files ############ +echo -e "\n\n\nCommand: $LDAPADD $AUTH -a -f $LDIF1\n\n\n" + +$LDAPADD $AUTH -a -f $LDIF1 +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: ldapadd has failed. Exiting." + exit $rv; +fi + + + + + +echo -e "\n\n\nCommand: $LDAPADD $AUTH -a -f $LDIF2\n\n\n" + +$LDAPADD $AUTH -a -f $LDIF2 +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: ldapadd has failed. Exiting." + exit $rv; +fi + + + + + +echo -e "\n\n\nCommand: $LDAPADD $AUTH -a -f $LDIF3\n\n\n" + +$LDAPADD $AUTH -a -f $LDIF3 +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: ldapadd has failed. Exiting." + exit $rv; +fi + + + + + +echo -e "\n\n\nCommand: $LDAPADD $AUTH -a -f $LDIF4\n\n\n" + +$LDAPADD $AUTH -a -f $LDIF4 +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: ldapadd has failed. Exiting." + exit $rv; +fi + + + + + +################# Synchronize ################### +echo "${PLUGINPATH} ${CFG}" + +TMPDIR=`mktemp -d /tmp/ldap_sync_test.XXXXXX` || exit 1 + +$OSYNCPLUGIN --plugin $PLUGINNAME --pluginpath $PLUGINPATH --config $CFG --configdir $TMPDIR --initialize --connect $SYNCMETHOD --syncdone --disconnect --finalize || exit 1 + + + + +########### Modify all the four entries ############# +echo -e "\n\n\nCommand: $LDAPMODIFY $AUTH -f $ENTRY1MODS" + +$LDAPMODIFY $AUTH -f $ENTRY1MODS +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: ldapmodify has failed. Exiting." + exit $rv; +fi + + +echo -e "\n\n\nCommand: $LDAPMODIFY $AUTH -f $ENTRY2MODS" + +$LDAPMODIFY $AUTH -f $ENTRY2MODS +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: ldapmodify has failed. Exiting." + exit $rv; +fi + + + + +echo -e "\n\n\nCommand: $LDAPMODIFY $AUTH -f $ENTRY3MODS" + +$LDAPMODIFY $AUTH -f $ENTRY3MODS +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: ldapmodify has failed. Exiting." + exit $rv; +fi + + + + +echo -e "\n\n\nCommand: $LDAPMODIFY $AUTH -f $ENTRY4MODS" + +$LDAPMODIFY $AUTH -f $ENTRY4MODS +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: ldapmodify has failed. Exiting." + exit $rv; +fi + + + + + + + + +############# Synchronize ################ + +$OSYNCPLUGIN --plugin $PLUGINNAME --pluginpath $PLUGINPATH --config $CFG --configdir $TMPDIR --initialize --connect $SYNCMETHOD --syncdone --disconnect --finalize || exit 1 + + + + + +############ Delete all the four entries ########### +delete_dn() +{ + ldif="$1" + if test -z "$ldif"; then + echo "$FILE:$LINENO: ERROR: \$ldif is empty. Exiting." + exit 1 + fi + + if test ! -r "$ldif"; then + echo "$FILE:$LINENO: ERROR: \"$ldif\" is not readable. Exiting." + exit 1 + fi + + + + DN_FULL=$(head -n 1 $ldif) + if test -z "$DN_FULL"; then + echo "$FILE:$LINENO: ERROR: \$DN_FULL is empty. Exiting." + exit 1; + fi + + DN=${DN_FULL#dn:} + if test -z "$DN"; then + echo "$FILE:$LINENO: ERROR: \$DN is empty. Exiting." + exit 1; + fi + + echo -e "\n\n\nTo be deleted: \"$DN\"" + echo "Command: $LDAPDELETE $AUTH -r $DN" + + $LDAPDELETE $AUTH -r $DN + rv=$? + if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: ldapdelete has failed. Exiting." + exit $rv; + fi +} + + +delete_dn "$LDIF1" +delete_dn "$LDIF2" +delete_dn "$LDIF3" +delete_dn "$LDIF4" + + + +########## Synchronize ############# +$OSYNCPLUGIN --plugin $PLUGINNAME --pluginpath $PLUGINPATH --config $CFG --configdir $TMPDIR --initialize --connect $SYNCMETHOD --syncdone --disconnect --finalize || exit 1 + + + Added: plugins/ldap-sync/tests/check_add_modify_delete_four_ldifs_and_valgrind_and_sync ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/tests/check_add_modify_delete_four_ldifs_and_valgrind_and_sync Thu Mar 26 01:17:22 2009 (r5337) @@ -0,0 +1,429 @@ +#!/bin/bash + +# Call as check_add_modify_delete_four_objtypes_and_valgrind_and_sync /path/to/ldap-sync/build/dir /path/to/ldap-sync/src/dir /path/to/ldif1 /path/to/ldif2 /path/to/ldif3 /path/to/ldif4 /path/to/entry1mods /path/to/entry2mods /path/to/entry3mods /path/to/entry4mods /path/to/suppressions +# + + +set -x + +FILE=$0 +PLUGINNAME="ldap-sync" +PLUGINPATH="$1/src" +CFG="$2/src/$PLUGINNAME" +LDIF1=$3 +LDIF2=$4 +LDIF3=$5 +LDIF4=$6 +ENTRY1MODS=$7 +ENTRY2MODS=$8 +ENTRY3MODS=$9 +ENTRY4MODS=${10} +SYNCMETHOD=${11} +SUPPRESSION_FILE=${12} + + +SOURCE_DIR=`dirname $FILE` +if test ! -d "$SOURCE_DIR"; then + echo "$FILE:$LINENO: ERROR: \"$SOURCE_DIR\" is not a directory. Exiting." + exit 1 +fi + +if test ! -r "$SOURCE_DIR/test.conf"; then + echo "$FILE:$LINENO: ERROR: \"$SOURCE_DIR/test.conf\" could not be read. Exiting." + exit 1 +fi + + +source "$SOURCE_DIR/test.conf" + +if test -z "$AUTH"; then + echo "$FILE:$LINENO: ERROR: \$AUTH is empty. Exiting."; + exit 1 +fi + +if test -z "$VALGRIND"; then + echo "$FILE:$LINENO: ERROR: \$VALGRIND is empty. Exiting."; + exit 1; +fi + + +if test -n "$SUPPRESSION_FILE" -a -f "$SUPPRESSION_FILE" -a -r "$SUPPRESSION_FILE"; then + VALGRIND="$VALGRIND --suppressions=$SUPPRESSION_FILE" +fi + + + +echo "PLUGINPATH = \"$PLUGINPATH\"" +echo "CFG = \"$CFG\"" +echo "LDIF = \"$LDIF\"" +echo "ENTRYMODS = \"$ENTRYMODS\"" +echo "SYNCMETHOD = \"$SYNCMETHOD\"" +echo "VALGRIND = \"$VALGRIND\"" + + +if test "$SYNCMETHOD" != "--fastsync"; then + if test "$SYNCMETHOD" != "--slowsync"; then + if test "$SYNCMETHOD" != "--sync"; then + echo "$FILE:$FILENO: WARNING: Syncronization method \"$SYNCMETHOD\" is unknown. Forcebly falling back to \"--fastsync\"." + SYNCMETHOD="--fastsync" + fi + fi +fi + + +b=$(echo $SYNCMETHOD | cut -c "1-2") +if test "$b" != "--"; then + echo "$FILE:$LINENO: WARNING: Prepending \"--\" to SYNCMETHOD." + $SYNCMETHOD = "--${SYNCMETHOD}" +fi + + +LDAPADD=$(which ldapadd 2>/dev/null) + +if test ! -f "$LDAPADD"; then + echo "$FILE:$LINENO: ERROR: ldapadd could not be found. Exiting." + exit 1 +fi + +if test ! -x "$LDAPADD"; then + echo "$FILE:$LINENO: ERROR: ldapadd could be found, but is not executable. Exiting." + exit 1 +fi + + + + + +LDAPMODIFY=$(which ldapmodify 2>/dev/null) + +if test ! -f "$LDAPMODIFY"; then + echo "$FILE:$LINENO: ERROR: ldapmodify could not be found. Exiting." + exit 1 +fi + +if test ! -x "$LDAPMODIFY"; then + echo "$FILE:$LINENO: ERROR: ldapmodify could be found, but is not executable. Exiting." + exit 1 +fi + + + +LDAPDELETE=$(which ldapdelete 2>/dev/null) + +if test ! -f "$LDAPDELETE"; then + echo "$FILE:$LINENO: ERROR: ldapdelete could not be found. Exiting." + exit 1 +fi + +if test ! -x "$LDAPDELETE"; then + echo "$FILE:$LINENO: ERROR: ldapdelete could be found, but is not executable. Exiting." + exit 1 +fi + + + + + + + +OSYNCPLUGIN=$(which osyncplugin 2>/dev/null) +if test ! -f "$OSYNCPLUGIN"; then + echo "$FILE:$LINENO: ERROR: osyncplugin could not be found. Exiting." + exit 1 +fi + +if test ! -x "$OSYNCPLUGIN"; then + echo "$FILE:$LINENO: ERROR: osyncplugin could be found, but it is not executable. Exiting." + exit 1 +fi + + + +WHOAMI=$(which whoami 2>/dev/null) +if test -n "$WHOAMI"; then + if test -x "$WHOAMI"; then + echo -n "This script $FILE is running under the login name: "; + $WHOAMI; + fi +fi + +echo "AUTH = \"$AUTH\"" + + + + + +if test ! -f "$LDIF1"; then + echo "$FILE:$LINENO: ERROR: \"$LDIF1\" could not be found. Exiting."; + exit 1; +fi + +if test ! -r "$LDIF1"; then + echo "$FILE:$LINENO: ERROR: \"$LDIF1\" could be found, but it is not readable. Exiting."; + exit 1; +fi + + +if test ! -f "$LDIF2"; then + echo "$FILE:$LINENO: ERROR: \"$LDIF2\" could not be found. Exiting."; + exit 1; +fi + +if test ! -r "$LDIF2"; then + echo "$FILE:$LINENO: ERROR: \"$LDIF2\" could be found, but it is not readable. Exiting."; + exit 1; +fi + + + +if test ! -f "$LDIF3"; then + echo "$FILE:$LINENO: ERROR: \"$LDIF3\" could not be found. Exiting."; + exit 1; +fi + +if test ! -r "$LDIF3"; then + echo "$FILE:$LINENO: ERROR: \"$LDIF3\" could be found, but it is not readable. Exiting."; + exit 1; +fi + + + +if test ! -f "$LDIF4"; then + echo "$FILE:$LINENO: ERROR: \"$LDIF4\" could not be found. Exiting."; + exit 1; +fi + +if test ! -r "$LDIF4"; then + echo "$FILE:$LINENO: ERROR: \"$LDIF4\" could be found, but it is not readable. Exiting."; + exit 1; +fi + + + + + + +if test ! -f "$ENTRY1MODS"; then + echo "$FILE:$LINENO: ERROR: \"$ENTRY1MODS\" could not be found. Exiting."; + exit 1; +fi + +if test ! -r "$ENTRY1MODS"; then + echo "$FILE:$LINENO: ERROR: \"$ENTRY1MODS\" could be found, but it is not readable. Exiting."; + exit 1; +fi + + + + +if test ! -f "$ENTRY2MODS"; then + echo "$FILE:$LINENO: ERROR: \"$ENTRY2MODS\" could not be found. Exiting."; + exit 1; +fi + +if test ! -r "$ENTRY2MODS"; then + echo "$FILE:$LINENO: ERROR: \"$ENTRY2MODS\" could be found, but it is not readable. Exiting."; + exit 1; +fi + + + + +if test ! -f "$ENTRY3MODS"; then + echo "$FILE:$LINENO: ERROR: \"$ENTRY3MODS\" could not be found. Exiting."; + exit 1; +fi + +if test ! -r "$ENTRY3MODS"; then + echo "$FILE:$LINENO: ERROR: \"$ENTRY3MODS\" could be found, but it is not readable. Exiting."; + exit 1; +fi + + + + + +if test ! -f "$ENTRY4MODS"; then + echo "$FILE:$LINENO: ERROR: \"$ENTRY4MODS\" could not be found. Exiting."; + exit 1; +fi + +if test ! -r "$ENTRY4MODS"; then + echo "$FILE:$LINENO: ERROR: \"$ENTRY4MODS\" could be found, but it is not readable. Exiting."; + exit 1; +fi + + + + + + + + + +add_ldif() +{ + ldif=$1 + if test -z "$ldif"; then + echo "$FILE:$LINENO: ERROR: \$ldif is empty. Returning." + return 1; + fi + + echo "Command: $LDAPADD $AUTH -a -f \"$ldif\"" + + $LDAPADD $AUTH -a -f "$ldif" + rv=$? + if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: ldapadd has failed. Exiting." + exit $rv; + fi + + return $rv +} + + + + + + + + +run_valgrind_and_osyncplugin() +{ + echo "${PLUGINPATH} ${CFG}" + + + echo + echo + echo + + + $VALGRIND $OSYNCPLUGIN --plugin $PLUGINNAME --pluginpath $PLUGINPATH --config $CFG --configdir $TMPDIR --initialize --connect $SYNCMETHOD --syncdone --disconnect --finalize +rv=$? + + + echo + echo + echo + + return $rv +} + + + + + + +modify_dn() +{ + entrymods=$1 + if test -z "$entrymods"; then + echo "$FILE:$LINENO: ERROR: \$entrymods is empty. Returning." + return 1; + fi + + + echo "Command: $LDAPMODIFY $AUTH -f \"$entrymods\"" + + $LDAPMODIFY $AUTH -f "$entrymods" + rv=$? + if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: ldapmodify has failed. Exiting." + exit $rv; + fi +} + + + + + +delete_dn() +{ + ldif=$1 + if test -z "$ldif"; then + echo "$FILE:$LINENO: ERROR: \$ldif is empty. Returning." + return 1; + fi + + DN_FULL=$(head -n 1 $ldif) + if test -z "$DN_FULL"; then + echo "$FILE:$LINENO: ERROR: \$DN_FULL is empty. Exiting." + exit 1; + fi + + DN=${DN_FULL#dn:} + if test -z "$DN"; then + echo "$FILE:$LINENO: ERROR: \$DN is empty. Exiting." + exit 1; + fi + + echo "To be deleted: \"$DN\"" + echo "Command: $LDAPDELETE $AUTH -r \"$DN\"" + + $LDAPDELETE $AUTH -r "$DN" + rv=$? + if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: ldapdelete has failed. Exiting." + exit $rv; + fi +} + + + + + +############### main() ############### + +TMPDIR=`mktemp -d /tmp/ldap_sync_test.XXXXXX` || exit 1 + + +add_ldif "$LDIF1"; +add_ldif "$LDIF2"; +add_ldif "$LDIF3"; +add_ldif "$LDIF4"; + +run_valgrind_and_osyncplugin +add_rv=$? + + + +modify_dn "$ENTRY1MODS"; +modify_dn "$ENTRY2MODS"; +modify_dn "$ENTRY3MODS"; +modify_dn "$ENTRY4MODS"; + +run_valgrind_and_osyncplugin +modify_rv=$? + + + +delete_dn "$LDIF1"; +delete_dn "$LDIF2"; +delete_dn "$LDIF3"; +delete_dn "$LDIF4"; + +run_valgrind_and_osyncplugin +delete_rv=$? + + + +echo +echo +echo + +echo "add_rv = $add_rv"; +echo "modify_rv = $modify_rv"; +echo "delete_rv = $delete_rv"; + +echo +echo +echo + +if test $add_rv -ne 0 -o $modify_rv -ne 0 -o $delete_rv -ne 0; then + echo "Valgrind has reported memory errors." + exit 1 +fi + +echo +echo +echo Added: plugins/ldap-sync/tests/check_connect ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/tests/check_connect Thu Mar 26 01:17:22 2009 (r5337) @@ -0,0 +1,34 @@ +#!/bin/bash + +# Call as check_connect /path/to/ldap-sync/build/dir /path/to/ldap-sync/src/dir +# +# E.g.: +# ./check_connect /home/user1/dev/plugins/ldap-sync/build_debug /home/user1/dev/plugins/ldap-sync + +set -x + +FILE=$0 +PLUGINNAME="ldap-sync" +PLUGINPATH="$1/src" +CFG="$2/src/$PLUGINNAME" + +OSYNCPLUGIN=$(which osyncplugin 2>/dev/null) +if test ! -f "$OSYNCPLUGIN"; then + echo "$FILE:$LINENO: ERROR: osyncplugin could not be found. Exiting." + exit 1 +fi + +if test ! -x "$OSYNCPLUGIN"; then + echo "$FILE:$LINENO: ERROR: osyncplugin could be found, but it is not executable. Exiting." + exit 1 +fi + + +echo "${PLUGINPATH} ${CFG}" + +TMPDIR=`mktemp -d /tmp/ldap_sync_test.XXXXXX` || exit 1 + +echo "$OSYNCPLUGIN --plugin $PLUGINNAME --pluginpath $PLUGINPATH --config $CFG --configdir $TMPDIR --initialize --connect --disconnect --finalize" + +$OSYNCPLUGIN --plugin $PLUGINNAME --pluginpath $PLUGINPATH --config $CFG --configdir $TMPDIR --initialize --connect --disconnect --finalize || exit 1 + Added: plugins/ldap-sync/tests/check_delete_and_fastsync ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/tests/check_delete_and_fastsync Thu Mar 26 01:17:22 2009 (r5337) @@ -0,0 +1,121 @@ +#!/bin/bash + +# Call as check_add_and_sync /path/to/ldap-sync/build/dir /path/to/ldap-sync/src/dir +# E.g.: +# ./check_add_and_sync /home/user1/dev/plugins/ldap-sync/build /home/user1/dev/plugins/ldap-sync contact2.ldif + +set -x + +FILE=$0 +PLUGINNAME="ldap-sync" +PLUGINPATH="$1/src" +CFG="$2/src/$PLUGINNAME" +LDIF=$3 + + +echo "PLUGINPATH = \"$PLUGINPATH\"" +echo "CFG = \"$CFG\"" +echo "LDIF = \"$LDIF\"" + + +SOURCE_DIR=`dirname $FILE` +if test ! -d "$SOURCE_DIR"; then + echo "$FILE:$LINENO: ERROR: \"$SOURCE_DIR\" is not a directory. Exiting." + exit 1 +fi + +if test ! -r "$SOURCE_DIR/test.conf"; then + echo "$FILE:$LINENO: ERROR: \"$SOURCE_DIR/test.conf\" could not be read. Exiting." + exit 1 +fi + +source "$SOURCE_DIR/test.conf" + +if test -z "$AUTH"; then + echo "$FILE:$LINENO: ERROR: \$AUTH is empty. Exiting."; + exit 1 +fi + + +LDAPDELETE=$(which ldapdelete 2>/dev/null) + +if test ! -f "$LDAPDELETE"; then + echo "$FILE:$LINENO: ERROR: ldapdelete could not be found. Exiting." + exit 1 +fi + +if test ! -x "$LDAPDELETE"; then + echo "$FILE:$LINENO: ERROR: ldapdelete could be found, but is not executable. Exiting." + exit 1 +fi + + + + +OSYNCPLUGIN=$(which osyncplugin 2>/dev/null) +if test ! -f "$OSYNCPLUGIN"; then + echo "$FILE:$LINENO: ERROR: osyncplugin could not be found. Exiting." + exit 1 +fi + +if test ! -x "$OSYNCPLUGIN"; then + echo "$FILE:$LINENO: ERROR: osyncplugin could be found, but it is not executable. Exiting." + exit 1 +fi + + + +WHOAMI=$(which whoami 2>/dev/null) +if test -n "$WHOAMI"; then + if test -x "$WHOAMI"; then + echo -n "This script $FILE is running under the login name: "; + $WHOAMI; + fi +fi + +echo "AUTH = \"$AUTH\"" + + +if test ! -f "$LDIF"; then + echo "$FILE:$LINENO: ERROR: \"$LDIF\" could not be found. Exiting."; + exit 1; +fi + +if test ! -r "$LDIF"; then + echo "$FILE:$LINENO: ERROR: \"$LDIF\" could be found, but it is not readable. Exiting."; + exit 1; +fi + + + +DN_FULL=$(head -n 1 $LDIF) +if test -z "$DN_FULL"; then + echo "$FILE:$LINENO: ERROR: \$DN_FULL is empty. Exiting." + exit 1; +fi + +DN=${DN_FULL#dn:} +if test -z "$DN"; then + echo "$FILE:$LINENO: ERROR: \$DN is empty. Exiting." + exit 1; +fi + +echo "To be deleted: \"$DN\"" +echo "Command: $LDAPDELETE $AUTH -r $DN" + +$LDAPDELETE $AUTH -r $DN +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: ldapdelete has failed. Exiting." + exit $rv; +fi + + + + +echo "${PLUGINPATH} ${CFG}" + +TMPDIR=`mktemp -d /tmp/ldap_sync_test.XXXXXX` || exit 1 + +$OSYNCPLUGIN --plugin $PLUGINNAME --pluginpath $PLUGINPATH --config $CFG --configdir $TMPDIR --initialize --connect --fastsync --syncdone --disconnect --finalize || exit 1 + Added: plugins/ldap-sync/tests/check_fastsync ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/tests/check_fastsync Thu Mar 26 01:17:22 2009 (r5337) @@ -0,0 +1,33 @@ +#!/bin/bash + +# Call as check_fastsync /pa... [truncated message content] |
From: <svn...@op...> - 2009-03-26 00:13:55
|
Author: scriptor Date: Thu Mar 26 01:13:36 2009 New Revision: 5334 URL: http://www.opensync.org/changeset/5334 Log: Initial version of the LDAP plugin having been ported to libopensync-0.3x. Added: plugins/ldap-sync/misc/ plugins/ldap-sync/misc/clean_ldap.sh (contents, props changed) Added: plugins/ldap-sync/misc/clean_ldap.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/misc/clean_ldap.sh Thu Mar 26 01:13:36 2009 (r5334) @@ -0,0 +1,122 @@ +#!/bin/bash + +# $Id$ + +file=`basename $0` +tmpfile="/tmp/list" + +# 1 is FALSE or "No, do NOT delete it." in bash. +# 0 is TRUE or "Yes, delete it." +# Or I should have better said, empty it. +delete_addressbook=1 +delete_calendar=1 +delete_todo=1 +delete_note=1 + +binddn="cn=ldap_user,dc=example,dc=com" +user="ldap_user" +password="secret" +sasl_mechanism="DIGEST-MD5" + +#auth="-x -D \"$binddn\" -w \"$password\" " +auth="-U \"$user\" -w \"$password\" -Y \"$sasl_mechanism\"" + + +addressbook='ou=addressbook,dc=example,dc=com' +calendar='ou=calendar,dc=example,dc=com' +todo='ou=todo,dc=example,dc=com' +note='o=notes,dc=example,dc=com' + + +if test -f "$tmpfile"; then + rm -f "$tmpfile"; +fi + +if test -f "$tmpfile"; then + echo "$file:$LINENO: ERROR: $tmpfile already exists and is NOT writable. Exiting." + exit 1 +fi + + + +run_command() +{ + cmd=$1 + + #echo "cmd = \"$cmd\"" + if test -n "$cmd"; then + eval $cmd + rv=$? + + if test $rv -ne 0; then + echo -e "The command \n\n$cmd\n\nhas failed. Exiting." + exit + fi + + return $rv + fi +} + + + +############### addressbook ################# +if test $delete_addressbook -eq 0; then + # What is to be deleted? + run_command "ldapsearch $auth -LLL -A -s one -b \"$addressbook\" 'dn' | awk 'BEGIN {RS = \"\n\n\"} {gsub(\"dn: \", \"\"); gsub(/\n /, \"\"); print}' > $tmpfile" + + + # Clear all the entries of the addressbook: + if test -s "$tmpfile"; then + run_command "ldapdelete $auth -r -c -f $tmpfile" + fi + + + # Check the result: + run_command "ldapsearch $auth -LLL -s sub -b \"$addressbook\"" +fi + + +############# calendar ################## +if test $delete_calendar -eq 0; then + run_command "ldapsearch $auth -LLL -s one -A -b \"$calendar\" 'dn' | awk 'BEGIN {RS = \"\n\n\"} {gsub(\"dn: \", \"\"); gsub(/\n /, \"\"); print}' > $tmpfile" + + # Clear all the entries of the calendar: + if test -s "$tmpfile"; then + run_command "ldapdelete $auth -r -f $tmpfile" + fi + + # Check the result: + run_command "ldapsearch $auth -LLL -s sub -b \"$calendar\"" +fi + + + +############# todo ################## +if test $delete_todo -eq 0; then + run_command "ldapsearch $auth -LLL -s one -A -b \"$todo\" 'dn' | awk 'BEGIN {RS = \"\n\n\"} {gsub(\"dn: \", \"\"); gsub(/\n /, \"\"); print}' > $tmpfile" + + # Clear all the entries of the todo's: + if test -s "$tmpfile"; then + run_command "ldapdelete $auth -r -f $tmpfile" + fi + + # Check the result: + run_command "ldapsearch $auth -LLL -s sub -b \"$todo\"" +fi + + + +############## notes #################### +if test $delete_note -eq 0; then + # What is to be deleted? + run_command "ldapsearch $auth -LLL -s one -A -b \"$note\" 'dn' | awk 'BEGIN {RS = \"\n\n\"} {gsub(\"dn: \", \"\"); gsub(/\n /, \"\"); gsub(/^ou=.+$/, \"\"); print}' > $tmpfile" + + # Clear all the entries of the notes: + if test -s "$tmpfile"; then + run_command "ldapdelete $auth -r -f $tmpfile" + fi + + # Check the result: + run_command "ldapsearch $auth -LLL -s sub -b \"$note\"" +fi + |
From: <svn...@op...> - 2009-03-26 00:13:24
|
Author: scriptor Date: Thu Mar 26 01:13:12 2009 New Revision: 5333 URL: http://www.opensync.org/changeset/5333 Log: Initial version of the LDAP plugin having been ported to libopensync-0.3x. Added: plugins/ldap-sync/README.txt (contents, props changed) Added: plugins/ldap-sync/README.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/README.txt Thu Mar 26 01:13:12 2009 (r5333) @@ -0,0 +1,3167 @@ +opensync-plugin-ldap-0.39 + +by Juergen Leising (c) 2009 + +Table of Contents + +Part I Installation + 1 Compiling the source code with cmake + 1.1 The following cmake modules are required for the LDAP plugin + 1.2 Regular build + 1.3 Debug build + 1.4 Build doxygen based documentation of the source code + 2 Tests + 2.1 Required software + 2.2 Running the tests + 2.3 Display a list of tests + 2.4 Run only one particular test +Part II Configuration + 3 Prepare the LDAP server “slapd” + 3.1 Configure the LDAP server + 3.2 Syntax test of the configuration file + 3.3 Build the directory information tree (= DIT) + 3.3.1 Establish an addressbook + 3.3.2 Estalish a calendar + 3.3.3 Establish the todo's + 3.3.4 Establish notes + 4 The different authentication methods with the LDAP server + 4.1 The “simple” authentication + 4.2 Configure the SASL library + 4.3 SASL/DIGEST-MD5 + 4.4 SASL/CRAM-MD5 + 4.5 SASL/PLAIN over an encrypted connection + 4.6 SASL/LOGIN over an encrypted connection + 4.7 SASL/GSSAPI (KERBEROS V5) + 4.7.1 Preparing KERBEROS V5 + DNS configuration + Determine realm on a fedora 10 system + Configure main configuration file for kerberos + Configure configuration file of the KDC, i.e. for issuing tickets per realm + Create the database for this particular realm EXAMPLE.COM and a stash file for the server to authenticate itself using the password “master” + Grant administrative access + Add administrative principals to the Kerberos database + Create service principal "ldap/host.example.com" + Create keytab file for service principal "ldap" + Adjust permissions: The keytab file must be readable by the LDAP server + Create the user principal "ldap_user" with password "secret" + Useful commands + Adjust SELinux + Start up the kdc on a fedora system + Kerberos related log files + 4.7.2 Configure the opensync-plugin-ldap: + 4.7.3 Using KERBEROS with SASL + 4.8 SASL/EXTERNAL using the TLS cert used in a TLS encrypted connection + 4.8.1 Generate server and client certificates + 4.8.2 Configuration of the LDAP server + 4.8.3 Configuration of the LDAP client side + 4.8.4 Configure the opensync-plugin-ldap +Part III Usage + 5 Synchronizing between evolution and LDAP + 6 Useful LDAP commands + 7 Extra section: How to integrate mutt with the LDAP server + 7.1 Installation of LBDB on fedora 10 + 7.2 Configure lbdb + 7.3 Configure mutt + 7.4 Using mutt + 7.5 Links +Part IV Development + 8 Function names + 9 Error messages + 10 Format/mapping problems + 11 Documentation +Part V Troubleshooting + 12 Enable debug output + 12.1 Enable trace files with libopensync and libopensync-plugin-ldap + 12.2 Enable trace files with libsyncml + 12.3 Enable debug output with the LDAP server slapd on fedora 10 + 12.4 How to debug the format conversions with the ldap-sync plugin + 13 CMakeError: MACRO_ENSURE_OUT_OF_SOURCE_BUILD + 14 Debugging hints for SASL + 14.1 Which SASL mechanisms are supported by the LDAP library + 14.1.1 With unencrypted sessions + 14.1.2 With encrypted sessions + 14.2 Display the TLS certificates + 14.3 Make the debug output of slapd visible + 15 Debugging the style sheets + 15.1 How to observe the mapping step from xmlformat_contact to ldap_inetorgperson + 15.2 Example file contact4.xml + 15.3 Check the mapping step from xmlformat_contact to ldap_inetorgperson + 15.4 Alternative parsers + 16 ERROR: (mod->mod_vals.modv_strvals) is NULL + 17 LDAP ERROR: No such object (32) + 18 LDAP ERROR: Invalid credentials (49) +Part VI References + + + + + +Installation + +1 Compiling the source code with cmake + +1.1 The following cmake modules are required for the LDAP plugin + +• FindLibLdap.cmake + +• FindLibGCrypt.cmake + +• FindLibSASL2.cmake + +• FindLibGSSAPIV2.cmake + +See the directory cmake/modules. + +1.2 Regular build + +tar -xvjf libopensync-plugin-ldap-0.39.tar.bz2 + +cd libopensync-plugin-ldap-0.39 + +mkdir build + +cd build + +PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/" cmake +-DCMAKE_INSTALL_PREFIX=/usr/local -DUPDATE_TYPE=svn +/home/user1/libopensync-plugin-ldap-0.39 + +make -s + +sudo make -s install + +sudo ldconfig + +cd ../.. + +1.3 Debug build + +tar -xvjf libopensync-plugin-ldap-0.39.tar.bz2 + +cd libopensync-plugin-ldap-0.39 + +mkdir build_debug + +cd build_debug + +PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/" cmake +-DCMAKE_INSTALL_PREFIX=/usr/local -DUPDATE_TYPE=svn +-DCMAKE_BUILD_TYPE=Debug -DCMAKE_VERBOSE_MAKEFILE=ON +/home/user1/libopensync-plugin-ldap-0.39 + +make -s + +sudo make -s install + +sudo ldconfig + +cd ../.. + +1.4 Build doxygen based documentation of the source code + +cd build + +make doxygen + +firefox doc/html/index.html & + +2 Tests + +There is a "test" target. It is primarily intended for +developers. Tests which I expect to fail are commented out in the +CMakeLists.txt. + +2.1 Required software + +The tests make use of external tools, most notably: + +• xmllint + +• xsltproc + +• ldapsearch + +• ldapadd + +• ldapmodify + +• ldapdelete + +• valgrind + +2.2 Running the tests + +cd build + +make test + +2.3 Display a list of tests + +cd build + +ctest -N + +2.4 Run only one particular test + +cd build + +ctest -I 51,51 + +ctest -R remove_test_ldifs + +Configuration + +3 Prepare the LDAP server “slapd” + +3.1 Configure the LDAP server + +vim /etc/openldap/slapd.conf + +(...) + +include /etc/openldap/schema/core.schema + +include /etc/openldap/schema/inetorgperson.schema + +include /etc/openldap/schema/evolutionperson.schema + +(...) + +database bdb + +suffix "dc=example,dc=com" + +checkpoint 1024 15 + +####### Root<rootdn> account, “simple” authentication + +rootdn "cn=root,dc=example,dc=com" + +rootpw password + + + +### Mappings to gain the bind-DN's in order + +### to answer the question about access rights + +### for SASL based authentication: + +authz-regexp + + uid=([^,]*),cn=digest-md5,cn=auth + + cn=$1,dc=example,dc=com + + + +authz-regexp + + uid=([^,]*),cn=cram-md5,cn=auth + + cn=$1,dc=example,dc=com + + + +authz-regexp + + uid=([^,]*),cn=plain,cn=auth + + cn=$1,dc=example,dc=com + + + +authz-regexp + + uid=([^,]*),cn=login,cn=auth + + cn=$1,dc=example,dc=com + + + +authz-regexp + + uid=([^,]*),cn=gssapi,cn=auth + + cn=$1,dc=example,dc=com + + + +authz-regexp + + +email=([^@]+)@host\.([^.]+)\.([^,]+),cn=host\.example\.com,ou=[^#]+[^\ +]+\ ldap\ client\ [^,]+,o=a\ private\ site\.,st=city,c=us + + cn=$1,dc=$2,dc=$3 + + + +sasl-host host.example.com + + + +### Minimal access rights for a given bind-DN: + +access to dn.subtree="ou=addressbook,dc=example,dc=com" by users +write + +access to dn.subtree="ou=calendar,dc=example,dc=com" by users +write + +access to dn.subtree="ou=todo,dc=example,dc=com" by users write + +access to dn.subtree="o=notes,dc=example,dc=com" by users write + + + +access to dn.base="cn=Subschema" by * read + +access to dn.one="ou=people,dc=example,dc=com" by * read + +directory /var/lib/ldap + +(...) + +3.2 Syntax test of the configuration file + +slapd -Ttest + +3.3 Build the directory information tree (= DIT) + +We are going to create a hierarchical tree like this one: + +<Graphics file: /tmp/dit1.tiff> + +ou=people will contain the user accounts for the so-called “ +simple” authentication method. + +ou=addressbook is intended to store entries for object type “ +contact” (object type here is a libopensync specific term; not to +be confused with “object class”, which is an LDAP specific term). + +ou=calendar is for object type “event”. + +ou=todo is for object type “todo”. Applications often refer to +this as “tasks”. + +o=notes is for object type “note”. The object class “organization” + has been chosen here just to demonstrate that this decision has +been made in an arbitrary way. A dedicated LDAP schema is +currently used for object “contact”, only. All the other object +types currently use general object classes, which will hopefully +be changed eventually. + +Establish the root subtree “dc=example,dc=com”, which is to hold +the people subtree, the addressbook subtree, the todo subtree and +the notes subtree. + +vim root1.ldif + +dn: dc=example,dc=com + +objectClass: top + +objectClass: dcObject + +objectClass: organizationalUnit + +dc: example + +ou: top node of LDAP Server + +Now add this to the DIT: + +ldapadd -x -D "cn=root,dc=example,dc=com" -w password -a -f +root1.ldif + +3.3.1 Establish an addressbook + +We use the LDAP root DN and the LDAP root password to establish +an addressbook: + +vim addressbook.ldif + +dn: ou=addressbook,dc=example,dc=com + +objectClass: top + +objectClass: organizationalUnit + +ou: addressbook + +description: Personal Addressbook + +Now add this LDIF file: + +ldapadd -x -D "cn=root,dc=example,dc=com" -w password -a -f +addressbook.ldif + +3.3.2 Estalish a calendar + +vim calendar1.ldif + +dn: ou=calendar,dc=example,dc=com + +objectClass: top + +objectClass: organizationalUnit + +ou: calendar + +description: Calendar + +Now add this LDIF file: + +ldapadd -x -D "cn=root,dc=example,dc=com" -w password -a -f +calendar1.ldif + +3.3.3 Establish the todo's + +vim todo1.ldif + +dn: ou=todo,dc=example,dc=com + +objectClass: top + +objectClass: organizationalUnit + +ou: todo + +description: Calendar + +Now add this LDIF file to the DIT: + +ldapadd -x -D "cn=root,dc=example,dc=com" -w password -a -f +todo1.ldif + +3.3.4 Establish notes + +vim notes.ldif + +dn: o=notes,dc=example,dc=com + +objectClass: top + +objectClass: dcObject + +objectClass: organization + +dc: notes + +o: notes + +description: Notes + +Now add this LDIF file: + +ldapadd -x -D "cn=root,dc=example,dc=com" -w password -a -f +notes.ldif + +4 The different authentication methods with the LDAP server + +4.1 The “simple” authentication + +<simple_authentication>The credentials for the “simple” +authentication can be configured either in slapd.conf itself or +in the LDAP DIT, i.e. in a particular database. We have already +used the first method for the LDAP root DN (see above [rootdn]). +Now we are going to use the second method for an ordinary user “ +ldap_user”: + +vim ldap_user.ldif + + + +dn: ou=people,dc=example,dc=com + +objectClass: organizationalUnit + +description: LDAP user accounts. + + + +dn: cn=ldap_user,ou=people,dc=example,dc=com + +objectClass: inetOrgPerson + +cn: ldap_user + +sn: ldap_user + +givenname: ldap_user + +mail: lda...@ex... + +telephonenumber: 000-000-0001 + + + +We use the LDAP root DN and the LDAP root password to add this +entry to the DIT: + +ldapadd -x -D "cn=root,dc=example,dc=com" -w "password" -f +ldap_user.ldif + + + +Provide “ldap_user” with the password “secret”. Note the +difference between -w and -s: We authenticate ourselves as root +(in terms of LDAP: root-DN with the corresponding password as +configured in slapd.conf) + +ldappasswd -x -D "cn=root,dc=example,dc=com" -w "password" -s +"secret" "cn=ldap_user,ou=people,dc=example,dc=com" + +4.2 Configure the SASL library + +<sasl_in_general>Which SASL mechanisms does the SASL library +offer? + +sasl2-shared-mechlist + +Available mechanisms: +DIGEST-MD5,GSSAPI,CRAM-MD5,LOGIN,PLAIN,ANONYMOUS + +Library supports: +EXTERNAL,ANONYMOUS,PLAIN,LOGIN,CRAM-MD5,GSSAPI,DIGEST-MD5 + +<sasl_mechanisms_offered_by_slapd>Which SASL mechanisms are +supported by the LDAP server slapd with unencrypted sessions? + +ldapsearch -x -b "" -s base -LLL supportedSASLMechanisms + +dn: + +supportedSASLMechanisms: DIGEST-MD5 + +supportedSASLMechanisms: GSSAPI + +supportedSASLMechanisms: CRAM-MD5 + +Which SASL mechanisms are supported by the LDAP server slapd with +encrypted sessions: + +ldapsearch -x -b "" -s base -LLL -Z supportedSASLMechanisms + +dn: + +supportedSASLMechanisms: DIGEST-MD5 + +supportedSASLMechanisms: GSSAPI + +supportedSASLMechanisms: CRAM-MD5 + +supportedSASLMechanisms: LOGIN + +supportedSASLMechanisms: PLAIN + + + +Configure SASL: + +The SASL library is configured with respect to slapd in a file +called “slapd.conf”. This file is located in /usr/lib/sasl2/ and +it MUST NOT be confused with /etc/openldap/slapd.conf. + +The mech_list in the following file determines which +authentication mechanisms are to be supported by libsasl: + +Cf. cyrus-sasl-lib-2.1.22/options.html in the source code of the +sasl library. + +vim /usr/lib/sasl2/slapd.conf + +pwcheck_method: saslauthd auxprop + +mech_list: plain login cram-md5 digest-md5 gssapi external +anonymous + +keytab: /etc/krb5.keytab + +log_level: 7 + +<sasldb_account>Create the account for “ldap_user” in the SASL +database as root: + +saslpasswd2 -c ldap_user + +Check the result as root: + +sasldblistusers2 + +ld...@ho...: userPassword + +Do the various mechanisms work as expected? + +As root in an xterm: + +sasl2-sample-server -s ldap + +(...) + +DIGEST-MD5 GSSAPI CRAM-MD5 LOGIN PLAIN ANONYMOUS + +As a simple user in another xterm: + +sasl2-sample-client -m PLAIN localhost + +sasl2-sample-client -m DIGEST-MD5 localhost + +sasl2-sample-client -m CRAM-MD5 localhost + +sasl2-sample-client -m LOGIN localhost + +sasl2-sample-client -m ANONYMOUS localhost + + + +Assuming the Kerberos V5 system is already configured. See below [kerberosv5] +. + +kinit -V ldap_user + +sasl2-sample-client -s ldap -m GSSAPI host.example.com + + + + + +4.3 SASL/DIGEST-MD5 + +<digest_md5>SASL using DIGEST-MD5 with the password being stored +in the sasldb as shown above under [sasldb_account]. For the +authentication itself nothing else has to be configured. + +For the access rules to work the authentication identifier +(bind-DN) can be rewritten by these lines in +/etc/openldap/slapd.conf: + +authz-regexp + + uid=([^,]*),cn=digest-md5,cn=auth + + cn=$1,dc=example,dc=com + +Configure the opensync-plugin-ldap: + + osynctool --configure "sync_ldap_with_evolution" 2 + + + +<AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>authcid</Name> + + <Type>string</Type> + + <Value>ldap_user</Value> + +</AdvancedOption> + +<AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>password</Name> + + <Type>string</Type> + + <Value>secret</Value> + +</AdvancedOption> + +<AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>anonymous</Name> + + <Type>string</Type> + + <Value>0</Value> + +</AdvancedOption> + +<AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>authmech</Name> + + <Type>string</Type> + + <Value>DIGEST-MD5</Value> + +</AdvancedOption> + +Any configuration setting performed by “osynctool --configure ...” + must additionally be set into effect by: + +osynctool --discover "sync_ldap_with_evolution" + +4.4 SASL/CRAM-MD5 + +SASL using CRAM-MD5 with the password being stored in the sasldb +as shown above under [sasldb_account]. For the authentication +itself nothing else has to be configured. + +For the access rules to work the authentication identifier +(bind-DN) can be rewritten by these lines in +/etc/openldap/slapd.conf: + +authz-regexp + + uid=([^,]*),cn=cram-md5,cn=auth + + cn=$1,dc=example,dc=com + +Configure the opensync-plugin-ldap: + +osynctool --configure "sync_ldap_with_evolution" 2 + + + +<AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>authcid</Name> + + <Type>string</Type> + + <Value>ldap_user</Value> + +</AdvancedOption> + +<AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>password</Name> + + <Type>string</Type> + + <Value>secret</Value> + +</AdvancedOption> + +<AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>anonymous</Name> + + <Type>string</Type> + + <Value>0</Value> + +</AdvancedOption> + +<AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>authmech</Name> + + <Type>string</Type> + + <Value>CRAM-MD5</Value> + +</AdvancedOption> + +Any configuration setting performed by “osynctool --configure ...” + must additionally be set into effect by: + +osynctool --discover "sync_ldap_with_evolution" + +4.5 SASL/PLAIN over an encrypted connection + +SASL using the PLAIN mechanism with the password being stored in +the sasldb. The default configuration of newer slapd versions +does not accept such an insecure authentication method without +encryption. See above under [sasl_mechanisms_offered_by_slapd]. +As a consequence the ldap plugin must establish an encrypted +connection. This can be configured EITHER by setting the option “ +encryption” to 1 OR by setting a network connection that leads to +a port used for encrypted sessions only: + +osynctool --configure "sync_ldap_with_evolution" 2 + + + +<AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>authcid</Name> + + <Type>string</Type> + + <Value>ldap_user</Value> + +</AdvancedOption> + +<AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>password</Name> + + <Type>string</Type> + + <Value>secret</Value> + +</AdvancedOption> + +<AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>anonymous</Name> + + <Type>string</Type> + + <Value>0</Value> + +</AdvancedOption> + +<AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>authmech</Name> + + <Type>string</Type> + + <Value>PLAIN</Value> + +</AdvancedOption> + + + +(...) + + + +<AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>encryption</Name> + + <Type>string</Type> + + <Value>1</Value> + +</AdvancedOption> + + + +(...) + + + +<Connection> + + <encrypted_connection1> +<ActiveConnection>Network</ActiveConnection> + + <Network> + + <Address>host.example.com</Address> + + <Port>636</Port> + + <Protocol>ldaps</Protocol> + + </Network> + +</Connection> + +Any configuration setting performed by “osynctool --configure ...” + must additionally be set into effect by: + +osynctool --discover "sync_ldap_with_evolution" + +For the access rules to work the authentication identifier +(bind-DN) can be rewritten by these lines in +/etc/openldap/slapd.conf: + +authz-regexp + + uid=([^,]*),cn=plain,cn=auth + + cn=$1,dc=example,dc=com + +4.6 SASL/LOGIN over an encrypted connection + +SASL using LOGIN with the password being stored in the sasldb. +The default configuration of newer slapd versions does not accept +such an insecure authentication method without encryption. See +above under [sasl_mechanisms_offered_by_slapd]. As a consequence +the ldap plugin must establish an encrypted connection. This can +be configured EITHER by setting the option “encryption” to 1 OR +by setting a network connection that leads to a port used for +encrypted sessions only: + +osynctool --configure "sync_ldap_with_evolution" 2 + + + +(...) + + + +<AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>authcid</Name> + + <Type>string</Type> + + <Value>ldap_user</Value> + +</AdvancedOption> + +<AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>password</Name> + + <Type>string</Type> + + <Value>secret</Value> + +</AdvancedOption> + +<AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>anonymous</Name> + + <Type>string</Type> + + <Value>0</Value> + +</AdvancedOption> + +<AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>authmech</Name> + + <Type>string</Type> + + <Value>PLAIN</Value> + +</AdvancedOption> + + + +(...) + + + +<AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>encryption</Name> + + <Type>string</Type> + + <Value>1</Value> + +</AdvancedOption> + + + +(...) + + + +<Connection> + + <ActiveConnection>Network</ActiveConnection> + + <Network> + + <Address>host.example.com</Address> + + <Port>636</Port> + + <Protocol>ldaps</Protocol> + + </Network> + +</Connection> + +Any configuration setting performed by “osynctool --configure ...” + must additionally be set into effect by: + +osynctool --discover "sync_ldap_with_evolution" + +For the access rules to work the authentication identifier +(bind-DN) can be rewritten by these lines in +/etc/openldap/slapd.conf: + +authz-regexp + + uid=([^,]*),cn=login,cn=auth + + cn=$1,dc=example,dc=com + +4.7 SASL/GSSAPI (KERBEROS V5) + +<kerberosv5>SASL using GSSAPI with the password being stored in +the kerberos subsystem. This has the advantage that the password +is not sent over the connection to the LDAP server. + +4.7.1 Preparing KERBEROS V5 + + DNS configuration + +Check resolver settings: + +vim /etc/nsswitch.conf + +(...) + +hosts: files dns + +(...) + +Add "kerberos" host name to DNS: + +vim /etc/hosts + +192.168.1.2 host.example.com host www kerberos + +Propagate KDCs via SRV record types in terms of RFC 2782: + +vim /etc/dnsmasq.conf + +srv-host=_kerberos._udp,host.example.com,88 + +srv-host=_kerberos-master._udp,host.example.com,88 + +srv-host=_kerberos-adm._tcp,host.example.com,749 + +srv-host=_kpasswd._udp,host.example.com,464 + +Make changes effective: + +service dnsmasq restart + +Test it: + +host kerberos + + Determine realm on a fedora 10 system + +vim /etc/sysconfig/krb5kdc + +KRB5KDC_ARGS= + +KRB5REALM=EXAMPLE.COM + + Configure main configuration file for kerberos + +vim /etc/krb5.conf + +[libdefaults] + + default_realm = EXAMPLE.COM + + dns_lookup_realm = false + + dns_lookup_kdc = false + + ticket_lifetime = 24h + + forwardable = yes + + + +[realms] + + EXAMPLE.COM = { + + kdc = host.example.com:88 + + kdc = kerberos.example.com:88 + + kdc = localhost.localdomain:88 + + kdc = localhost + + admin_server = kerberos.example.com:749 + + default_domain = example.com + + } + + + +[domain_realm] + + .example.com = EXAMPLE.COM + + example.com = EXAMPLE.COM + + localdomain = EXAMPLE.COM + + .localdomain = EXAMPLE.COM + + Configure configuration file of the KDC, i.e. for issuing + tickets per realm + +vim /var/kerberos/krb5kdc/kdc.conf + +[kdcdefaults] + + v4_mode = nopreauth + + kdc_ports = 88,750 + + kdc_tcp_ports = 88 + + + +[realms] + + EXAMPLE.COM = { + + acl_file = /var/kerberos/krb5kdc/kadm5.acl + + dict_file = /usr/share/dict/words + + admin_keytab = /var/kerberos/krb5kdc/kadm5.keytab + + supported_enctypes = aes256-cts:normal aes128-cts:normal +des3-hmac-sha1:normal arcfour-hmac:normal des-hmac-sha1:normal +des-cbc-md5:normal des-cbc-crc:normal des-cbc-crc:v4 +des-cbc-crc:afs3 + + } + + Create the database for this particular realm EXAMPLE.COM and a + stash file for the server to authenticate itself using the + password “master” + +If you choose not to install a stash file, the KDC will prompt +you for the master key each time it starts up. This means that +the KDC will not be able to start automatically, such as after a +system reboot. + +kdb5_util create -r EXAMPLE.COM -s + +(...) + +Enter KDC database master key: master + +Re-enter KDC database master key to verify: master + + Grant administrative access + +vim /var/kerberos/krb5kdc/kadm5.acl + +*/ad...@EX... * + + Add administrative principals to the Kerberos database + +kadmin.local -q "addprinc root/admin" + +(...) + + Create service principal "ldap/host.example.com" + +kadmin.local -q "addprinc ldap/host.example.com" + +(...) + + Create keytab file for service principal "ldap" + +kadmin.local -q "ktadd ldap/host.example.com" + +(...) + + Adjust permissions: The keytab file must be readable by the + LDAP server + +For a dissenting opinion on this (suggests building a second +keytab file): Cf. [http://www.openldap.org/faq/index.cgi?_highlightWords=keytab&file=630||http://www.openldap.org/faq/index.cgi?_highlightWords=keytab&file=630] + +chown root:ldap /etc/krb5.keytab + +chmod g+r /etc/krb5.keytab + + Create the user principal "ldap_user" with password "secret" + +useradd ldap_user + +(...) + + + +passwd ldap_user + +(...) + + + +kadmin.local -q "addprinc ldap_user" + +(...) + + Useful commands + +kadmin.local -q "list_principals" + +(...) + + + +ktutil + +ktutil: read_kt /etc/krb5.keytab + +ktutil: list + +(...) + +ktutil: quit + + + +kadmin.local -q "get_principal ldap" + +(...) + + + +kadmin.local -q "get_principal ldap_user" + +(...) + + Adjust SELinux + +setsebool -P allow_kerberos 1 + + Start up the kdc on a fedora system + +chkconfig --level 345 kadmin on + +chkconfig --level 345 krb5kdc on + +service krb5kdc start + +service kadmin start + + Kerberos related log files + +tail -f /var/log/krb5kdc.log + +(...) + + + +tail -f /var/log/kadmind.log + +(...) + +4.7.2 Configure the opensync-plugin-ldap: + +osynctool --configure "sync_ldap_with_evolution" 2 + + + +(...) + +<AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>authcid</Name> + + <Type>string</Type> + + <Value>ldap_user</Value> + +</AdvancedOption> + + + +(...) + + + +<AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>anonymous</Name> + + <Type>string</Type> + + <Value>0</Value> + +</AdvancedOption> + +<AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>authmech</Name> + + <Type>string</Type> + + <Value>GSSAPI</Value> + +</AdvancedOption> + +Any configuration setting performed by “osynctool --configure ...” + must additionally be set into effect by: + +osynctool --discover "sync_ldap_with_evolution" + +For the access rules to work the authentication identifier +(bind-DN) can be rewritten by these lines in +/etc/openldap/slapd.conf: + +authz-regexp + + uid=([^,]*),cn=gssapi,cn=auth + + cn=$1,dc=example,dc=com + +4.7.3 Using KERBEROS with SASL + +Retrieve a ticket-granting ticket: + +kinit -V ldap_user + +Password for lda...@EX...: secret + +Authenticated to Kerberos v5 + +Get to know the expiration date: + +klist + +(...) + +Run osynctool: + +osynctool --configure ... + +osynctool --discover ... + +osynctool --sync ... + +4.8 SASL/EXTERNAL using the TLS cert used in a TLS encrypted + connection + +SASL using the EXTERNAL mechanism with both the identifier and +the password being stored in the SSL/TLS subsystem. + +4.8.1 Generate server and client certificates + +<tls_certs>cd /etc/openldap/cacerts/ + +Create server certificate signing request and server key + +openssl req -new -nodes -out server.csr -keyout server.key + +Sign the server certificate + +openssl ca -policy policy_anything -out server.crt -infiles +./server.csr + +Display contents of the LDAP server certificate + +openssl x509 -text -in server.crt + +Create client certificate signing request and client key + +openssl req -new -nodes -out client.csr -keyout client.key + +Sign the client certificate + +openssl ca -out client.crt -infiles ./client.csr + +Display contents of the LDAP client certificate + +openssl x509 -text -in client.crt + +4.8.2 Configuration of the LDAP server + +Tell slapd about the TLS key and the TLS certificate: + +vim /etc/openldap/slapd.conf + +TLSCACertificatePath /etc/openldap/cacerts + +TLSCipherSuite HIGH:MEDIUM:+SSLv2:RSA + +TLSCertificateFile /etc/openldap/cacerts/server.crt + +TLSCertificateKeyFile /etc/openldap/cacerts/server.key + +Change slapd start up options on a fedora 10 system + +vim /etc/sysconfig/ldap + +SLAPD_LDAP=no + +SLAPD_LDAPS=yes + +For the access rules to work the authentication identifier +(bind-DN) can be rewritten by these lines in +/etc/openldap/slapd.conf: + +authz-regexp + + +email=([^@]+)@host\.([^.]+)\.([^,]+),cn=host\.example\.com,ou=[^#]+[^\ +]+\ ldap\ client\ [^,]+,o=a\ private\ site\.,st=city,c=us + + cn=$1,dc=$2,dc=$3 + +Check syntax of slapd.conf + +slapd -Ttest + +4.8.3 Configuration of the LDAP client side + +vim /etc/openldap/ldap.conf + +URI ldaps://host.example.com/ + +BASE dc=example,dc=com + +The TLS_* variables MUST NOT be configured in +/etc/openldap/ldap.conf. + +They MUST be configured in ~/ldaprc or ~/.ldaprc: + +vim /home/user1/.ldaprc + +TLS_CACERTDIR /etc/openldap/cacerts + +TLS_CACERT /etc/openldap/cacerts/server.crt + +TLS_CERT /etc/openldap/cacerts/client.crt + +TLS_KEY /etc/openldap/cacerts/client.key + +TLSCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP + +TLS_REQCERT never + +4.8.4 Configure the opensync-plugin-ldap + +osynctool --configure "sync_ldap_with_evolution" 2 + + + +(...) + + + +<AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>anonymous</Name> + + <Type>string</Type> + + <Value>0</Value> + +</AdvancedOption> + +<AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>authmech</Name> + + <Type>string</Type> + + <Value>EXTERNAL</Value> + +</AdvancedOption> + + + +(...) + + + +<AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>encryption</Name> + + <Type>string</Type> + + <Value>1</Value> + +</AdvancedOption> + + + +(...) + + + +<Connection> + + <ActiveConnection>Network</ActiveConnection> + + <Network> + + <Address>host.example.com</Address> + + <Port>636</Port> + + <Protocol>ldaps</Protocol> + + </Network> + +</Connection> + +Any configuration setting performed by “osynctool --configure ...” + must additionally be set into effect by: + +osynctool --discover "sync_ldap_with_evolution" + +Usage + +5 Synchronizing between evolution and LDAP + +If you want to start from scratch: + +osynctool --delgroup "sync_ldap_with_evolution" + +The very first configuration step: Choose a name for a particular +synchronization group: + +osynctool --addgroup "sync_ldap_with_evolution" + +Which plugins could we use for this synchronization group? + +osynctool --listplugins + +Available plugins: + +ldap-sync + +syncml-http-server + +syncml-http-client + +syncml-obex-client + +file-sync + +evo2-sync + +Here we choose the “evo2-sync” and the “ldap-sync” plugin: + +osynctool --addmember "sync_ldap_with_evolution" evo2-sync + + + +osynctool --addmember "sync_ldap_with_evolution" ldap-sync + +Which formats are available for configuring each plugin? + +osynctool --listformats + +(...) + +Format: ldap-evolutionperson + + Object Type: contact + +Format: ldap-inetorgperson + + Object Type: contact + +Format: ldap-event + + Object Type: event + +Format: ldap-todo + + Object Type: todo + +Format: ldap-note + + Object Type: note + +(...) + +Configure the evo2-sync plugin: + +osynctool --configure "sync_ldap_with_evolution" 1 + +(...) + +Configure the “ldap-sync” plugin: The following configuration +lets only the objtype “contact” be enabled. It chooses +SASL/DIGEST-MD5 as authentication mechanism with the authcid +being “ldap_user” and the password “secret”. It connects to a +host “host.example.com” on port 389 with the protocol “ldap”. + +For how to set up an encrypted connection see above [encrypted_connection1] + and [tls_certs]. + +For the “simple” authentication see above [simple_authentication] +. + +For SASL/DIGEST-MD5 see also above [digest_md5] and for how to +configure the SASL library see above [sasl_in_general]. + +osynctool --configure "sync_ldap_with_evolution" 2 + +<?xml version="1.0"?> + +<config version="1.0"> + + <AdvancedOptions> + + <AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>binddn</Name> + + <Type>string</Type> + + <Value>cn=ldap_user,ou=people,dc=example,dc=com</Value> + + </AdvancedOption> + + <AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>authcid</Name> + + <Type>string</Type> + + <Value>ldap_user</Value> + + </AdvancedOption> + + <AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>password</Name> + + <Type>string</Type> + + <Value>secret</Value> + + </AdvancedOption> + + <AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>anonymous</Name> + + <Type>string</Type> + + <Value>0</Value> + + </AdvancedOption> + + <AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>authmech</Name> + + <Type>string</Type> + + <Value>DIGEST-MD5</Value> + + </AdvancedOption> + + <AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>encryption</Name> + + <Type>string</Type> + + <Value>0</Value> + + </AdvancedOption> + + <AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>ldap_read</Name> + + <Type>string</Type> + + <Value>1</Value> + + </AdvancedOption> + + <AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>ldap_write</Name> + + <Type>string</Type> + + <Value>1</Value> + + </AdvancedOption> + + <AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>searchbase_contact</Name> + + <Type>string</Type> + + <Value>ou=addressbook,dc=example,dc=com</Value> + + </AdvancedOption> + + <AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>searchfilter_contact</Name> + + <Type>string</Type> + + <Value></Value> + + </AdvancedOption> + + <AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>storebase_contact</Name> + + <Type>string</Type> + + <Value></Value> + + </AdvancedOption> + + <AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>searchbase_event</Name> + + <Type>string</Type> + + <Value>ou=calendar,dc=example,dc=com</Value> + + </AdvancedOption> + + <AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>searchfilter_event</Name> + + <Type>string</Type> + + <Value></Value> + + </AdvancedOption> + + <AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>storebase_event</Name> + + <Type>string</Type> + + <Value></Value> + + </AdvancedOption> + + <AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>searchbase_todo</Name> + + <Type>string</Type> + + <Value>ou=todo,dc=example,dc=com</Value> + + </AdvancedOption> + + <AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>searchfilter_todo</Name> + + <Type>string</Type> + + <Value></Value> + + </AdvancedOption> + + <AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>storebase_todo</Name> + + <Type>string</Type> + + <Value></Value> + + </AdvancedOption> + + <AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>searchbase_note</Name> + + <Type>string</Type> + + <Value>o=notes,dc=example,dc=com</Value> + + </AdvancedOption> + + <AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>searchfilter_note</Name> + + <Type>string</Type> + + <Value></Value> + + </AdvancedOption> + + <AdvancedOption> + + <MaxOccurs>2147483647</MaxOccurs> + + <Max>2147483647</Max> + + <Name>storebase_note</Name> + + <Type>string</Type> + + <Value></Value> + + </AdvancedOption> + + </AdvancedOptions> + + <Connection> + + <ActiveConnection>Network</ActiveConnection> + + <Network> + + <Address>host.example.com</Address> + + <Port>389</Port> + + <Protocol>ldap</Protocol> + + </Network> + + </Connection> + + <Resources> + + <Resource> + + <Enabled>1</Enabled> + + <Formats> + + <Format> + + <Name>ldap-inetorgperson</Name> + + </Format> + + </Formats> + + <ObjType>contact</ObjType> + + </Resource> + + <Resource> + + <Enabled>1</Enabled> + + <Formats> + + <Format> + + <Name>ldap-event</Name> + + </Format> + + </Formats> + + <ObjType>event</ObjType> + + </Resource> + + <Resource> + + <Enabled>1</Enabled> + + <Formats> + + <Format> + + <Name>ldap-todo</Name> + + </Format> + + </Formats> + + <ObjType>todo</ObjType> + + </Resource> + + <Resource> + + <Enabled>1</Enabled> + + <Formats> + + <Format> + + <Name>ldap-note</Name> + + </Format> + + </Formats> + + <ObjType>note</ObjType> + + </Resource> + + </Resources> + +</config> + + + + + + + +Make the configuration become effective: + +osynctool --discover "sync_ldap_with_evolution" 1 + +osynctool --discover "sync_ldap_with_evolution" 2 + +osynctool --discover "sync_ldap_with_evolution" + +(...) + +Quickly check the “members”: + +osynctool --showgroup "sync_ldap_with_evolution" + +Group: sync_ldap_with_evolution + +Member 2: ldap-sync + +Member 1: evo2-sync + +And the object types available: + +osynctool --showobjtypes "sync_ldap_with_evolution" + +(...) + +Ok. Now we can try and synchronize the LDAP server with +evolution2: + +osynctool --sync "sync_ldap_with_evolution" + +If we want to avoid any modification and deletion, we can choose “ +--slow-sync”. This has not so much to do with just a slower +synchronization speed. It rather enforces the change type “ADDED” +for each entry of each peer. This is the best way to avoid any +data loss even in cases when problems arise: + +osynctool --sync "sync_ldap_with_evolution" --slow-sync "contact" + +osynctool --sync "sync_ldap_with_evolution" --slow-sync "event" + +6 Useful LDAP commands + +Display addressbook with anonymous access to the LDAP server: + +ldapsearch -x -LLL -s sub -b 'ou=addressbook,dc=example,dc=com' + +-x Use simple authentication instead of SASL. + +-s base|one|sub|children + +Specify the scope of the search to be one of base, one, sub, or + +children to specify a base object, one-level, subtree, or chil- + +dren search. The default is sub. Note: children scope requires + +LDAPv3 subordinate feature extension. + +-b searchbase + +Use searchbase as the starting point for the search instead of + +the default. + +Note: Anonymous access is NOT possible, if you have configured +slapd only with the access rules as proposed above. + + +Display the addressbook authenticating as ldap_user with the +simple authentication method: + +ldapsearch -x -D "cn=ldap_user,ou=people,dc=example,dc=com" -w +"secret" -LLL -s sub -b 'ou=calendar,dc=example,dc=com' + +Display the addressbook using SASL for authenticating without +specifying any particular mechanism: + +ldapsearch -U "ldap_user" -w "secret" -LLL -s sub -b +'ou=addressbook,dc=example,dc=com' + +Display the addressbook and choose explicitly CRAM-MD5 as SASL +mechanism: + +ldapsearch -Y CRAM-MD5 -U "ldap_user" -w "secret" -LLL -s sub -b +'ou=addressbook,dc=example,dc=com' + +Display the addressbook via GSSAPI after having retrieved a +ticket-granting ticket by kinit -V ldap_user: + +ldapsearch -Y GSSAPI -LLL -s sub -b +'ou=addressbook,dc=example,dc=com' + +Display one particular entry in the addressbook: + +ldapsearch -x -LLL -s sub -b 'ou=addressbook,dc=example,dc=com' +'uid=pas-id-496CB33100000065' + + ++ To get the “operational attributes”, as well. + +ldapsearch -x -LLL -s sub -b +'uid=pas-id-496CB33100000065,ou=addressbook,dc=example,dc=com' +'ou=Revision' + + +Add an entry to the addressbook: + +vim contact1.ldif + +dn: uid=pas-id-4971256100000127,ou=addressbook,dc=example,dc=com + +cn: user4 + +givenName: user4 + +mail: user4@localhost + +sn: user4 + +uid: pas-id-4971256100000127 + +homePhone: 0000000000000 + +objectClass: evolutionPerson + + +ldapadd -a -w password -x -D "cn=root,dc=example,dc=com" -f +contact1.ldif + +Modify this entry: + +vim /tmp/entrymods + +dn: uid=pas-id-4971256100000127,ou=addressbook,dc=example,dc=com + +replace: homePhone + +homePhone: 0000000000001 + + +ldapmodify -x -D "cn=root,dc=example,dc=com" -w password -f +/tmp/entrymods + +Delete right this entry from the addressbook: + +ldapdelete -x -w password -D "cn=root,dc=example,dc=com" -r +"uid=pas-id-4971256100000127,ou=addressbook,dc=example,dc=com" + +Display calendar accessing the LDAP server anonymously: + +ldapsearch -x -LLL -s sub -b 'ou=calendar,dc=example,dc=com' + +Display todo's: + +ldapsearch -x -LLL -s sub -b 'ou=todo,dc=example,dc=com' + +Display notes (everything, including the base): + +ldapsearch -x -LLL -s sub -b 'o=notes,dc=example,dc=com' + +Display notes, only the base: + +ldapsearch -x -LLL -s base -b 'o=notes,dc=example,dc=com' + +Display all the entries under o=notes (i.e. all of the "notes", +without any subentries and withou the base): + +ldapsearch -x -LLL -s one -b 'o=notes,dc=example,dc=com' + +Display the subentries of one particular entry under o=notes: + +ldapsearch -x -LLL -s children -b +'documentIdentifier=200...@ho...,o=notes,dc=example,dc=com' + + +ldapsearch -x -LLL -s sub -b 'o=notes,dc=example,dc=com' +'(documentidentifier=200...@ho...)' + +Delete everything under o=notes: + +ldapsearch -x -LLL -s one -A -b "o=notes,dc=example,dc=com" 'dn' +| awk 'BEGIN {RS = "\n\n"} {gsub("dn: ", ""); gsub(/\n /, ""); +print}' > /tmp/file + + +ldapdelete -x -w password -D "cn=root,dc=example,dc=com" -r -f +/tmp/file + +Check the result: + +ldapsearch -x -LLL -s sub -b "o=notes,dc=example,dc=com" + +Or in one step with a pipe: + +ldapsearch -x -LLL -s one -A -b "o=notes,dc=example,dc=com" 'dn' +| awk 'BEGIN {RS = "\n\n"} {gsub("dn: ", ""); gsub(/\n /, ""); +print}' | ldapdelete -x -w password -D +"cn=root,dc=example,dc=com" -r + +7 Extra section: How to integrate mutt with the LDAP server + +This section shows how mutt must be extended and configured to be +able to access the email addresses stored in the addressbook of +the LDAP server. Dozens of scripts are out there to achieve this +aim. All of them provide mutt with a read-only access. This +means, that adding new address entries to the LDAP server from +inside mutt requires a different or additional tool (not solved, +yet). + +Here is one way how to enable this kind of read-access. + +We make use of the “Little brother database”. LBDB accesses the +LDAP server. + +7.1 Installation of LBDB on fedora 10 + +rpm -Uvh /dvd/Packages/perl-Convert-ASN1-0.21-3.fc9.noarch.rpm + +rpm -Uvh /usbstick/perl-LDAP-0.34-4.fc9.noarch.rpm + +Download LBDB source code: + +[http://www.spinnaker.de/debian/lbdb_0.36.tar.gz||http://www.spinnaker.de/debian/lbdb_0.36.tar.gz] + +tar -xvzf lbdb_0.36.tar.gz + +cd lbdb-0.36/ + +./configure --prefix=/usr/local --with-gpg --with-ypcat + +make -s + +make -w install + +ldconfig + +7.2 Configure lbdb + +vim /usr/local/etc/lbdb.rc + +METHODS="m_inmail m_ldap m_muttalias m_gpg" + +lbdb makes use of mutt_ldap_query. Older, but working version: + +cp /usr/share/doc/mutt-1.5.18/mutt_ldap_query /usr/local/lib/ + +Other examples: + +[http://www.courville.org/code/mutt_ldap_query/mutt_ldap_query.pl.in||http://www.courville.org/code/mutt_ldap_query/mutt_ldap_query.pl.in] + +cp mutt_ldap_query.pl.in /usr/local/lib/mutt_ldap_query + +vim /usr/local/lib/mutt_ldap_query + +# hostname of your ldap server + +our $ldap_server = 'host.example.com'; + +# ldap base search + +our $search_base = 'ou=addressbook,dc=example,dc=com'; + +# list of the fields that will be used for the query + +our $ldap_search_fields = 'uid givenname sn cn mail'; + +# list of the fields that will be used for composing the answer + +our $ldap_expected_answers = 'givenname sn mail o'; + +# format of the email result based on the expected answers of the +ldap query + +our $ldap_result_email = '${mail}'; + +# format of the real name result based on the expected answers of +the ldap query + +our $ldap_result_realname = '${givenname} ${sn}'; + +# format of the comment result based on the expected answers of +the ldap query + +our $ldap_result_comment = '(${o})'; + +# use ignorant (wildcard searching): + +our $ignorant = 0; + +# LDAP bind DN: + +our $ldap_bind_dn = 'cn=ldap_user,ou=people,dc=example,dc=com'; + +# LDAP bind password: + +our $ldap_bind_password = 'secret'; + +7.3 Configure mutt + +vim ~/.muttrc + +# Little brother database: + +set query_command="/usr/local/bin/lbdbq %s" + +7.4 Using mutt + +SHIFT-Q prompts for a name. Enter it. Return. And the mail +address should be displayed, if found, at all. + +In case of any problems: + +Check it from outside of mutt: + +lbdbq user1 + +7.5 Links + +Homepage of the “Little brother database”: + +[http://www.spinnaker.de/lbdb/||http://www.spinnaker.de/lbdb/] + +About LBDB: + +[http://mark.stosberg.com/Tech/mutt.html||http://mark.stosberg.com/Tech/mutt.html] + +Development + +8 Function names + +The function name prefixes (uniformly ldap_plugin_... and +ldap_format_...) have been chosen deliberately: + +• in order to make a clear distinction between libldap calls and + plugin calls, + +• in order to make a clear distinction between libopensync calls + and plugin calls, + +• and in order to make it easier to detect the plugin functions + while reading any backtraces. + +9 Error messages + +The error messages contain all file name and line number to +accelerate debugging. Null pointers should be recognizable +instantaneously without having to launch a debugger or to grep +through the trace files. The number of error messages, trace +messages and debugging messages has greatly been increased in +order to speed up debugging. + +10 Format/mapping problems + +The LDAP format plugin is the place where most of the future +development might have to be done. + +Basically the mapping is done in two steps: + +1. From xmlformat-contact, for example, to an XML format used + internally by the LDAP plugin, only. This is done by means of + an XML style sheet. This internal XML format is to a certain + degree oriented towards LDIF (= LDAP Data Interchange Format). + +2. From this plugin-internal XML format to C structs by means of + functions in ldap_format.c. + +And, of course, the other way round. + +The alternative would have been a style sheet that maps directly +to LDIF. But this turned out to be too difficult. XSLT is a +rather dumb programming language, actually, not even a +programming language. And it is, at least in my personal opinion, +not really suitable for all those quirks that will have to be +applied when paying attention to all kinds of LDAP specific +requirements. + +The mapping especially with the objtype “contact” is still +neither loss-free nor bug-free. The whole concept how to store +the data on the LDAP server is not really compatible with the +requirements as laid out in the various *.xsd files. It is not +just a simple mapping, as, for example, from vcard10 to +xmlformat-contact. + +One and the same element must not appear more than one time in an +LDAP entry. Which conflicts with the “unbounded” specification in +the XML schema files, obviously. Certain elements are obligatory +on the LDAP side, regardless of whether they have actually +appeared on the side of the peer. The current implementation has +no solution for the problem that certain elements may appear more +than one time. And the format plugin is not really able to enter +deeper levels than the first one under the ou=addressbook entry, +for instance. Only in exceptional cases, and this has not been +coded in a more general way, yet. + +Several XML elements are not mapped directly to any of the +elements offered by the LDAP schemata. They are stored in +subentries in an unusual way. For example: + +• This is an example for what I would call a direct or a regular + mapping: <Birthday><Content>...</Content></Birthday>. This can + be mapped directly to the LDAP attribute “birthDate:”. But any + potential XML attributes can not be stored with this LDAP + attribute. + +• And this is an example where an adequate LDAP attribute is + simply missing: <Nickname><Content>Foo</Content></Nickname>. + The style sheet will sort out this one and reformat the XML + file: +<subentry> +<Nickname> +Foo +</Nickname> +</subentry> +And this reformatted XML file is mapped to an LDAP entry located + one level below the entry of objectclass “evolutionPerson” + (i.e. mapped to a subentry, which could be called an indirect + or irregular mapping): + +dn: +ou=Nickname,uid=pas-id-49AD628000000004,ou=addressbook,dc=example,dc=com + +objectClass: organizationalUnit + +description: Foo + +ou: Nickname + +Quite clear, that this is not optimal. It is a workaround to +overcome the incompatibility problem. + +For the time being there is no solution for the problem, either, +that the LDAP schemata “evolutionperson” and “inetorgperson” have +various elements that are not mapped, at all, to any element of +the xmlformat-contact format. + +11 Documentation + +This README has been written in lyx-1.6.0. Thus the conversion to +HTML, PS and PDF is quite easy. And the authoring is quicker than +writing in plain LaTeX. + +The source code has been annotated with doxygen based comments. “ +make doxygen” should lead to a “doc” sub directory in the build +directory with HTML, man and other subsubdirectories. “firefox +doc/html/index.html” displays the entry page. + +All of this should save us time. + +Troubleshooting + +12 Enable debug output + +12.1 Enable trace files with libopensync and + libopensync-plugin-ldap + +mkdir /tmp/trace + +export OSYNC_TRACE=/tmp/trace + +osynctool --listplugins + +(...) + +12.2 Enable trace files with libsyncml + +mkdir /tmp/trace + +export SYNCML_TRACE=/tmp/trace + +(...) + +12.3 Enable debug output with the LDAP server slapd on fedora 10 + +vim /etc/rsyslog.conf + +*.* /var/log/debug + + + +service syslog restart + + + +vim /etc/sysconfig/ldap + +OPTIONS="-d 32767" + + +vim /etc/openldap/slapd.conf + +logfile /tmp/slapd.log + +loglevel any + + +service ldap configtest + +service ldap restart + +tail -f /tmp/slapd.log + +12.4 How to debug the format conversions with the ldap-sync + plugin + +The transformation from the format understood by the libldap API +to any format understood by libopensync is performed in several +steps and can be observed by defining certain DEBUG_* constants: + +LDAP <---> ldap plugin <---> libopensync <---> syncml plugin +<---> phone + +The conversation with the LDAP server API for getting data + +out of the directory information tree (DIT) can be watched + +by defining in ldap_plugin.h + +DEBUG_ldapdata_from_server + +The step from the LDAP server API to the xml format internally +used + +by the ldap-sync plugin can be observed by this constant: + +DEBUG_convert_ldap2xmldoc + +The step from this plugin-internal xml format to +xmlformat-contact, + +for instance, or the other way round: + +DEBUG_do_apply_stylesheet + +The step from xmlformt-contact to the xml format used by the ldap + +plugin internally: + +DEBUG_convert_xmldoc2ldap + +And the way how the ldap plugin talks to the LDAP server API, + +in order to write data into the directory information tree: + +DEBUG_ldapdata_to_server + + +13 CMakeError: MACRO_ENSURE_OUT_OF_SOURCE_BUILD + +Problem: + +CMake Error at cmake/modules/MacroEnsureOutOfSourceBuild.cmake:13 +(MESSAGE): libopensync-plugin-ldap doesn't allow to build +within the source directory. Please, create a seperate build +directory and run 'cmake /home/user1/dev/plugins/ldap-sync +[options]'! Call Stack (most recent call first): +/usr/local/share/libopensync1/cmake/modules/OpenSyncInternal.cmake:9 +(MACRO_ENSURE_OUT_OF_SOURCE_BUILD) CMakeLists.txt:50 (INCLUDE) + +Solution: + +tar -xvjf libopensync-plugin-ldap-0.39 + +cd libopensync-plugin-ldap-0.39 + +mkdir build + +cd build + +cmake ... + +make ... + +Problem: But I did make a separate build directory! Why does +cmake not realize this? + +Solution: Delete all the cache files “CMakeCache.txt” that you +can find inside the libopensync-plugin-ldap-0.xx source +directory. + +14 Debugging hints for SASL + +14.1 Which SASL mechanisms are supported by the LDAP library + +14.1.1 With unencrypted sessions + +ldapsearch -x -b "" -s base -LLL supportedSASLMechanisms + +14.1.2 With encrypted sessions + +ldapsearch -x -b "" -s base -LLL -Z supportedSASLMechanisms + +Test SASL authentication with regard to read access, only + +ldapwhoami -U "ldap_user" -w "secret" -Y DIGEST-MD5 + +ldapwhoami -U "ldap_user" -w "secret" -Y CRAM-MD5 + +ldapwhoami -U "ldap_user" -w "secret" -Z -Y LOGIN + +ldapwhoami -U "ldap_user" -w "secret" -Z -Y PLAIN + +ldapwhoami -Z -Y EXTERNAL + + + +kinit -V ldap_user + +(...) + +ldapwhoami -Y GSSAPI + +In case of any problems, one could add “-V -d1” to the ldapwhoami +command line. + +14.2 Display the TLS certificates + +of the LDAP server only + +openssl s_client -connect localhost:636 -showcerts + +both of the server and the client + +openssl s_client -connect localhost:636 -cert +/etc/openldap/cacerts/client.crt -key +/etc/openldap/cacerts/client.key -showcerts + +14.3 Make the debug output of slapd visible + +vim /etc/rsyslog.conf + +*.* /var/log/debug + + + +service syslog restart + + + +vim /etc/sysconfig/ldap + +OPTIONS="-d 32767" + +Example of a debug session: + +ldapwhoami -V -d 1 -Z -Y EXTERNAL + +(...) + +ldap_sasl_interactive_bind_s: user selected: EXTERNAL + +ldap_int_sasl_bind: EXTERNAL + +ldap_int_sasl_open: host=host.example.com + +SASL/EXTERNAL authentication started + +ldap_err2string + +ldap_sasl_interactive_bind_s: Unknown authentication method (-6) + + + +tail -f /var/log/debug + +Feb 20 13:30:49 host slapd[6298]: connection_get(21): got +connid=1 + +Feb 20 13:30:49 host slapd[6298]: connection_read(21): checking +for input on id=1 + +Feb 20 13:30:50 host slapd[6298]: + +connection_read(21): unable to get TLS client DN, error=49 id=1 + +Feb 20 13:30:50 host slapd[6298]: conn=1 fd=21 TLS established +tls_ssf=256 ssf=25 6 + +Solution: + +The variables TLS_CACERTDIR, TLS_CERT, TLS_KEY, TLSCipherSuite +and TLS_REQCERT MUST NOT be configured in +/etc/openldap/ldap.conf. They MUST be configured in ~/.ldaprc, +instead. + +15 Debugging the style sheets + +15.1 How to observe the mapping step from xmlformat_contact to + ldap_inetorgperson + +Comment out #undef DEBUG_do_apply_stylesheet so that +DEBUG_do_apply_stylesheet becomes defined: + +vim ldap_plugin.h + +// undef DEBUG_do_apply_stylesheet + +15.2 Example file contact4.xml + +<?xml version="1.0"?> + +<contact> + +<Address Location="Home"> + +<PostOfficeBox>12345</PostOfficeBox> + +<ExtendedAddress>userstreet5 + +10000 Any City + +user1 + +Berlin + +Berlin + +10000 + +Germany + +</ExtendedAddress> + +<Street>Mr. user1</Street> + +<Locality>Any City</Locality> + +<Region>Any State</Region> + +<PostalCode>10000</PostalCode> + +<Country>Any Country</Country> + +</Address> + +<AddressLabel Location="Home"> + +<Content>Mr. user1 + +userstreet5 + +10000 Any City + +user1 + +Berlin + +Berlin + +10000 + +Germany + +Any City, Any State + +10000 + +12345 + +Any Country</Content> + +</AddressLabel> + +<AddressLabel> + +<Content>user1 + +userstreet 5 + +Berlin, Berlin + +10000 + +10000 Berlin + +Germany</Content> + +</AddressLabel> + +<Anniversary> + +<Content>20090302</Content> + +</Anniversary> + +<Assistant> + +<Content>workaholic</Content> + +</Assistant> + +<Birthday> + +<Content>20090301</Content> + +</Birthday> + +<BlogUrl> + +<Content>http://blog.example.com/</Content> + +</BlogUrl> + +<CalendarUrl> + +<Content>http://calendar.example.com/</Content> + +</CalendarUrl> + +<Categories> + +<Category>Hot Contacts</Category> + +</Categories> + +<EMail Location="Other" UI-Slot="1"> + +<Content>user1@home</Content> + +</EMail> + +<FileAs> + +<Content>user1</Content> + +</FileAs> + +<FormattedName> + +<Content>user1</Content> + +</FormattedName> + +<FreeBusyUrl> + +<Content>http://busy.example.com/</Content> + +</FreeBusyUrl> + +<IM-AIM Location="Home" UI-Slot="1"> + +<Content>aim_account</Content> + +</IM-AIM> + +<IM-ICQ Location="Home" UI-Slot="4"> + +<Content>icq_account</Content> + +</IM-ICQ> + +<IM-MSN Location="Home" UI-Slot="3"> + +<Content>msn_account</Content> + +</IM-MSN> + +<IM-Yahoo Location="Home" UI-Slot="2"> + +<Content>yahoo_account</Content> + +</IM-Yahoo> + +<Manager> + +<Content>dude1</Content> + +</Manager> + +<Name> + +<FirstName>user1</FirstName> + +</Name> + +<Nickname> + +<Content>one</Content> + +</Nickname> + +<Note> + +<Content>Here we could any notes.</Content> + +</Note> + +<Organization> + +<Name>creative.com</Name> + +<Unit>supervisory</Unit> + +<Unit>Second floor</Unit> + +</Organization> + +<Profession> + +<Content>creator</Content> + +</Profession> + +<Revision> + +<Content>20090315T124347Z</Content> + +</Revision> + +<Spouse> + +<Content>Betty</Content> + +</Spouse> + +<Telephone Location="Work" UI-Slot="1"> + +<Content>0000000000004</Content> + +</Telephone> + +<Title> + +<Content>Emperor</Content> + +</Title> + +<Uid> + +<Content>pas-id-49BCF74000000000</Content> + +</Uid> + +<Url> + +<Content>http://www.example.com/</Content> + +</Url> + +<VideoUrl> + +<Content>http://video.example.com/</Content> + +</VideoUrl> + +<WantsHtml> + +<Content>TRUE</Content> + +</WantsHtml> + +</contact> + +15.3 Check the mapping step from xmlformat_contact to + ldap_inetorgperson + +xsltproc xmlformat_contact2ldap_inetorgperson.xsl contact4.xml + + + +xsltproc xmlformat_contact2ldap_inetorgperson.xsl contact4.xml | +xmllint --noout - + + + +xsltproc xmlformat_contact2ldap_inetorgperson.xsl contact4.xml | +xsltproc ldap_inetorgperson2xmlformat_contact.xsl - + + + +xsltproc xmlformat_contact2ldap_inetorgperson.xsl contact4.xml | +xsltproc ldap_inetorgperson2xmlformat_contact.xsl - | xmllint +--noout - + + + +xsltproc xmlformat_contact2ldap_inetorgperson.xsl contact4.xml | +xsltproc ldap_inetorgperson2xmlformat_contact.xsl - | xmllint +--noout --schema +/usr/local/share/libopensync1/schemas/xmlformat-contact.xsd - + +15.4 Alternative parsers + +java -jar /usr/share/java/xalan-j2.jar -IN contact4.xml -XSL +xmlformat_contact2ldap_inetorgperson.xsl + + + +java -jar /usr/share/java/saxon.jar contact4.xml +xmlformat_contact2ldap_inetorgperson.xsl + +16 ERROR: (mod->mod_vals.modv_strvals) is NULL + +This error message: + +ERROR: (mod->mod_vals.modv_strvals) is NULL. + +means that a particular libldap call has not been told to use +binary values rather than strings. The ldap plugin does NOT use “ +modv_strvals”. Throughout the whole plugin “ +mod->mod_vals.modv_bvals”, or shorter, “mod->mod_bvalues” are +used. So there must always be a prior line “mod->mod_op = +LDAP_MOD_BVALUES” or “mod->mod_op = LDAP_MOD_BVALUES | +ANY_OTHER_OPTION | ...”. Apparently, such a line is missing in +this case. + +17 LDAP ERROR: No such object (32) + +This error message may have different reasons, the most common +one being that you simply have a type in your search: ... [truncated message content] |
From: <svn...@op...> - 2009-03-26 00:12:49
|
Author: scriptor Date: Thu Mar 26 01:12:20 2009 New Revision: 5331 URL: http://www.opensync.org/changeset/5331 Log: Initial version of the LDAP plugin having been ported to libopensync-0.3x. Added: plugins/ldap-sync/README.lyx (contents, props changed) Added: plugins/ldap-sync/README.lyx ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/README.lyx Thu Mar 26 01:12:20 2009 (r5331) @@ -0,0 +1,6667 @@ +#LyX 1.6.0 created this file. For more info see http://www.lyx.org/ +\lyxformat 345 +\begin_document +\begin_header +\textclass article +\use_default_options true +\language english +\inputencoding auto +\font_roman default +\font_sans default +\font_typewriter default +\font_default_family default +\font_sc false +\font_osf false +\font_sf_scale 100 +\font_tt_scale 100 + +\graphics default +\paperfontsize default +\use_hyperref false +\papersize default +\use_geometry false +\use_amsmath 1 +\use_esint 1 +\cite_engine basic +\use_bibtopic false +\paperorientation portrait +\secnumdepth 3 +\tocdepth 3 +\paragraph_separation indent +\defskip medskip +\quotes_language english +\papercolumns 1 +\papersides 1 +\paperpagestyle default +\tracking_changes false +\output_changes false +\author "" +\author "" +\end_header + +\begin_body + +\begin_layout Title +opensync-plugin-ldap-0.39 +\end_layout + +\begin_layout Author +by Juergen Leising (c) 2009 +\end_layout + +\begin_layout Standard +\begin_inset CommandInset toc +LatexCommand tableofcontents + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Newpage newpage +\end_inset + + +\end_layout + +\begin_layout Part +Installation +\end_layout + +\begin_layout Section +Compiling the source code with cmake +\end_layout + +\begin_layout Subsection +The following cmake modules are required for the LDAP plugin +\end_layout + +\begin_layout Itemize +FindLibLdap.cmake +\end_layout + +\begin_layout Itemize +FindLibGCrypt.cmake +\end_layout + +\begin_layout Itemize +FindLibSASL2.cmake +\end_layout + +\begin_layout Itemize +FindLibGSSAPIV2.cmake +\end_layout + +\begin_layout Standard +See the directory cmake/modules. +\end_layout + +\begin_layout Subsection +Regular build +\end_layout + +\begin_layout LyX-Code +tar -xvjf libopensync-plugin-ldap-0.39.tar.bz2 +\end_layout + +\begin_layout LyX-Code +cd libopensync-plugin-ldap-0.39 +\end_layout + +\begin_layout LyX-Code +mkdir build +\end_layout + +\begin_layout LyX-Code +cd build +\end_layout + +\begin_layout LyX-Code +PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/" cmake -DCMAKE_INSTALL_PREFIX=/usr/lo +cal -DUPDATE_TYPE=svn /home/user1/libopensync-plugin-ldap-0.39 +\end_layout + +\begin_layout LyX-Code +make -s +\end_layout + +\begin_layout LyX-Code +sudo make -s install +\end_layout + +\begin_layout LyX-Code +sudo ldconfig +\end_layout + +\begin_layout LyX-Code +cd ../.. +\end_layout + +\begin_layout Subsection +Debug build +\end_layout + +\begin_layout LyX-Code +tar -xvjf libopensync-plugin-ldap-0.39.tar.bz2 +\end_layout + +\begin_layout LyX-Code +cd libopensync-plugin-ldap-0.39 +\end_layout + +\begin_layout LyX-Code +mkdir build_debug +\end_layout + +\begin_layout LyX-Code +cd build_debug +\end_layout + +\begin_layout LyX-Code +PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/" cmake -DCMAKE_INSTALL_PREFIX=/usr/lo +cal -DUPDATE_TYPE=svn -DCMAKE_BUILD_TYPE=Debug -DCMAKE_VERBOSE_MAKEFILE=ON + /home/user1/libopensync-plugin-ldap-0.39 +\end_layout + +\begin_layout LyX-Code +make -s +\end_layout + +\begin_layout LyX-Code +sudo make -s install +\end_layout + +\begin_layout LyX-Code +sudo ldconfig +\end_layout + +\begin_layout LyX-Code +cd ../.. +\end_layout + +\begin_layout Subsection +Build doxygen based documentation of the source code +\end_layout + +\begin_layout LyX-Code +cd build +\end_layout + +\begin_layout LyX-Code +make doxygen +\end_layout + +\begin_layout LyX-Code +firefox doc/html/index.html & +\end_layout + +\begin_layout Section +Tests +\end_layout + +\begin_layout Standard +There is a "test" target. + It is primarily intended for developers. + Tests which I expect to fail are commented out in the CMakeLists.txt. +\end_layout + +\begin_layout Subsection +Required software +\end_layout + +\begin_layout Standard +The tests make use of external tools, most notably: +\end_layout + +\begin_layout Itemize +xmllint +\end_layout + +\begin_layout Itemize +xsltproc +\end_layout + +\begin_layout Itemize +ldapsearch +\end_layout + +\begin_layout Itemize +ldapadd +\end_layout + +\begin_layout Itemize +ldapmodify +\end_layout + +\begin_layout Itemize +ldapdelete +\end_layout + +\begin_layout Itemize +valgrind +\end_layout + +\begin_layout Subsection +Running the tests +\end_layout + +\begin_layout LyX-Code +cd build +\end_layout + +\begin_layout LyX-Code +make test +\end_layout + +\begin_layout Subsection +Display a list of tests +\end_layout + +\begin_layout LyX-Code +cd build +\end_layout + +\begin_layout LyX-Code +ctest -N +\end_layout + +\begin_layout Subsection +Run only one particular test +\end_layout + +\begin_layout LyX-Code +cd build +\end_layout + +\begin_layout LyX-Code +ctest -I 51,51 +\end_layout + +\begin_layout LyX-Code +ctest -R remove_test_ldifs +\end_layout + +\begin_layout Part +Configuration +\end_layout + +\begin_layout Section +Prepare the LDAP server +\begin_inset Quotes eld +\end_inset + +slapd +\begin_inset Quotes erd +\end_inset + + +\end_layout + +\begin_layout Subsection +Configure the LDAP server +\end_layout + +\begin_layout Standard +vim /etc/openldap/slapd.conf +\end_layout + +\begin_layout LyX-Code +(...) +\end_layout + +\begin_layout LyX-Code +include /etc/openldap/schema/core.schema +\end_layout + +\begin_layout LyX-Code +include /etc/openldap/schema/inetorgperson.schema +\end_layout + +\begin_layout LyX-Code +include /etc/openldap/schema/evolutionperson.schema +\end_layout + +\begin_layout LyX-Code +(...) +\end_layout + +\begin_layout LyX-Code +database bdb +\end_layout + +\begin_layout LyX-Code +suffix "dc=example,dc=com" +\end_layout + +\begin_layout LyX-Code +checkpoint 1024 15 +\end_layout + +\begin_layout LyX-Code +####### Root +\begin_inset CommandInset label +LatexCommand label +name "rootdn" + +\end_inset + + account, +\begin_inset Quotes eld +\end_inset + +simple +\begin_inset Quotes erd +\end_inset + + authentication +\end_layout + +\begin_layout LyX-Code +rootdn "cn=root,dc=example,dc=com" +\end_layout + +\begin_layout LyX-Code +rootpw password +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +### Mappings to gain the bind-DN's in order +\end_layout + +\begin_layout LyX-Code +### to answer the question about access rights +\end_layout + +\begin_layout LyX-Code +### for SASL based authentication: +\end_layout + +\begin_layout LyX-Code +authz-regexp +\end_layout + +\begin_layout LyX-Code + uid=([^,]*),cn=digest-md5,cn=auth +\end_layout + +\begin_layout LyX-Code + cn=$1,dc=example,dc=com +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +authz-regexp +\end_layout + +\begin_layout LyX-Code + uid=([^,]*),cn=cram-md5,cn=auth +\end_layout + +\begin_layout LyX-Code + cn=$1,dc=example,dc=com +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +authz-regexp +\end_layout + +\begin_layout LyX-Code + uid=([^,]*),cn=plain,cn=auth +\end_layout + +\begin_layout LyX-Code + cn=$1,dc=example,dc=com +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +authz-regexp +\end_layout + +\begin_layout LyX-Code + uid=([^,]*),cn=login,cn=auth +\end_layout + +\begin_layout LyX-Code + cn=$1,dc=example,dc=com +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +authz-regexp +\end_layout + +\begin_layout LyX-Code + uid=([^,]*),cn=gssapi,cn=auth +\end_layout + +\begin_layout LyX-Code + cn=$1,dc=example,dc=com +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +authz-regexp +\end_layout + +\begin_layout LyX-Code + email=([^@]+)@host +\backslash +.([^.]+) +\backslash +.([^,]+),cn=host +\backslash +.example +\backslash +.com,ou=[^#]+[^ +\backslash + ]+ +\backslash + ldap +\backslash + client +\backslash + [^,]+,o=a +\backslash + private +\backslash + site +\backslash +.,st=city,c=us +\end_layout + +\begin_layout LyX-Code + cn=$1,dc=$2,dc=$3 +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +sasl-host host.example.com +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +### Minimal access rights for a given bind-DN: +\end_layout + +\begin_layout LyX-Code +access to dn.subtree="ou=addressbook,dc=example,dc=com" by users write +\end_layout + +\begin_layout LyX-Code +access to dn.subtree="ou=calendar,dc=example,dc=com" by users write +\end_layout + +\begin_layout LyX-Code +access to dn.subtree="ou=todo,dc=example,dc=com" by users write +\end_layout + +\begin_layout LyX-Code +access to dn.subtree="o=notes,dc=example,dc=com" by users write +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +access to dn.base="cn=Subschema" by * read +\end_layout + +\begin_layout LyX-Code +access to dn.one="ou=people,dc=example,dc=com" by * read +\end_layout + +\begin_layout LyX-Code +directory /var/lib/ldap +\end_layout + +\begin_layout LyX-Code +(...) +\end_layout + +\begin_layout Subsection +Syntax test of the configuration file +\end_layout + +\begin_layout LyX-Code +slapd -Ttest +\end_layout + +\begin_layout Subsection +Build the directory information tree (= DIT) +\end_layout + +\begin_layout Standard +We are going to create a hierarchical tree like this one: +\end_layout + +\begin_layout Standard +\begin_inset Graphics + filename /tmp/dit1.tiff + +\end_inset + + +\end_layout + +\begin_layout Standard +ou=people will contain the user accounts for the so-called +\begin_inset Quotes eld +\end_inset + +simple +\begin_inset Quotes erd +\end_inset + + authentication method. +\end_layout + +\begin_layout Standard +ou=addressbook is intended to store entries for object type +\begin_inset Quotes eld +\end_inset + +contact +\begin_inset Quotes erd +\end_inset + + (object type here is a libopensync specific term; not to be confused with + +\begin_inset Quotes eld +\end_inset + +object class +\begin_inset Quotes erd +\end_inset + +, which is an LDAP specific term). +\end_layout + +\begin_layout Standard +ou=calendar is for object type +\begin_inset Quotes eld +\end_inset + +event +\begin_inset Quotes erd +\end_inset + +. +\end_layout + +\begin_layout Standard +ou=todo is for object type +\begin_inset Quotes eld +\end_inset + +todo +\begin_inset Quotes erd +\end_inset + +. + Applications often refer to this as +\begin_inset Quotes eld +\end_inset + +tasks +\begin_inset Quotes erd +\end_inset + +. +\end_layout + +\begin_layout Standard +o=notes is for object type +\begin_inset Quotes eld +\end_inset + +note +\begin_inset Quotes erd +\end_inset + +. + The object class +\begin_inset Quotes eld +\end_inset + +organization +\begin_inset Quotes erd +\end_inset + + has been chosen here just to demonstrate that this decision has been made + in an arbitrary way. + A dedicated LDAP schema is currently used for object +\begin_inset Quotes eld +\end_inset + +contact +\begin_inset Quotes erd +\end_inset + +, only. + All the other object types currently use general object classes, which + will hopefully be changed eventually. +\end_layout + +\begin_layout Standard +Establish the root subtree +\begin_inset Quotes eld +\end_inset + +dc=example,dc=com +\begin_inset Quotes erd +\end_inset + +, which is to hold the people subtree, the addressbook subtree, the todo + subtree and the notes subtree. +\end_layout + +\begin_layout LyX-Code +vim root1.ldif +\end_layout + +\begin_layout LyX-Code +dn: dc=example,dc=com +\end_layout + +\begin_layout LyX-Code +objectClass: top +\end_layout + +\begin_layout LyX-Code +objectClass: dcObject +\end_layout + +\begin_layout LyX-Code +objectClass: organizationalUnit +\end_layout + +\begin_layout LyX-Code +dc: example +\end_layout + +\begin_layout LyX-Code +ou: top node of LDAP Server +\end_layout + +\begin_layout Standard +Now add this to the DIT: +\end_layout + +\begin_layout LyX-Code +ldapadd -x -D "cn=root,dc=example,dc=com" -w password -a -f root1.ldif +\end_layout + +\begin_layout Subsubsection +Establish an addressbook +\end_layout + +\begin_layout Standard +We use the LDAP root DN and the LDAP root password to establish an addressbook: +\end_layout + +\begin_layout LyX-Code +vim addressbook.ldif +\end_layout + +\begin_layout LyX-Code +dn: ou=addressbook,dc=example,dc=com +\end_layout + +\begin_layout LyX-Code +objectClass: top +\end_layout + +\begin_layout LyX-Code +objectClass: organizationalUnit +\end_layout + +\begin_layout LyX-Code +ou: addressbook +\end_layout + +\begin_layout LyX-Code +description: Personal Addressbook +\end_layout + +\begin_layout Standard +Now add this LDIF file: +\end_layout + +\begin_layout LyX-Code +ldapadd -x -D "cn=root,dc=example,dc=com" -w password -a -f addressbook.ldif +\end_layout + +\begin_layout Subsubsection +Estalish a calendar +\end_layout + +\begin_layout LyX-Code +vim calendar1.ldif +\end_layout + +\begin_layout LyX-Code +dn: ou=calendar,dc=example,dc=com +\end_layout + +\begin_layout LyX-Code +objectClass: top +\end_layout + +\begin_layout LyX-Code +objectClass: organizationalUnit +\end_layout + +\begin_layout LyX-Code +ou: calendar +\end_layout + +\begin_layout LyX-Code +description: Calendar +\end_layout + +\begin_layout Standard +Now add this LDIF file: +\end_layout + +\begin_layout LyX-Code +ldapadd -x -D "cn=root,dc=example,dc=com" -w password -a -f calendar1.ldif +\end_layout + +\begin_layout Subsubsection +Establish the todo's +\end_layout + +\begin_layout LyX-Code +vim todo1.ldif +\end_layout + +\begin_layout LyX-Code +dn: ou=todo,dc=example,dc=com +\end_layout + +\begin_layout LyX-Code +objectClass: top +\end_layout + +\begin_layout LyX-Code +objectClass: organizationalUnit +\end_layout + +\begin_layout LyX-Code +ou: todo +\end_layout + +\begin_layout LyX-Code +description: Calendar +\end_layout + +\begin_layout Standard +Now add this LDIF file to the DIT: +\end_layout + +\begin_layout LyX-Code +ldapadd -x -D "cn=root,dc=example,dc=com" -w password -a -f todo1.ldif +\end_layout + +\begin_layout Subsubsection +Establish notes +\end_layout + +\begin_layout LyX-Code +vim notes.ldif +\end_layout + +\begin_layout LyX-Code +dn: o=notes,dc=example,dc=com +\end_layout + +\begin_layout LyX-Code +objectClass: top +\end_layout + +\begin_layout LyX-Code +objectClass: dcObject +\end_layout + +\begin_layout LyX-Code +objectClass: organization +\end_layout + +\begin_layout LyX-Code +dc: notes +\end_layout + +\begin_layout LyX-Code +o: notes +\end_layout + +\begin_layout LyX-Code +description: Notes +\end_layout + +\begin_layout Standard +Now add this LDIF file: +\end_layout + +\begin_layout LyX-Code +ldapadd -x -D "cn=root,dc=example,dc=com" -w password -a -f notes.ldif +\end_layout + +\begin_layout Section +The different authentication methods with the LDAP server +\end_layout + +\begin_layout Subsection +The +\begin_inset Quotes eld +\end_inset + +simple +\begin_inset Quotes erd +\end_inset + + authentication +\end_layout + +\begin_layout Standard +\begin_inset CommandInset label +LatexCommand label +name "simple_authentication" + +\end_inset + +The credentials for the +\begin_inset Quotes eld +\end_inset + +simple +\begin_inset Quotes erd +\end_inset + + authentication can be configured either in slapd.conf itself or in the LDAP + DIT, i.e. + in a particular database. + We have already used the first method for the LDAP root DN (see above +\begin_inset CommandInset ref +LatexCommand ref +reference "rootdn" + +\end_inset + +). + Now we are going to use the second method for an ordinary user +\begin_inset Quotes eld +\end_inset + +ldap_user +\begin_inset Quotes erd +\end_inset + +: +\end_layout + +\begin_layout LyX-Code +vim ldap_user.ldif +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +dn: ou=people,dc=example,dc=com +\end_layout + +\begin_layout LyX-Code +objectClass: organizationalUnit +\end_layout + +\begin_layout LyX-Code +description: LDAP user accounts. +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +dn: cn=ldap_user,ou=people,dc=example,dc=com +\end_layout + +\begin_layout LyX-Code +objectClass: inetOrgPerson +\end_layout + +\begin_layout LyX-Code +cn: ldap_user +\end_layout + +\begin_layout LyX-Code +sn: ldap_user +\end_layout + +\begin_layout LyX-Code +givenname: ldap_user +\end_layout + +\begin_layout LyX-Code +mail: lda...@ex... +\end_layout + +\begin_layout LyX-Code +telephonenumber: 000-000-0001 +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout Standard +We use the LDAP root DN and the LDAP root password to add this entry to + the DIT: +\end_layout + +\begin_layout LyX-Code +ldapadd -x -D "cn=root,dc=example,dc=com" -w "password" -f ldap_user.ldif +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout Standard +Provide +\begin_inset Quotes eld +\end_inset + +ldap_user +\begin_inset Quotes erd +\end_inset + + with the password +\begin_inset Quotes eld +\end_inset + +secret +\begin_inset Quotes erd +\end_inset + +. + Note the difference between -w and -s: We authenticate ourselves as root + (in terms of LDAP: root-DN with the corresponding password as configured + in slapd.conf) +\end_layout + +\begin_layout LyX-Code +ldappasswd -x -D "cn=root,dc=example,dc=com" -w "password" -s "secret" "cn=ldap_ +user,ou=people,dc=example,dc=com" +\end_layout + +\begin_layout Subsection +Configure the SASL library +\end_layout + +\begin_layout Standard +\begin_inset CommandInset label +LatexCommand label +name "sasl_in_general" + +\end_inset + +Which SASL mechanisms does the SASL library offer? +\end_layout + +\begin_layout LyX-Code +sasl2-shared-mechlist +\end_layout + +\begin_layout LyX-Code +Available mechanisms: DIGEST-MD5,GSSAPI,CRAM-MD5,LOGIN,PLAIN,ANONYMOUS +\end_layout + +\begin_layout LyX-Code +Library supports: EXTERNAL,ANONYMOUS,PLAIN,LOGIN,CRAM-MD5,GSSAPI,DIGEST-MD5 +\end_layout + +\begin_layout Standard +\begin_inset CommandInset label +LatexCommand label +name "sasl_mechanisms_offered_by_slapd" + +\end_inset + +Which SASL mechanisms are supported by the LDAP server slapd with unencrypted + sessions? +\end_layout + +\begin_layout LyX-Code +ldapsearch -x -b "" -s base -LLL supportedSASLMechanisms +\end_layout + +\begin_layout LyX-Code +dn: +\end_layout + +\begin_layout LyX-Code +supportedSASLMechanisms: DIGEST-MD5 +\end_layout + +\begin_layout LyX-Code +supportedSASLMechanisms: GSSAPI +\end_layout + +\begin_layout LyX-Code +supportedSASLMechanisms: CRAM-MD5 +\end_layout + +\begin_layout Standard +Which SASL mechanisms are supported by the LDAP server slapd with encrypted + sessions: +\end_layout + +\begin_layout LyX-Code +ldapsearch -x -b "" -s base -LLL -Z supportedSASLMechanisms +\end_layout + +\begin_layout LyX-Code +dn: +\end_layout + +\begin_layout LyX-Code +supportedSASLMechanisms: DIGEST-MD5 +\end_layout + +\begin_layout LyX-Code +supportedSASLMechanisms: GSSAPI +\end_layout + +\begin_layout LyX-Code +supportedSASLMechanisms: CRAM-MD5 +\end_layout + +\begin_layout LyX-Code +supportedSASLMechanisms: LOGIN +\end_layout + +\begin_layout LyX-Code +supportedSASLMechanisms: PLAIN +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout Standard +Configure SASL: +\end_layout + +\begin_layout Standard +The SASL library is configured with respect to slapd in a file called +\begin_inset Quotes eld +\end_inset + +slapd.conf +\begin_inset Quotes erd +\end_inset + +. + This file is located in /usr/lib/sasl2/ and it MUST NOT be confused with + /etc/openldap/slapd.conf. +\end_layout + +\begin_layout Standard +The mech_list in the following file determines which authentication mechanisms + are to be supported by libsasl: +\end_layout + +\begin_layout Standard +Cf. + cyrus-sasl-lib-2.1.22/options.html in the source code of the sasl library. +\end_layout + +\begin_layout LyX-Code +vim /usr/lib/sasl2/slapd.conf +\end_layout + +\begin_layout LyX-Code +pwcheck_method: saslauthd auxprop +\end_layout + +\begin_layout LyX-Code +mech_list: plain login cram-md5 digest-md5 gssapi external anonymous +\end_layout + +\begin_layout LyX-Code +keytab: /etc/krb5.keytab +\end_layout + +\begin_layout LyX-Code +log_level: 7 +\end_layout + +\begin_layout Standard +\begin_inset CommandInset label +LatexCommand label +name "sasldb_account" + +\end_inset + +Create the account for +\begin_inset Quotes eld +\end_inset + +ldap_user +\begin_inset Quotes erd +\end_inset + + in the SASL database as root: +\end_layout + +\begin_layout LyX-Code +saslpasswd2 -c ldap_user +\end_layout + +\begin_layout Standard +Check the result as root: +\end_layout + +\begin_layout LyX-Code +sasldblistusers2 +\end_layout + +\begin_layout LyX-Code +ld...@ho...: userPassword +\end_layout + +\begin_layout Standard +Do the various mechanisms work as expected? +\end_layout + +\begin_layout Standard +As root in an xterm: +\end_layout + +\begin_layout LyX-Code +sasl2-sample-server -s ldap +\end_layout + +\begin_layout LyX-Code +(...) +\end_layout + +\begin_layout LyX-Code +DIGEST-MD5 GSSAPI CRAM-MD5 LOGIN PLAIN ANONYMOUS +\end_layout + +\begin_layout Standard +As a simple user in another xterm: +\end_layout + +\begin_layout LyX-Code +sasl2-sample-client -m PLAIN localhost +\end_layout + +\begin_layout LyX-Code +sasl2-sample-client -m DIGEST-MD5 localhost +\end_layout + +\begin_layout LyX-Code +sasl2-sample-client -m CRAM-MD5 localhost +\end_layout + +\begin_layout LyX-Code +sasl2-sample-client -m LOGIN localhost +\end_layout + +\begin_layout LyX-Code +sasl2-sample-client -m ANONYMOUS localhost +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout Standard +Assuming the Kerberos V5 system is already configured. + See below +\begin_inset CommandInset ref +LatexCommand ref +reference "kerberosv5" + +\end_inset + +. +\end_layout + +\begin_layout LyX-Code +kinit -V ldap_user +\end_layout + +\begin_layout LyX-Code +sasl2-sample-client -s ldap -m GSSAPI host.example.com +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout Standard + +\end_layout + +\begin_layout Subsection +SASL/DIGEST-MD5 +\end_layout + +\begin_layout Standard +\begin_inset CommandInset label +LatexCommand label +name "digest_md5" + +\end_inset + +SASL using DIGEST-MD5 with the password being stored in the sasldb as shown + above under +\begin_inset CommandInset ref +LatexCommand ref +reference "sasldb_account" + +\end_inset + +. + For the authentication itself nothing else has to be configured. + +\end_layout + +\begin_layout Standard +For the access rules to work the authentication identifier (bind-DN) can + be rewritten by these lines in /etc/openldap/slapd.conf: +\end_layout + +\begin_layout LyX-Code +authz-regexp +\end_layout + +\begin_layout LyX-Code + uid=([^,]*),cn=digest-md5,cn=auth +\end_layout + +\begin_layout LyX-Code + cn=$1,dc=example,dc=com +\end_layout + +\begin_layout Standard +Configure the opensync-plugin-ldap: +\end_layout + +\begin_layout LyX-Code + osynctool --configure "sync_ldap_with_evolution" 2 +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +<AdvancedOption> +\end_layout + +\begin_layout LyX-Code + <MaxOccurs>2147483647</MaxOccurs> +\end_layout + +\begin_layout LyX-Code + <Max>2147483647</Max> +\end_layout + +\begin_layout LyX-Code + <Name>authcid</Name> +\end_layout + +\begin_layout LyX-Code + <Type>string</Type> +\end_layout + +\begin_layout LyX-Code + <Value>ldap_user</Value> +\end_layout + +\begin_layout LyX-Code +</AdvancedOption> +\end_layout + +\begin_layout LyX-Code +<AdvancedOption> +\end_layout + +\begin_layout LyX-Code + <MaxOccurs>2147483647</MaxOccurs> +\end_layout + +\begin_layout LyX-Code + <Max>2147483647</Max> +\end_layout + +\begin_layout LyX-Code + <Name>password</Name> +\end_layout + +\begin_layout LyX-Code + <Type>string</Type> +\end_layout + +\begin_layout LyX-Code + <Value>secret</Value> +\end_layout + +\begin_layout LyX-Code +</AdvancedOption> +\end_layout + +\begin_layout LyX-Code +<AdvancedOption> +\end_layout + +\begin_layout LyX-Code + <MaxOccurs>2147483647</MaxOccurs> +\end_layout + +\begin_layout LyX-Code + <Max>2147483647</Max> +\end_layout + +\begin_layout LyX-Code + <Name>anonymous</Name> +\end_layout + +\begin_layout LyX-Code + <Type>string</Type> +\end_layout + +\begin_layout LyX-Code + <Value>0</Value> +\end_layout + +\begin_layout LyX-Code +</AdvancedOption> +\end_layout + +\begin_layout LyX-Code +<AdvancedOption> +\end_layout + +\begin_layout LyX-Code + <MaxOccurs>2147483647</MaxOccurs> +\end_layout + +\begin_layout LyX-Code + <Max>2147483647</Max> +\end_layout + +\begin_layout LyX-Code + <Name>authmech</Name> +\end_layout + +\begin_layout LyX-Code + <Type>string</Type> +\end_layout + +\begin_layout LyX-Code + <Value>DIGEST-MD5</Value> +\end_layout + +\begin_layout LyX-Code +</AdvancedOption> +\end_layout + +\begin_layout Standard +Any configuration setting performed by +\begin_inset Quotes eld +\end_inset + +osynctool --configure ... +\begin_inset Quotes erd +\end_inset + + must additionally be set into effect by: +\end_layout + +\begin_layout LyX-Code +osynctool --discover "sync_ldap_with_evolution" +\end_layout + +\begin_layout Subsection +SASL/CRAM-MD5 +\end_layout + +\begin_layout Standard +SASL using CRAM-MD5 with the password being stored in the sasldb as shown + above under +\begin_inset CommandInset ref +LatexCommand ref +reference "sasldb_account" + +\end_inset + +. + For the authentication itself nothing else has to be configured. + +\end_layout + +\begin_layout Standard +For the access rules to work the authentication identifier (bind-DN) can + be rewritten by these lines in /etc/openldap/slapd.conf: +\end_layout + +\begin_layout LyX-Code +authz-regexp +\end_layout + +\begin_layout LyX-Code + uid=([^,]*),cn=cram-md5,cn=auth +\end_layout + +\begin_layout LyX-Code + cn=$1,dc=example,dc=com +\end_layout + +\begin_layout Standard +Configure the opensync-plugin-ldap: +\end_layout + +\begin_layout LyX-Code +osynctool --configure "sync_ldap_with_evolution" 2 +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +<AdvancedOption> +\end_layout + +\begin_layout LyX-Code + <MaxOccurs>2147483647</MaxOccurs> +\end_layout + +\begin_layout LyX-Code + <Max>2147483647</Max> +\end_layout + +\begin_layout LyX-Code + <Name>authcid</Name> +\end_layout + +\begin_layout LyX-Code + <Type>string</Type> +\end_layout + +\begin_layout LyX-Code + <Value>ldap_user</Value> +\end_layout + +\begin_layout LyX-Code +</AdvancedOption> +\end_layout + +\begin_layout LyX-Code +<AdvancedOption> +\end_layout + +\begin_layout LyX-Code + <MaxOccurs>2147483647</MaxOccurs> +\end_layout + +\begin_layout LyX-Code + <Max>2147483647</Max> +\end_layout + +\begin_layout LyX-Code + <Name>password</Name> +\end_layout + +\begin_layout LyX-Code + <Type>string</Type> +\end_layout + +\begin_layout LyX-Code + <Value>secret</Value> +\end_layout + +\begin_layout LyX-Code +</AdvancedOption> +\end_layout + +\begin_layout LyX-Code +<AdvancedOption> +\end_layout + +\begin_layout LyX-Code + <MaxOccurs>2147483647</MaxOccurs> +\end_layout + +\begin_layout LyX-Code + <Max>2147483647</Max> +\end_layout + +\begin_layout LyX-Code + <Name>anonymous</Name> +\end_layout + +\begin_layout LyX-Code + <Type>string</Type> +\end_layout + +\begin_layout LyX-Code + <Value>0</Value> +\end_layout + +\begin_layout LyX-Code +</AdvancedOption> +\end_layout + +\begin_layout LyX-Code +<AdvancedOption> +\end_layout + +\begin_layout LyX-Code + <MaxOccurs>2147483647</MaxOccurs> +\end_layout + +\begin_layout LyX-Code + <Max>2147483647</Max> +\end_layout + +\begin_layout LyX-Code + <Name>authmech</Name> +\end_layout + +\begin_layout LyX-Code + <Type>string</Type> +\end_layout + +\begin_layout LyX-Code + <Value>CRAM-MD5</Value> +\end_layout + +\begin_layout LyX-Code +</AdvancedOption> +\end_layout + +\begin_layout Standard +Any configuration setting performed by +\begin_inset Quotes eld +\end_inset + +osynctool --configure ... +\begin_inset Quotes erd +\end_inset + + must additionally be set into effect by: +\end_layout + +\begin_layout LyX-Code +osynctool --discover "sync_ldap_with_evolution" +\end_layout + +\begin_layout Subsection +SASL/PLAIN over an encrypted connection +\end_layout + +\begin_layout Standard +SASL using the PLAIN mechanism with the password being stored in the sasldb. + The default configuration of newer slapd versions does not accept such + an insecure authentication method without encryption. + See above under +\begin_inset CommandInset ref +LatexCommand ref +reference "sasl_mechanisms_offered_by_slapd" + +\end_inset + +. + As a consequence the ldap plugin must establish an encrypted connection. + This can be configured EITHER by setting the option +\begin_inset Quotes eld +\end_inset + +encryption +\begin_inset Quotes erd +\end_inset + + to 1 OR by setting a network connection that leads to a port used for encrypted + sessions only: +\end_layout + +\begin_layout LyX-Code +osynctool --configure "sync_ldap_with_evolution" 2 +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +<AdvancedOption> +\end_layout + +\begin_layout LyX-Code + <MaxOccurs>2147483647</MaxOccurs> +\end_layout + +\begin_layout LyX-Code + <Max>2147483647</Max> +\end_layout + +\begin_layout LyX-Code + <Name>authcid</Name> +\end_layout + +\begin_layout LyX-Code + <Type>string</Type> +\end_layout + +\begin_layout LyX-Code + <Value>ldap_user</Value> +\end_layout + +\begin_layout LyX-Code +</AdvancedOption> +\end_layout + +\begin_layout LyX-Code +<AdvancedOption> +\end_layout + +\begin_layout LyX-Code + <MaxOccurs>2147483647</MaxOccurs> +\end_layout + +\begin_layout LyX-Code + <Max>2147483647</Max> +\end_layout + +\begin_layout LyX-Code + <Name>password</Name> +\end_layout + +\begin_layout LyX-Code + <Type>string</Type> +\end_layout + +\begin_layout LyX-Code + <Value>secret</Value> +\end_layout + +\begin_layout LyX-Code +</AdvancedOption> +\end_layout + +\begin_layout LyX-Code +<AdvancedOption> +\end_layout + +\begin_layout LyX-Code + <MaxOccurs>2147483647</MaxOccurs> +\end_layout + +\begin_layout LyX-Code + <Max>2147483647</Max> +\end_layout + +\begin_layout LyX-Code + <Name>anonymous</Name> +\end_layout + +\begin_layout LyX-Code + <Type>string</Type> +\end_layout + +\begin_layout LyX-Code + <Value>0</Value> +\end_layout + +\begin_layout LyX-Code +</AdvancedOption> +\end_layout + +\begin_layout LyX-Code +<AdvancedOption> +\end_layout + +\begin_layout LyX-Code + <MaxOccurs>2147483647</MaxOccurs> +\end_layout + +\begin_layout LyX-Code + <Max>2147483647</Max> +\end_layout + +\begin_layout LyX-Code + <Name>authmech</Name> +\end_layout + +\begin_layout LyX-Code + <Type>string</Type> +\end_layout + +\begin_layout LyX-Code + <Value>PLAIN</Value> +\end_layout + +\begin_layout LyX-Code +</AdvancedOption> +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +(...) +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +<AdvancedOption> +\end_layout + +\begin_layout LyX-Code + <MaxOccurs>2147483647</MaxOccurs> +\end_layout + +\begin_layout LyX-Code + <Max>2147483647</Max> +\end_layout + +\begin_layout LyX-Code + <Name>encryption</Name> +\end_layout + +\begin_layout LyX-Code + <Type>string</Type> +\end_layout + +\begin_layout LyX-Code + <Value>1</Value> +\end_layout + +\begin_layout LyX-Code +</AdvancedOption> +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +(...) +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +<Connection> +\end_layout + +\begin_layout LyX-Code + +\begin_inset CommandInset label +LatexCommand label +name "encrypted_connection1" + +\end_inset + +<ActiveConnection>Network</ActiveConnection> +\end_layout + +\begin_layout LyX-Code + <Network> +\end_layout + +\begin_layout LyX-Code + <Address>host.example.com</Address> +\end_layout + +\begin_layout LyX-Code + <Port>636</Port> +\end_layout + +\begin_layout LyX-Code + <Protocol>ldaps</Protocol> +\end_layout + +\begin_layout LyX-Code + </Network> +\end_layout + +\begin_layout LyX-Code +</Connection> +\end_layout + +\begin_layout Standard +Any configuration setting performed by +\begin_inset Quotes eld +\end_inset + +osynctool --configure ... +\begin_inset Quotes erd +\end_inset + + must additionally be set into effect by: +\end_layout + +\begin_layout LyX-Code +osynctool --discover "sync_ldap_with_evolution" +\end_layout + +\begin_layout Standard +For the access rules to work the authentication identifier (bind-DN) can + be rewritten by these lines in /etc/openldap/slapd.conf: +\end_layout + +\begin_layout LyX-Code +authz-regexp +\end_layout + +\begin_layout LyX-Code + uid=([^,]*),cn=plain,cn=auth +\end_layout + +\begin_layout LyX-Code + cn=$1,dc=example,dc=com +\end_layout + +\begin_layout Subsection +SASL/LOGIN over an encrypted connection +\end_layout + +\begin_layout Standard +SASL using LOGIN with the password being stored in the sasldb. + The default configuration of newer slapd versions does not accept such + an insecure authentication method without encryption. + See above under +\begin_inset CommandInset ref +LatexCommand ref +reference "sasl_mechanisms_offered_by_slapd" + +\end_inset + +. + As a consequence the ldap plugin must establish an encrypted connection. + This can be configured EITHER by setting the option +\begin_inset Quotes eld +\end_inset + +encryption +\begin_inset Quotes erd +\end_inset + + to 1 OR by setting a network connection that leads to a port used for encrypted + sessions only: +\end_layout + +\begin_layout LyX-Code +osynctool --configure "sync_ldap_with_evolution" 2 +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +(...) +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +<AdvancedOption> +\end_layout + +\begin_layout LyX-Code + <MaxOccurs>2147483647</MaxOccurs> +\end_layout + +\begin_layout LyX-Code + <Max>2147483647</Max> +\end_layout + +\begin_layout LyX-Code + <Name>authcid</Name> +\end_layout + +\begin_layout LyX-Code + <Type>string</Type> +\end_layout + +\begin_layout LyX-Code + <Value>ldap_user</Value> +\end_layout + +\begin_layout LyX-Code +</AdvancedOption> +\end_layout + +\begin_layout LyX-Code +<AdvancedOption> +\end_layout + +\begin_layout LyX-Code + <MaxOccurs>2147483647</MaxOccurs> +\end_layout + +\begin_layout LyX-Code + <Max>2147483647</Max> +\end_layout + +\begin_layout LyX-Code + <Name>password</Name> +\end_layout + +\begin_layout LyX-Code + <Type>string</Type> +\end_layout + +\begin_layout LyX-Code + <Value>secret</Value> +\end_layout + +\begin_layout LyX-Code +</AdvancedOption> +\end_layout + +\begin_layout LyX-Code +<AdvancedOption> +\end_layout + +\begin_layout LyX-Code + <MaxOccurs>2147483647</MaxOccurs> +\end_layout + +\begin_layout LyX-Code + <Max>2147483647</Max> +\end_layout + +\begin_layout LyX-Code + <Name>anonymous</Name> +\end_layout + +\begin_layout LyX-Code + <Type>string</Type> +\end_layout + +\begin_layout LyX-Code + <Value>0</Value> +\end_layout + +\begin_layout LyX-Code +</AdvancedOption> +\end_layout + +\begin_layout LyX-Code +<AdvancedOption> +\end_layout + +\begin_layout LyX-Code + <MaxOccurs>2147483647</MaxOccurs> +\end_layout + +\begin_layout LyX-Code + <Max>2147483647</Max> +\end_layout + +\begin_layout LyX-Code + <Name>authmech</Name> +\end_layout + +\begin_layout LyX-Code + <Type>string</Type> +\end_layout + +\begin_layout LyX-Code + <Value>PLAIN</Value> +\end_layout + +\begin_layout LyX-Code +</AdvancedOption> +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +(...) +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +<AdvancedOption> +\end_layout + +\begin_layout LyX-Code + <MaxOccurs>2147483647</MaxOccurs> +\end_layout + +\begin_layout LyX-Code + <Max>2147483647</Max> +\end_layout + +\begin_layout LyX-Code + <Name>encryption</Name> +\end_layout + +\begin_layout LyX-Code + <Type>string</Type> +\end_layout + +\begin_layout LyX-Code + <Value>1</Value> +\end_layout + +\begin_layout LyX-Code +</AdvancedOption> +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +(...) +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +<Connection> +\end_layout + +\begin_layout LyX-Code + <ActiveConnection>Network</ActiveConnection> +\end_layout + +\begin_layout LyX-Code + <Network> +\end_layout + +\begin_layout LyX-Code + <Address>host.example.com</Address> +\end_layout + +\begin_layout LyX-Code + <Port>636</Port> +\end_layout + +\begin_layout LyX-Code + <Protocol>ldaps</Protocol> +\end_layout + +\begin_layout LyX-Code + </Network> +\end_layout + +\begin_layout LyX-Code +</Connection> +\end_layout + +\begin_layout Standard +Any configuration setting performed by +\begin_inset Quotes eld +\end_inset + +osynctool --configure ... +\begin_inset Quotes erd +\end_inset + + must additionally be set into effect by: +\end_layout + +\begin_layout LyX-Code +osynctool --discover "sync_ldap_with_evolution" +\end_layout + +\begin_layout Standard +For the access rules to work the authentication identifier (bind-DN) can + be rewritten by these lines in /etc/openldap/slapd.conf: +\end_layout + +\begin_layout LyX-Code +authz-regexp +\end_layout + +\begin_layout LyX-Code + uid=([^,]*),cn=login,cn=auth +\end_layout + +\begin_layout LyX-Code + cn=$1,dc=example,dc=com +\end_layout + +\begin_layout Subsection +SASL/GSSAPI (KERBEROS V5) +\end_layout + +\begin_layout Standard +\begin_inset CommandInset label +LatexCommand label +name "kerberosv5" + +\end_inset + +SASL using GSSAPI with the password being stored in the kerberos subsystem. + This has the advantage that the password is not sent over the connection + to the LDAP server. +\end_layout + +\begin_layout Subsubsection +Preparing KERBEROS V5 +\end_layout + +\begin_layout Paragraph +DNS configuration +\end_layout + +\begin_layout Standard +Check resolver settings: +\end_layout + +\begin_layout LyX-Code +vim /etc/nsswitch.conf +\end_layout + +\begin_layout LyX-Code +(...) +\end_layout + +\begin_layout LyX-Code +hosts: files dns +\end_layout + +\begin_layout LyX-Code +(...) +\end_layout + +\begin_layout Standard +Add "kerberos" host name to DNS: +\end_layout + +\begin_layout LyX-Code +vim /etc/hosts +\end_layout + +\begin_layout LyX-Code +192.168.1.2 host.example.com host www kerberos +\end_layout + +\begin_layout Standard +Propagate KDCs via SRV record types in terms of RFC 2782: +\end_layout + +\begin_layout LyX-Code +vim /etc/dnsmasq.conf +\end_layout + +\begin_layout LyX-Code +srv-host=_kerberos._udp,host.example.com,88 +\end_layout + +\begin_layout LyX-Code +srv-host=_kerberos-master._udp,host.example.com,88 +\end_layout + +\begin_layout LyX-Code +srv-host=_kerberos-adm._tcp,host.example.com,749 +\end_layout + +\begin_layout LyX-Code +srv-host=_kpasswd._udp,host.example.com,464 +\end_layout + +\begin_layout Standard +Make changes effective: +\end_layout + +\begin_layout LyX-Code +service dnsmasq restart +\end_layout + +\begin_layout Standard +Test it: +\end_layout + +\begin_layout LyX-Code +host kerberos +\end_layout + +\begin_layout Paragraph +Determine realm on a fedora 10 system +\end_layout + +\begin_layout LyX-Code +vim /etc/sysconfig/krb5kdc +\end_layout + +\begin_layout LyX-Code +KRB5KDC_ARGS= +\end_layout + +\begin_layout LyX-Code +KRB5REALM=EXAMPLE.COM +\end_layout + +\begin_layout Paragraph +Configure main configuration file for kerberos +\end_layout + +\begin_layout LyX-Code +vim /etc/krb5.conf +\end_layout + +\begin_layout LyX-Code +[libdefaults] +\end_layout + +\begin_layout LyX-Code + default_realm = EXAMPLE.COM +\end_layout + +\begin_layout LyX-Code + dns_lookup_realm = false +\end_layout + +\begin_layout LyX-Code + dns_lookup_kdc = false +\end_layout + +\begin_layout LyX-Code + ticket_lifetime = 24h +\end_layout + +\begin_layout LyX-Code + forwardable = yes +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +[realms] +\end_layout + +\begin_layout LyX-Code + EXAMPLE.COM = { +\end_layout + +\begin_layout LyX-Code + kdc = host.example.com:88 +\end_layout + +\begin_layout LyX-Code + kdc = kerberos.example.com:88 +\end_layout + +\begin_layout LyX-Code + kdc = localhost.localdomain:88 +\end_layout + +\begin_layout LyX-Code + kdc = localhost +\end_layout + +\begin_layout LyX-Code + admin_server = kerberos.example.com:749 +\end_layout + +\begin_layout LyX-Code + default_domain = example.com +\end_layout + +\begin_layout LyX-Code + } +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +[domain_realm] +\end_layout + +\begin_layout LyX-Code + .example.com = EXAMPLE.COM +\end_layout + +\begin_layout LyX-Code + example.com = EXAMPLE.COM +\end_layout + +\begin_layout LyX-Code + localdomain = EXAMPLE.COM +\end_layout + +\begin_layout LyX-Code + .localdomain = EXAMPLE.COM +\end_layout + +\begin_layout Paragraph +Configure configuration file of the KDC, i.e. + for issuing tickets per realm +\end_layout + +\begin_layout LyX-Code +vim /var/kerberos/krb5kdc/kdc.conf +\end_layout + +\begin_layout LyX-Code +[kdcdefaults] +\end_layout + +\begin_layout LyX-Code + v4_mode = nopreauth +\end_layout + +\begin_layout LyX-Code + kdc_ports = 88,750 +\end_layout + +\begin_layout LyX-Code + kdc_tcp_ports = 88 +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +[realms] +\end_layout + +\begin_layout LyX-Code + EXAMPLE.COM = { +\end_layout + +\begin_layout LyX-Code + acl_file = /var/kerberos/krb5kdc/kadm5.acl +\end_layout + +\begin_layout LyX-Code + dict_file = /usr/share/dict/words +\end_layout + +\begin_layout LyX-Code + admin_keytab = /var/kerberos/krb5kdc/kadm5.keytab +\end_layout + +\begin_layout LyX-Code + supported_enctypes = aes256-cts:normal aes128-cts:normal des3-hmac-sha1:norm +al arcfour-hmac:normal des-hmac-sha1:normal des-cbc-md5:normal des-cbc-crc:norma +l des-cbc-crc:v4 des-cbc-crc:afs3 +\end_layout + +\begin_layout LyX-Code + } +\end_layout + +\begin_layout Paragraph +Create the database for this particular realm EXAMPLE.COM and a stash file + for the server to authenticate itself using the password +\begin_inset Quotes eld +\end_inset + +master +\begin_inset Quotes erd +\end_inset + + +\end_layout + +\begin_layout Standard +If you choose not to install a stash file, the KDC will prompt you for the + master key each time it starts up. + This means that the KDC will not be able to start automatically, such as + after a system reboot. +\end_layout + +\begin_layout LyX-Code +kdb5_util create -r EXAMPLE.COM -s +\end_layout + +\begin_layout LyX-Code +(...) +\end_layout + +\begin_layout LyX-Code +Enter KDC database master key: master +\end_layout + +\begin_layout LyX-Code +Re-enter KDC database master key to verify: master +\end_layout + +\begin_layout Paragraph +Grant administrative access +\end_layout + +\begin_layout LyX-Code +vim /var/kerberos/krb5kdc/kadm5.acl +\end_layout + +\begin_layout LyX-Code +*/ad...@EX... * +\end_layout + +\begin_layout Paragraph +Add administrative principals to the Kerberos database +\end_layout + +\begin_layout LyX-Code +kadmin.local -q "addprinc root/admin" +\end_layout + +\begin_layout LyX-Code +(...) +\end_layout + +\begin_layout Paragraph +Create service principal "ldap/host.example.com" +\end_layout + +\begin_layout LyX-Code +kadmin.local -q "addprinc ldap/host.example.com" +\end_layout + +\begin_layout LyX-Code +(...) +\end_layout + +\begin_layout Paragraph +Create keytab file for service principal "ldap" +\end_layout + +\begin_layout LyX-Code +kadmin.local -q "ktadd ldap/host.example.com" +\end_layout + +\begin_layout LyX-Code +(...) +\end_layout + +\begin_layout Paragraph +Adjust permissions: The keytab file must be readable by the LDAP server +\end_layout + +\begin_layout Standard +For a dissenting opinion on this (suggests building a second keytab file): + Cf. + +\begin_inset CommandInset href +LatexCommand href +name "http://www.openldap.org/faq/index.cgi?_highlightWords=keytab&file=630" +target "http://www.openldap.org/faq/index.cgi?_highlightWords=keytab&file=630" + +\end_inset + + +\end_layout + +\begin_layout LyX-Code +chown root:ldap /etc/krb5.keytab +\end_layout + +\begin_layout LyX-Code +chmod g+r /etc/krb5.keytab +\end_layout + +\begin_layout Paragraph +Create the user principal "ldap_user" with password "secret" +\end_layout + +\begin_layout LyX-Code +useradd ldap_user +\end_layout + +\begin_layout LyX-Code +(...) +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +passwd ldap_user +\end_layout + +\begin_layout LyX-Code +(...) +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +kadmin.local -q "addprinc ldap_user" +\end_layout + +\begin_layout LyX-Code +(...) +\end_layout + +\begin_layout Paragraph +Useful commands +\end_layout + +\begin_layout LyX-Code +kadmin.local -q "list_principals" +\end_layout + +\begin_layout LyX-Code +(...) +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +ktutil +\end_layout + +\begin_layout LyX-Code +ktutil: read_kt /etc/krb5.keytab +\end_layout + +\begin_layout LyX-Code +ktutil: list +\end_layout + +\begin_layout LyX-Code +(...) +\end_layout + +\begin_layout LyX-Code +ktutil: quit +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +kadmin.local -q "get_principal ldap" +\end_layout + +\begin_layout LyX-Code +(...) +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +kadmin.local -q "get_principal ldap_user" +\end_layout + +\begin_layout LyX-Code +(...) +\end_layout + +\begin_layout Paragraph +Adjust SELinux +\end_layout + +\begin_layout LyX-Code +setsebool -P allow_kerberos 1 +\end_layout + +\begin_layout Paragraph +Start up the kdc on a fedora system +\end_layout + +\begin_layout LyX-Code +chkconfig --level 345 kadmin on +\end_layout + +\begin_layout LyX-Code +chkconfig --level 345 krb5kdc on +\end_layout + +\begin_layout LyX-Code +service krb5kdc start +\end_layout + +\begin_layout LyX-Code +service kadmin start +\end_layout + +\begin_layout Paragraph +Kerberos related log files +\end_layout + +\begin_layout LyX-Code +tail -f /var/log/krb5kdc.log +\end_layout + +\begin_layout LyX-Code +(...) +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +tail -f /var/log/kadmind.log +\end_layout + +\begin_layout LyX-Code +(...) +\end_layout + +\begin_layout Subsubsection +Configure the opensync-plugin-ldap: +\end_layout + +\begin_layout LyX-Code +osynctool --configure "sync_ldap_with_evolution" 2 +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +(...) +\end_layout + +\begin_layout LyX-Code +<AdvancedOption> +\end_layout + +\begin_layout LyX-Code + <MaxOccurs>2147483647</MaxOccurs> +\end_layout + +\begin_layout LyX-Code + <Max>2147483647</Max> +\end_layout + +\begin_layout LyX-Code + <Name>authcid</Name> +\end_layout + +\begin_layout LyX-Code + <Type>string</Type> +\end_layout + +\begin_layout LyX-Code + <Value>ldap_user</Value> +\end_layout + +\begin_layout LyX-Code +</AdvancedOption> +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +(...) +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +<AdvancedOption> +\end_layout + +\begin_layout LyX-Code + <MaxOccurs>2147483647</MaxOccurs> +\end_layout + +\begin_layout LyX-Code + <Max>2147483647</Max> +\end_layout + +\begin_layout LyX-Code + <Name>anonymous</Name> +\end_layout + +\begin_layout LyX-Code + <Type>string</Type> +\end_layout + +\begin_layout LyX-Code + <Value>0</Value> +\end_layout + +\begin_layout LyX-Code +</AdvancedOption> +\end_layout + +\begin_layout LyX-Code +<AdvancedOption> +\end_layout + +\begin_layout LyX-Code + <MaxOccurs>2147483647</MaxOccurs> +\end_layout + +\begin_layout LyX-Code + <Max>2147483647</Max> +\end_layout + +\begin_layout LyX-Code + <Name>authmech</Name> +\end_layout + +\begin_layout LyX-Code + <Type>string</Type> +\end_layout + +\begin_layout LyX-Code + <Value>GSSAPI</Value> +\end_layout + +\begin_layout LyX-Code +</AdvancedOption> +\end_layout + +\begin_layout Standard +Any configuration setting performed by +\begin_inset Quotes eld +\end_inset + +osynctool --configure ... +\begin_inset Quotes erd +\end_inset + + must additionally be set into effect by: +\end_layout + +\begin_layout LyX-Code +osynctool --discover "sync_ldap_with_evolution" +\end_layout + +\begin_layout Standard +For the access rules to work the authentication identifier (bind-DN) can + be rewritten by these lines in /etc/openldap/slapd.conf: +\end_layout + +\begin_layout LyX-Code +authz-regexp +\end_layout + +\begin_layout LyX-Code + uid=([^,]*),cn=gssapi,cn=auth +\end_layout + +\begin_layout LyX-Code + cn=$1,dc=example,dc=com +\end_layout + +\begin_layout Subsubsection +Using KERBEROS with SASL +\end_layout + +\begin_layout Standard +Retrieve a ticket-granting ticket: +\end_layout + +\begin_layout LyX-Code +kinit -V ldap_user +\end_layout + +\begin_layout LyX-Code +Password for lda...@EX...: secret +\end_layout + +\begin_layout LyX-Code +Authenticated to Kerberos v5 +\end_layout + +\begin_layout Standard +Get to know the expiration date: +\end_layout + +\begin_layout LyX-Code +klist +\end_layout + +\begin_layout LyX-Code +(...) +\end_layout + +\begin_layout Standard +Run osynctool: +\end_layout + +\begin_layout LyX-Code +osynctool --configure ... +\end_layout + +\begin_layout LyX-Code +osynctool --discover ... +\end_layout + +\begin_layout LyX-Code +osynctool --sync ... +\end_layout + +\begin_layout Subsection +SASL/EXTERNAL using the TLS cert used in a TLS encrypted connection +\end_layout + +\begin_layout Standard +SASL using the EXTERNAL mechanism with both the identifier and the password + being stored in the SSL/TLS subsystem. +\end_layout + +\begin_layout Subsubsection +Generate server and client certificates +\end_layout + +\begin_layout LyX-Code +\begin_inset CommandInset label +LatexCommand label +name "tls_certs" + +\end_inset + +cd /etc/openldap/cacerts/ +\end_layout + +\begin_layout Standard +Create server certificate signing request and server key +\end_layout + +\begin_layout LyX-Code +openssl req -new -nodes -out server.csr -keyout server.key +\end_layout + +\begin_layout Standard +Sign the server certificate +\end_layout + +\begin_layout LyX-Code +openssl ca -policy policy_anything -out server.crt -infiles ./server.csr +\end_layout + +\begin_layout Standard +Display contents of the LDAP server certificate +\end_layout + +\begin_layout LyX-Code +openssl x509 -text -in server.crt +\end_layout + +\begin_layout Standard +Create client certificate signing request and client key +\end_layout + +\begin_layout LyX-Code +openssl req -new -nodes -out client.csr -keyout client.key +\end_layout + +\begin_layout Standard +Sign the client certificate +\end_layout + +\begin_layout LyX-Code +openssl ca -out client.crt -infiles ./client.csr +\end_layout + +\begin_layout Standard +Display contents of the LDAP client certificate +\end_layout + +\begin_layout LyX-Code +openssl x509 -text -in client.crt +\end_layout + +\begin_layout Subsubsection +Configuration of the LDAP server +\end_layout + +\begin_layout Standard +Tell slapd about the TLS key and the TLS certificate: +\end_layout + +\begin_layout LyX-Code +vim /etc/openldap/slapd.conf +\end_layout + +\begin_layout LyX-Code +TLSCACertificatePath /etc/openldap/cacerts +\end_layout + +\begin_layout LyX-Code +TLSCipherSuite HIGH:MEDIUM:+SSLv2:RSA +\end_layout + +\begin_layout LyX-Code +TLSCertificateFile /etc/openldap/cacerts/server.crt +\end_layout + +\begin_layout LyX-Code +TLSCertificateKeyFile /etc/openldap/cacerts/server.key +\end_layout + +\begin_layout Standard +Change slapd start up options on a fedora 10 system +\end_layout + +\begin_layout LyX-Code +vim /etc/sysconfig/ldap +\end_layout + +\begin_layout LyX-Code +SLAPD_LDAP=no +\end_layout + +\begin_layout LyX-Code +SLAPD_LDAPS=yes +\end_layout + +\begin_layout Standard +For the access rules to work the authentication identifier (bind-DN) can + be rewritten by these lines in /etc/openldap/slapd.conf: +\end_layout + +\begin_layout LyX-Code +authz-regexp +\end_layout + +\begin_layout LyX-Code + email=([^@]+)@host +\backslash +.([^.]+) +\backslash +.([^,]+),cn=host +\backslash +.example +\backslash +.com,ou=[^#]+[^ +\backslash + ]+ +\backslash + ldap +\backslash + client +\backslash + [^,]+,o=a +\backslash + private +\backslash + site +\backslash +.,st=city,c=us +\end_layout + +\begin_layout LyX-Code + cn=$1,dc=$2,dc=$3 +\end_layout + +\begin_layout Standard +Check syntax of slapd.conf +\end_layout + +\begin_layout LyX-Code +slapd -Ttest +\end_layout + +\begin_layout Subsubsection +Configuration of the LDAP client side +\end_layout + +\begin_layout LyX-Code +vim /etc/openldap/ldap.conf +\end_layout + +\begin_layout LyX-Code +URI ldaps://host.example.com/ +\end_layout + +\begin_layout LyX-Code +BASE dc=example,dc=com +\end_layout + +\begin_layout Standard +The TLS_* variables MUST NOT be configured in /etc/openldap/ldap.conf. +\end_layout + +\begin_layout Standard +They MUST be configured in ~/ldaprc or ~/.ldaprc: +\end_layout + +\begin_layout LyX-Code +vim /home/user1/.ldaprc +\end_layout + +\begin_layout LyX-Code +TLS_CACERTDIR /etc/openldap/cacerts +\end_layout + +\begin_layout LyX-Code +TLS_CACERT /etc/openldap/cacerts/server.crt +\end_layout + +\begin_layout LyX-Code +TLS_CERT /etc/openldap/cacerts/client.crt +\end_layout + +\begin_layout LyX-Code +TLS_KEY /etc/openldap/cacerts/client.key +\end_layout + +\begin_layout LyX-Code +TLSCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP +\end_layout + +\begin_layout LyX-Code +TLS_REQCERT never +\end_layout + +\begin_layout Subsubsection +Configure the opensync-plugin-ldap +\end_layout + +\begin_layout LyX-Code +osynctool --configure "sync_ldap_with_evolution" 2 +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +(...) +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +<AdvancedOption> +\end_layout + +\begin_layout LyX-Code + <MaxOccurs>2147483647</MaxOccurs> +\end_layout + +\begin_layout LyX-Code + <Max>2147483647</Max> +\end_layout + +\begin_layout LyX-Code + <Name>anonymous</Name> +\end_layout + +\begin_layout LyX-Code + <Type>string</Type> +\end_layout + +\begin_layout LyX-Code + <Value>0</Value> +\end_layout + +\begin_layout LyX-Code +</AdvancedOption> +\end_layout + +\begin_layout LyX-Code +<AdvancedOption> +\end_layout + +\begin_layout LyX-Code + <MaxOccurs>2147483647</MaxOccurs> +\end_layout + +\begin_layout LyX-Code + <Max>2147483647</Max> +\end_layout + +\begin_layout LyX-Code + <Name>authmech</Name> +\end_layout + +\begin_layout LyX-Code + <Type>string</Type> +\end_layout + +\begin_layout LyX-Code + <Value>EXTERNAL</Value> +\end_layout + +\begin_layout LyX-Code +</AdvancedOption> +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +(...) +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +<AdvancedOption> +\end_layout + +\begin_layout LyX-Code + <MaxOccurs>2147483647</MaxOccurs> +\end_layout + +\begin_layout LyX-Code + <Max>2147483647</Max> +\end_layout + +\begin_layout LyX-Code + <Name>encryption</Name> +\end_layout + +\begin_layout LyX-Code + <Type>string</Type> +\end_layout + +\begin_layout LyX-Code + <Value>1</Value> +\end_layout + +\begin_layout LyX-Code +</AdvancedOption> +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +(...) +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +<Connection> +\end_layout + +\begin_layout LyX-Code + <ActiveConnection>Network</ActiveConnection> +\end_layout + +\begin_layout LyX-Code + <Network> +\end_layout + +\begin_layout LyX-Code + <Address>host.example.com</Address> +\end_layout + +\begin_layout LyX-Code + <Port>636</Port> +\end_layout + +\begin_layout LyX-Code + <Protocol>ldaps</Protocol> +\end_layout + +\begin_layout LyX-Code + </Network> +\end_layout + +\begin_layout LyX-Code +</Connection> +\end_layout + +\begin_layout Standard +Any configuration setting performed by +\begin_inset Quotes eld +\end_inset + +osynctool --configure ... +\begin_inset Quotes erd +\end_inset + + must additionally be set into effect by: +\end_layout + +\begin_layout LyX-Code +osynctool --discover "sync_ldap_with_evolution" +\end_layout + +\begin_layout Part +Usage +\end_layout + +\begin_layout Section +Synchronizing between evolution and LDAP +\end_layout + +\begin_layout Standard +If you want to start from scratch: +\end_layout + +\begin_layout LyX-Code +osynctool --delgroup "sync_ldap_with_evolution" +\end_layout + +\begin_layout Standard +The very first configuration step: Choose a name for a particular synchronizatio +n group: +\end_layout + +\begin_layout LyX-Code +osynctool --addgroup "sync_ldap_with_evolution" +\end_layout + +\begin_layout Standard +Which plugins could we use for this synchronization group? +\end_layout + +\begin_layout LyX-Code +osynctool --listplugins +\end_layout + +\begin_layout LyX-Code +Available plugins: +\end_layout + +\begin_layout LyX-Code +ldap-sync +\end_layout + +\begin_layout LyX-Code +syncml-http-server +\end_layout + +\begin_layout LyX-Code +syncml-http-client +\end_layout + +\begin_layout LyX-Code +syncml-obex-client +\end_layout + +\begin_layout LyX-Code +file-sync +\end_layout + +\begin_layout LyX-Code +evo2-sync +\end_layout + +\begin_layout Standard +Here we choose the +\begin_inset Quotes eld +\end_inset + +evo2-sync +\begin_inset Quotes erd +\end_inset + + and the +\begin_inset Quotes eld +\end_inset + +ldap-sync +\begin_inset Quotes erd +\end_inset + + plugin: +\end_layout + +\begin_layout LyX-Code +osynctool --addmember "sync_ldap_with_evolution" evo2-sync +\end_layout + +\begin_layout LyX-Code + +\end_layout + +\begin_layout LyX-Code +osynctool --addmember "sync_ldap_with_evolution" ldap-sync +\end_layout + +\begin_layout Standard +Which formats are available for configuring each plugin? +\end_layout + +\begin_layout LyX-Code +osynctool --listformats +\end_layout + +\begin_layout LyX-Code +(...) +\end_layout + +\begin_layout LyX-Code +Format: ldap-evolutionperson +\end_layout + +\begin_layout LyX-Code + Object Type: contact +\end_layout + +\begin_layout LyX-Code +Format: ldap-inetorgperson +\end_layout + +\begin_layout LyX-Code + Object Type: contact +\end_layout + +\begin_layout LyX-Code +Format: ldap-event +\end_layout + +\begin_layout LyX-Code + Object Type: event +\end_layout + +\begin_layout LyX-Code +Format: ldap-todo +\end_layout + +\begin_layout LyX-Code + Object Type: todo +\end_layout + +\begin_layout LyX-Code +Format: ldap-note +\end_layout + +\begin_layout LyX-Code + Object Type: note +\end_layout + +\begin_layout LyX-Code +(...) +\end_layout + +\begin_layout Standard +Configure the evo2-sync plugin: +\end_layout + +\begin_layout LyX-Code +osynctool --configure "sync_ldap_with_evolution" 1 +\end_layout + +\begin_layout LyX-Code +(...) +\end_layout + +\begin_layout Standard +Configure the +\begin_inset Quotes eld +\end_inset + +ldap-sync +\begin_inset Quotes erd +\end_inset + + plugin: The following configuration lets only the objtype +\begin_inset Quotes eld +\end_inset + +contact +\begin_inset Quotes erd +\end_inset + + be enabled. + It chooses SASL/DIGEST-MD5 as authentication mechanism with the authcid + being +\begin_inset Quotes eld +\end_inset + +ldap_user +\begin_inset Quotes erd +\end_inset + + and the password +\begin_inset Quotes eld +\end_inset + +secret +\begin_inset Quotes erd +\end_inset + +. + It connects to a host +\begin_inset Quotes eld +\end_inset + +host.example.com +\begin_inset Quotes erd +\end_inset + + on port 389 with the protocol +\begin_inset Quotes eld +\end_inset + +ldap +\begin_inset Quotes erd +\end_inset + +. +\end_layout + +\begin_layout Standard +For how to set up an encrypted connection see above +\begin_inset CommandInset ref +LatexCommand ref +reference "encrypted_connection1" + +\end_inset + + and ... [truncated message content] |
From: <svn...@op...> - 2009-03-26 00:12:06
|
Author: scriptor Date: Thu Mar 26 01:11:56 2009 New Revision: 5330 URL: http://www.opensync.org/changeset/5330 Log: Initial version of the LDAP plugin having been ported to libopensync-0.3x. Added: plugins/ldap-sync/NEWS (contents, props changed) Added: plugins/ldap-sync/NEWS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/NEWS Thu Mar 26 01:11:56 2009 (r5330) @@ -0,0 +1,54 @@ +$Id$ + + +March 2009: + +The ldap plugin has been ported to openldap-2.4 and opensync-0.39 (r5291). +The plugin has been splitted up in the actual ldap-sync plugin +and the ldap-format plugin. + +All 4 object types can be synchronized. + +The mapping from + +xmlformat-contact, +xmlformat-event, +xmlformat-todo, +xmlformat-note + +to + +ldap-evolutionperson or ldap-inetorgperson, +ldap-event, +ldap-todo, +ldap-note + +and vice versa is NOT loss-free and by far not bug-free, yet. + +The mapping is performed in two steps: + +1. From xmlformat-contact, for example, to some ldap-plugin + internal XML format. + +2. From this internal XML format to C structs suitable for libldap. + +And vice versa. + +Some fields are not mapped, at all. + +Some other fields are mapped to some subentry of objectClass +"organizationalUnit" instead of being mapped to objectClass +"evolutionperson". This is a workaround for the problem that +the formats used by libopensync are not really compatible +to the various LDAP schemes generally used. + +There is still no support for XML elements that occur MORE than +one time, like two or three addresses. + +And there is no real support for deeper XML element levels, either, +as it can be found in the "<Address>"-element. + +For other changes see ChangeLog. + + + |
From: <svn...@op...> - 2009-03-26 00:11:55
|
Author: scriptor Date: Thu Mar 26 01:11:40 2009 New Revision: 5329 URL: http://www.opensync.org/changeset/5329 Log: Initial version of the LDAP plugin having been ported to libopensync-0.3x. Added: plugins/ldap-sync/LICENSE (contents, props changed) Added: plugins/ldap-sync/LICENSE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/LICENSE Thu Mar 26 01:11:40 2009 (r5329) @@ -0,0 +1 @@ +link COPYING \ No newline at end of file |
From: <svn...@op...> - 2009-03-26 00:11:39
|
Author: scriptor Date: Thu Mar 26 01:11:28 2009 New Revision: 5328 URL: http://www.opensync.org/changeset/5328 Log: Initial version of the LDAP plugin having been ported to libopensync-0.3x. Added: plugins/ldap-sync/INSTALL (contents, props changed) Added: plugins/ldap-sync/INSTALL ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/INSTALL Thu Mar 26 01:11:28 2009 (r5328) @@ -0,0 +1,88 @@ +$Id$ + + +A. Regular build: + +tar -xvjf libopensync-plugin-ldap-0.39.tar.bz2 +cd libopensync-plugin-ldap-0.39 +mkdir build +cd build +PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/" cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DUPDATE_TYPE=svn /home/user1/libopensync-0.39/libopensync-plugin-ldap-0.39 +make -s +make -w install +ldconfig +cd ../.. + + +B. Debug build: + +tar -xvjf libopensync-plugin-ldap-0.39.tar.bz2 +cd libopensync-plugin-ldap-0.39 +mkdir build_debug +cd build_debug +PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/" cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DUPDATE_TYPE=svn -DCMAKE_BUILD_TYPE=Debug -DCMAKE_VERBOSE_MAKEFILE=ON /home/user1/libopensync-0.39/libopensync-plugin-ldap-0.39 +make -s +make -w install +ldconfig +cd ../.. + + + + +C. Build doxygen based documentation of the source code: + +cd build +make doxygen +firefox doc/html/index.html & + + + +D. Tests: + +There is a "test" target. It is primarily intended for developers. + +I. Required software: + +The tests make use of external tools, most notably: + +- xmllint +- xsltproc +- ldapsearch +- ldapadd +- ldapmodify +- ldapdelete +- valgrind + + +II. Running the tests: + +cd build +make test + + +III. Display a list of tests: + +cd build +ctest -N + + +IV. Run only one particular test: + + +cd build +ctest -I 51,51 +ctest -R remove_test_ldifs + + + + +E. The following cmake modules are required for the LDAP plugin: + +FindLibLdap.cmake +FindLibGCrypt.cmake +FindLibSASL2.cmake +FindLibGSSAPIV2.cmake + +See cmake/modules. + + |
From: <svn...@op...> - 2009-03-26 00:11:29
|
Author: scriptor Date: Thu Mar 26 01:11:17 2009 New Revision: 5327 URL: http://www.opensync.org/changeset/5327 Log: Initial version of the LDAP plugin having been ported to libopensync-0.3x. Added: plugins/ldap-sync/Doxyfile.in (contents, props changed) Added: plugins/ldap-sync/Doxyfile.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/Doxyfile.in Thu Mar 26 01:11:17 2009 (r5327) @@ -0,0 +1,1473 @@ +# Doxyfile 1.5.7.1 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = libopensync-plugin-ldap + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = ${OPENSYNC_VERSION} + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = doc + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek, +# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish, +# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene, +# Spanish, Swedish, and Ukrainian. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = NO + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen to replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penality. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will rougly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = YES + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespace are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command <command> <input-file>, where <command> is the value of +# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by +# doxygen. The layout file controls the global structure of the generated output files +# in an output format independent way. The create the layout file that represents +# doxygen's defaults, run doxygen with the -l option. You can optionally specify a +# file name after the option, if omitted DoxygenLayout.xml will be used as the name +# of the layout file. + +LAYOUT_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = ${CMAKE_SOURCE_DIR}/src + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = "config.h" + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command <filter> <input-file>, where <filter> +# is the value of the INPUT_FILTER tag, and <input-file> is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# is applied to all files. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. Otherwise they will link to the documentstion. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = YES + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = ${CMAKE_SOURCE_DIR}/src/custom_doxygen_header.html + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = YES + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = YES + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = YES + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER +# are set, an additional index file will be generated that can be used as input for +# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated +# HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# <a href="http://doc.trolltech.com/qthelpproject.html#namespace">Qt Help Project / Namespace</a>. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# <a href="http://doc.trolltech.com/qthelpproject.html#virtual-folders">Qt Help Project / Virtual Folders</a>. + +QHP_VIRTUAL_FOLDER = doc + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file . + +QHG_LOCATION = + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 4 + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to FRAME, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, +# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are +# probably better off using the HTML help feature. Other possible values +# for this tag are: HIERARCHIES, which will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list; +# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which +# disables this behavior completely. For backwards compatibility with previous +# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE +# respectively. + +GENERATE_TREEVIEW = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = YES + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4 + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = YES + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = YES + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = YES + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = YES + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = YES + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = YES + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse +# the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more +# powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = YES + +# By default doxygen will write a font called FreeSans.ttf to the output +# directory and reference it in all dot files that doxygen generates. This +# font does not include all possible unicode characters however, so when you need +# these (or just want a differently looking font) you can specify the font name +# using DOT_FONTNAME. You need need to make sure dot is able to find the font, +# which can be done by putting it in a standard location or by setting the +# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory +# containing the font. + +DOT_FONTNAME = FreeSans + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the output directory to look for the +# FreeSans.ttf font (which doxygen will put there itself). If you specify a +# different font using DOT_FONTNAME you can set the path where dot +# can find it using this tag. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = YES + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = YES + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, S... [truncated message content] |
From: <svn...@op...> - 2009-03-26 00:11:19
|
Author: scriptor Date: Thu Mar 26 01:11:00 2009 New Revision: 5326 URL: http://www.opensync.org/changeset/5326 Log: Initial version of the LDAP plugin having been ported to libopensync-0.3x. Added: plugins/ldap-sync/CTestConfig.cmake (contents, props changed) Added: plugins/ldap-sync/CTestConfig.cmake ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/CTestConfig.cmake Thu Mar 26 01:11:00 2009 (r5326) @@ -0,0 +1,16 @@ +## $Id$ +## +## This file should be placed in the root directory of your project. +## Then modify the CMakeLists.txt file in the root directory of your +## project to incorporate the testing dashboard. +## +## The following are required to uses Dart and the Cdash dashboard +## ENABLE_TESTING() +## INCLUDE(Dart) +set(CTEST_PROJECT_NAME "ldap-sync") +set(CTEST_NIGHTLY_START_TIME "00:00:00 CET") + +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "opensync.org") +set(CTEST_DROP_LOCATION "/testing/submit.php?project=file-sync") +set(CTEST_DROP_SITE_CDASH TRUE) |
From: <svn...@op...> - 2009-03-26 00:11:00
|
Author: scriptor Date: Thu Mar 26 01:10:43 2009 New Revision: 5325 URL: http://www.opensync.org/changeset/5325 Log: Initial version of the LDAP plugin having been ported to libopensync-0.3x. Added: plugins/ldap-sync/COPYING Added: plugins/ldap-sync/COPYING ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/COPYING Thu Mar 26 01:10:43 2009 (r5325) @@ -0,0 +1,510 @@ + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations +below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it +becomes a de-facto standard. To achieve this, non-free programs must +be allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control +compilation and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at least + three years, to give the same user the materials specified in + Subsection 6a, above, for a charge no more than the cost of + performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply, and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License +may add an explicit geographical distribution limitation excluding those +countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms +of the ordinary General Public License). + + To apply these terms, attach the following notices to the library. +It is safest to attach them to the start of each source file to most +effectively convey the exclusion of warranty; and each file should +have at least the "copyright" line and a pointer to where the full +notice is found. + + + <one line to give the library's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or +your school, if any, to sign a "copyright disclaimer" for the library, +if necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James + Random Hacker. + + <signature of Ty Coon>, 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + |
From: <svn...@op...> - 2009-03-26 00:10:36
|
Author: scriptor Date: Thu Mar 26 01:10:25 2009 New Revision: 5324 URL: http://www.opensync.org/changeset/5324 Log: Initial version of the LDAP plugin having been ported to libopensync-0.3x. Added: plugins/ldap-sync/config.h.cmake (contents, props changed) Added: plugins/ldap-sync/config.h.cmake ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/config.h.cmake Thu Mar 26 01:10:25 2009 (r5324) @@ -0,0 +1,21 @@ +#ifndef _CONFIG_H_LDAP_PLUGIN +#define _CONFIG_H_LDAP_PLUGIN + + +#define CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}" +#define CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG}" +#define CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" +#define CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" +#define HAVE_DOT "${HAVE_DOT}" +#define LDAP_INCLUDE_DIR "${LDAP_INCLUDE_DIR}" +#define LDAP_LIBRARY "${LDAP_LIBRARY}" +#define LIBGSSAPIV2_FOUND "${LIBGSSAPIV2_FOUND}" +#define LIBLDAP_FOUND "${LIBLDAP_FOUND}" +#define LIBSASL2_FOUND "${LIBSASL2_FOUND}" +#define LIBXSLT_FOUND "${LIBXSLT_FOUND}" +#define LDAP_PLUGIN_OPENSYNC_CONFIGDIR "${LDAP_PLUGIN_OPENSYNC_CONFIGDIR}" +#define LDAP_PLUGIN_OPENSYNC_SCHEMASDIR "${LDAP_PLUGIN_OPENSYNC_SCHEMASDIR}" +#define VERSION "${VERSION}" + + +#endif |