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-04-02 19:19:58
|
Author: scriptor Date: Thu Apr 2 21:19:40 2009 New Revision: 5516 URL: http://www.opensync.org/changeset/5516 Log: Limit the production of trace files to the actual synchronization, i.e. osynctool --sync ... So that we don't get 30 files or so, just because there was osynctool --configure..., --discover and --enable before. Modified: plugins/ldap-sync/tests/check_osynctool_common.inc Modified: plugins/ldap-sync/tests/check_osynctool_common.inc ============================================================================== --- plugins/ldap-sync/tests/check_osynctool_common.inc Thu Apr 2 00:00:34 2009 (r5515) +++ plugins/ldap-sync/tests/check_osynctool_common.inc Thu Apr 2 21:19:40 2009 (r5516) @@ -337,6 +337,14 @@ prologue() { + if test -n "$OSYNC_TRACE"; then + remember="$OSYNC_TRACE" + unset OSYNC_TRACE + else + remember="" + fi + + check_plugin_available "ldap-sync" check_plugin_available "file-sync" @@ -344,6 +352,11 @@ check_xmlformats; setup_group "$GROUPNAME" + + + if test -n "$remember"; then + export OSYNC_TRACE="$remember"; + fi } @@ -351,11 +364,22 @@ epilogue() { + if test -n "$OSYNC_TRACE"; then + remember="$OSYNC_TRACE" + unset OSYNC_TRACE + else + remember="" + fi + shutdown_group "$GROUPNAME" if test -d "$TMPDIR"; then rm -rf "$TMPDIR"; fi + + if test -n "$remember"; then + export OSYNC_TRACE="$remember"; + fi } @@ -570,13 +594,13 @@ if test -z "$CONTACT1_FILE"; then echo "${FUNCNAME}(): ERROR: \$CONTACT1_FILE is empty. Ignoring." elif test -f "$CONTACT1_FILE"; then - rm -f "$CONTACT1_FILE"; + rm -f "${CONTACT1_FILE}*"; fi if test -z "$CONTACT2_FILE"; then echo "${FUNCNAME}(): ERROR: \$CONTACT2_FILE is empty. Ignoring." elif test -f "$CONTACT2_FILE"; then - rm -f "$CONTACT2_FILE"; + rm -f "${CONTACT2_FILE}*"; fi output=$(ls -al /tmp/file_contact) @@ -589,7 +613,7 @@ if test -z "$EVENT1_FILE"; then echo "${FUNCNAME}(): ERROR: \$EVENT1_FILE is empty. Ignoring." elif test -f "$EVENT1_FILE"; then - rm -f "$EVENT1_FILE"; + rm -f "${EVENT1_FILE}*"; fi output=$(ls -al /tmp/file_event) @@ -602,7 +626,7 @@ if test -z "$TODO1_FILE"; then echo "${FUNCNAME}(): ERROR: \$TODO1_FILE is empty. Ignoring." elif test -f "$TODO1_FILE"; then - rm -f "$TODO1_FILE"; + rm -f "${TODO1_FILE}*"; fi output=$(ls -al /tmp/file_todo) @@ -615,13 +639,13 @@ if test -z "$NOTE1_FILE"; then echo "${FUNCNAME}(): ERROR: \$NOTE1_FILE is empty. Ignoring." elif test -f "$NOTE1_FILE"; then - rm -f "$NOTE1_FILE"; + rm -f "${NOTE1_FILE}*"; fi if test -z "$NOTE2_FILE"; then echo "${FUNCNAME}(): ERROR: \$NOTE2_FILE is empty. Ignoring." elif test -f "$NOTE2_FILE"; then - rm -f "$NOTE2_FILE"; + rm -f "${NOTE2_FILE}*"; fi output=$(ls -al /tmp/file_note) @@ -921,16 +945,16 @@ if test "$objtype" == "contact"; then - rm -f "$CONTACT1_FILE" + remove_contact_files elif test "$objtype" == "event"; then - rm -f "$EVENT1_FILE" + remove_event1_file elif test "$objtype" == "todo"; then - rm -f "$TODO1_FILE" + remove_todo1_file elif test "$objtype" == "note"; then - rm -f "$NOTE1_FILE" + remove_note_files fi } @@ -956,6 +980,13 @@ exit 1; fi + if test -n "$OSYNC_TRACE"; then + remember="$OSYNC_TRACE" + unset OSYNC_TRACE + else + remember="" + fi + if test "$objtype" == "contact"; then echo "${FUNCNAME}(): Enabling objtype \"contact\"." @@ -982,6 +1013,10 @@ $OSYNCTOOL --configdir "$TMPDIR" --disable-objtype "$GROUPNAME" "todo" $OSYNCTOOL --configdir "$TMPDIR" --enable-objtype "$GROUPNAME" "note" fi + + if test -n "$remember"; then + export OSYNC_TRACE="$remember"; + fi } |
From: <svn...@op...> - 2009-04-02 15:10:30
|
Author: bellmich Date: Thu Apr 2 17:10:21 2009 New Revision: 1025 URL: http://libsyncml.opensync.org/changeset/1025 Log: stress test of DS API (causes actually a segmentation fault) Modified: trunk/tests/check_data_sync_api.c Modified: trunk/tests/check_data_sync_api.c ============================================================================== --- trunk/tests/check_data_sync_api.c Thu Apr 2 16:35:33 2009 (r1024) +++ trunk/tests/check_data_sync_api.c Thu Apr 2 17:10:21 2009 (r1025) @@ -485,6 +485,46 @@ } END_TEST +START_TEST (check_multi_text_vcard_21) +{ + SmlError *error = NULL; + init_testbed("HTTP", "17004"); + + /* register datastore + * the source must be identical because this is http + */ + client_source = "contacts"; + server_source = "contacts"; + if (!smlDataSyncAddDatastore( + client, + "text/x-vcard", + NULL, + client_source, + &error)) + goto error; + if (!smlDataSyncAddDatastore( + server, + "text/x-vcard", + NULL, + server_source, + &error)) + goto error; + + /* configure test data */ + int max_items = 10000; + int i; + for(i = 0; i < max_items; i++) { + client_items = g_list_append(client_items, "client data"); + } + + run_testbed(); + + return; +error: + sml_fail_unless(FALSE, "%s", smlErrorPrint(&error)); +} +END_TEST + Suite *ds_suite(void) { Suite *s = suite_create("OMA DS API"); @@ -493,6 +533,7 @@ create_case(s, "check_text_vcard_21", check_text_vcard_21); create_case(s, "check_image_jpeg", check_image_jpeg); create_case(s, "check_unknown_ct", check_unknown_ct); + create_case(s, "check_multi_text_vcard_21", check_multi_text_vcard_21); return s; } |
From: <svn...@op...> - 2009-04-02 14:35:37
|
Author: bellmich Date: Thu Apr 2 16:35:33 2009 New Revision: 1024 URL: http://libsyncml.opensync.org/changeset/1024 Log: fixed ticket #222 Modified: trunk/libsyncml/sml_support.c Modified: trunk/libsyncml/sml_support.c ============================================================================== --- trunk/libsyncml/sml_support.c Mon Mar 30 13:05:37 2009 (r1023) +++ trunk/libsyncml/sml_support.c Thu Apr 2 16:35:33 2009 (r1024) @@ -130,9 +130,21 @@ current_tabs = g_private_new (NULL); else tabs = GPOINTER_TO_INT(g_private_get(current_tabs)); - - unsigned long int id = (unsigned long int)pthread_self(); - pid_t pid = getpid(); + + unsigned long int id; + pid_t pid; + const char *endline; +#ifdef _WIN32 + if (!thread_id) + thread_id = g_private_new (NULL); + id = GPOINTER_TO_INT(thread_id); + pid = _getpid(); + endline = "\r\n"; +#else + id = (unsigned long int)pthread_self(); + pid = getpid(); + endline = "\n"; +#endif char *logfile = g_strdup_printf("%s/Thread%lu-%d.log", trace, id, pid); // create message @@ -173,23 +185,23 @@ char *logmessage = NULL; switch (type) { case TRACE_ENTRY: - logmessage = g_strdup_printf("[%li.%06li]\t%s>>>>>>> %s\n", curtime.tv_sec, curtime.tv_usec, tabstr->str, buffer); + logmessage = g_strdup_printf("[%li.%06li]\t%s>>>>>>> %s%s", curtime.tv_sec, curtime.tv_usec, tabstr->str, buffer, endline); tabs++; break; case TRACE_INTERNAL: - logmessage = g_strdup_printf("[%li.%06li]\t%s%s\n", curtime.tv_sec, curtime.tv_usec, tabstr->str, buffer); + logmessage = g_strdup_printf("[%li.%06li]\t%s%s%s", curtime.tv_sec, curtime.tv_usec, tabstr->str, buffer, endline); break; case TRACE_ERROR: - logmessage = g_strdup_printf("[%li.%06li]\t%sERROR: %s\n", curtime.tv_sec, curtime.tv_usec, tabstr->str, buffer); + logmessage = g_strdup_printf("[%li.%06li]\t%sERROR: %s%s", curtime.tv_sec, curtime.tv_usec, tabstr->str, buffer, endline); break; case TRACE_EXIT: - logmessage = g_strdup_printf("[%li.%06li]%s<<<<<<< %s\n", curtime.tv_sec, curtime.tv_usec, tabstr->str, buffer); + logmessage = g_strdup_printf("[%li.%06li]%s<<<<<<< %s%s", curtime.tv_sec, curtime.tv_usec, tabstr->str, buffer, endline); tabs--; if (tabs < 0) tabs = 0; break; case TRACE_EXIT_ERROR: - logmessage = g_strdup_printf("[%li.%06li]%s<--- ERROR --- %s\n", curtime.tv_sec, curtime.tv_usec, tabstr->str, buffer); + logmessage = g_strdup_printf("[%li.%06li]%s<--- ERROR --- %s%s", curtime.tv_sec, curtime.tv_usec, tabstr->str, buffer, endline); tabs--; if (tabs < 0) tabs = 0; @@ -204,7 +216,7 @@ GError *error = NULL; GIOChannel *chan = g_io_channel_new_file(logfile, "a", &error); if (!chan) { - printf("unable to open %s for writing: %s\n", logfile, error->message); + printf("unable to open %s for writing: %s%s", logfile, error->message, endline); smlSafeCFree(&logfile); smlSafeCFree(&logmessage); return; @@ -213,7 +225,7 @@ gsize writen; g_io_channel_set_encoding(chan, NULL, NULL); if (g_io_channel_write_chars(chan, logmessage, strlen(logmessage), &writen, NULL) != G_IO_STATUS_NORMAL) { - printf("unable to write trace to %s\n", logfile); + printf("unable to write trace to %s%s", logfile, endline); } else g_io_channel_flush(chan, NULL); |
From: <svn...@op...> - 2009-04-01 22:00:38
|
Author: scriptor Date: Thu Apr 2 00:00:34 2009 New Revision: 5515 URL: http://www.opensync.org/changeset/5515 Log: Technically this is a removal of some tests. But actually, it is a rename: The suffix must be "slowsync" rather than "sync". Deleted: plugins/ldap-sync/tests/check_osynctool_add_file_and_sync plugins/ldap-sync/tests/check_osynctool_add_file_and_valgrind_and_sync plugins/ldap-sync/tests/check_osynctool_add_ldif_and_sync plugins/ldap-sync/tests/check_osynctool_add_ldif_and_valgrind_and_sync |
From: <svn...@op...> - 2009-04-01 21:59:16
|
Author: scriptor Date: Wed Apr 1 23:59:13 2009 New Revision: 5514 URL: http://www.opensync.org/changeset/5514 Log: Further tests. Added: plugins/ldap-sync/tests/check_osynctool_add_modify_delete_file_and_sync (contents, props changed) Added: plugins/ldap-sync/tests/check_osynctool_add_modify_delete_file_and_sync ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/tests/check_osynctool_add_modify_delete_file_and_sync Wed Apr 1 23:59:13 2009 (r5514) @@ -0,0 +1,190 @@ +#!/bin/bash + +set -x + +FILE=$0 +OSYNCTOOL=$(which osynctool 2>/dev/null) +if test ! -f "$OSYNCTOOL"; then + echo "$FILE:$LINENO: ERROR: osynctool could not be found. Exiting." + exit 1 +fi + +if test ! -x "$OSYNCTOOL"; then + echo "$FILE:$LINENO: ERROR: osynctool could be found, but it is not executable. Exiting." + exit 1 +fi + + + +PLUGINNAME="ldap-sync" +PLUGINPATH="$1/src" +CFG="$2/src/$PLUGINNAME" +OBJECTTYPE="$3" +XMLFILE="$4" +MODIFIED_FILE="$5" + + + +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 + +if test ! -r "$SOURCE_DIR/check_osynctool_common.inc"; then + echo "$FILE:$LINENO: ERROR: \"$SOURCE_DIR/test.conf\" could not be read. Exiting." + exit 1 +fi + +source "$SOURCE_DIR/test.conf" +source "$SOURCE_DIR/check_osynctool_common.inc" + +echo "PLUGINPATH = \"$PLUGINPATH\"" +echo "CFG = \"$CFG\"" + + +if test -n "$TRACE_FILES"; then + echo "$FILE:$LINENO: Enabling OSYNC_TRACE." + if test ! -d "$TRACE_FILES"; then + mkdir -p "$TRACE_FILES" + fi + export OSYNC_TRACE="$TRACE_FILES" +fi + + +if test -z "$XMLFILE"; then + echo "$FILE:$LINENO: ERROR: \$XMLFILE is empty. Exiting." + exit 1 +fi + +if test ! -f "$XMLFILE"; then + echo "$FILE:$LINENO: ERROR: \"$XMLFILE\" could not be found. Exiting." + exit 1 +fi + +if test ! -r "$XMLFILE"; then + echo "$FILE:$LINENO: ERROR: \"$XMLFILE\" could be found, but it is not readable. Exiting." + exit 1 +fi + + +if test -z "$MODIFIED_FILE"; then + echo "$FILE:$LINENO: ERROR: \$MODIFIED_FILE is empty. Exiting." + exit 1 +fi + +if test ! -f "$MODIFIED_FILE"; then + echo "$FILE:$LINENO: ERROR: \"$MODIFIED_FILE\" could not be found. Exiting." + exit 1 +fi + +if test ! -r "$MODIFIED_FILE"; then + echo "$FILE:$LINENO: ERROR: \"$MODIFIED_FILE\" could be found, but it is not readable. Exiting." + exit 1 +fi + + + + + +TMPDIR=`mktemp -d /tmp/ldap_sync_test.XXXXXX` || exit 1 +echo "TMPDIR = \"$TMPDIR\"" + + + + +# Set up test group +prologue; + + +# Empty LDAP DIT +$SOURCE_DIR/remove_test_ldifs + + +# Remove entry from directory used by file-sync +remove_file_by_objtype "$OBJECTTYPE" + + +# Add XML file +echo -e "\n\n\nAdd XML file\n\n\n" +add_file "$OBJECTTYPE" "$XMLFILE" +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: add_file() has failed." + exit 1; +fi + + +# osynctool should synchronize only one particular object type: +echo -e "\n\n\nEnable just $OBJECTTYPE\n\n\n" +enable_only "$OBJECTTYPE" + + +# Trigger synchronization +echo -e "\n\n\nSynchronize after an XML file has been added\n\n\n" +fast_sync "$OBJECTTYPE" +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: fast_sync() has failed (1)." + exit 1; +fi + + +# Modify the XML File +echo -e "\n\n\nModify XML file\n\n\n" +modify_file "$OBJECTTYPE" "$XMLFILE" "$MODIFIED_FILE" +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: modify_file() has failed." + exit 1; +fi + +echo -e "\n\n\n" +diff "$XMLFILE" "$MODIFIED_FILE" +echo -e "\n\n\n" + + +# Trigger synchronization +echo -e "\n\n\nSynchronize after the XML file has been modified\n\n\n" +fast_sync "$OBJECTTYPE" +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: fast_sync() has failed (1)." + exit 1; +fi + + +# Delete the XML File +echo -e "\n\n\nDelete XML file\n\n\n" +delete_file "$OBJECTTYPE" "$XMLFILE" +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: delete_file() has failed." + exit 1; +fi + + +# Trigger synchronization +echo -e "\n\n\nSynchronize after the XML file has been deleted\n\n\n" +fast_sync "$OBJECTTYPE" +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: fast_sync() has failed (1)." + exit 1; +fi +echo -e "\n\n\n" + + + +# Shut down test group +epilogue + + +exit $rv + +#vim:ts=2:sw=2 |
From: <svn...@op...> - 2009-04-01 21:58:43
|
Author: scriptor Date: Wed Apr 1 23:58:39 2009 New Revision: 5513 URL: http://www.opensync.org/changeset/5513 Log: Fixed one of those notorious "XML format not valid"-errors by enforcing the order prescribed by xmlformat-event.xsd more strictly. Modified: plugins/ldap-sync/src/xslt/ldap_note2xmlformat_note.xsl Modified: plugins/ldap-sync/src/xslt/ldap_note2xmlformat_note.xsl ============================================================================== --- plugins/ldap-sync/src/xslt/ldap_note2xmlformat_note.xsl Wed Apr 1 23:58:28 2009 (r5512) +++ plugins/ldap-sync/src/xslt/ldap_note2xmlformat_note.xsl Wed Apr 1 23:58:39 2009 (r5513) @@ -34,7 +34,477 @@ <xsl:comment> </xsl:comment> --> - <xsl:apply-templates /> + + <!-- Transform all the different elements --> + <!-- <xsl:choose> --> + + <xsl:for-each select="subentry/Attach"> + <xsl:element name="Attach"> + <xsl:for-each select="@*"> + <xsl:attribute name="{name()}"> + <xsl:value-of select="." /> + </xsl:attribute> + </xsl:for-each> + + <xsl:for-each select="../attribute/name"> + <xsl:attribute name="{.}"> + <xsl:value-of select="following-sibling::value" /> + </xsl:attribute> + </xsl:for-each> + + <xsl:element name="Content"> + <xsl:value-of select="."/> + </xsl:element> + </xsl:element> + </xsl:for-each> + + + <xsl:for-each select="subentry/Attendee"> + <xsl:element name="Attendee"> + <xsl:for-each select="@*"> + <xsl:attribute name="{name()}"> + <xsl:value-of select="." /> + </xsl:attribute> + </xsl:for-each> + + <xsl:for-each select="../attribute/name"> + <xsl:attribute name="{.}"> + <xsl:value-of select="following-sibling::value" /> + </xsl:attribute> + </xsl:for-each> + + <xsl:element name="Content"> + <xsl:value-of select="."/> + </xsl:element> + </xsl:element> + </xsl:for-each> + + + <!-- TODO --> + <xsl:for-each select="documentLocation"> + <xsl:element name="Categories"> + <xsl:element name="Category"> + <xsl:value-of select="."/> + </xsl:element> + </xsl:element> + </xsl:for-each> + + + <xsl:for-each select="documentPublisher"> + <xsl:element name="Class"> + <xsl:element name="Content"> + <xsl:value-of select="."/> + </xsl:element> + </xsl:element> + </xsl:for-each> + + + <xsl:for-each select="subentry/Comment"> + <xsl:element name="Comment"> + <xsl:for-each select="@*"> + <xsl:attribute name="{name()}"> + <xsl:value-of select="." /> + </xsl:attribute> + </xsl:for-each> + + <xsl:for-each select="../attribute/name"> + <xsl:attribute name="{.}"> + <xsl:value-of select="following-sibling::value" /> + </xsl:attribute> + </xsl:for-each> + + <xsl:element name="Content"> + <xsl:value-of select="."/> + </xsl:element> + </xsl:element> + </xsl:for-each> + + + <xsl:for-each select="subentry/Contact"> + <xsl:element name="Contact"> + <xsl:for-each select="@*"> + <xsl:attribute name="{name()}"> + <xsl:value-of select="." /> + </xsl:attribute> + </xsl:for-each> + + <xsl:for-each select="../attribute/name"> + <xsl:attribute name="{.}"> + <xsl:value-of select="following-sibling::value" /> + </xsl:attribute> + </xsl:for-each> + + <xsl:element name="Content"> + <xsl:value-of select="."/> + </xsl:element> + </xsl:element> + </xsl:for-each> + + + <xsl:for-each select="subentry/Created"> + <xsl:element name="Created"> + <xsl:for-each select="@*"> + <xsl:attribute name="{name()}"> + <xsl:value-of select="." /> + </xsl:attribute> + </xsl:for-each> + + <xsl:for-each select="../attribute/name"> + <xsl:attribute name="{.}"> + <xsl:value-of select="following-sibling::value" /> + </xsl:attribute> + </xsl:for-each> + + <xsl:element name="Content"> + <xsl:value-of select="."/> + </xsl:element> + </xsl:element> + </xsl:for-each> + + + <xsl:for-each select="subentry/DateCalendarCreated"> + <xsl:element name="DateCalendarCreated"> + <xsl:for-each select="@*"> + <xsl:attribute name="{name()}"> + <xsl:value-of select="." /> + </xsl:attribute> + </xsl:for-each> + + <xsl:for-each select="../attribute/name"> + <xsl:attribute name="{.}"> + <xsl:value-of select="following-sibling::value" /> + </xsl:attribute> + </xsl:for-each> + + <xsl:element name="Content"> + <xsl:value-of select="."/> + </xsl:element> + </xsl:element> + </xsl:for-each> + + + <xsl:for-each select="subentry/DateStarted"> + <xsl:element name="DateStarted"> + <xsl:for-each select="@*"> + <xsl:attribute name="{name()}"> + <xsl:value-of select="." /> + </xsl:attribute> + </xsl:for-each> + + <xsl:if test="../attribute"> + <xsl:variable name="variable2" select="../attribute/value" /> + <xsl:attribute name="Value"> + <xsl:value-of select="$variable2" /> + </xsl:attribute> + </xsl:if> + + <xsl:element name="Content"> + <xsl:value-of select="."/> + </xsl:element> + + </xsl:element> + </xsl:for-each> + + + <xsl:for-each select="subentry/Description"> + <xsl:element name="Description"> + <xsl:for-each select="@*"> + <xsl:attribute name="{name()}"> + <xsl:value-of select="." /> + </xsl:attribute> + </xsl:for-each> + + <xsl:for-each select="../attribute/name"> + <xsl:attribute name="{.}"> + <xsl:value-of select="following-sibling::value" /> + </xsl:attribute> + </xsl:for-each> + + <xsl:element name="Content"> + <xsl:value-of select="."/> + </xsl:element> + </xsl:element> + </xsl:for-each> + + + <xsl:for-each select="subentry/ExceptionDateTime"> + <xsl:element name="ExceptionDateTime"> + <xsl:for-each select="@*"> + <xsl:attribute name="{name()}"> + <xsl:value-of select="." /> + </xsl:attribute> + </xsl:for-each> + + <xsl:for-each select="../attribute/name"> + <xsl:attribute name="{.}"> + <xsl:value-of select="following-sibling::value" /> + </xsl:attribute> + </xsl:for-each> + + <xsl:element name="Content"> + <xsl:value-of select="."/> + </xsl:element> + </xsl:element> + </xsl:for-each> + + + <xsl:for-each select="subentry/ExceptionRule"> + <xsl:element name="ExceptionRule"> + <xsl:for-each select="@*"> + <xsl:attribute name="{name()}"> + <xsl:value-of select="." /> + </xsl:attribute> + </xsl:for-each> + + <xsl:for-each select="../attribute/name"> + <xsl:attribute name="{.}"> + <xsl:value-of select="following-sibling::value" /> + </xsl:attribute> + </xsl:for-each> + + <xsl:element name="Content"> + <xsl:value-of select="."/> + </xsl:element> + </xsl:element> + </xsl:for-each> + + + <xsl:for-each select="subentry/LastModified"> + <xsl:element name="LastModified"> + <xsl:for-each select="@*"> + <xsl:attribute name="{name()}"> + <xsl:value-of select="." /> + </xsl:attribute> + </xsl:for-each> + + <xsl:for-each select="../attribute/name"> + <xsl:attribute name="{.}"> + <xsl:value-of select="following-sibling::value" /> + </xsl:attribute> + </xsl:for-each> + + <xsl:element name="Content"> + <xsl:value-of select="."/> + </xsl:element> + </xsl:element> + </xsl:for-each> + + + <xsl:for-each select="subentry/Method"> + <xsl:element name="Method"> + <xsl:for-each select="@*"> + <xsl:attribute name="{name()}"> + <xsl:value-of select="." /> + </xsl:attribute> + </xsl:for-each> + + <xsl:for-each select="../attribute/name"> + <xsl:attribute name="{.}"> + <xsl:value-of select="following-sibling::value" /> + </xsl:attribute> + </xsl:for-each> + + <xsl:element name="Content"> + <xsl:value-of select="."/> + </xsl:element> + </xsl:element> + </xsl:for-each> + + + <xsl:for-each select="subentry/Organizer"> + <xsl:element name="Organizer"> + <xsl:for-each select="@*"> + <xsl:attribute name="{name()}"> + <xsl:value-of select="." /> + </xsl:attribute> + </xsl:for-each> + + <xsl:for-each select="../attribute/name"> + <xsl:attribute name="{.}"> + <xsl:value-of select="following-sibling::value" /> + </xsl:attribute> + </xsl:for-each> + + <xsl:element name="Content"> + <xsl:value-of select="."/> + </xsl:element> + </xsl:element> + </xsl:for-each> + + + <xsl:for-each select="subentry/ProductID"> + <xsl:element name="ProductID"> + <xsl:for-each select="@*"> + <xsl:attribute name="{name()}"> + <xsl:value-of select="." /> + </xsl:attribute> + </xsl:for-each> + + <xsl:for-each select="../attribute/name"> + <xsl:attribute name="{.}"> + <xsl:value-of select="following-sibling::value" /> + </xsl:attribute> + </xsl:for-each> + + <xsl:element name="Content"> + <xsl:value-of select="."/> + </xsl:element> + </xsl:element> + </xsl:for-each> + + + <xsl:for-each select="subentry/RecurrenceId"> + <xsl:element name="RecurrenceId"> + <xsl:for-each select="@*"> + <xsl:attribute name="{name()}"> + <xsl:value-of select="." /> + </xsl:attribute> + </xsl:for-each> + + <xsl:for-each select="../attribute/name"> + <xsl:attribute name="{.}"> + <xsl:value-of select="following-sibling::value" /> + </xsl:attribute> + </xsl:for-each> + + <xsl:element name="Content"> + <xsl:value-of select="."/> + </xsl:element> + </xsl:element> + </xsl:for-each> + + + <xsl:for-each select="subentry/Related"> + <xsl:element name="Related"> + <xsl:for-each select="@*"> + <xsl:attribute name="{name()}"> + <xsl:value-of select="." /> + </xsl:attribute> + </xsl:for-each> + + <xsl:for-each select="../attribute/name"> + <xsl:attribute name="{.}"> + <xsl:value-of select="following-sibling::value" /> + </xsl:attribute> + </xsl:for-each> + + <xsl:element name="Content"> + <xsl:value-of select="."/> + </xsl:element> + </xsl:element> + </xsl:for-each> + + + <xsl:for-each select="subentry/RecurrenceRule"> + <xsl:element name="RecurrenceRule"> + <xsl:for-each select="@*"> + <xsl:attribute name="{name()}"> + <xsl:value-of select="." /> + </xsl:attribute> + </xsl:for-each> + + <xsl:for-each select="../attribute/name"> + <xsl:attribute name="{.}"> + <xsl:value-of select="following-sibling::value" /> + </xsl:attribute> + </xsl:for-each> + + <xsl:element name="Content"> + <xsl:value-of select="."/> + </xsl:element> + </xsl:element> + </xsl:for-each> + + + <xsl:for-each select="subentry/RStatus"> + <xsl:element name="RStatus"> + <xsl:for-each select="@*"> + <xsl:attribute name="{name()}"> + <xsl:value-of select="." /> + </xsl:attribute> + </xsl:for-each> + + <xsl:for-each select="../attribute/name"> + <xsl:attribute name="{.}"> + <xsl:value-of select="following-sibling::value" /> + </xsl:attribute> + </xsl:for-each> + + <xsl:element name="Content"> + <xsl:value-of select="."/> + </xsl:element> + </xsl:element> + </xsl:for-each> + + + <xsl:for-each select="subentry/Sequence"> + <xsl:element name="Sequence"> + <xsl:for-each select="@*"> + <xsl:attribute name="{name()}"> + <xsl:value-of select="." /> + </xsl:attribute> + </xsl:for-each> + + <xsl:for-each select="../attribute/name"> + <xsl:attribute name="{.}"> + <xsl:value-of select="following-sibling::value" /> + </xsl:attribute> + </xsl:for-each> + + <xsl:element name="Content"> + <xsl:value-of select="."/> + </xsl:element> + </xsl:element> + </xsl:for-each> + + + <xsl:for-each select="subentry/documentVersion"> + <xsl:element name="Status"> + <xsl:for-each select="@*"> + <xsl:attribute name="{name()}"> + <xsl:value-of select="." /> + </xsl:attribute> + </xsl:for-each> + + <xsl:for-each select="../attribute/name"> + <xsl:attribute name="{.}"> + <xsl:value-of select="following-sibling::value" /> + </xsl:attribute> + </xsl:for-each> + + <xsl:element name="Content"> + <xsl:value-of select="."/> + </xsl:element> + </xsl:element> + </xsl:for-each> + + + <xsl:for-each select="subentry/documentTitle"> + <xsl:element name="Summary"> + <xsl:for-each select="@*"> + <xsl:attribute name="{name()}"> + <xsl:value-of select="." /> + </xsl:attribute> + </xsl:for-each> + + <xsl:for-each select="../attribute/name"> + <xsl:attribute name="{.}"> + <xsl:value-of select="following-sibling::value" /> + </xsl:attribute> + </xsl:for-each> + + <xsl:element name="Content"> + <xsl:value-of select="."/> + </xsl:element> + </xsl:element> + </xsl:for-each> + +<!-- + </xsl:choose> +--> + + + <xsl:choose> @@ -63,470 +533,8 @@ </xsl:template> -<!-- Transform all the different elements --> -<xsl:template match="subentry/Attach"> - <xsl:element name="Attach"> - <xsl:for-each select="@*"> - <xsl:attribute name="{name()}"> - <xsl:value-of select="." /> - </xsl:attribute> - </xsl:for-each> - - <xsl:for-each select="attribute/name"> - <xsl:attribute name="{.}"> - <xsl:value-of select="following-sibling::value" /> - </xsl:attribute> - </xsl:for-each> - - <xsl:element name="Content"> - <xsl:copy-of select="text()"/> - </xsl:element> - </xsl:element> -</xsl:template> - - -<xsl:template match="subentry/Attendee"> - <xsl:element name="Attendee"> - <xsl:for-each select="@*"> - <xsl:attribute name="{name()}"> - <xsl:value-of select="." /> - </xsl:attribute> - </xsl:for-each> - - <xsl:for-each select="attribute/name"> - <xsl:attribute name="{.}"> - <xsl:value-of select="following-sibling::value" /> - </xsl:attribute> - </xsl:for-each> - - <xsl:element name="Content"> - <xsl:copy-of select="text()"/> - </xsl:element> - </xsl:element> -</xsl:template> - - -<!-- TODO --> -<xsl:template match="documentLocation"> - <xsl:element name="Categories"> - <xsl:element name="Category"> - <xsl:copy-of select="text()"/> - </xsl:element> - </xsl:element> -</xsl:template> - - -<xsl:template match="documentPublisher"> - <xsl:element name="Class"> - <xsl:element name="Content"> - <xsl:copy-of select="text()"/> - </xsl:element> - </xsl:element> -</xsl:template> - - -<xsl:template match="subentry/Comment"> - <xsl:element name="Comment"> - <xsl:for-each select="@*"> - <xsl:attribute name="{name()}"> - <xsl:value-of select="." /> - </xsl:attribute> - </xsl:for-each> - - <xsl:for-each select="attribute/name"> - <xsl:attribute name="{.}"> - <xsl:value-of select="following-sibling::value" /> - </xsl:attribute> - </xsl:for-each> - - <xsl:element name="Content"> - <xsl:copy-of select="text()"/> - </xsl:element> - </xsl:element> -</xsl:template> - - -<xsl:template match="subentry/Contact"> - <xsl:element name="Contact"> - <xsl:for-each select="@*"> - <xsl:attribute name="{name()}"> - <xsl:value-of select="." /> - </xsl:attribute> - </xsl:for-each> - - <xsl:for-each select="attribute/name"> - <xsl:attribute name="{.}"> - <xsl:value-of select="following-sibling::value" /> - </xsl:attribute> - </xsl:for-each> - - <xsl:element name="Content"> - <xsl:copy-of select="text()"/> - </xsl:element> - </xsl:element> -</xsl:template> - - -<xsl:template match="subentry/Created"> - <xsl:element name="Created"> - <xsl:for-each select="@*"> - <xsl:attribute name="{name()}"> - <xsl:value-of select="." /> - </xsl:attribute> - </xsl:for-each> - - <xsl:for-each select="attribute/name"> - <xsl:attribute name="{.}"> - <xsl:value-of select="following-sibling::value" /> - </xsl:attribute> - </xsl:for-each> - - <xsl:element name="Content"> - <xsl:copy-of select="text()"/> - </xsl:element> - </xsl:element> -</xsl:template> - - -<xsl:template match="subentry/DateCalendarCreated"> - <xsl:element name="DateCalendarCreated"> - <xsl:for-each select="@*"> - <xsl:attribute name="{name()}"> - <xsl:value-of select="." /> - </xsl:attribute> - </xsl:for-each> - - <xsl:for-each select="attribute/name"> - <xsl:attribute name="{.}"> - <xsl:value-of select="following-sibling::value" /> - </xsl:attribute> - </xsl:for-each> - - <xsl:element name="Content"> - <xsl:copy-of select="text()"/> - </xsl:element> - </xsl:element> -</xsl:template> - - -<xsl:template match="subentry/DateStarted"> - <xsl:element name="DateStarted"> - <xsl:for-each select="@*"> - <xsl:attribute name="{name()}"> - <xsl:value-of select="." /> - </xsl:attribute> - </xsl:for-each> - - <xsl:if test="../attribute"> - <xsl:variable name="variable2" select="../attribute/value" /> - <xsl:attribute name="Value"> - <xsl:value-of select="$variable2" /> - </xsl:attribute> - </xsl:if> - - <xsl:element name="Content"> - <xsl:copy-of select="text()"/> - </xsl:element> - - </xsl:element> -</xsl:template> - - -<xsl:template match="subentry/Description"> - <xsl:element name="Description"> - <xsl:for-each select="@*"> - <xsl:attribute name="{name()}"> - <xsl:value-of select="." /> - </xsl:attribute> - </xsl:for-each> - - <xsl:for-each select="attribute/name"> - <xsl:attribute name="{.}"> - <xsl:value-of select="following-sibling::value" /> - </xsl:attribute> - </xsl:for-each> - - <xsl:element name="Content"> - <xsl:copy-of select="text()"/> - </xsl:element> - </xsl:element> -</xsl:template> - - -<xsl:template match="subentry/ExceptionDateTime"> - <xsl:element name="ExceptionDateTime"> - <xsl:for-each select="@*"> - <xsl:attribute name="{name()}"> - <xsl:value-of select="." /> - </xsl:attribute> - </xsl:for-each> - - <xsl:for-each select="attribute/name"> - <xsl:attribute name="{.}"> - <xsl:value-of select="following-sibling::value" /> - </xsl:attribute> - </xsl:for-each> - - <xsl:element name="Content"> - <xsl:copy-of select="text()"/> - </xsl:element> - </xsl:element> -</xsl:template> - - -<xsl:template match="subentry/ExceptionRule"> - <xsl:element name="ExceptionRule"> - <xsl:for-each select="@*"> - <xsl:attribute name="{name()}"> - <xsl:value-of select="." /> - </xsl:attribute> - </xsl:for-each> - - <xsl:for-each select="attribute/name"> - <xsl:attribute name="{.}"> - <xsl:value-of select="following-sibling::value" /> - </xsl:attribute> - </xsl:for-each> - - <xsl:element name="Content"> - <xsl:copy-of select="text()"/> - </xsl:element> - </xsl:element> -</xsl:template> - - -<xsl:template match="subentry/LastModified"> - <xsl:element name="LastModified"> - <xsl:for-each select="@*"> - <xsl:attribute name="{name()}"> - <xsl:value-of select="." /> - </xsl:attribute> - </xsl:for-each> - - <xsl:for-each select="attribute/name"> - <xsl:attribute name="{.}"> - <xsl:value-of select="following-sibling::value" /> - </xsl:attribute> - </xsl:for-each> - - <xsl:element name="Content"> - <xsl:copy-of select="text()"/> - </xsl:element> - </xsl:element> -</xsl:template> - - -<xsl:template match="subentry/Method"> - <xsl:element name="Method"> - <xsl:for-each select="@*"> - <xsl:attribute name="{name()}"> - <xsl:value-of select="." /> - </xsl:attribute> - </xsl:for-each> - - <xsl:for-each select="attribute/name"> - <xsl:attribute name="{.}"> - <xsl:value-of select="following-sibling::value" /> - </xsl:attribute> - </xsl:for-each> - - <xsl:element name="Content"> - <xsl:copy-of select="text()"/> - </xsl:element> - </xsl:element> -</xsl:template> - - -<xsl:template match="subentry/Organizer"> - <xsl:element name="Organizer"> - <xsl:for-each select="@*"> - <xsl:attribute name="{name()}"> - <xsl:value-of select="." /> - </xsl:attribute> - </xsl:for-each> - - <xsl:for-each select="attribute/name"> - <xsl:attribute name="{.}"> - <xsl:value-of select="following-sibling::value" /> - </xsl:attribute> - </xsl:for-each> - - <xsl:element name="Content"> - <xsl:copy-of select="text()"/> - </xsl:element> - </xsl:element> -</xsl:template> - - -<xsl:template match="subentry/ProductID"> - <xsl:element name="ProductID"> - <xsl:for-each select="@*"> - <xsl:attribute name="{name()}"> - <xsl:value-of select="." /> - </xsl:attribute> - </xsl:for-each> - - <xsl:for-each select="attribute/name"> - <xsl:attribute name="{.}"> - <xsl:value-of select="following-sibling::value" /> - </xsl:attribute> - </xsl:for-each> - - <xsl:element name="Content"> - <xsl:copy-of select="text()"/> - </xsl:element> - </xsl:element> -</xsl:template> - - -<xsl:template match="subentry/RecurrenceId"> - <xsl:element name="RecurrenceId"> - <xsl:for-each select="@*"> - <xsl:attribute name="{name()}"> - <xsl:value-of select="." /> - </xsl:attribute> - </xsl:for-each> - - <xsl:for-each select="attribute/name"> - <xsl:attribute name="{.}"> - <xsl:value-of select="following-sibling::value" /> - </xsl:attribute> - </xsl:for-each> - - <xsl:element name="Content"> - <xsl:copy-of select="text()"/> - </xsl:element> - </xsl:element> -</xsl:template> - - -<xsl:template match="subentry/Related"> - <xsl:element name="Related"> - <xsl:for-each select="@*"> - <xsl:attribute name="{name()}"> - <xsl:value-of select="." /> - </xsl:attribute> - </xsl:for-each> - - <xsl:for-each select="attribute/name"> - <xsl:attribute name="{.}"> - <xsl:value-of select="following-sibling::value" /> - </xsl:attribute> - </xsl:for-each> - - <xsl:element name="Content"> - <xsl:copy-of select="text()"/> - </xsl:element> - </xsl:element> -</xsl:template> - - -<xsl:template match="subentry/RecurrenceRule"> - <xsl:element name="RecurrenceRule"> - <xsl:for-each select="@*"> - <xsl:attribute name="{name()}"> - <xsl:value-of select="." /> - </xsl:attribute> - </xsl:for-each> - - <xsl:for-each select="attribute/name"> - <xsl:attribute name="{.}"> - <xsl:value-of select="following-sibling::value" /> - </xsl:attribute> - </xsl:for-each> - - <xsl:element name="Content"> - <xsl:copy-of select="text()"/> - </xsl:element> - </xsl:element> -</xsl:template> - - -<xsl:template match="subentry/RStatus"> - <xsl:element name="RStatus"> - <xsl:for-each select="@*"> - <xsl:attribute name="{name()}"> - <xsl:value-of select="." /> - </xsl:attribute> - </xsl:for-each> - - <xsl:for-each select="attribute/name"> - <xsl:attribute name="{.}"> - <xsl:value-of select="following-sibling::value" /> - </xsl:attribute> - </xsl:for-each> - - <xsl:element name="Content"> - <xsl:copy-of select="text()"/> - </xsl:element> - </xsl:element> -</xsl:template> - - -<xsl:template match="subentry/Sequence"> - <xsl:element name="Sequence"> - <xsl:for-each select="@*"> - <xsl:attribute name="{name()}"> - <xsl:value-of select="." /> - </xsl:attribute> - </xsl:for-each> - - <xsl:for-each select="attribute/name"> - <xsl:attribute name="{.}"> - <xsl:value-of select="following-sibling::value" /> - </xsl:attribute> - </xsl:for-each> - - <xsl:element name="Content"> - <xsl:copy-of select="text()"/> - </xsl:element> - </xsl:element> -</xsl:template> - - -<xsl:template match="subentry/documentVersion"> - <xsl:element name="Status"> - <xsl:for-each select="@*"> - <xsl:attribute name="{name()}"> - <xsl:value-of select="." /> - </xsl:attribute> - </xsl:for-each> - - <xsl:for-each select="attribute/name"> - <xsl:attribute name="{.}"> - <xsl:value-of select="following-sibling::value" /> - </xsl:attribute> - </xsl:for-each> - - <xsl:element name="Content"> - <xsl:copy-of select="text()"/> - </xsl:element> - </xsl:element> -</xsl:template> - - -<xsl:template match="subentry/documentTitle"> - <xsl:element name="Summary"> - <xsl:for-each select="@*"> - <xsl:attribute name="{name()}"> - <xsl:value-of select="." /> - </xsl:attribute> - </xsl:for-each> - - <xsl:for-each select="attribute/name"> - <xsl:attribute name="{.}"> - <xsl:value-of select="following-sibling::value" /> - </xsl:attribute> - </xsl:for-each> - - <xsl:element name="Content"> - <xsl:copy-of select="text()"/> - </xsl:element> - </xsl:element> -</xsl:template> - -<!-- Remove certain elements that have been dealt with otherwise --> +<!-- Remove further elements that have been dealt with otherwise --> <xsl:template match="documentIdentifier" /> <xsl:template match="seeAlso" /> |
From: <svn...@op...> - 2009-04-01 21:58:32
|
Author: scriptor Date: Wed Apr 1 23:58:28 2009 New Revision: 5512 URL: http://www.opensync.org/changeset/5512 Log: Fixed smaller bugs with CALL_ABORT. Modified: plugins/ldap-sync/src/ldap_format.c Modified: plugins/ldap-sync/src/ldap_format.c ============================================================================== --- plugins/ldap-sync/src/ldap_format.c Wed Apr 1 23:57:55 2009 (r5511) +++ plugins/ldap-sync/src/ldap_format.c Wed Apr 1 23:58:28 2009 (r5512) @@ -164,6 +164,8 @@ } + + /** * @brief Frees an LDAP entry. Helper function for * ldap_format_free_ldap_entries(). @@ -1985,7 +1987,7 @@ #ifdef CALL_ABORT osync_trace(TRACE_ERROR, "%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Calling abort().\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); ldap_plugin_printf("%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Calling abort().\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); - fprintf("%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Calling abort().\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); + fprintf(stderr, "%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Calling abort().\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); fflush(stderr); abort(); @@ -2113,7 +2115,7 @@ #ifdef CALL_ABORT osync_trace(TRACE_ERROR, "%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Where does that come from? Calling abort().\n\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); ldap_plugin_printf( "%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Where does that come from? Calling abort().\n\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); - fprintf("%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Where does that come from? Calling abort().\n\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); + fprintf(stderr, "%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Where does that come from? Calling abort().\n\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); fflush(stderr); abort(); @@ -4808,9 +4810,12 @@ goto error; } - + +#ifndef CALL_ABORT applying_stylesheet: +#endif + // Apply stylesheet if (!ldap_format_do_apply_stylesheet((char *)xmlbuff, size, output, outpsize, config, userdata, stylesheet_name, error)) { |
From: <svn...@op...> - 2009-04-01 21:58:02
|
Author: scriptor Date: Wed Apr 1 23:57:55 2009 New Revision: 5511 URL: http://www.opensync.org/changeset/5511 Log: Further tests. Added: plugins/ldap-sync/tests/check_osynctool_add_file_and_slowsync (contents, props changed) plugins/ldap-sync/tests/check_osynctool_add_ldif_and_slowsync (contents, props changed) plugins/ldap-sync/tests/check_osynctool_add_ldif_and_valgrind_and_slowsync (contents, props changed) plugins/ldap-sync/tests/contact1.xml_modified plugins/ldap-sync/tests/contact2.xml_modified plugins/ldap-sync/tests/event1.xml_modified plugins/ldap-sync/tests/note1.xml_modified plugins/ldap-sync/tests/note2.xml_modified plugins/ldap-sync/tests/todo1.xml_modified Modified: plugins/ldap-sync/tests/CMakeLists.txt plugins/ldap-sync/tests/check_osynctool_common.inc plugins/ldap-sync/tests/contact1.xml plugins/ldap-sync/tests/test.conf Modified: plugins/ldap-sync/tests/CMakeLists.txt ============================================================================== --- plugins/ldap-sync/tests/CMakeLists.txt Wed Apr 1 23:56:44 2009 (r5510) +++ plugins/ldap-sync/tests/CMakeLists.txt Wed Apr 1 23:57:55 2009 (r5511) @@ -271,7 +271,7 @@ # 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 ) +ADD_TEST( remove_test_ldifs1 ${TESTDIR}/remove_test_ldifs ) IF (LDAPADD_EXECUTABLE) @@ -451,26 +451,46 @@ IF (LDAPMODIFY_EXECUTABLE) IF (LDAPDELETE_EXECUTABLE) - ADD_TEST( osynctool_add_contact1_ldif ${TESTDIR}/check_osynctool_add_ldif_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "contact" "${TESTDIR}/contact1.ldif" ) + ADD_TEST( osynctool_add_contact1_ldif ${TESTDIR}/check_osynctool_add_ldif_and_slowsync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "contact" "${TESTDIR}/contact1.ldif" ) - #ADD_TEST( osynctool_add_contact2_ldif ${TESTDIR}/check_osynctool_add_ldif_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "contact" "${TESTDIR}/contact2.ldif" ) + #ADD_TEST( osynctool_add_contact2_ldif ${TESTDIR}/check_osynctool_add_ldif_and_slowsync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "contact" "${TESTDIR}/contact2.ldif" ) - ADD_TEST( osynctool_add_event_ldif ${TESTDIR}/check_osynctool_add_ldif_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "event" "${TESTDIR}/event1.ldif" ) + ADD_TEST( osynctool_add_event_ldif ${TESTDIR}/check_osynctool_add_ldif_and_slowsync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "event" "${TESTDIR}/event1.ldif" ) - ADD_TEST( osynctool_add_todo_ldif ${TESTDIR}/check_osynctool_add_ldif_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "todo" "${TESTDIR}/todo1.ldif" ) + ADD_TEST( osynctool_add_todo_ldif ${TESTDIR}/check_osynctool_add_ldif_and_slowsync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "todo" "${TESTDIR}/todo1.ldif" ) - ADD_TEST( osynctool_add_note_ldif ${TESTDIR}/check_osynctool_add_ldif_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "note" "${TESTDIR}/note1.ldif" ) + ADD_TEST( osynctool_add_note_ldif ${TESTDIR}/check_osynctool_add_ldif_and_slowsync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "note" "${TESTDIR}/note1.ldif" ) - ADD_TEST( osynctool_add_contact1_xmlfile ${TESTDIR}/check_osynctool_add_file_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "contact" "${TESTDIR}/contact1.xml" ) + ADD_TEST( osynctool_add_contact1_xmlfile ${TESTDIR}/check_osynctool_add_file_and_slowsync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "contact" "${TESTDIR}/contact1.xml" ) - ADD_TEST( osynctool_add_contact2_xmlfile ${TESTDIR}/check_osynctool_add_file_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "contact" "${TESTDIR}/contact2.xml" ) + ADD_TEST( osynctool_add_contact2_xmlfile ${TESTDIR}/check_osynctool_add_file_and_slowsync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "contact" "${TESTDIR}/contact2.xml" ) - ADD_TEST( osynctool_add_event_xmlfile ${TESTDIR}/check_osynctool_add_file_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "event" "${TESTDIR}/event1.xml" ) + ADD_TEST( osynctool_add_event_xmlfile ${TESTDIR}/check_osynctool_add_file_and_slowsync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "event" "${TESTDIR}/event1.xml" ) - ADD_TEST( osynctool_add_todo_xmlfile ${TESTDIR}/check_osynctool_add_file_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "todo" "${TESTDIR}/todo1.xml" ) + ADD_TEST( osynctool_add_todo_xmlfile ${TESTDIR}/check_osynctool_add_file_and_slowsync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "todo" "${TESTDIR}/todo1.xml" ) - ADD_TEST( osynctool_add_note_xmlfile ${TESTDIR}/check_osynctool_add_file_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "note" "${TESTDIR}/note1.xml" ) + ADD_TEST( osynctool_add_note1_xmlfile ${TESTDIR}/check_osynctool_add_file_and_slowsync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "note" "${TESTDIR}/note1.xml" ) + + ADD_TEST( osynctool_add_note2_xmlfile ${TESTDIR}/check_osynctool_add_file_and_slowsync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "note" "${TESTDIR}/note2.xml" ) + + + + ADD_TEST( remove_test_ldifs2 ${TESTDIR}/remove_test_ldifs ) + + + + ADD_TEST( osynctool_add_modify_delete_contact1_xmlfile ${TESTDIR}/check_osynctool_add_modify_delete_file_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "contact" "${TESTDIR}/contact1.xml" "${TESTDIR}/contact1.xml_modified" ) + + ADD_TEST( osynctool_add_modify_delete_contact2_xmlfile ${TESTDIR}/check_osynctool_add_modify_delete_file_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "contact" "${TESTDIR}/contact2.xml" "${TESTDIR}/contact2.xml_modified" ) + + ADD_TEST( osynctool_add_modify_delete_event_xmlfile ${TESTDIR}/check_osynctool_add_modify_delete_file_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "event" "${TESTDIR}/event1.xml" "${TESTDIR}/event1.xml_modified" ) + + ADD_TEST( osynctool_add_modify_delete_todo_xmlfile ${TESTDIR}/check_osynctool_add_modify_delete_file_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "todo" "${TESTDIR}/todo1.xml" "${TESTDIR}/todo1.xml_modified" ) + + ADD_TEST( osynctool_add_modify_delete_note1_xmlfile ${TESTDIR}/check_osynctool_add_modify_delete_file_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "note" "${TESTDIR}/note1.xml" "${TESTDIR}/note1.xml_modified" ) + + ADD_TEST( osynctool_add_modify_delete_note2_xmlfile ${TESTDIR}/check_osynctool_add_modify_delete_file_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "note" "${TESTDIR}/note2.xml" "${TESTDIR}/note2.xml_modified" ) ENDIF (LDAPDELETE_EXECUTABLE) Added: plugins/ldap-sync/tests/check_osynctool_add_file_and_slowsync ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/tests/check_osynctool_add_file_and_slowsync Wed Apr 1 23:57:55 2009 (r5511) @@ -0,0 +1,108 @@ +#!/bin/bash + +set -x + +FILE=$0 +OSYNCTOOL=$(which osynctool 2>/dev/null) +if test ! -f "$OSYNCTOOL"; then + echo "$FILE:$LINENO: ERROR: osynctool could not be found. Exiting." + exit 1 +fi + +if test ! -x "$OSYNCTOOL"; then + echo "$FILE:$LINENO: ERROR: osynctool could be found, but it is not executable. Exiting." + exit 1 +fi + + + +PLUGINNAME="ldap-sync" +PLUGINPATH="$1/src" +CFG="$2/src/$PLUGINNAME" +OBJECTTYPE="$3" +XMLFILE="$4" + + +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 + +if test ! -r "$SOURCE_DIR/check_osynctool_common.inc"; then + echo "$FILE:$LINENO: ERROR: \"$SOURCE_DIR/test.conf\" could not be read. Exiting." + exit 1 +fi + +source "$SOURCE_DIR/test.conf" +source "$SOURCE_DIR/check_osynctool_common.inc" + +echo "PLUGINPATH = \"$PLUGINPATH\"" +echo "CFG = \"$CFG\"" + + +if test -n "$TRACE_FILES"; then + echo "$FILE:$LINENO: Enabling OSYNC_TRACE." + if test ! -d "$TRACE_FILES"; then + mkdir -p "$TRACE_FILES" + fi + export OSYNC_TRACE="$TRACE_FILES" +fi + + +if test -z "$XMLFILE"; then + echo "$FILE:$LINENO: ERROR: \$XMLFILE is empty. Exiting." + exit 1 +fi + +if test ! -f "$XMLFILE"; then + echo "$FILE:$LINENO: ERROR: \"$XMLFILE\" could not be found. Exiting." + exit 1 +fi + +if test ! -r "$XMLFILE"; then + echo "$FILE:$LINENO: ERROR: \"$XMLFILE\" could be found, but it is not readable. Exiting." + exit 1 +fi + + +TMPDIR=`mktemp -d /tmp/ldap_sync_test.XXXXXX` || exit 1 +echo "TMPDIR = \"$TMPDIR\"" + + + + +# Set up test group +prologue; + +# Empty LDAP DIT +$SOURCE_DIR/remove_test_ldifs + +# Remove entry from directory used by file-sync +remove_file_by_objtype "$OBJECTTYPE" + +# Add XML file +add_file "$OBJECTTYPE" "$XMLFILE" +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: add_file() has failed." + exit 1; +fi + +# osynctool should synchronize only one particular object type: +enable_only "$OBJECTTYPE" + +# Trigger synchronization +slow_sync "$OBJECTTYPE" +rv=$? + +# Shut down test group +epilogue + + +exit $rv Added: plugins/ldap-sync/tests/check_osynctool_add_ldif_and_slowsync ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/tests/check_osynctool_add_ldif_and_slowsync Wed Apr 1 23:57:55 2009 (r5511) @@ -0,0 +1,108 @@ +#!/bin/bash + +set -x + +FILE=$0 +OSYNCTOOL=$(which osynctool 2>/dev/null) +if test ! -f "$OSYNCTOOL"; then + echo "$FILE:$LINENO: ERROR: osynctool could not be found. Exiting." + exit 1 +fi + +if test ! -x "$OSYNCTOOL"; then + echo "$FILE:$LINENO: ERROR: osynctool could be found, but it is not executable. Exiting." + exit 1 +fi + + + +PLUGINNAME="ldap-sync" +PLUGINPATH="$1/src" +CFG="$2/src/$PLUGINNAME" +OBJECTTYPE="$3" +LDIF="$4" + + +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 + +if test ! -r "$SOURCE_DIR/check_osynctool_common.inc"; then + echo "$FILE:$LINENO: ERROR: \"$SOURCE_DIR/test.conf\" could not be read. Exiting." + exit 1 +fi + +source "$SOURCE_DIR/test.conf" +source "$SOURCE_DIR/check_osynctool_common.inc" + +echo "PLUGINPATH = \"$PLUGINPATH\"" +echo "CFG = \"$CFG\"" + + +if test -n "$TRACE_FILES"; then + echo "$FILE:$LINENO: Enabling OSYNC_TRACE." + if test ! -d "$TRACE_FILES"; then + mkdir -p "$TRACE_FILES" + fi + export OSYNC_TRACE="$TRACE_FILES" +fi + +if test -z "$LDIF"; then + echo "$FILE:$LINENO: ERROR: \$LDIF is empty. Exiting." + exit 1 +fi + +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 + + + +TMPDIR=`mktemp -d /tmp/ldap_sync_test.XXXXXX` || exit 1 +echo "TMPDIR = \"$TMPDIR\"" + + + + +# Set up test group +prologue; + +# Empty LDAP DIT +$SOURCE_DIR/remove_test_ldifs + +# Remove entry from directory used by file-sync +remove_file_by_objtype "$OBJECTTYPE" + +# Add *.ldif +run_ldapadd "$LDIF" +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: run_ldapadd has failed." + exit 1; +fi + +# osynctool should synchronize only one particular object type: +enable_only "$OBJECTTYPE" + +# Trigger synchronization +slow_sync "$OBJECTTYPE" +rv=$? + +# Shut down test group +epilogue + + +exit $rv Added: plugins/ldap-sync/tests/check_osynctool_add_ldif_and_valgrind_and_slowsync ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/tests/check_osynctool_add_ldif_and_valgrind_and_slowsync Wed Apr 1 23:57:55 2009 (r5511) @@ -0,0 +1,115 @@ +#!/bin/bash + +set -x + +FILE=$0 +OSYNCTOOL=$(which osynctool 2>/dev/null) +if test ! -f "$OSYNCTOOL"; then + echo "$FILE:$LINENO: ERROR: osynctool could not be found. Exiting." + exit 1 +fi + +if test ! -x "$OSYNCTOOL"; then + echo "$FILE:$LINENO: ERROR: osynctool could be found, but it is not executable. Exiting." + exit 1 +fi + + + +PLUGINNAME="ldap-sync" +PLUGINPATH="$1/src" +CFG="$2/src/$PLUGINNAME" +OBJECTTYPE="$3" +LDIF="$4" + + +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 + +if test ! -r "$SOURCE_DIR/check_osynctool_common.inc"; then + echo "$FILE:$LINENO: ERROR: \"$SOURCE_DIR/test.conf\" could not be read. Exiting." + exit 1 +fi + +source "$SOURCE_DIR/test.conf" +source "$SOURCE_DIR/check_osynctool_common.inc" + +echo "PLUGINPATH = \"$PLUGINPATH\"" +echo "CFG = \"$CFG\"" + + +if test -n "$TRACE_FILES"; then + echo "$FILE:$LINENO: Enabling OSYNC_TRACE." + if test ! -d "$TRACE_FILES"; then + mkdir -p "$TRACE_FILES" + fi + export OSYNC_TRACE="$TRACE_FILES" +fi + +if test -z "$LDIF"; then + echo "$FILE:$LINENO: ERROR: \$LDIF is empty. Exiting." + exit 1 +fi + +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 -z "$VALGRIND"; then + echo "$FILE:$LINENO: ERROR: \$VALGRIND is empty. Exiting."; + exit 1; +fi + + + + +TMPDIR=`mktemp -d /tmp/ldap_sync_test.XXXXXX` || exit 1 +echo "TMPDIR = \"$TMPDIR\"" + + + + +# Set up test group +prologue; + +# Empty LDAP DIT +$SOURCE_DIR/remove_test_ldifs + +# Remove entry from directory used by file-sync +remove_file_by_objtype "$OBJECTTYPE" + +# Add *.ldif +run_ldapadd "$LDIF" +rv=$? +if test $rv -ne 0; then + echo "$FILE:$LINENO: ERROR: run_ldapadd has failed." + exit 1; +fi + +# osynctool should synchronize only one particular object type: +enable_only "$OBJECTTYPE" + +# Trigger synchronization +valgrind_slow_sync "$OBJECTTYPE" +rv=$? + +# Shut down test group +epilogue + + +exit $rv Modified: plugins/ldap-sync/tests/check_osynctool_common.inc ============================================================================== --- plugins/ldap-sync/tests/check_osynctool_common.inc Wed Apr 1 23:56:44 2009 (r5510) +++ plugins/ldap-sync/tests/check_osynctool_common.inc Wed Apr 1 23:57:55 2009 (r5511) @@ -1,4 +1,4 @@ -GROUPNAME="sync_test_group" +# GROUPNAME="sync_test_group" check_plugin_available() { @@ -573,7 +573,6 @@ rm -f "$CONTACT1_FILE"; fi - if test -z "$CONTACT2_FILE"; then echo "${FUNCNAME}(): ERROR: \$CONTACT2_FILE is empty. Ignoring." elif test -f "$CONTACT2_FILE"; then @@ -678,6 +677,148 @@ if test -z "$objtype"; then + echo "${FUNCNAME}(): ERROR: \$objtype is empty. Exiting." + exit 1 + fi + + if test "$objtype" != "contact" -a "$objtype" != "event" -a "$objtype" != "todo" -a "$objtype" != "note"; then + echo "${FUNCNAME}(): ERROR: \"$objtype\" is wrong: \$objtype can only be either \"contact\" or \"event\" or \"todo\" or \"note\". Exiting." + exit 1; + fi + + if test -z "$xmlfile"; then + echo "${FUNCNAME}(): ERROR: \$xmlfile is empty. Exiting." + exit 1 + fi + + if test ! -f "$xmlfile"; then + echo "${FUNCNAME}(): ERROR: \"$xmlfile\" could not be found. Exiting." + exit 1 + fi + + if test ! -r "$xmlfile"; then + echo "${FUNCNAME}(): ERROR: \"$xmlfile\" could be found, but it is not readable. Exiting." + exit 1 + fi + + + + + if test "$objtype" == "contact"; then + cp -f "$xmlfile" $CONTACT1_FILE + + elif test "$objtype" == "event"; then + cp -f "$xmlfile" $EVENT1_FILE + + elif test "$objtype" == "todo"; then + cp -f "$xmlfile" $TODO1_FILE + + elif test "$objtype" == "note"; then + cp -f "$xmlfile" $NOTE1_FILE + + fi +} + + + + + + + +check_presence_of_file() +{ + objtype="$1" + xmlfile="$2" + + + if test -z "$objtype"; then + echo "${FUNCNAME}(): ERROR: \$objtype is empty. Exiting." + exit 1 + fi + + if test "$objtype" != "contact" -a "$objtype" != "event" -a "$objtype" != "todo" -a "$objtype" != "note"; then + echo "${FUNCNAME}(): ERROR: \"$objtype\" is wrong: \$objtype can only be either \"contact\" or \"event\" or \"todo\" or \"note\". Exiting." + exit 1; + fi + + if test -z "$xmlfile"; then + echo "${FUNCNAME}(): ERROR: \$xmlfile is empty. Exiting." + exit 1 + fi + + if test ! -f "$xmlfile"; then + echo "${FUNCNAME}(): ERROR: \"$xmlfile\" could not be found. Exiting." + exit 1 + fi + + if test ! -r "$xmlfile"; then + echo "${FUNCNAME}(): ERROR: \"$xmlfile\" could be found, but it is not readable. Exiting." + exit 1 + fi + + + + if test "$objtype" == "contact"; then + if test ! -f "$CONTACT1_FILE"; then + echo "${FUNCNAME}(): ERROR: \"$CONTACT1_FILE\" could NOT be found." + return 1 + fi + + if test ! -r "$CONTACT1_FILE"; then + echo "${FUNCNAME}(): ERROR: \"$CONTACT1_FILE\" could be found, but it is not readable." + return 1 + fi + + elif test "$objtype" == "event"; then + if test ! -f "$EVENT1_FILE"; then + echo "${FUNCNAME}(): ERROR: \"$EVENT1_FILE\" could NOT be found." + return 1 + fi + + if test ! -r "$EVENT1_FILE"; then + echo "${FUNCNAME}(): ERROR: \"$EVENT1_FILE\" could be found, but it is not readable." + return 1 + fi + + elif test "$objtype" == "todo"; then + if test ! -f "$TODO1_FILE"; then + echo "${FUNCNAME}(): ERROR: \"$TODO1_FILE\" could NOT be found." + return 1 + fi + + if test ! -r "$TODO1_FILE"; then + echo "${FUNCNAME}(): ERROR: \"$TODO1_FILE\" could be found, but it is not readable." + return 1 + fi + + elif test "$objtype" == "note"; then + if test ! -f "$NOTE1_FILE"; then + echo "${FUNCNAME}(): ERROR: \"$NOTE1_FILE\" could NOT be found." + return 1 + fi + + if test ! -r "$NOTE1_FILE"; then + echo "${FUNCNAME}(): ERROR: \"$NOTE1_FILE\" could be found, but it is not readable." + return 1 + fi + + fi +} + + + + + + + +modify_file() +{ + objtype="$1" + xmlfile="$2" + newfile="$3" + + + if test -z "$objtype"; then echo "$FILE:$LINENO: ERROR: \$objtype is empty. Exiting." exit 1 fi @@ -703,29 +844,40 @@ fi + if test -z "$newfile"; then + echo "$FILE:$LINENO: ERROR: \$newfile is empty. Exiting." + exit 1 + fi + + if test ! -f "$newfile"; then + echo "$FILE:$LINENO: ERROR: \"$newfile\" could not be found. Exiting." + exit 1 + fi + + if test ! -r "$newfile"; then + echo "$FILE:$LINENO: ERROR: \"$newfile\" could be found, but it is not readable. Exiting." + exit 1 + fi + + -# if test "$objtype" == "contact"; then -# remove_contact_files -# elif test "$objtype" == "event"; then -# remove_event1_file -# elif test "$objtype" == "todo"; then -# remove_todo1_file -# elif test "$objtype" == "note"; then -# remove_note_files -# fi if test "$objtype" == "contact"; then - cp -f "$xmlfile" $CONTACT1_FILE + rm -f "$CONTACT1_FILE" + cp -f "$newfile" $CONTACT1_FILE elif test "$objtype" == "event"; then - cp -f "$xmlfile" $EVENT1_FILE + rm -f "$EVENT1_FILE" + cp -f "$newfile" $EVENT1_FILE elif test "$objtype" == "todo"; then - cp -f "$xmlfile" $TODO1_FILE + rm -f "$TODO1_FILE" + cp -f "$newfile" $TODO1_FILE elif test "$objtype" == "note"; then - cp -f "$xmlfile" $NOTE1_FILE + rm -f "$NOTE1_FILE" + cp -f "$newfile" $NOTE1_FILE fi } @@ -734,6 +886,60 @@ +delete_file() +{ + objtype="$1" + xmlfile="$2" + + + if test -z "$objtype"; then + echo "$FILE:$LINENO: ERROR: \$objtype is empty. Exiting." + exit 1 + fi + + if test "$objtype" != "contact" -a "$objtype" != "event" -a "$objtype" != "todo" -a "$objtype" != "note"; then + echo "${FUNCNAME}(): ERROR: \"$objtype\" is wrong: \$objtype can only be either \"contact\" or \"event\" or \"todo\" or \"note\". Exiting." + exit 1; + fi + + if test -z "$xmlfile"; then + echo "$FILE:$LINENO: ERROR: \$xmlfile is empty. Exiting." + exit 1 + fi + + if test ! -f "$xmlfile"; then + echo "$FILE:$LINENO: ERROR: \"$xmlfile\" could not be found. Exiting." + exit 1 + fi + + if test ! -r "$xmlfile"; then + echo "$FILE:$LINENO: ERROR: \"$xmlfile\" could be found, but it is not readable. Exiting." + exit 1 + fi + + + + + if test "$objtype" == "contact"; then + rm -f "$CONTACT1_FILE" + + elif test "$objtype" == "event"; then + rm -f "$EVENT1_FILE" + + elif test "$objtype" == "todo"; then + rm -f "$TODO1_FILE" + + elif test "$objtype" == "note"; then + rm -f "$NOTE1_FILE" + + fi +} + + + + + + enable_only() { objtype="$1" @@ -839,6 +1045,64 @@ +fast_sync() +{ + group="$GROUPNAME" + objtype="$1" + + + if test -z "$group"; then + echo "${FUNCNAME}(): ERROR: \$group is empty. Exiting."; + exit 1; + fi + + + if test -z "$objtype"; then + echo "${FUNCNAME}(): ERROR: \$objtype is empty. Exiting."; + exit 1; + fi + + + if test -z "$OSYNCTOOL"; then + echo "${FUNCNAME}(): ERROR: \$OSYNCTOOL is empty. Exiting." + exit 1; + fi + + if test ! -f "$OSYNCTOOL"; then + echo "${FUNCNAME}(): ERROR: \$OSYNCTOOL does not exist. Exiting." + exit 1; + fi + + if test ! -x "$OSYNCTOOL"; then + echo "${FUNCNAME}(): ERROR: \$OSYNCTOOL does exist, but it is not executable. Exiting." + exit 1; + fi + + if test -z "$TMPDIR"; then + echo "${FUNCNAME}(): ERROR: \$TMPDIR is empty. Exiting." + exit 1; + fi + + if test ! -d "$TMPDIR"; then + echo "${FUNCNAME}(): ERROR: \$TMPDIR is not a directory. Exiting." + exit 1; + fi + + + $OSYNCTOOL --configdir "$TMPDIR" --sync "$group" --always-accept-forecast --conflict 2 + + +} + + + + + + + + + + valgrind_slow_sync() { group="$GROUPNAME" @@ -898,3 +1162,64 @@ } + + + +valgrind_fast_sync() +{ + group="$GROUPNAME" + objtype="$1" + + + if test -z "$group"; then + echo "${FUNCNAME}(): ERROR: \$group is empty. Exiting."; + exit 1; + fi + + + if test -z "$objtype"; then + echo "${FUNCNAME}(): ERROR: \$objtype is empty. Exiting."; + exit 1; + fi + + + if test -z "$OSYNCTOOL"; then + echo "${FUNCNAME}(): ERROR: \$OSYNCTOOL is empty. Exiting." + exit 1; + fi + + if test ! -f "$OSYNCTOOL"; then + echo "${FUNCNAME}(): ERROR: \$OSYNCTOOL does not exist. Exiting." + exit 1; + fi + + if test ! -x "$OSYNCTOOL"; then + echo "${FUNCNAME}(): ERROR: \$OSYNCTOOL does exist, but it is not executable. Exiting." + exit 1; + fi + + if test -z "$TMPDIR"; then + echo "${FUNCNAME}(): ERROR: \$TMPDIR is empty. Exiting." + exit 1; + fi + + if test ! -d "$TMPDIR"; then + echo "${FUNCNAME}(): ERROR: \$TMPDIR is not a directory. 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 + + + + $VALGRIND $OSYNCTOOL --configdir "$TMPDIR" --sync "$group" --always-accept-forecast --conflict 2 + +} Modified: plugins/ldap-sync/tests/contact1.xml ============================================================================== --- plugins/ldap-sync/tests/contact1.xml Wed Apr 1 23:56:44 2009 (r5510) +++ plugins/ldap-sync/tests/contact1.xml Wed Apr 1 23:57:55 2009 (r5511) @@ -18,15 +18,6 @@ <PostalCode>111111</PostalCode> <Country>Germany</Country> </Address> - <Address Location="Work"> - <PostOfficeBox>111111</PostOfficeBox> - <ExtendedAddress>Berlin</ExtendedAddress> - <Street>Me at work</Street> - <Locality>Berlin</Locality> - <Region>Berlin</Region> - <PostalCode>111111</PostalCode> - <Country>Germania</Country> - </Address> <AddressLabel Location="Home"> <Content>Me at home Kuhpoedelskoog Added: plugins/ldap-sync/tests/contact1.xml_modified ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/tests/contact1.xml_modified Wed Apr 1 23:57:55 2009 (r5511) @@ -0,0 +1,139 @@ +<?xml version="1.0"?> +<contact> + <Address Location="Home"> + <PostOfficeBox>333333</PostOfficeBox> + <ExtendedAddress>Kuhpoedelskoog</ExtendedAddress> + <Street>Me at home</Street> + <Locality>Kuhpoedelskoog</Locality> + <Region>Saxonia inferior</Region> + <PostalCode>444444</PostalCode> + <Country>Germania</Country> + </Address> + <Address Location="Work"> + <PostOfficeBox>222222</PostOfficeBox> + <ExtendedAddress>Berlin</ExtendedAddress> + <Street>Me at work</Street> + <Locality>Berlin</Locality> + <Region>Berlin</Region> + <PostalCode>222222</PostalCode> + <Country>Germany</Country> + </Address> + <AddressLabel Location="Home"> + <Content>Me at home +Kuhpoedelskoog +Kuhpoedelskoog, Saxonia inferior +444444 +444444 +Germania</Content> + </AddressLabel> + <AddressLabel Location="Work"> + <Content>Me at work +Berlin +Berlin, Berlin +111111 +111111 +Germany</Content> + </AddressLabel> + <Anniversary> + <Content>20090331</Content> + </Anniversary> + <Assistant> + <Content>Healthy, keen, eager like hell.</Content> + </Assistant> + <Birthday> + <Content>20090301</Content> + </Birthday> + <BlogUrl> + <Content>https://blog.example.com</Content> + </BlogUrl> + <CalendarUrl> + <Content>https://calendar.example.com</Content> + </CalendarUrl> + <Categories> + <Category>Hot Contacts</Category> + </Categories> + <EMail Location="Other" UI-Slot="3"> + <Content>us...@ot...</Content> + </EMail> + <EMail Location="Home" UI-Slot="2"> + <Content>us...@ho...</Content> + </EMail> + <EMail Location="Work" UI-Slot="1"> + <Content>us...@wo...</Content> + </EMail> + <FileAs> + <Content>user2</Content> + </FileAs> + <FormattedName> + <Content>user2</Content> + </FormattedName> + <FreeBusyUrl> + <Content>http://freebusy.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>Vanished</Content> + </Manager> + <Name> + <FirstName>user2</FirstName> + </Name> + <Nickname> + <Content>two</Content> + </Nickname> + <Note> + <Content>Ok, let's write some notes...</Content> + </Note> + <Organization> + <Name>Creative Co</Name> + <Unit>Studio</Unit> + <Unit>The other building</Unit> + </Organization> + <Profession> + <Content>Creator</Content> + </Profession> + <Revision> + <Content>20090323T172004Z</Content> + </Revision> + <Spouse> + <Content>Betty</Content> + </Spouse> + <Telephone Location="Work" UI-Slot="4"> + <Content>0000000004</Content> + </Telephone> + <Telephone Type="Cellular" UI-Slot="3"> + <Content>0000000003</Content> + </Telephone> + <Telephone Location="Home" UI-Slot="2"> + <Content>0000000002</Content> + </Telephone> + <Telephone Location="Work" UI-Slot="1"> + <Content>0000000001</Content> + </Telephone> + <Title> + <Content>Emperor</Content> + </Title> + <Uid> + <Content>pas-id-49C7C3710000002B</Content> + </Uid> + <Url> + <Content>http://www.example.com</Content> + </Url> + <VideoUrl> + <Content>http://video_chat.example.com</Content> + </VideoUrl> + <WantsHtml> + <Content>TRUE</Content> + </WantsHtml> +</contact> + Added: plugins/ldap-sync/tests/contact2.xml_modified ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/tests/contact2.xml_modified Wed Apr 1 23:57:55 2009 (r5511) @@ -0,0 +1,127 @@ +<?xml version="1.0"?> +<contact> + <Address Location="Home"> + <Locality>Kuhpoedelskoog</Locality> + <Region>Saxonia inferior</Region> + <PostalCode>333333</PostalCode> + <Country>Germania</Country> + </Address> + <Address Location="Work"> + <Locality>Kuhpoedelskoog</Locality> + <Region>Saxonia inferior</Region> + <PostalCode>333333</PostalCode> + <Country>Germania</Country> + </Address> + <AddressLabel Location="Work"> + <Content>Kuhpoedelskoog, Saxonia inferior +333333 +Germania</Content> + </AddressLabel> + <AddressLabel Location="Home"> + <Content>Kuhpoedelskoog, Saxonia inferior +333333 +Germania</Content> + </AddressLabel> + <Anniversary> + <Content>20090306</Content> + </Anniversary> + <Assistant> + <Content>Dodgy, half-conscious, not really present in this world.</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>Miscellaneous</Category> + </Categories> + <EMail Location="Work" UI-Slot="3"> + <Content>us...@wo...</Content> + </EMail> + <EMail Location="Home" UI-Slot="2"> + <Content>us...@ho...</Content> + </EMail> + <EMail Location="Other" UI-Slot="1"> + <Content>us...@ot...</Content> + </EMail> + <FileAs> + <Content>user1</Content> + </FileAs> + <FormattedName> + <Content>user1</Content> + </FormattedName> + <FreeBusyUrl> + <Content>http://freebusy.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>vanished</Content> + </Manager> + <Name> + <FirstName>user1</FirstName> + </Name> + <Nickname> + <Content>one</Content> + </Nickname> + <Note> + <Content>Thinking of what could I write as notes...</Content> + </Note> + <Organization> + <Name>creative.com</Name> + <Unit>controlling</Unit> + <Unit>The other building.</Unit> + </Organization> + <Profession> + <Content>creator</Content> + </Profession> + <Revision> + <Content>20090322T123606Z</Content> + </Revision> + <Spouse> + <Content>betty</Content> + </Spouse> + <Telephone Location="Work" UI-Slot="4"> + <Content>0000000000004</Content> + </Telephone> + <Telephone Type="Cellular" UI-Slot="3"> + <Content>0000000000002</Content> + </Telephone> + <Telephone Location="Home" UI-Slot="2"> + <Content>0000000000001</Content> + </Telephone> + <Telephone Location="Work" UI-Slot="1"> + <Content>0000000000003</Content> + </Telephone> + <Title> + <Content>Emperor</Content> + </Title> + <Uid> + <Content>pas-id-49C62FB900000022</Content> + </Uid> + <Url> + <Content>http://www.example.com/</Content> + </Url> + <VideoUrl> + <Content>http://videochat.example.com/</Content> + </VideoUrl> + <WantsHtml> + <Content>TRUE</Content> + </WantsHtml> +</contact> + Added: plugins/ldap-sync/tests/event1.xml_modified ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/tests/event1.xml_modified Wed Apr 1 23:57:55 2009 (r5511) @@ -0,0 +1,88 @@ +<?xml version="1.0"?> +<event> + <AlarmDisplay Value="DURATION" RelatedType="START"> + <AlarmAction>DISPLAY</AlarmAction> + <AlarmDescription>Appointment no. 1</AlarmDescription> + <AlarmTrigger>-PT15M</AlarmTrigger> + </AlarmDisplay> + <Categories> + <Category>Miscellaneous</Category> + </Categories> + <Class> + <Content>PRIVATE</Content> + </Class> + <Created> + <Content>20090322T135232</Content> + </Created> + <DateCalendarCreated> + <Content>20090320T204925Z</Content> + </DateCalendarCreated> + <DateEnd TimezoneID="/softwarestudio.org/Tzfile/Europe/Berlin"> + <Content>20090320T223000</Content> + </DateEnd> + <DateStarted TimezoneID="/softwarestudio.org/Tzfile/Europe/Berlin"> + <Content>20090320T220000</Content> + </DateStarted> + <Description> + <Content>This appointment reoccures. It has been slightly modified. And it has an alarm.</Content> + </Description> + <LastModified> + <Content>20090401T135232</Content> + </LastModified> + <Location> + <Content>Over there.</Content> + </Location> + <Method> + <Content>PUBLISH</Content> + </Method> + <ProductID> + <Content>-//Ximian//NONSGML Evolution Calendar//EN</Content> + </ProductID> + <RecurrenceRule> + <Frequency>DAILY</Frequency> + <Count>2</Count> + <Interval>1</Interval> + </RecurrenceRule> + <Sequence> + <Content>2</Content> + </Sequence> + <Summary> + <Content>Appointment no. 1</Content> + </Summary> + <TimeTransparency> + <Content>OPAQUE</Content> + </TimeTransparency> + <Timezone TimezoneID="/softwarestudio.org/Tzfile/Europe/Berlin"> + <X-Location>Europe/Berlin</X-Location> + </Timezone> + <TimezoneComponent TZComponent="Standard" TimezoneID="/softwarestudio.org/Tzfile/Europe/Berlin"> + <DateTimeStart>19701025T020000</DateTimeStart> + <TZName>CET</TZName> + <TZOffsetFrom>+0200</TZOffsetFrom> + <TZOffsetTo>+0100</TZOffsetTo> + </TimezoneComponent> + <TimezoneComponent TZComponent="Daylight" TimezoneID="/softwarestudio.org/Tzfile/Europe/Berlin"> + <DateTimeStart>19700329T030000</DateTimeStart> + <TZName>CEST</TZName> + <TZOffsetFrom>+0100</TZOffsetFrom> + <TZOffsetTo>+0200</TZOffsetTo> + </TimezoneComponent> + <TimezoneRule TZComponent="Standard" TimezoneID="/softwarestudio.org/Tzfile/Europe/Berlin"> + <Frequency>YEARLY</Frequency> + <Count>0</Count> + <Interval>1</Interval> + <ByDay>-1SU</ByDay> + <ByMonth>10</ByMonth> + </TimezoneRule> + <TimezoneRule TZComponent="Daylight" TimezoneID="/softwarestudio.org/Tzfile/Europe/Berlin"> + <Frequency>YEARLY</Frequency> + <Count>0</Count> + <Interval>1</Interval> + <ByDay>-1SU</ByDay> + <ByMonth>3</ByMonth> + </TimezoneRule> + <Uid> + <Content>200...@ho...</Content> + </Uid> +</event> + Added: plugins/ldap-sync/tests/note1.xml_modified ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/tests/note1.xml_modified Wed Apr 1 23:57:55 2009 (r5511) @@ -0,0 +1,39 @@ +<?xml version="1.0"?> +<note> + <Categories> + <Category>Waiting</Category> + </Categories> + <Class> + <Content>PRIVATE</Content> + </Class> + <Created> + <Content>20090317T211814</Content> + </Created> + <DateCalendarCreated> + <Content>20090228T003924Z</Content> + </DateCalendarCreated> + <DateStarted Value="DATE"> + <Content>20090228</Content> + </DateStarted> + <Description> + <Content>This is my first memo. </Content> + </Description> + <LastModified> + <Content>20090401T211814</Content> + </LastModified> + <Method> + <Content>PUBLISH</Content> + </Method> + <ProductID> + <Content>-//Ximian//NONSGML Evolution Calendar//EN</Content> + </ProductID> + <Sequence> + <Content>1</Content> + </Sequence> + <Summary> + <Content>First memo. In a slightly modified form.</Content> + </Summary> + <Uid> + <Content>200...@ho...</Content> + </Uid> +</note> Added: plugins/ldap-sync/tests/note2.xml_modified ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/tests/note2.xml_modified Wed Apr 1 23:57:55 2009 (r5511) @@ -0,0 +1,43 @@ +<?xml version="1.0"?> +<note> + <Attach> + <Content>file:///home/user1/.evolution/memos/local/system/200...@ho...-file</Content> + </Attach> + <Categories> + <Category>development</Category> + </Categories> + <Class> + <Content>PRIVATE</Content> + </Class> + <Created> + <Content>20090103T144254</Content> + </Created> + <DateCalendarCreated> + <Content>20090103T144254Z</Content> + </DateCalendarCreated> + <DateStarted Value="DATE"> + <Content>20090103</Content> + </DateStarted> + <Description> + <Content>This is my first memo in evolution. It is confidential. With an attachment of 9 bytes.</Content> + </Description> + <LastModified> + <Content>20090401T144755</Content> + </LastModified> + <Method> + <Content>PUBLISH</Content> + </Method> + <ProductID> + <Content>-//Ximian//NONSGML Evolution Calendar//EN</Content> + </ProductID> + <Sequence> + <Content>1</Content> + </Sequence> + <Summary> + <Content>1st memo. In a slightly modified form.</Content> + </Summary> +<Uid> + <Content>200...@ho...</Content> + </Uid> +</note> + Modified: plugins/ldap-sync/tests/test.conf ============================================================================== --- plugins/ldap-sync/tests/test.conf Wed Apr 1 23:56:44 2009 (r5510) +++ plugins/ldap-sync/tests/test.conf Wed Apr 1 23:57:55 2009 (r5511) @@ -31,6 +31,8 @@ NOTE1_FILE='/tmp/file_note/200...@ho...' NOTE2_FILE='/tmp/file_note/200...@ho...' +GROUPNAME="sync_test_group" + ########## Without leak checking: VALGRIND="valgrind --db-attach=no --num-callers=30 --gen-suppressions=all --leak-check=no --show-reachable=yes --error-exitcode=1 --track-origins=yes" Added: plugins/ldap-sync/tests/todo1.xml_modified ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ plugins/ldap-sync/tests/todo1.xml_modified Wed Apr 1 23:57:55 2009 (r5511) @@ -0,0 +1,49 @@ +<?xml version="1.0"?> +<todo> + <Categories> + <Category>Phone Calls</Category> + </Categories> + <Class> + <Content>PRIVATE</Content> + </Class> + <Created> + <Content>20090325T135501</Content> + </Created> + <DateCalendarCreated> + <Content>20090325T135501Z</Content> + </DateCalendarCreated> + <DateStarted Value="DATE"> + <Content>20090301</Content> + </DateStarted> + <Description> + <Content>This is the very first task.</Content> + </Description> + <Due Value="DATE"> + <Content>20090328</Content> + </Due> + <LastModified> + <Content>20090401T135622</Content> + </LastModified> + <Method> + <Content>PUBLISH</Content> + </Method> + <PercentComplete> + <Content>30</Content> + </PercentComplete> + <Priority> + <Content>1</Content> + </Priority> + <ProductID> + <Content>-//Ximian//NONSGML Evolution Calendar//EN</Content> + </ProductID> + <Sequence> + <Content>1</Content> + </Sequence> + <Summary> + <Content>Task no. 1</Content> + </Summary> + <Uid> + <Content>200...@ho...</Content> + </Uid> +</todo> + |
From: <svn...@op...> - 2009-04-01 21:56:47
|
Author: scriptor Date: Wed Apr 1 23:56:44 2009 New Revision: 5510 URL: http://www.opensync.org/changeset/5510 Log: Checking for the presence of the keyattribute is something different from making sure, that the most-left part of an LDAP DN is actually present as an LDAP attribute, and that the values of both are really identical. Otherwise: "Naming violation". New function: ldap_plugin_assure_attribute() Tiny changes with some comments. Modified: plugins/ldap-sync/src/ldap_connect.c plugins/ldap-sync/src/ldap_plugin.c plugins/ldap-sync/src/ldap_plugin.h Modified: plugins/ldap-sync/src/ldap_connect.c ============================================================================== --- plugins/ldap-sync/src/ldap_connect.c Wed Apr 1 20:15:48 2009 (r5509) +++ plugins/ldap-sync/src/ldap_connect.c Wed Apr 1 23:56:44 2009 (r5510) @@ -3719,8 +3719,12 @@ /*****************************/ // Rewrite the check_entry object - if (!ldap_plugin_rewrite_ldap_entry(check_entry, modifications, error)) { - goto error; + if (modifications) { + if (!ldap_plugin_rewrite_ldap_entry(check_entry, modifications, error)) { + goto error; + } + } else { + osync_trace(TRACE_INTERNAL, "%s:%i:%s(): No modification could be found. Nothing to do, therefore.", __FILE__, __LINE__, __func__); } @@ -3733,11 +3737,11 @@ #ifdef DEBUG_change_type_modified - ldap_plugin_printf( "\n\n----------\n%s:%i:%s(): \nModified version of check_entry:", __FILE__, __LINE__, __func__); + ldap_plugin_printf( "\n\n----------\n%s:%i:%s(): \nModified version of check_entry:", __FILE__, __LINE__, __func__); - // TODO - ldap_plugin_dump_ldap_attributes(check_entry); - ldap_plugin_printf("----------\n\n"); + // TODO + ldap_plugin_dump_ldap_attributes(check_entry); + ldap_plugin_printf("----------\n\n"); #endif @@ -3764,12 +3768,185 @@ } +/** + * @brief This function checks an LDAP entry for the presence of a + * particular LDAP attribute. If not found, it supplements + * the LDAP entry accordingly. + * + * @param entry The LDAP entry to be checked. + * @param attribute The LDAP attribute which is required to be present. + * @param value The value of the required LDAP attribute. + * + * @param error The libopensync error pointer. + */ + +osync_bool ldap_plugin_assure_attribute(ldap_entry *entry, const char *ldap_attribute, const char *value, OSyncError **error) +{ + int i = 0; + osync_bool found_attribute = FALSE; + + + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, entry, ldap_attribute, error); + + + if (entry == NULL) { + osync_error_set(error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: entry = NULL.", __FILE__, __LINE__); + goto error; + } + + if (entry->id == NULL) { + osync_error_set(error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: entry->id = NULL.", __FILE__, __LINE__); + goto error; + } + + if (entry->id[0] == 0) { + osync_error_set(error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: entry->id[0] = 0.", __FILE__, __LINE__); + goto error; + } + + if (entry->mods == NULL) { + osync_trace(TRACE_INTERNAL, "%s:%i: WARNING: entry->mods = NULL. Strange, but not really a problem.", __FILE__, __LINE__); + goto out; + } + + if (ldap_attribute == NULL) { + osync_error_set(error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: ldap_attribute = NULL.", __FILE__, __LINE__); + goto error; + } + -osync_bool ldap_plugin_check_for_keyattribute(sink_environment *sinkenv, ldap_entry *entry, OSyncError **error) + // Search the array of mods for ldap_attribute + for (i = 0; entry->mods[i]; i++) { + LDAPMod *mod = entry->mods[i]; + + if (mod) { + if (mod->mod_type) { + if (!strcmp(mod->mod_type, ldap_attribute)) { + osync_trace(TRACE_INTERNAL, "%s(): OK. Attribute \"%s\" found.", __func__, ldap_attribute); + found_attribute = TRUE; + } + } + } + } // for (i = 0; entry->mods[i]; i++) + + + // Supplement it, if necessary + if (!found_attribute) { + GList *new_set_of_mods = NULL; +#ifndef CALL_ABORT + int j = 0; +#endif + + + osync_trace(TRACE_INTERNAL, "%s:%i: WARNING: Attribute \"%s\" could not be found.", __FILE__, __LINE__, ldap_attribute); + osync_trace(TRACE_INTERNAL, "This happened with:"); + osync_trace(TRACE_INTERNAL, "entry->dn = \"%s\"", entry->dn); + osync_trace(TRACE_INTERNAL, "entry->id = \"%s\"", entry->id); + // ldap_plugin_dump_ldap_attributes(entry); + osync_trace(TRACE_INTERNAL, "-------------"); + +#ifdef CALL_ABORT + osync_trace(TRACE_ERROR, "%s:%i: Calling abort();\n", __FILE__, __LINE__); + ldap_plugin_printf("%s:%i: Calling abort();\n", __FILE__, __LINE__); + fprintf(stderr, "%s:%i: Calling abort();\n\n", __FILE__, __LINE__); + fflush(stderr); + abort(); + +#else + osync_trace(TRACE_INTERNAL, "%s:%i: Trying to add missing LDAP attribute.", __FILE__, __LINE__); + + // Copy old mods into new_set_of_mods + for (j = 0 ; entry->mods[j] ; j++ ) { + if (entry->mods[j]->mod_type) { + if (entry->mods[j]->mod_bvalues) { + if (entry->mods[j]->mod_values[0]) { + if (entry->mods[j]->mod_bvalues[0]->bv_val) { + new_set_of_mods = ldap_plugin_append_ldapmod(new_set_of_mods, entry->mods[j]->mod_type, entry->mods[j]->mod_bvalues[0]->bv_val); + } else { + osync_trace(TRACE_ERROR, "%s:%i: ERROR: mod_bvalues[0]->bv_val = NULL with j = %i", __FILE__, __LINE__, j); + } + } else { + osync_trace(TRACE_ERROR, "%s:%i: ERROR: mod_bvalues[0] = NULL with j = %i", __FILE__, __LINE__, j); + } + } else { + osync_trace(TRACE_ERROR, "%s:%i: ERROR: mod_bvalues = NULL with j = %i", __FILE__, __LINE__, j); + } + } else { + osync_trace(TRACE_ERROR, "%s:%i: ERROR: mod_type = NULL with j = %i", __FILE__, __LINE__, j); + } + } + + + // Add missing attribute + new_set_of_mods = ldap_plugin_append_ldapmod(new_set_of_mods, (char *)ldap_attribute, (char *)value); + + + // Rewrite the LDAP entry + ldap_plugin_rewrite_ldap_entry(entry, new_set_of_mods, error); + if (osync_error_is_set(error)) { + osync_trace(TRACE_ERROR, "%s:%i: ERROR: ldap_plugin_rewrite_ldap_entry() has failed.", __FILE__, __LINE__); + goto error; + } + +#endif + + } // if (!found_attribute) + + +out: + osync_trace(TRACE_EXIT, "%s: found_attribute = %s", __func__, found_attribute ? "TRUE" : "FALSE"); + return TRUE; + + +error: + if (!osync_error_is_set(error)) + osync_error_set(error, OSYNC_ERROR_GENERIC, "Unknown reason.\n"); + + osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error)); + osync_error_unref(error); + + return FALSE; +} + + + + + + +/** + * @brief This function checks whether the sinkenv->keyattr is present in the + * LDAP entry. + * + * This is important for two reasons: + * - The hashtable and the whole synchronization process requires + * the key attribute, as it is the identifier that matters. + * - The LDAP server requires the most-left part of the DN + * be present in the LDAP entry. + * Example: + * dn: ou=addressbook,dc=example,dc=com + * ou: addressbook MUST be present in the LDAP entry. + * Otherwise: Naming violation. + * + * Note: This function MUST NOT be called for subentries and + * sub-subentries. + * + * @param sinkenv The sink specific environment. + * @param entry The LDAP entry to be checked + * @param check_key_attribute Whether or not the presence of the key attribute + * should be checked. As it seems, entrymods that + * are to be sent to ldap_modify_ext_s() should + * set FALSE here. + * @param error The libopensync error pointer. + * + * @returns TRUE on success, FALSE in case of any error + */ + +osync_bool ldap_plugin_check_for_keyattribute(sink_environment *sinkenv, ldap_entry *entry, osync_bool check_key_attribute, OSyncError **error) { int i = 0; - osync_bool found_name = FALSE, found_value = FALSE; + osync_bool dn_attribute_found = FALSE, identical = FALSE; + gchar **required = NULL; osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, sinkenv, entry, error); @@ -3812,51 +3989,117 @@ } - for (i = 0; entry->mods[i]; i++) { - LDAPMod *mod = entry->mods[i]; - if (mod) { - if (mod->mod_type) { - if (!strcmp(mod->mod_type, sinkenv->keyattr)) { - osync_trace(TRACE_INTERNAL, "%s(): OK. Keyattribute \"%s\" found.", __func__, sinkenv->keyattr); - found_name = TRUE; - - if (mod->mod_bvalues) { - if (mod->mod_bvalues[0]) { - if (mod->mod_bvalues[0]->bv_val) { - if (!strcmp(mod->mod_bvalues[0]->bv_val, entry->id)) { - osync_trace(TRACE_INTERNAL, "%s(): OK. Value of keyattribute is identical to the identifier: \"%s\".", __func__, entry->id); - found_value = TRUE; - } else { - osync_trace(TRACE_ERROR, "%s:%i: WARNING: Value of keyattribute \"%s\" conflicts with identifier \"%s\". Trying to enforce correct one.", __FILE__, __LINE__, mod->mod_bvalues[0]->bv_val, entry->id); - g_free(mod->mod_bvalues[0]->bv_val); - mod->mod_bvalues[0]->bv_val = g_strdup(entry->id); - mod->mod_bvalues[0]->bv_len = strlen(entry->id); - // What about the hash value? + + // Check for keyattribute + if (check_key_attribute) { + if (g_str_has_prefix(entry->dn, sinkenv->keyattr)) { + osync_trace(TRACE_INTERNAL, "%s:%i: Checking for presence of keyattribute for \"dn: %s\"", __FILE__, __LINE__, entry->dn); + + + if (!ldap_plugin_assure_attribute(entry, sinkenv->keyattr, entry->id, error)) { + if (!osync_error_is_set(error)) + osync_error_set(error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: ldap_plugin_assure_attribute.\n", __FILE__, __LINE__); + + goto error; + } + } else { + osync_trace(TRACE_INTERNAL, "%s:%i: This must be a subentry: \"dn: %s\". Therefore NOT checking for presence of keyattribute. Only checking for consistency.", __FILE__, __LINE__, entry->dn); + } + } + + + + + // Check for identity between DN prefix and corresponding LDAP attribute + required = g_strsplit(entry->dn, "=", 10); + + + if (required) { + if (required[0]) { + osync_trace(TRACE_INTERNAL, "%s:%i: required = \"%s\"", __FILE__, __LINE__, required[0]); + + for (i = 0; entry->mods[i]; i++) { + LDAPMod *mod = entry->mods[i]; + + if (mod) { + if (mod->mod_type) { + if (!strcmp(mod->mod_type, required[0])) { + osync_trace(TRACE_INTERNAL, "%s(): OK. First element of DN \"%s\" has been found.", __func__, required[0]); + dn_attribute_found = TRUE; + + if (mod->mod_bvalues) { + if (mod->mod_bvalues[0]) { + if (mod->mod_bvalues[0]->bv_val) { + if (!strcmp(mod->mod_bvalues[0]->bv_val, entry->id)) { + osync_trace(TRACE_INTERNAL, "%s(): OK. Value of keyattribute is identical to the identifier: \"%s\".", __func__, entry->id); + identical = TRUE; + } else { + osync_trace(TRACE_ERROR, "%s:%i: WARNING: Value of keyattribute \"%s\" conflicts with identifier \"%s\". Trying to enforce correct one.", __FILE__, __LINE__, mod->mod_bvalues[0]->bv_val, entry->id); + g_free(mod->mod_bvalues[0]->bv_val); + mod->mod_bvalues[0]->bv_val = g_strdup(entry->id); + mod->mod_bvalues[0]->bv_len = strlen(entry->id); + + // What about the hash value? + } + } } } + + break; } } + } + } // for (i = 0; entry->mods[i]; i++) + + + if (check_key_attribute) { + if (dn_attribute_found == FALSE) { + osync_trace(TRACE_ERROR, "%s:%i: ERROR: required LDAP attribute \"%s\" could not be found.", __FILE__, __LINE__, required[0]); + osync_trace(TRACE_ERROR, "%s:%i: ERROR: This happened with entry->id = \"%s\", entry->dn = \"%s\":", __FILE__, __LINE__, entry->id, entry->dn); + ldap_plugin_dump_ldap_attributes(entry); + ldap_plugin_printf("-----------------\n"); + + +#ifdef CALL_ABORT + osync_trace(TRACE_ERROR, "%s:%i: Calling abort();\n", __FILE__, __LINE__); + ldap_plugin_printf("%s:%i: Calling abort();\n", __FILE__, __LINE__); + fprintf(stderr, "%s:%i: Calling abort();\n\n", __FILE__, __LINE__); + fflush(stderr); + abort(); + +#else + if (!ldap_plugin_assure_attribute(entry, required[0], entry->id, error)) { + if (!osync_error_is_set(error)) + osync_error_set(error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: ldap_plugin_assure_attribute.\n", __FILE__, __LINE__); + + goto error; + } +#endif - break; } } + + + } else { + osync_error_set(error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: required[0] = NULL.", __FILE__, __LINE__); + goto error; } - } - if (!found_name) { - osync_trace(TRACE_ERROR, "%s:%i: WARNING: Keyattribute \"%s\" could not be found.", __FILE__, __LINE__, sinkenv->keyattr); - ldap_plugin_printf("This happened with:"); - ldap_plugin_dump_ldap_attributes(entry); - ldap_plugin_printf("-------------"); + g_strfreev(required); + required = NULL; + + } else { + osync_error_set(error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: required = NULL.", __FILE__, __LINE__); + goto error; } out: - osync_trace(TRACE_EXIT, "%s: found_name = %s, found_value = %s", __func__, found_name ? "TRUE" : "FALSE", found_value ? "TRUE" : "FALSE"); + osync_trace(TRACE_EXIT, "%s: dn_attribute_found = %s, identical = %s", __func__, dn_attribute_found ? "TRUE" : "FALSE", identical ? "TRUE" : "FALSE"); return TRUE; error: @@ -3871,9 +4114,6 @@ - - - /** Modified: plugins/ldap-sync/src/ldap_plugin.c ============================================================================== --- plugins/ldap-sync/src/ldap_plugin.c Wed Apr 1 20:15:48 2009 (r5509) +++ plugins/ldap-sync/src/ldap_plugin.c Wed Apr 1 23:56:44 2009 (r5510) @@ -225,9 +225,6 @@ - - - /** * @brief Since changeset r5277 gaining "sink_environment *sinkenv" * has changed: It cannot be got from a library call, any more. @@ -1090,6 +1087,123 @@ + + + +/** + * + @brief Adds one "attribute name - value" pair in form of an LDAPMod to a GList + @details ldap.h + 697 union mod_vals_u { + 698 char **modv_strvals; + 699 struct berval **modv_bvals; + 700 } mod_vals; + 701 define mod_values mod_vals.modv_strvals + 702 define mod_bvalues mod_vals.modv_bvals + + @details lber.h + 208 typedef struct berval { + 209 ber_len_t bv_len; + 210 char *bv_val; + 211 } BerValue; + + @param list A list of LDAPMod's or NULL. + @param ldapattr The attribute name out of which the LDAPMod will be built + @param value The attribute value out of which the LDAPMod will be built + @returns A list of LDAPMod's + */ + +GList *ldap_plugin_append_ldapmod(GList *list, gchar *ldapattr, gchar *value) +{ + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, list, ldapattr, value); + + + + if (ldapattr == NULL) { + osync_trace(TRACE_ERROR, "%s:%i: ERROR: ldapattr = NULL. Returning.\n", __FILE__, __LINE__); + goto out; + } + + + if (ldapattr[0] == 0) { + osync_trace(TRACE_ERROR, "%s:%i: ERROR: ldapattr[0] = 0. Returning.\n", __FILE__, __LINE__); + goto out; + } + + + if (value == NULL) { + osync_trace(TRACE_ERROR, "%s:%i: ERROR: value = NULL. Returning.\n", __FILE__, __LINE__); + goto out; + } + + + + + + LDAPMod *mod = (LDAPMod*)g_malloc0(sizeof(LDAPMod)); + mod->mod_type = g_strdup(ldapattr); + mod->mod_op = LDAP_MOD_BVALUES; // Do not forget this! + mod->mod_bvalues = (struct berval **)g_malloc0(2 * sizeof(struct berval *)); + if (mod->mod_bvalues) { + mod->mod_bvalues[1] = NULL; // terminating NULL + mod->mod_bvalues[0] = (struct berval *)g_malloc0(sizeof(struct berval)); + if (mod->mod_bvalues[0]) { + int check = 0; + + mod->mod_bvalues[0]->bv_val = g_strdup(value); + mod->mod_bvalues[0]->bv_len = strlen(value); + if (mod->mod_bvalues[0]->bv_val == NULL) { + osync_trace(TRACE_ERROR, "%s:%i: ERROR: bv_val = NULL.\n", __FILE__, __LINE__); + } else { + if (mod->mod_bvalues[0]->bv_val[0] == 0) { + osync_trace(TRACE_ERROR, "%s:%i: ERROR: mod->mod_bvalues[0] is 0.\n", __FILE__, __LINE__); + } else { + check = check + 1; + } + } + + if (mod->mod_bvalues[0]->bv_len == 0) { + osync_trace(TRACE_ERROR, "%s:%i: ERROR: bv_len = 0.\n", __FILE__, __LINE__); + } else { + check = check + 1; + } + + } else { + osync_trace(TRACE_ERROR, "%s:%i: ERROR: mod->mod_bvalues[0] = NULL. Calling abort().", __FILE__, __LINE__); + ldap_plugin_printf("%s:%i: ERROR: mod->mod_bvalues[0] = NULL. Calling abort().", __FILE__, __LINE__); + abort(); + } + + + + } else { + ldap_plugin_printf("%s:%i: ERROR: mod->mod_bvalues = NULL. malloc problem. Exiting.", __FILE__, __LINE__); + exit(1); + } + + + + list = g_list_append(list, mod); + + if (list == NULL) { + osync_trace(TRACE_ERROR, "%s:%i: ERROR: list = NULL. \n", __FILE__, __LINE__); + } + + +out: + osync_trace(TRACE_EXIT, "%s(): list = %p", __func__, list); + return list; +} + + + + + + + + + + /** * @brief This function is just a dummy function, not a real validator * for the plugin-internal XML format. @@ -2930,7 +3044,7 @@ // Workaround for buggy peers, that send an identifier which differs // from what has been stored as value for the key attribute. - if (!ldap_plugin_check_for_keyattribute(sinkenv, entry, error)) { + if (!ldap_plugin_check_for_keyattribute(sinkenv, entry, TRUE, error)) { if (!osync_error_is_set(error)) osync_error_set(error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: ldap_plugin_check_for_keyattribute() has failed."); @@ -3200,7 +3314,7 @@ // Make sure that the key attribute is present in the LDAP entry. // And that its value is identical to the one that builds // the identifier. - if (!ldap_plugin_check_for_keyattribute(sinkenv, entry, error)) { + if (!ldap_plugin_check_for_keyattribute(sinkenv, entry, TRUE, error)) { if (!osync_error_is_set(error)) osync_error_set(error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: ldap_plugin_check_for_keyattribute() has failed."); @@ -3283,7 +3397,7 @@ // Make sure that the key attribute is present in the LDAP entry. // And that its value is identical to the one that builds // the identifier. - if (!ldap_plugin_check_for_keyattribute(sinkenv, entry, error)) { + if (!ldap_plugin_check_for_keyattribute(sinkenv, entry, FALSE, error)) { if (!osync_error_is_set(error)) osync_error_set(error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: ldap_plugin_check_for_keyattribute() has failed."); Modified: plugins/ldap-sync/src/ldap_plugin.h ============================================================================== --- plugins/ldap-sync/src/ldap_plugin.h Wed Apr 1 20:15:48 2009 (r5509) +++ plugins/ldap-sync/src/ldap_plugin.h Wed Apr 1 23:56:44 2009 (r5510) @@ -71,6 +71,7 @@ #include "config.h" +#if 0 /** * @headerfile "/usr/local/include/valgrind/valgrind.h" * @headerfile "/usr/local/include/valgrind/memcheck.h" @@ -78,7 +79,6 @@ * use of certain VALGRIND macros to check addressability * and definedness of a variable. */ -#if 0 #include "/usr/local/include/valgrind/valgrind.h" #include "/usr/local/include/valgrind/memcheck.h" #endif @@ -90,19 +90,19 @@ ///< function names of this plugin keep being ///< visible in backtraces when running ///< valgrind ... --leak-check=full -#undef DISABLE_SET_SLOWSYNC 1 ///< Defining this disables all of the code - ///< that deals with setting slowsync based - ///< on any anchor or database setting. -#undef NO_OUTPUT_TO_SCREEN 1 ///< Calls to ldap_plugin_printf() print a - ///< message by default BOTH to the trace files - ///< AND to the screen. However, defining this - ///< makes this function abstain from printing - ///< anything to the screen. -#undef CALL_ABORT 1 ///< Defining this lets certain code call "abort()" rather - ///< than "goto error". The code fragments that make - ///< use of this define are known to detect error - ///< conditions in libopensync. So they are almost - ///< scheduled for debugging. +// define DISABLE_SET_SLOWSYNC 1 ///< Defining this disables all of the code + ///< that deals with setting slowsync based + ///< on any anchor or database setting. +// define NO_OUTPUT_TO_SCREEN 1 ///< Calls to ldap_plugin_printf() print a + ///< message by default BOTH to the trace files + ///< AND to the screen. However, defining this + ///< makes this function abstain from printing + ///< anything to the screen. +// define CALL_ABORT 1 ///< Defining this lets certain code call "abort()" rather + ///< than "goto error". The code fragments that make + ///< use of this define are known to detect error + ///< conditions in libopensync. So they are almost + ///< scheduled for debugging. #define DEBUG_auth 1 #define DEBUG_configuration 1 @@ -393,10 +393,12 @@ // ldap_connect.c: void ldap_plugin_add_uid_to_list(const char *uid, const char *hash, void *userdata); +GList *ldap_plugin_append_ldapmod(GList *list, gchar *ldapattr, gchar *value); +osync_bool ldap_plugin_assure_attribute(ldap_entry *entry, const char *attribute, const char *value, OSyncError **error); char *ldap_plugin_build_actual_hash(OSyncContext *ctx, sink_environment *sinkenv, const char *base, const char *filter, LDAPMessage *all_entries, OSyncError **error); osync_bool ldap_plugin_call_ldap_search(OSyncContext *ctx, const LDAP *ldap_handle, const char *searchbase, const char *filter, const int scope, const int kind_of_attributes, const sink_environment *sinkenv, LDAPMessage **results, OSyncError **error); osync_bool ldap_plugin_check_contact_format_support(OSyncContext *ctx, sink_environment *sinkenv, OSyncError **error); -osync_bool ldap_plugin_check_for_keyattribute(sink_environment *sinkenv, ldap_entry *entry, OSyncError **error); +osync_bool ldap_plugin_check_for_keyattribute(sink_environment *sinkenv, ldap_entry *entry, osync_bool check_key_attribute, OSyncError **error); osync_bool ldap_plugin_check_ldap_schema_support(OSyncContext *ctx, sink_environment *sinkenv, const char *ldap_schema, osync_bool *result, OSyncError **error); osync_bool ldap_plugin_check_modify_on_attr_vals (OSyncContext *ctx, struct berval **oldvals, struct berval **newvals, osync_bool *modification, OSyncError **error); void ldap_plugin_connect(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *userdata); |
From: <svn...@op...> - 2009-04-01 18:16:00
|
Author: dgollub Date: Wed Apr 1 20:15:48 2009 New Revision: 5509 URL: http://www.opensync.org/changeset/5509 Log: Fixed potential segfault if OSyncClient allocation would fail. Patch by Nicolas Modified: trunk/opensync/client/osplugin.c Modified: trunk/opensync/client/osplugin.c ============================================================================== --- trunk/opensync/client/osplugin.c Wed Apr 1 13:56:31 2009 (r5508) +++ trunk/opensync/client/osplugin.c Wed Apr 1 20:15:48 2009 (r5509) @@ -67,7 +67,7 @@ usage(0); client = osync_client_new(&error); if (!client) - goto error; + goto done; if (!strcmp (argv[1], "-f")) { usePipes = TRUE; @@ -128,6 +128,7 @@ error: osync_client_unref(client); + done: osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(&error)); fprintf(stderr, "Unable to initialize environment: %s\n", osync_error_print(&error)); osync_error_unref(&error); |
From: <svn...@op...> - 2009-04-01 11:56:45
|
Author: henrik Date: Wed Apr 1 13:56:31 2009 New Revision: 5508 URL: http://www.opensync.org/changeset/5508 Log: Rename THUNDERBIRD_VERSION to THUNDERBIRD_XPCOM_VERSION to match settings in pkgconfig file. Identify main version of Thunderbird (2 or 3) and Sunbird (0 or 1) Modified: branches/3rd-party-cmake-modules/modules/FindThunderbirdXpcom.cmake Modified: branches/3rd-party-cmake-modules/modules/FindThunderbirdXpcom.cmake ============================================================================== --- branches/3rd-party-cmake-modules/modules/FindThunderbirdXpcom.cmake Wed Apr 1 05:40:33 2009 (r5507) +++ branches/3rd-party-cmake-modules/modules/FindThunderbirdXpcom.cmake Wed Apr 1 13:56:31 2009 (r5508) @@ -79,30 +79,31 @@ # For Thunderbird 3.0 we need to link the glue library EXEC_PROGRAM ( thunderbird ARGS "--version" - OUTPUT_VARIABLE _THUNDERBIRD_VERSION - RETURN_VALUE _THUNDERBIRD_VERSION_RET ) + OUTPUT_VARIABLE _THUNDERBIRD_XPCOM_VERSION + RETURN_VALUE _THUNDERBIRD_XPCOM_VERSION_RET ) - IF ( _THUNDERBIRD_VERSION_RET ) + IF ( _THUNDERBIRD_XPCOM_VERSION_RET ) EXEC_PROGRAM ( icedove ARGS "--version" - OUTPUT_VARIABLE _THUNDERBIRD_VERSION - RETURN_VALUE _THUNDERBIRD_VERSION_RET ) - ENDIF ( _THUNDERBIRD_VERSION_RET ) - - IF ( NOT _THUNDERBIRD_VERSION_RET ) - - STRING ( REGEX MATCH ".*([0-9]\\.[0-9]).*" _THUNDERBIRD_VERSION_OK "${_THUNDERBIRD_VERSION}" ) - IF ( _THUNDERBIRD_VERSION_OK ) - STRING ( REGEX REPLACE ".*([0-9]\\.[0-9]).*" "\\1" THUNDERBIRD_VERSION "${_THUNDERBIRD_VERSION}" ) - MESSAGE ( STATUS "THUNDERBIRD_VERSION [${THUNDERBIRD_VERSION}]" ) - IF ( THUNDERBIRD_VERSION STREQUAL "3.0" ) + OUTPUT_VARIABLE _THUNDERBIRD_XPCOM_VERSION + RETURN_VALUE _THUNDERBIRD_XPCOM_VERSION_RET ) + ENDIF ( _THUNDERBIRD_XPCOM_VERSION_RET ) + + IF ( NOT _THUNDERBIRD_XPCOM_VERSION_RET ) + + STRING ( REGEX MATCH ".*([0-9]\\.[0-9]).*" _THUNDERBIRD_XPCOM_VERSION_OK "${_THUNDERBIRD_XPCOM_VERSION}" ) + IF ( _THUNDERBIRD_XPCOM_VERSION_OK ) + STRING ( REGEX REPLACE ".*([0-9]\\.[0-9]).*" "\\1" THUNDERBIRD_XPCOM_VERSION "${_THUNDERBIRD_XPCOM_VERSION}" ) + MESSAGE ( STATUS "THUNDERBIRD_XPCOM_VERSION [${THUNDERBIRD_XPCOM_VERSION}]" ) + IF ( THUNDERBIRD_XPCOM_VERSION STREQUAL "3.0" ) SET ( THUNDERBIRD_XPCOM_LIBRARIES "xpcomglue_s;xpcom" ) - ENDIF ( THUNDERBIRD_VERSION STREQUAL "3.0" ) - ENDIF ( _THUNDERBIRD_VERSION_OK ) - ENDIF ( NOT _THUNDERBIRD_VERSION_RET ) + ENDIF ( THUNDERBIRD_XPCOM_VERSION STREQUAL "3.0" ) + ENDIF ( _THUNDERBIRD_XPCOM_VERSION_OK ) + ENDIF ( NOT _THUNDERBIRD_XPCOM_VERSION_RET ) ENDIF( THUNDERBIRD_XPCOM_FOUND ) # So, by now we should have the following variables set: +MESSAGE ( STATUS " THUNDERBIRD_XPCOM_VERSION ${THUNDERBIRD_XPCOM_VERSION}" ) MESSAGE ( STATUS " THUNDERBIRD_XPCOM_MAIN_INCLUDE_DIR ${THUNDERBIRD_XPCOM_MAIN_INCLUDE_DIR}" ) MESSAGE ( STATUS " NSPR_MAIN_INCLUDE_DIR ${NSPR_MAIN_INCLUDE_DIR}" ) MESSAGE ( STATUS " THUNDERBIRD_XPCOM_LIBRARY_DIRS ${THUNDERBIRD_XPCOM_LIBRARY_DIRS}" ) @@ -178,6 +179,10 @@ ENDIF ( SUNBIRD_FOUND ) +# Thunderbird and Sunbird main version +STRING (REGEX REPLACE "^([0-9]+)\\..*$" "\\1" THUNDERBIRD_VERSION_MAIN "${THUNDERBIRD_XPCOM_VERSION}" ) +STRING (REGEX REPLACE "^([0-9]+)\\..*$" "\\1" SUNBIRD_VERSION_MAIN "${SUNBIRD_VERSION}" ) + # So, by now we should have the following variables set: MESSAGE ( STATUS " SUNBIRD_MAIN_INCLUDE_DIR ${SUNBIRD_MAIN_INCLUDE_DIR}" ) MESSAGE ( STATUS " SUNBIRD_VERSION ${SUNBIRD_VERSION}" ) @@ -189,6 +194,10 @@ # And here is what we found out: MESSAGE ( STATUS "Found xpcom (thunderbird and sunbird):" ) +MESSAGE ( STATUS " THUNDERBIRD_XPCOM_VERSION=[${THUNDERBIRD_XPCOM_VERSION}]" ) +MESSAGE ( STATUS " SUNBIRD_VERSION=[${SUNBIRD_VERSION}]" ) +MESSAGE ( STATUS " THUNDERBIRD_VERSION_MAIN=[${THUNDERBIRD_VERSION_MAIN}]" ) +MESSAGE ( STATUS " SUNBIRD_VERSION_MAIN=[${SUNBIRD_VERSION_MAIN}]" ) MESSAGE ( STATUS " XPCOM_INCLUDE_DIRS ${XPCOM_INCLUDE_DIRS}" ) MESSAGE ( STATUS " XPCOM_LIBRARY_DIRS ${XPCOM_LIBRARY_DIRS}" ) MESSAGE ( STATUS " XPCOM_LIBRARIES ${XPCOM_LIBRARIES}" ) |
From: <svn...@op...> - 2009-04-01 03:40:47
|
Author: cdfrey Date: Wed Apr 1 05:40:33 2009 New Revision: 5507 URL: http://www.opensync.org/changeset/5507 Log: Removed unneeded cast for osync_marshal_read_buffer() due to API change Modified: format-plugins/xmlformat/trunk/src/xmlformat.c Modified: format-plugins/xmlformat/trunk/src/xmlformat.c ============================================================================== --- format-plugins/xmlformat/trunk/src/xmlformat.c Wed Apr 1 00:15:45 2009 (r5506) +++ format-plugins/xmlformat/trunk/src/xmlformat.c Wed Apr 1 05:40:33 2009 (r5507) @@ -103,7 +103,7 @@ void *buffer = NULL; unsigned int size = 0; OSyncXMLFormat *xmlformat = NULL; - osync_marshal_read_buffer(marshal, &buffer, (int *)&size); + osync_marshal_read_buffer(marshal, &buffer, &size); xmlformat = osync_xmlformat_parse((char *)buffer, size, error); if (!xmlformat) { |
From: <svn...@op...> - 2009-03-31 22:15:53
|
Author: cdfrey Date: Wed Apr 1 00:15:45 2009 New Revision: 5506 URL: http://www.opensync.org/changeset/5506 Log: Fixed spelling typo Modified: trunk/cmake/OpenSyncDefaults.cmake Modified: trunk/cmake/OpenSyncDefaults.cmake ============================================================================== --- trunk/cmake/OpenSyncDefaults.cmake Wed Apr 1 00:13:25 2009 (r5505) +++ trunk/cmake/OpenSyncDefaults.cmake Wed Apr 1 00:15:45 2009 (r5506) @@ -50,7 +50,7 @@ ENDIF ( NOT CMAKE_BUILD_TYPE ) SET( OPENSYNC_TRACE TRUE CACHE BOOL "Debugging/Trace output of OpenSync" ) -SET( OPENSYNC_DEBUG_MODULES FALSE CACHE BOOL "Debugging modules. Avhoid unload of modules." ) +SET( OPENSYNC_DEBUG_MODULES FALSE CACHE BOOL "Debugging modules. Avoid unload of modules." ) SET( OPENSYNC_UNITTESTS FALSE CACHE BOOL "Build OpenSync unit tests." ) SET( OPENSYNC_PYTHONBINDINGS TRUE CACHE BOOL "Build OpenSync with Python bindings." ) |
From: <svn...@op...> - 2009-03-31 22:13:31
|
Author: cdfrey Date: Wed Apr 1 00:13:25 2009 New Revision: 5505 URL: http://www.opensync.org/changeset/5505 Log: Updated python wrapper with API changes... wrapper should now compile - get_conflict_resolution's long long change - anchor / state_db rename - set_functions/set_userdata API change Modified: trunk/wrapper/opensync-group.i trunk/wrapper/opensync-helper.i trunk/wrapper/opensync-plugin.i Modified: trunk/wrapper/opensync-group.i ============================================================================== --- trunk/wrapper/opensync-group.i Wed Apr 1 00:12:31 2009 (r5504) +++ trunk/wrapper/opensync-group.i Wed Apr 1 00:13:25 2009 (r5505) @@ -179,8 +179,8 @@ %apply ConflictResolution *OUTPUT { ConflictResolution *res, int *num }; %apply int *OUTPUT { ConflictResolution *res, int *num }; - void get_conflict_resolution(ConflictResolution *res, int *num) { - osync_group_get_conflict_resolution(self, res, num); + void get_conflict_resolution(ConflictResolution *res, long long int *winner) { + osync_group_get_conflict_resolution(self, res, winner); } bool get_merger_enabled() { Modified: trunk/wrapper/opensync-helper.i ============================================================================== --- trunk/wrapper/opensync-helper.i Wed Apr 1 00:12:31 2009 (r5504) +++ trunk/wrapper/opensync-helper.i Wed Apr 1 00:13:25 2009 (r5505) @@ -1,9 +1,9 @@ %inline %{ - static bool anchor_compare(OSyncAnchor *anchor, const char *new_anchor) { + static bool sink_state_equal(OSyncSinkStateDB *state_db, const char *key, const char *value) { Error *err = NULL; - bool ret; + osync_bool ret; - osync_anchor_compare(anchor, new_anchor, &ret, &err); + osync_sink_state_equal(state_db, key, value, &ret, &err); if (raise_exception_on_error(err)) return FALSE; @@ -11,19 +11,19 @@ return ret; } - static bool anchor_update(OSyncAnchor *anchor, const char *new_anchor) { + static bool sink_state_set(OSyncSinkStateDB *state_db, const char *key, const char *value) { Error *err = NULL; - osync_anchor_update(anchor, new_anchor, &err); + osync_sink_state_set(state_db, key, value, &err); if (raise_exception_on_error(err)) return FALSE; return TRUE; } - static char *anchor_retrieve(OSyncAnchor *anchor) { + static char *sink_state_get(OSyncSinkStateDB *state_db, const char *key) { Error *err = NULL; char *ret; - ret = osync_anchor_retrieve(anchor, &err); + ret = osync_sink_state_get(state_db, key, &err); if (raise_exception_on_error(err)) return NULL; Modified: trunk/wrapper/opensync-plugin.i ============================================================================== --- trunk/wrapper/opensync-plugin.i Wed Apr 1 00:12:31 2009 (r5504) +++ trunk/wrapper/opensync-plugin.i Wed Apr 1 00:13:25 2009 (r5505) @@ -318,10 +318,8 @@ /* set userdata pointer to supplied python wrapper object */ if (callback_obj) { - OSyncObjTypeSinkFunctions functions; Py_INCREF(callback_obj); - memset(&functions, 0, sizeof(functions)); - osync_objtype_sink_set_functions(sink, functions, callback_obj); + osync_objtype_sink_set_userdata(sink, callback_obj); } return sink; @@ -359,8 +357,8 @@ osync_objtype_sink_remove_objformat_sink(self, format_sink); } - OSyncAnchor *get_anchor() { - return osync_objtype_sink_get_anchor(self); + OSyncSinkStateDB *get_state_db() { + return osync_objtype_sink_get_state_db(self); } OSyncHashTable *get_hashtable() { |
From: <svn...@op...> - 2009-03-31 22:12:51
|
Author: cdfrey Date: Wed Apr 1 00:12:31 2009 New Revision: 5504 URL: http://www.opensync.org/changeset/5504 Log: Removed deleted API functions and types from python wrapper Modified: trunk/wrapper/opensync-format.i trunk/wrapper/opensync-group.i trunk/wrapper/opensync-helper.i trunk/wrapper/opensync-plugin.i trunk/wrapper/opensync.i Modified: trunk/wrapper/opensync-format.i ============================================================================== --- trunk/wrapper/opensync-format.i Wed Apr 1 00:11:36 2009 (r5503) +++ trunk/wrapper/opensync-format.i Wed Apr 1 00:12:31 2009 (r5504) @@ -79,17 +79,6 @@ osync_converter_path_add_edge(self, edge); } - int num_edges() { - return osync_converter_path_num_edges(self); - } - - FormatConverter *nth_edge(unsigned int nth) { - FormatConverter *ret = osync_converter_path_nth_edge(self, nth); - if (ret) - osync_converter_ref(ret); - return ret; - } - const char *get_config() { return osync_converter_path_get_config(self); } @@ -105,7 +94,6 @@ __oldinit = __init__ def __init__(self, *args): self.__oldinit(*args) - self.edges = _ListWrapper(self.num_edges, self.nth_edge) %} } @@ -188,17 +176,6 @@ return ret; } - int num_objformats() { - return osync_format_env_num_objformats(self); - } - - ObjFormat *nth_objformat(int nth) { - ObjFormat *ret = osync_format_env_nth_objformat(self, nth); - if (ret) - osync_objformat_ref(ret); - return ret; - } - void register_converter(FormatConverter *converter) { osync_format_env_register_converter(self, converter); } @@ -210,17 +187,6 @@ return ret; } - int num_converters() { - return osync_format_env_num_converters(self); - } - - FormatConverter *nth_converter(int nth) { - FormatConverter *ret = osync_format_env_nth_converter(self, nth); - if (ret) - osync_converter_ref(ret); - return ret; - } - /* void register_filter(CustomFilter *filter) { osync_format_env_register_filter(self, filter); @@ -306,8 +272,6 @@ __oldinit = __init__ def __init__(self, *args): self.__oldinit(*args) - self.objformats = _ListWrapper(self.num_objformats, self.nth_objformat) - self.converters = _ListWrapper(self.num_converters, self.nth_converter) /* self.filters = _ListWrapper(self.num_filters, self.nth_filter) */ Modified: trunk/wrapper/opensync-group.i ============================================================================== --- trunk/wrapper/opensync-group.i Wed Apr 1 00:11:36 2009 (r5503) +++ trunk/wrapper/opensync-group.i Wed Apr 1 00:12:31 2009 (r5504) @@ -38,23 +38,11 @@ osync_group_env_remove_group(self, group); } - int num_groups() { - return osync_group_env_num_groups(self); - } - - Group *nth_group(int nth) { - Group *group = osync_group_env_nth_group(self, nth); - if (group) - osync_group_ref(group); - return group; - } - %pythoncode %{ # extend the SWIG-generated constructor, so that we can setup our list-wrapper classes __oldinit = __init__ def __init__(self, *args): self.__oldinit(*args) - self.groups = _ListWrapper(self.num_groups, self.nth_group) %} } @@ -144,17 +132,6 @@ return member; } - Member *nth_member(int nth) { - Member *member = osync_group_nth_member(self, nth); - if (member) - osync_member_ref(member); - return member; - } - - int num_members() { - return osync_group_num_members(self); - } - const char *get_configdir() { return osync_group_get_configdir(self); } @@ -163,14 +140,6 @@ osync_group_set_configdir(self, directory); } - int num_objtypes() { - return osync_group_num_objtypes(self); - } - - const char *nth_objtype(int nth) { - return osync_group_nth_objtype(self, nth); - } - void set_objtype_enabled(const char *objtype, bool enabled) { osync_group_set_objtype_enabled(self, objtype, enabled); } @@ -241,8 +210,6 @@ __oldinit = __init__ def __init__(self, *args): self.__oldinit(*args) - self.members = _ListWrapper(self.num_members, self.nth_member) - self.objtypes = _ListWrapper(self.num_objtypes, self.nth_objtype) /* self.filters = _ListWrapper(self.num_filters, self.nth_filter) */ @@ -366,14 +333,6 @@ osync_member_add_objtype_sink(self, sink); } - int num_objtypes() { - return osync_member_num_objtypes(self); - } - - const char *nth_objtype(int nth) { - return osync_member_nth_objtype(self, nth); - } - bool objtype_enabled(const char *objtype) { return osync_member_objtype_enabled(self, objtype); } @@ -412,6 +371,5 @@ __oldinit = __init__ def __init__(self, *args): self.__oldinit(*args) - self.objtypes = _ListWrapper(self.num_objtypes, self.nth_objtype) %} } Modified: trunk/wrapper/opensync-helper.i ============================================================================== --- trunk/wrapper/opensync-helper.i Wed Apr 1 00:11:36 2009 (r5503) +++ trunk/wrapper/opensync-helper.i Wed Apr 1 00:12:31 2009 (r5504) @@ -43,10 +43,6 @@ return TRUE; } - static int hashtable_num_entries(OSyncHashTable *hashtable) { - return osync_hashtable_num_entries(hashtable); - } - void hashtable_update_change(OSyncHashTable *hashtable, Change *change) { osync_hashtable_update_change(hashtable, change); } Modified: trunk/wrapper/opensync-plugin.i ============================================================================== --- trunk/wrapper/opensync-plugin.i Wed Apr 1 00:11:36 2009 (r5503) +++ trunk/wrapper/opensync-plugin.i Wed Apr 1 00:12:31 2009 (r5504) @@ -345,14 +345,6 @@ osync_objtype_sink_set_name(self, name); } - unsigned int num_objformats() { - return osync_objtype_sink_num_objformat_sinks(self); - } - - ObjFormatSink *nth_objformat(int nth) { - return osync_objtype_sink_nth_objformat_sink(self, nth); - } - ObjFormatSink *find_objformat(ObjFormat *objformat) { return osync_objtype_sink_find_objformat_sink(self, objformat); } Modified: trunk/wrapper/opensync.i ============================================================================== --- trunk/wrapper/opensync.i Wed Apr 1 00:11:36 2009 (r5503) +++ trunk/wrapper/opensync.i Wed Apr 1 00:12:31 2009 (r5504) @@ -44,7 +44,6 @@ typedef OSyncMember Member; typedef OSyncObjFormat ObjFormat; typedef OSyncObjFormatSink ObjFormatSink; -typedef OSyncObjTypeSinkFunctions ObjTypeSinkFunctions; typedef OSyncObjTypeSink ObjTypeSink; typedef OSyncPluginConfig PluginConfig; typedef OSyncPluginEnv PluginEnv; |
From: <svn...@op...> - 2009-03-31 22:11:41
|
Author: cdfrey Date: Wed Apr 1 00:11:36 2009 New Revision: 5503 URL: http://www.opensync.org/changeset/5503 Log: Cleaned up ambiguous comments surrounding commented out code Modified: trunk/wrapper/opensync-plugin.i Modified: trunk/wrapper/opensync-plugin.i ============================================================================== --- trunk/wrapper/opensync-plugin.i Tue Mar 31 23:03:39 2009 (r5502) +++ trunk/wrapper/opensync-plugin.i Wed Apr 1 00:11:36 2009 (r5503) @@ -381,6 +381,7 @@ void *get_userdata() { return osync_objtype_sink_get_userdata(self); } + */ /* as above, but return it as a PyObject * for python code */ @@ -390,6 +391,7 @@ } */ + /* void get_changes(PluginInfo *info, Context *ctx) { osync_objtype_sink_get_changes(self, info, ctx); } @@ -453,6 +455,7 @@ void set_slowsync(bool slowsync) { osync_objtype_sink_set_slowsync(self, slowsync); } + */ /* returns a list of strings */ /* |
From: <svn...@op...> - 2009-03-31 21:03:51
|
Author: scriptor Date: Tue Mar 31 23:03:39 2009 New Revision: 5502 URL: http://www.opensync.org/changeset/5502 Log: Adding #ifdef CALL_ABORT to parts of the code that detect the issue that the converter functions in the LDAP format plugin sometimes get called for wrong kinds of input formats. This is something that is scheduled for debugging eventually. Note: The memory addresses of all of the converter functions are logged to the trace files. Modified: plugins/ldap-sync/src/ldap_format.c Modified: plugins/ldap-sync/src/ldap_format.c ============================================================================== --- plugins/ldap-sync/src/ldap_format.c Tue Mar 31 23:02:45 2009 (r5501) +++ plugins/ldap-sync/src/ldap_format.c Tue Mar 31 23:03:39 2009 (r5502) @@ -1962,7 +1962,18 @@ if (!strcmp((char *)root_element->name, "contact")) { if (strcmp(stylesheet_file, STYLESHEET_XMLFORMAT_CONTACT2LDAP_EVOLUTIONPERSON) && (strcmp(stylesheet_file, STYLESHEET_XMLFORMAT_CONTACT2LDAP_INETORGPERSON))) { osync_error_set(error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this.\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __FILE__); + +#ifdef CALL_ABORT + osync_trace(TRACE_ERROR, "%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Calling abort().\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __FILE__); + ldap_plugin_printf("%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Calling abort().\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __FILE__); + fprintf(stderr, "%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Calling abort().\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __FILE__); + fflush(stderr); + abort(); + +#else goto error; +#endif + } } @@ -1970,7 +1981,18 @@ if (!strcmp((char *)root_element->name, "event")) { if (strcmp(stylesheet_file, STYLESHEET_XMLFORMAT_EVENT2LDAP_EVENT)) { osync_error_set(error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this.\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); + +#ifdef CALL_ABORT + osync_trace(TRACE_ERROR, "%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Calling abort().\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); + ldap_plugin_printf("%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Calling abort().\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); + fprintf("%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Calling abort().\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); + fflush(stderr); + abort(); + +#else goto error; +#endif + } } @@ -1978,7 +2000,18 @@ if (!strcmp((char *)root_element->name, "todo")) { if (strcmp(stylesheet_file, STYLESHEET_XMLFORMAT_TODO2LDAP_TODO)) { osync_error_set(error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this.\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); + +#ifdef CALL_ABORT + osync_trace(TRACE_ERROR, "%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Calling abort().\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); + ldap_plugin_printf("%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Calling abort().\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); + fprintf(stderr, "%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Calling abort().\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); + fflush(stderr); + abort(); + +#else goto error; +#endif + } } @@ -1986,14 +2019,35 @@ if (!strcmp((char *)root_element->name, "note")) { if (strcmp(stylesheet_file, STYLESHEET_XMLFORMAT_NOTE2LDAP_NOTE)) { osync_error_set(error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this.\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); + +#ifdef CALL_ABORT + osync_trace(TRACE_ERROR, "%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Calling abort().\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); + ldap_plugin_printf("%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Calling abort().\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); + fprintf(stderr, "%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Calling abort().\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); + fflush(stderr); + abort(); + +#else goto error; +#endif + } } if (!strcmp((char *)root_element->name, FORMAT_LDAP_EVOLUTIONPERSON)) { if (strcmp(stylesheet_file, STYLESHEET_LDAP_EVOLUTIONPERSON2XMLFORMAT_CONTACT)) { osync_error_set(error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this.\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); + +#ifdef CALL_ABORT + osync_trace(TRACE_ERROR, "%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Calling abort().\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); + ldap_plugin_printf("%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Calling abort().\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); + fprintf(stderr, "%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Calling abort().\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); + fflush(stderr); + abort(); +#else + goto error; +#endif } } @@ -2001,7 +2055,17 @@ if (!strcmp((char *)root_element->name, FORMAT_LDAP_INETORGPERSON)) { if (strcmp(stylesheet_file, STYLESHEET_LDAP_INETORGPERSON2XMLFORMAT_CONTACT)) { osync_error_set(error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this.\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); + +#ifdef CALL_ABORT + osync_trace(TRACE_ERROR, "%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Calling abort().\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); + ldap_plugin_printf("%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Calling abort().\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); + fprintf(stderr, "%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Calling abort().\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); + fflush(stderr); + abort(); + +#else goto error; +#endif } } @@ -2009,7 +2073,16 @@ if (!strcmp((char *)root_element->name, FORMAT_LDAP_EVENT)) { if (strcmp(stylesheet_file, STYLESHEET_LDAP_EVENT2XMLFORMAT_EVENT)) { osync_error_set(error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this.\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); + +#ifdef CALL_ABORT + osync_trace(TRACE_ERROR, "%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this.\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); + ldap_plugin_printf("%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Calling abort().\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); + fprintf(stderr, "%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Calling abort().\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__ ); + fflush(stderr); + abort(); +#else goto error; +#endif } } @@ -2017,7 +2090,18 @@ if (!strcmp((char *)root_element->name, FORMAT_LDAP_TODO)) { if (strcmp(stylesheet_file, STYLESHEET_LDAP_TODO2XMLFORMAT_TODO)) { osync_error_set(error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this.\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); + +#ifdef CALL_ABORT + osync_trace(TRACE_ERROR, "%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Calling abort().\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); + ldap_plugin_printf("%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Calling abort().\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); + fprintf(stderr, "%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Calling abort().\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); + fflush(stderr); + abort(); + +#else goto error; +#endif + } } @@ -2025,7 +2109,18 @@ if (!strcmp((char *)root_element->name, FORMAT_LDAP_NOTE)) { if (strcmp(stylesheet_file, STYLESHEET_LDAP_NOTE2XMLFORMAT_NOTE)) { osync_error_set(error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this.\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); + +#ifdef CALL_ABORT + osync_trace(TRACE_ERROR, "%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Where does that come from? Calling abort().\n\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); + ldap_plugin_printf( "%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Where does that come from? Calling abort().\n\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); + fprintf("%s:%i: ERROR: For this root_element \"%s\" is \"%s\" the wrong style sheet file. %s() is not prepared to convert this. Where does that come from? Calling abort().\n\n", __FILE__, __LINE__, root_element->name, stylesheet_file, __func__); + fflush(stderr); + abort(); + +#else goto error; +#endif + } } |
From: <svn...@op...> - 2009-03-31 21:02:50
|
Author: scriptor Date: Tue Mar 31 23:02:45 2009 New Revision: 5501 URL: http://www.opensync.org/changeset/5501 Log: One more tiny change in the course of migrating from the "anchor system" to the "state database". Modified: plugins/ldap-sync/src/ldap_connect.c plugins/ldap-sync/src/ldap_plugin.h Modified: plugins/ldap-sync/src/ldap_connect.c ============================================================================== --- plugins/ldap-sync/src/ldap_connect.c Tue Mar 31 20:34:51 2009 (r5500) +++ plugins/ldap-sync/src/ldap_connect.c Tue Mar 31 23:02:45 2009 (r5501) @@ -433,7 +433,7 @@ // Anchor system - ldap_plugin_check_anchor_system(ctx, sinkenv, &error); + ldap_plugin_check_state_system(ctx, sinkenv, &error); Modified: plugins/ldap-sync/src/ldap_plugin.h ============================================================================== --- plugins/ldap-sync/src/ldap_plugin.h Tue Mar 31 20:34:51 2009 (r5500) +++ plugins/ldap-sync/src/ldap_plugin.h Tue Mar 31 23:02:45 2009 (r5501) @@ -71,7 +71,13 @@ #include "config.h" - +/** + * @headerfile "/usr/local/include/valgrind/valgrind.h" + * @headerfile "/usr/local/include/valgrind/memcheck.h" + * @brief This header file must be included if you want to make + * use of certain VALGRIND macros to check addressability + * and definedness of a variable. + */ #if 0 #include "/usr/local/include/valgrind/valgrind.h" #include "/usr/local/include/valgrind/memcheck.h" @@ -79,10 +85,24 @@ -#define OPENSYNC_DEBUG_MODULES 1 -// define DISABLE_SET_SLOWSYNC 1 -// define NO_OUTPUT_TO_SCREEN 1 -// define CALL_ABORT 1 +#define OPENSYNC_DEBUG_MODULES 1 ///< Defining ghis prevents libopensync from + ///< calling free() and dlclose() so that the + ///< function names of this plugin keep being + ///< visible in backtraces when running + ///< valgrind ... --leak-check=full +#undef DISABLE_SET_SLOWSYNC 1 ///< Defining this disables all of the code + ///< that deals with setting slowsync based + ///< on any anchor or database setting. +#undef NO_OUTPUT_TO_SCREEN 1 ///< Calls to ldap_plugin_printf() print a + ///< message by default BOTH to the trace files + ///< AND to the screen. However, defining this + ///< makes this function abstain from printing + ///< anything to the screen. +#undef CALL_ABORT 1 ///< Defining this lets certain code call "abort()" rather + ///< than "goto error". The code fragments that make + ///< use of this define are known to detect error + ///< conditions in libopensync. So they are almost + ///< scheduled for debugging. #define DEBUG_auth 1 #define DEBUG_configuration 1 @@ -146,9 +166,12 @@ #define STYLESHEET_XMLFORMAT_TODO2LDAP_TODO "xmlformat_todo2ldap_todo.xsl" #define STYLESHEET_XMLFORMAT_NOTE2LDAP_NOTE "xmlformat_note2ldap_note.xsl" -#define USER_ATTRIBUTES 1 -#define OPERATIONAL_ATTRIBUTES 2 -#define OBJECTCLASSES 3 +#define USER_ATTRIBUTES 1 ///< This refers to ldap_plugin_call_ldap_search() + ///< and LDAP_ALL_USER_ATTRIBUTE in ldap.h +#define OPERATIONAL_ATTRIBUTES 2 ///< This refers to ldap_plugin_call_ldap_search() + ///< and LDAP_ALL_OPERATIONAL_ATTRIBUTES in ldap.h +#define OBJECTCLASSES 3 ///< This refers to ldap_plugin_call_ldap_search() + @@ -426,7 +449,7 @@ int dont_free(void); osync_bool get_sync_info(OSyncPluginEnv *env, OSyncError **error); int get_version(void); -osync_bool ldap_plugin_check_anchor_system(OSyncContext *ctx, sink_environment *sinkenv, OSyncError **error); +osync_bool ldap_plugin_check_state_system(OSyncContext *ctx, sink_environment *sinkenv, OSyncError **error); osync_bool ldap_plugin_check_hash_calculation(OSyncContext *ctx, sink_environment *sinkenv, const char *debug_id, const char *hash, OSyncError **error); osync_bool ldap_plugin_commit_addition(OSyncContext *ctx, sink_environment *sinkenv, OSyncChange *change, GList *ldap_entries, int *result, OSyncError **error); void ldap_plugin_commit_change(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, OSyncChange *change, void *userdata); |
From: <svn...@op...> - 2009-03-31 18:34:54
|
Author: scriptor Date: Tue Mar 31 20:34:51 2009 New Revision: 5500 URL: http://www.opensync.org/changeset/5500 Log: Removed the pdf and html files to make it easier for the svn server. Deleted: plugins/ldap-sync/README.html.LyXconv/ |
From: <svn...@op...> - 2009-03-31 18:30:52
|
Author: scriptor Date: Tue Mar 31 20:30:48 2009 New Revision: 5499 URL: http://www.opensync.org/changeset/5499 Log: Removed the pdf and html files to make it easier for the svn server. Deleted: plugins/ldap-sync/README.txt |
From: <svn...@op...> - 2009-03-31 18:30:20
|
Author: scriptor Date: Tue Mar 31 20:30:16 2009 New Revision: 5498 URL: http://www.opensync.org/changeset/5498 Log: Removed the pdf and html files to make it easier for the svn server. Deleted: plugins/ldap-sync/README.pdf |
From: <svn...@op...> - 2009-03-31 18:30:07
|
Author: scriptor Date: Tue Mar 31 20:30:03 2009 New Revision: 5497 URL: http://www.opensync.org/changeset/5497 Log: The LDAP format plugin gets sometimes called with an empty input (inpsize = 0). Prepared for debugging this: abort() is now called in this situation. This bug seems to occur with objtype event and todo, only. Modified: plugins/ldap-sync/src/ldap_format.c Modified: plugins/ldap-sync/src/ldap_format.c ============================================================================== --- plugins/ldap-sync/src/ldap_format.c Tue Mar 31 20:28:54 2009 (r5496) +++ plugins/ldap-sync/src/ldap_format.c Tue Mar 31 20:30:03 2009 (r5497) @@ -4605,13 +4605,18 @@ // We do not really know, what input exactly is. So any cast is dangerous. // It SHOULD be a glist_container. Well, who knows... if (inpsize < sizeof(glist_container)) { - osync_error_set(error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: inpsize = %i\n", __FILE__, __LINE__, inpsize); - goto error; + osync_error_set(error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: inpsize = %i. Calling abort()\n", __FILE__, __LINE__, inpsize); + osync_trace(TRACE_ERROR, "%s:%i: ERROR: inpsize = %i. Calling abort()\n", __FILE__, __LINE__, inpsize); + ldap_plugin_printf("%s:%i: ERROR: inpsize = %i. Calling abort()\n", __FILE__, __LINE__, inpsize); + + abort(); + +// goto error; } if (inpsize != sizeof(glist_container)) { - osync_error_set(error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: input is NOT a glist_container.\n", __FILE__, __LINE__); + // osync_error_set(error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: input is NOT a glist_container.\n", __FILE__, __LINE__); osync_trace(TRACE_ERROR, "%s:%i: What is input? inpsize = %i", __FILE__, __LINE__, inpsize); @@ -4623,6 +4628,49 @@ osync_trace(TRACE_ERROR, "%s:%i: input looks like an ldap_entry.", __FILE__, __LINE__); } else if (inpsize == osync_xmlformat_size()) { osync_trace(TRACE_ERROR, "%s:%i: input looks like an OsyncXMLFormat.\n", __FILE__, __LINE__); + + +#ifdef CALL_ABORT + osync_error_set(error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: input is NOT a glist_container. Looks like an OSyncXMLFormat.\n", __FILE__, __LINE__); + osync_trace(TRACE_ERROR, "%s:%i: Where does that come from? Calling abort().", __FILE__, __LINE__); + ldap_plugin_printf("%s:%i: Where does that come from? Calling abort().", __FILE__, __LINE__); + fprintf(stderr, "%s:%i: Where does that come from? Calling abort().\n\n", __FILE__, __LINE__); + fflush(stderr); + abort(); + +#else + osync_assert(input); + osync_trace(TRACE_INTERNAL, "%s:%i: We can handle this. If you prefer getting a core dump, define CALL_ABORT in ldap_plugin.h and recompile the LDAP format plugin.", __FILE__, __LINE__); + + + + if (!osync_xmlformat_assemble((OSyncXMLFormat *)input, (char **) &xmlbuff, (unsigned int *)&size)) { + osync_error_set(error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: input is NOT a glist_container. Looks like an OSyncXMLFormat.\n", __FILE__, __LINE__); + osync_trace(TRACE_ERROR, "%s:%i: ERROR: osync_xmlformat_assemble() has failed for an unknown reason. Giving up.\n", __FILE__, __LINE__); + goto error; + } + + if (xmlbuff == NULL) { + osync_error_set(error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: input is NOT a glist_container. Looks like an OSyncXMLFormat.\n", __FILE__, __LINE__); + osync_trace(TRACE_ERROR, "%s:%i: ERROR: xmlbuff = NULL. osync_xmlformat_assemble() must have failed for an unknown reason. Giving up.\n", __FILE__, __LINE__); + + goto error; + } + + if (size < 6) { + osync_error_set(error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: input is NOT a glist_container. Looks like an OSyncXMLFormat.\n", __FILE__, __LINE__); + osync_trace(TRACE_ERROR, "%s:%i: ERROR: size = %i. osync_xmlformat_assemble() must have failed for an unknown reason. Giving up.\n", __FILE__, __LINE__, size); + + goto error; + } + + + osync_trace(TRACE_INTERNAL, "%s:%i: This is the content of the OSyncXMLFormat:\n\"%.*s\"", __FILE__, __LINE__, size, xmlbuff); + + goto applying_stylesheet; +#endif + + } else { osync_trace(TRACE_ERROR, "%s:%i: Don't know. inpsize = %u\n", __FILE__, __LINE__, inpsize); } @@ -4667,6 +4715,8 @@ } +applying_stylesheet: + // Apply stylesheet if (!ldap_format_do_apply_stylesheet((char *)xmlbuff, size, output, outpsize, config, userdata, stylesheet_name, error)) { osync_trace(TRACE_ERROR, "%s:%i: ldap_format_do_apply_stylesheet() has failed.\n", __FILE__, __LINE__); @@ -5423,7 +5473,6 @@ #endif - if (!ldap_format_do_conv_ldap_to_xmlformat(input, inpsize, output, outpsize, free_input, FORMAT_LDAP_NOTE, FORMAT_XMLFORMAT_NOTE, STYLESHEET_LDAP_NOTE2XMLFORMAT_NOTE, OBJECTTYPE_NOTE, config, userdata, error)) { osync_trace(TRACE_ERROR, "%s:%i: ERROR: ldap_format_do_conv_ldap_to_xmlformat() has failed.\n", __FILE__, __LINE__); |
From: <svn...@op...> - 2009-03-31 18:28:58
|
Author: scriptor Date: Tue Mar 31 20:28:54 2009 New Revision: 5496 URL: http://www.opensync.org/changeset/5496 Log: Fixing a "Naming violation" error with LDAP: value of naming attribute 'documentIdentifier' is not present in entry: Replaced "_host" by "@host" etc. Modified: plugins/ldap-sync/tests/note1.xml plugins/ldap-sync/tests/test.conf Modified: plugins/ldap-sync/tests/note1.xml ============================================================================== --- plugins/ldap-sync/tests/note1.xml Tue Mar 31 20:28:44 2009 (r5495) +++ plugins/ldap-sync/tests/note1.xml Tue Mar 31 20:28:54 2009 (r5496) @@ -34,6 +34,6 @@ <Content>First memo.</Content> </Summary> <Uid> - <Content>200...@jl...</Content> + <Content>200...@ho...</Content> </Uid> -</note> \ No newline at end of file +</note> Modified: plugins/ldap-sync/tests/test.conf ============================================================================== --- plugins/ldap-sync/tests/test.conf Tue Mar 31 20:28:44 2009 (r5495) +++ plugins/ldap-sync/tests/test.conf Tue Mar 31 20:28:54 2009 (r5496) @@ -26,10 +26,10 @@ CONTACT1_FILE='/tmp/file_contact/pas-id-49C8DD6D00000035' CONTACT2_FILE='/tmp/file_contact/pas-id-49C6A95E00000026' -EVENT1_FILE='/tmp/file_event/20090320T204925Z-32394-500-1-247_host.example.com' -TODO1_FILE='/tmp/file_todo/20090325T135501Z-32394-500-1-302_host.example.com' -NOTE1_FILE='/tmp/file_note/20090228T003924Z-14681-500-1-43_host.example.com' -NOTE2_FILE='/tmp/file_note/20090103T144254Z-31888-500-1-0_host.example.com' +EVENT1_FILE='/tmp/file_event/200...@ho...' +TODO1_FILE='/tmp/file_todo/200...@ho...' +NOTE1_FILE='/tmp/file_note/200...@ho...' +NOTE2_FILE='/tmp/file_note/200...@ho...' ########## Without leak checking: VALGRIND="valgrind --db-attach=no --num-callers=30 --gen-suppressions=all --leak-check=no --show-reachable=yes --error-exitcode=1 --track-origins=yes" |
From: <svn...@op...> - 2009-03-31 18:28:48
|
Author: scriptor Date: Tue Mar 31 20:28:44 2009 New Revision: 5495 URL: http://www.opensync.org/changeset/5495 Log: Added mkdir -p... for the trace files. Adding/Removing tests. Modified: plugins/ldap-sync/tests/CMakeLists.txt plugins/ldap-sync/tests/check_add_modify_delete_and_sync plugins/ldap-sync/tests/check_add_modify_delete_four_ldifs_and_sync plugins/ldap-sync/tests/check_add_modify_delete_four_ldifs_and_valgrind_and_sync plugins/ldap-sync/tests/check_connect plugins/ldap-sync/tests/check_fastsync plugins/ldap-sync/tests/check_init plugins/ldap-sync/tests/check_modify_and_fastsync plugins/ldap-sync/tests/check_osyncplugin1 plugins/ldap-sync/tests/check_osynctool1 plugins/ldap-sync/tests/check_osynctool2 plugins/ldap-sync/tests/check_osynctool_add_file_and_sync plugins/ldap-sync/tests/check_osynctool_add_file_and_valgrind_and_sync plugins/ldap-sync/tests/check_osynctool_add_ldif_and_sync plugins/ldap-sync/tests/check_osynctool_add_ldif_and_valgrind_and_sync plugins/ldap-sync/tests/check_osynctool_common.inc plugins/ldap-sync/tests/check_osynctool_file1 plugins/ldap-sync/tests/check_slowsync plugins/ldap-sync/tests/check_sync Modified: plugins/ldap-sync/tests/CMakeLists.txt ============================================================================== --- plugins/ldap-sync/tests/CMakeLists.txt Tue Mar 31 20:28:14 2009 (r5494) +++ plugins/ldap-sync/tests/CMakeLists.txt Tue Mar 31 20:28:44 2009 (r5495) @@ -416,7 +416,7 @@ ############################ -# Now osyncplugin with valgrind... +# Now osyncplugin under valgrind... IF (LDAPADD_EXECUTABLE) IF (LDAPMODIFY_EXECUTABLE) IF (LDAPDELETE_EXECUTABLE) @@ -457,20 +457,20 @@ ADD_TEST( osynctool_add_event_ldif ${TESTDIR}/check_osynctool_add_ldif_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "event" "${TESTDIR}/event1.ldif" ) - #ADD_TEST( osynctool_add_todo_ldif ${TESTDIR}/check_osynctool_add_ldif_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "todo" "${TESTDIR}/todo1.ldif" ) + ADD_TEST( osynctool_add_todo_ldif ${TESTDIR}/check_osynctool_add_ldif_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "todo" "${TESTDIR}/todo1.ldif" ) ADD_TEST( osynctool_add_note_ldif ${TESTDIR}/check_osynctool_add_ldif_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "note" "${TESTDIR}/note1.ldif" ) ADD_TEST( osynctool_add_contact1_xmlfile ${TESTDIR}/check_osynctool_add_file_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "contact" "${TESTDIR}/contact1.xml" ) - #ADD_TEST( osynctool_add_contact2_xmlfile ${TESTDIR}/check_osynctool_add_file_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "contact" "${TESTDIR}/contact2.xml" ) + ADD_TEST( osynctool_add_contact2_xmlfile ${TESTDIR}/check_osynctool_add_file_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "contact" "${TESTDIR}/contact2.xml" ) - #ADD_TEST( osynctool_add_event_xmlfile ${TESTDIR}/check_osynctool_add_file_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "event" "${TESTDIR}/event1.xml" ) + ADD_TEST( osynctool_add_event_xmlfile ${TESTDIR}/check_osynctool_add_file_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "event" "${TESTDIR}/event1.xml" ) - #ADD_TEST( osynctool_add_todo_xmlfile ${TESTDIR}/check_osynctool_add_file_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "todo" "${TESTDIR}/todo1.xml" ) + ADD_TEST( osynctool_add_todo_xmlfile ${TESTDIR}/check_osynctool_add_file_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "todo" "${TESTDIR}/todo1.xml" ) - #ADD_TEST( osynctool_add_note_xmlfile ${TESTDIR}/check_osynctool_add_file_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "note" "${TESTDIR}/note1.xml" ) + ADD_TEST( osynctool_add_note_xmlfile ${TESTDIR}/check_osynctool_add_file_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "note" "${TESTDIR}/note1.xml" ) ENDIF (LDAPDELETE_EXECUTABLE) @@ -481,12 +481,14 @@ ############################ -# Now osynctool with valgrind... +# Now osynctool under valgrind... IF (LDAPADD_EXECUTABLE) IF (LDAPMODIFY_EXECUTABLE) IF (LDAPDELETE_EXECUTABLE) IF (VALGRIND_EXECUTABLE) + + #ADD_TEST( valgrind_osynctool_add_contact1_ldif ${TESTDIR}/check_osynctool_add_ldif_and_valgrind_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "contact" "${TESTDIR}/contact1.ldif" ) #ADD_TEST( valgrind_osynctool_add_contact2_ldif ${TESTDIR}/check_osynctool_add_ldif_and_valgrind_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "contact" "${TESTDIR}/contact2.ldif" ) @@ -498,6 +500,7 @@ #ADD_TEST( valgrind_osynctool_add_note_ldif ${TESTDIR}/check_osynctool_add_ldif_and_valgrind_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "note" "${TESTDIR}/note1.ldif" ) + #ADD_TEST( valgrind_osynctool_add_contact1_xmlfile ${TESTDIR}/check_osynctool_add_file_and_valgrind_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "contact" "${TESTDIR}/contact1.xml" ) #ADD_TEST( valgrind_osynctool_add_contact2_xmlfile ${TESTDIR}/check_osynctool_add_file_and_valgrind_and_sync ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} "contact" "${TESTDIR}/contact2.xml" ) @@ -510,7 +513,6 @@ - ENDIF (VALGRIND_EXECUTABLE) ENDIF (LDAPDELETE_EXECUTABLE) ENDIF (LDAPMODIFY_EXECUTABLE) Modified: plugins/ldap-sync/tests/check_add_modify_delete_and_sync ============================================================================== --- plugins/ldap-sync/tests/check_add_modify_delete_and_sync Tue Mar 31 20:28:14 2009 (r5494) +++ plugins/ldap-sync/tests/check_add_modify_delete_and_sync Tue Mar 31 20:28:44 2009 (r5495) @@ -116,6 +116,9 @@ if test -n "$TRACE_FILES"; then echo "$FILE:$LINENO: Enabling OSYNC_TRACE." + if test ! -d "$TRACE_FILES"; then + mkdir -p "$TRACE_FILES" + fi export OSYNC_TRACE="$TRACE_FILES" fi Modified: plugins/ldap-sync/tests/check_add_modify_delete_four_ldifs_and_sync ============================================================================== --- plugins/ldap-sync/tests/check_add_modify_delete_four_ldifs_and_sync Tue Mar 31 20:28:14 2009 (r5494) +++ plugins/ldap-sync/tests/check_add_modify_delete_four_ldifs_and_sync Tue Mar 31 20:28:44 2009 (r5495) @@ -62,6 +62,9 @@ if test -n "$TRACE_FILES"; then echo "$FILE:$LINENO: Enabling OSYNC_TRACE." + if test ! -d "$TRACE_FILES"; then + mkdir -p "$TRACE_FILES" + fi export OSYNC_TRACE="$TRACE_FILES" fi Modified: plugins/ldap-sync/tests/check_add_modify_delete_four_ldifs_and_valgrind_and_sync ============================================================================== --- plugins/ldap-sync/tests/check_add_modify_delete_four_ldifs_and_valgrind_and_sync Tue Mar 31 20:28:14 2009 (r5494) +++ plugins/ldap-sync/tests/check_add_modify_delete_four_ldifs_and_valgrind_and_sync Tue Mar 31 20:28:44 2009 (r5495) @@ -72,6 +72,9 @@ if test -n "$TRACE_FILES"; then echo "$FILE:$LINENO: Enabling OSYNC_TRACE." + if test ! -d "$TRACE_FILES"; then + mkdir -p "$TRACE_FILES" + fi export OSYNC_TRACE="$TRACE_FILES" fi Modified: plugins/ldap-sync/tests/check_connect ============================================================================== --- plugins/ldap-sync/tests/check_connect Tue Mar 31 20:28:14 2009 (r5494) +++ plugins/ldap-sync/tests/check_connect Tue Mar 31 20:28:44 2009 (r5495) @@ -56,6 +56,9 @@ if test -n "$TRACE_FILES"; then echo "$FILE:$LINENO: Enabling OSYNC_TRACE." + if test ! -d "$TRACE_FILES"; then + mkdir -p "$TRACE_FILES" + fi export OSYNC_TRACE="$TRACE_FILES" fi Modified: plugins/ldap-sync/tests/check_fastsync ============================================================================== --- plugins/ldap-sync/tests/check_fastsync Tue Mar 31 20:28:14 2009 (r5494) +++ plugins/ldap-sync/tests/check_fastsync Tue Mar 31 20:28:44 2009 (r5495) @@ -55,6 +55,9 @@ if test -n "$TRACE_FILES"; then echo "$FILE:$LINENO: Enabling OSYNC_TRACE." + if test ! -d "$TRACE_FILES"; then + mkdir -p "$TRACE_FILES" + fi export OSYNC_TRACE="$TRACE_FILES" fi Modified: plugins/ldap-sync/tests/check_init ============================================================================== --- plugins/ldap-sync/tests/check_init Tue Mar 31 20:28:14 2009 (r5494) +++ plugins/ldap-sync/tests/check_init Tue Mar 31 20:28:44 2009 (r5495) @@ -59,6 +59,9 @@ if test -n "$TRACE_FILES"; then echo "$FILE:$LINENO: Enabling OSYNC_TRACE." + if test ! -d "$TRACE_FILES"; then + mkdir -p "$TRACE_FILES" + fi export OSYNC_TRACE="$TRACE_FILES" fi Modified: plugins/ldap-sync/tests/check_modify_and_fastsync ============================================================================== --- plugins/ldap-sync/tests/check_modify_and_fastsync Tue Mar 31 20:28:14 2009 (r5494) +++ plugins/ldap-sync/tests/check_modify_and_fastsync Tue Mar 31 20:28:44 2009 (r5495) @@ -52,6 +52,9 @@ if test -n "$TRACE_FILES"; then echo "$FILE:$LINENO: Enabling OSYNC_TRACE." + if test ! -d "$TRACE_FILES"; then + mkdir -p "$TRACE_FILES" + fi export OSYNC_TRACE="$TRACE_FILES" fi Modified: plugins/ldap-sync/tests/check_osyncplugin1 ============================================================================== --- plugins/ldap-sync/tests/check_osyncplugin1 Tue Mar 31 20:28:14 2009 (r5494) +++ plugins/ldap-sync/tests/check_osyncplugin1 Tue Mar 31 20:28:44 2009 (r5495) @@ -31,6 +31,9 @@ if test -n "$TRACE_FILES"; then echo "$FILE:$LINENO: Enabling OSYNC_TRACE." + if test ! -d "$TRACE_FILES"; then + mkdir -p "$TRACE_FILES" + fi export OSYNC_TRACE="$TRACE_FILES" fi Modified: plugins/ldap-sync/tests/check_osynctool1 ============================================================================== --- plugins/ldap-sync/tests/check_osynctool1 Tue Mar 31 20:28:14 2009 (r5494) +++ plugins/ldap-sync/tests/check_osynctool1 Tue Mar 31 20:28:44 2009 (r5495) @@ -14,6 +14,29 @@ fi +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 + + + +if test -n "$TRACE_FILES"; then + echo "$FILE:$LINENO: Enabling OSYNC_TRACE." + if test ! -d "$TRACE_FILES"; then + mkdir -p "$TRACE_FILES" + fi + export OSYNC_TRACE="$TRACE_FILES" +fi + + + $OSYNCTOOL --listplugins | grep -q "ldap-sync" rv=$? if test $rv -ne 0; then Modified: plugins/ldap-sync/tests/check_osynctool2 ============================================================================== --- plugins/ldap-sync/tests/check_osynctool2 Tue Mar 31 20:28:14 2009 (r5494) +++ plugins/ldap-sync/tests/check_osynctool2 Tue Mar 31 20:28:44 2009 (r5495) @@ -14,6 +14,31 @@ fi + +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 + + + +if test -n "$TRACE_FILES"; then + echo "$FILE:$LINENO: Enabling OSYNC_TRACE." + if test ! -d "$TRACE_FILES"; then + mkdir -p "$TRACE_FILES" + fi + export OSYNC_TRACE="$TRACE_FILES" +fi + + + + $OSYNCTOOL --listformats | grep -q "ldap-evolutionperson" rv=$? if test $rv -ne 0; then Modified: plugins/ldap-sync/tests/check_osynctool_add_file_and_sync ============================================================================== --- plugins/ldap-sync/tests/check_osynctool_add_file_and_sync Tue Mar 31 20:28:14 2009 (r5494) +++ plugins/ldap-sync/tests/check_osynctool_add_file_and_sync Tue Mar 31 20:28:44 2009 (r5495) @@ -48,6 +48,9 @@ if test -n "$TRACE_FILES"; then echo "$FILE:$LINENO: Enabling OSYNC_TRACE." + if test ! -d "$TRACE_FILES"; then + mkdir -p "$TRACE_FILES" + fi export OSYNC_TRACE="$TRACE_FILES" fi Modified: plugins/ldap-sync/tests/check_osynctool_add_file_and_valgrind_and_sync ============================================================================== --- plugins/ldap-sync/tests/check_osynctool_add_file_and_valgrind_and_sync Tue Mar 31 20:28:14 2009 (r5494) +++ plugins/ldap-sync/tests/check_osynctool_add_file_and_valgrind_and_sync Tue Mar 31 20:28:44 2009 (r5495) @@ -48,6 +48,9 @@ if test -n "$TRACE_FILES"; then echo "$FILE:$LINENO: Enabling OSYNC_TRACE." + if test ! -d "$TRACE_FILES"; then + mkdir -p "$TRACE_FILES" + fi export OSYNC_TRACE="$TRACE_FILES" fi Modified: plugins/ldap-sync/tests/check_osynctool_add_ldif_and_sync ============================================================================== --- plugins/ldap-sync/tests/check_osynctool_add_ldif_and_sync Tue Mar 31 20:28:14 2009 (r5494) +++ plugins/ldap-sync/tests/check_osynctool_add_ldif_and_sync Tue Mar 31 20:28:44 2009 (r5495) @@ -48,6 +48,9 @@ if test -n "$TRACE_FILES"; then echo "$FILE:$LINENO: Enabling OSYNC_TRACE." + if test ! -d "$TRACE_FILES"; then + mkdir -p "$TRACE_FILES" + fi export OSYNC_TRACE="$TRACE_FILES" fi Modified: plugins/ldap-sync/tests/check_osynctool_add_ldif_and_valgrind_and_sync ============================================================================== --- plugins/ldap-sync/tests/check_osynctool_add_ldif_and_valgrind_and_sync Tue Mar 31 20:28:14 2009 (r5494) +++ plugins/ldap-sync/tests/check_osynctool_add_ldif_and_valgrind_and_sync Tue Mar 31 20:28:44 2009 (r5495) @@ -48,6 +48,9 @@ if test -n "$TRACE_FILES"; then echo "$FILE:$LINENO: Enabling OSYNC_TRACE." + if test ! -d "$TRACE_FILES"; then + mkdir -p "$TRACE_FILES" + fi export OSYNC_TRACE="$TRACE_FILES" fi Modified: plugins/ldap-sync/tests/check_osynctool_common.inc ============================================================================== --- plugins/ldap-sync/tests/check_osynctool_common.inc Tue Mar 31 20:28:14 2009 (r5494) +++ plugins/ldap-sync/tests/check_osynctool_common.inc Tue Mar 31 20:28:44 2009 (r5495) @@ -648,9 +648,9 @@ if test "$objtype" == "contact"; then remove_contact_files elif test "$objtype" == "event"; then - remove_event_file + remove_event1_file elif test "$objtype" == "todo"; then - remove_todo_file + remove_todo1_file elif test "$objtype" == "note"; then remove_note_files fi @@ -663,6 +663,8 @@ remove_files() { remove_contact_files + remove_event1_file + remove_todo1_file remove_note_files } @@ -705,9 +707,9 @@ # if test "$objtype" == "contact"; then # remove_contact_files # elif test "$objtype" == "event"; then -# remove_event_file +# remove_event1_file # elif test "$objtype" == "todo"; then -# remove_todo_file +# remove_todo1_file # elif test "$objtype" == "note"; then # remove_note_files # fi Modified: plugins/ldap-sync/tests/check_osynctool_file1 ============================================================================== --- plugins/ldap-sync/tests/check_osynctool_file1 Tue Mar 31 20:28:14 2009 (r5494) +++ plugins/ldap-sync/tests/check_osynctool_file1 Tue Mar 31 20:28:44 2009 (r5495) @@ -22,6 +22,9 @@ if test -n "$TRACE_FILES"; then echo "$FILE:$LINENO: Enabling OSYNC_TRACE." + if test ! -d "$TRACE_FILES"; then + mkdir -p "$TRACE_FILES" + fi export OSYNC_TRACE="$TRACE_FILES" fi Modified: plugins/ldap-sync/tests/check_slowsync ============================================================================== --- plugins/ldap-sync/tests/check_slowsync Tue Mar 31 20:28:14 2009 (r5494) +++ plugins/ldap-sync/tests/check_slowsync Tue Mar 31 20:28:44 2009 (r5495) @@ -58,6 +58,9 @@ if test -n "$TRACE_FILES"; then echo "$FILE:$LINENO: Enabling OSYNC_TRACE." + if test ! -d "$TRACE_FILES"; then + mkdir -p "$TRACE_FILES" + fi export OSYNC_TRACE="$TRACE_FILES" fi Modified: plugins/ldap-sync/tests/check_sync ============================================================================== --- plugins/ldap-sync/tests/check_sync Tue Mar 31 20:28:14 2009 (r5494) +++ plugins/ldap-sync/tests/check_sync Tue Mar 31 20:28:44 2009 (r5495) @@ -59,6 +59,9 @@ if test -n "$TRACE_FILES"; then echo "$FILE:$LINENO: Enabling OSYNC_TRACE." + if test ! -d "$TRACE_FILES"; then + mkdir -p "$TRACE_FILES" + fi export OSYNC_TRACE="$TRACE_FILES" fi |
From: <svn...@op...> - 2009-03-31 18:28:18
|
Author: scriptor Date: Tue Mar 31 20:28:14 2009 New Revision: 5494 URL: http://www.opensync.org/changeset/5494 Log: 1. Added/extended a workaround for buggy peers, that send an identifier which differs from what has been stored as value for the key attribute. The LDAP server does not accept such a discrepancy. 2. Extending error messages for a potential issue with either the one mentioned under 1. or with a new, possibly unrelated bug. 3. Preparation for debugging another bug: The format plugin gets sometimes called with an empty input (inpsize = 0). Here in ldap_plugin.c the size of the data is dumped to the trace files, that is to be delivered to osync_data_new(), whenever this function is about to be called, to prove which size of input is sent out by the LDAP plugin. The bug seems to be limited to objtypes event and todo. Probably an issue with the xmlformat plugin. Cf. test "osynctool_add_todo_xmlfile". Modified: plugins/ldap-sync/src/ldap_connect.c plugins/ldap-sync/src/ldap_plugin.c plugins/ldap-sync/src/ldap_plugin.h Modified: plugins/ldap-sync/src/ldap_connect.c ============================================================================== --- plugins/ldap-sync/src/ldap_connect.c Tue Mar 31 18:16:19 2009 (r5493) +++ plugins/ldap-sync/src/ldap_connect.c Tue Mar 31 20:28:14 2009 (r5494) @@ -3848,6 +3848,9 @@ if (!found_name) { osync_trace(TRACE_ERROR, "%s:%i: WARNING: Keyattribute \"%s\" could not be found.", __FILE__, __LINE__, sinkenv->keyattr); + ldap_plugin_printf("This happened with:"); + ldap_plugin_dump_ldap_attributes(entry); + ldap_plugin_printf("-------------"); } Modified: plugins/ldap-sync/src/ldap_plugin.c ============================================================================== --- plugins/ldap-sync/src/ldap_plugin.c Tue Mar 31 18:16:19 2009 (r5493) +++ plugins/ldap-sync/src/ldap_plugin.c Tue Mar 31 20:28:14 2009 (r5494) @@ -1328,16 +1328,15 @@ to_be_reported->magic = "glist_container"; to_be_reported->list = list_to_be_reported; - - - - - - - - osync_assert(to_be_reported); + osync_trace(TRACE_INTERNAL, "%s:%i: sizeof(*to_be_reported) = %u", __FILE__, __LINE__, sizeof(*to_be_reported)); + if (sizeof(*to_be_reported) == 0) { + osync_error_set(error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: sizeof(*to_be_reported) is 0.\n", __FILE__, __LINE__); + osync_change_unref(change); + goto error; + } + // HERE: From LDAP to "the framework": to_be_reported. odata = osync_data_new((char *)to_be_reported, sizeof(*to_be_reported), format_type, error); @@ -1515,6 +1514,8 @@ osync_objformat_set_validate_func(format, ldap_plugin_validate); + osync_trace(TRACE_INTERNAL, "%s:%i:%s(): osync_data_new() gets provided with NULL and size = 0, because this is OSYNC_CHANGE_TYPE_DELETED.", __FILE__, __LINE__, __func__); + OSyncData *odata = osync_data_new(NULL, 0, format, error); if (!odata) { if (!osync_error_is_set(error)) { @@ -2619,6 +2620,7 @@ + /** * @brief Prepare commitment of a to-be-deleted change struct. * Helper function for ldap_plugin_commit_change(). @@ -2675,8 +2677,7 @@ id = g_strdup((gchar*)osync_change_get_uid(change)); dn = g_strdup_printf("%s=%s,%s", sinkenv->keyattr, id, sinkenv->storebase); - - + #ifdef DEBUG_ldapdata_to_server ldap_plugin_printf("About to commit deletion for: \ndn = \"%s\"", dn); #endif @@ -2926,6 +2927,16 @@ continue; } + + // Workaround for buggy peers, that send an identifier which differs + // from what has been stored as value for the key attribute. + if (!ldap_plugin_check_for_keyattribute(sinkenv, entry, error)) { + if (!osync_error_is_set(error)) + osync_error_set(error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: ldap_plugin_check_for_keyattribute() has failed."); + + goto error; + } + int rv = ldap_add_ext_s (sinkenv->ld, entry->dn, entry->mods, NULL, NULL); if (rv != LDAP_SUCCESS && rv != LDAP_ALREADY_EXISTS) { @@ -3114,6 +3125,8 @@ *dn_of_modified_entry = g_strdup(entry->dn); } + + if (*dn_of_modified_entry == NULL) { osync_error_set(error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: *dn_of_modified_entry = NULL.", __FILE__, __LINE__); goto error; @@ -3183,6 +3196,18 @@ goto error; } + + // Make sure that the key attribute is present in the LDAP entry. + // And that its value is identical to the one that builds + // the identifier. + if (!ldap_plugin_check_for_keyattribute(sinkenv, entry, error)) { + if (!osync_error_is_set(error)) + osync_error_set(error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: ldap_plugin_check_for_keyattribute() has failed."); + + goto error; + } + + // Add this particular entry to the DIT res = ldap_add_ext_s (sinkenv->ld, entry->dn, entry->mods, NULL, NULL); @@ -3255,7 +3280,7 @@ // Should actually be moved into the format plugin. // But there are id and dn unknown. - // Make that the key attribute is present in the LDAP entry. + // Make sure that the key attribute is present in the LDAP entry. // And that its value is identical to the one that builds // the identifier. if (!ldap_plugin_check_for_keyattribute(sinkenv, entry, error)) { @@ -3381,6 +3406,11 @@ } + + + + + #ifdef DEBUG_change_type_modified osync_trace(TRACE_INTERNAL, "\n\n\n\n%s:%i:%s():\n*dn_of_modified_entry = \"%s\"", __FILE__, __LINE__, __func__, *dn_of_modified_entry); Modified: plugins/ldap-sync/src/ldap_plugin.h ============================================================================== --- plugins/ldap-sync/src/ldap_plugin.h Tue Mar 31 18:16:19 2009 (r5493) +++ plugins/ldap-sync/src/ldap_plugin.h Tue Mar 31 20:28:14 2009 (r5494) @@ -82,6 +82,7 @@ #define OPENSYNC_DEBUG_MODULES 1 // define DISABLE_SET_SLOWSYNC 1 // define NO_OUTPUT_TO_SCREEN 1 +// define CALL_ABORT 1 #define DEBUG_auth 1 #define DEBUG_configuration 1 |