From: <svn...@op...> - 2009-04-04 00:36:31
|
Author: scriptor Date: Sat Apr 4 02:36:28 2009 New Revision: 5528 URL: http://www.opensync.org/changeset/5528 Log: Made behaviour of the LDAP plugin in case of inpsize = 0 dependant of #ifdef CALL_ABORT. Downgraded "duplicate attribute" error to a WARNING that shows up in the trace files only. Modified: plugins/ldap-sync/src/ldap_format.c Modified: plugins/ldap-sync/src/ldap_format.c ============================================================================== --- plugins/ldap-sync/src/ldap_format.c Sat Apr 4 02:35:47 2009 (r5527) +++ plugins/ldap-sync/src/ldap_format.c Sat Apr 4 02:36:28 2009 (r5528) @@ -391,7 +391,7 @@ if (mod->mod_type && mod->mod_type[0] != 0) { if (strlen(name) == strlen(mod->mod_type)) { if (!strcmp(mod->mod_type, name)) { - osync_trace(TRACE_ERROR, "%s:%i: WARNING: duplicate ldap attribute found: \"%s\"", __FILE__, __LINE__, name); + osync_trace(TRACE_INTERNAL, "%s:%i: WARNING: duplicate ldap attribute found: \"%s\"", __FILE__, __LINE__, name); osync_trace(TRACE_EXIT, "%s(): return value: 2", __func__); return 2; } @@ -4107,7 +4107,7 @@ // any solution to this problem, yet. if (*ldapmods) { if (ldap_format_avoid_duplicate_attribute(*ldapmods, (const char *)name) == 2) { - osync_trace(TRACE_ERROR, "%s:%i: WARNING: Suppressing LDAP attribute \"%s\", because it is already present.", __FILE__, __LINE__, name); + osync_trace(TRACE_INTERNAL, "%s:%i: WARNING: Suppressing LDAP attribute \"%s\", because it is already present.", __FILE__, __LINE__, name); if (value) { xmlFree(value); @@ -4705,13 +4705,16 @@ // 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. Calling abort()\n", __FILE__, __LINE__, inpsize); + +#ifdef CALL_ABORT 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(); +#else + osync_error_set(error, OSYNC_ERROR_GENERIC, "%s:%i: ERROR: inpsize = %i.\n", __FILE__, __LINE__, inpsize); + goto error; +#endif -// goto error; } |