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 + } } |