Codebase list slapi-nis / 27dcf97
Don't log "with closest match (null)" If we're sending a result, don't log that we're sending a closest match, even if it's "(null)", if we're not sending a closest match. Nalin Dahyabhai 10 years ago
1 changed file(s) with 14 addition(s) and 15 deletion(s). Raw diff Collapse all Expand all
13611361 #endif
13621362 /* If we "own" the search target DN, then we need to send a response. */
13631363 if (cbdata.answer) {
1364 if (!(cbdata.matched || (cbdata.n_entries > 0))) {
1364 if (cbdata.matched || (cbdata.n_entries > 0)) {
1365 /* Free the closest-match that we've recorded, so that
1366 * we don't send it as part of the result. */
1367 free(cbdata.closest_match);
1368 cbdata.closest_match = NULL;
1369 slapi_log_error(SLAPI_LOG_PLUGIN,
1370 cbdata.state->plugin_desc->spd_id,
1371 "sending error %d\n", cbdata.result);
1372 } else {
13651373 /* Return a no-such-object error because the target DN
13661374 * was not found. */
13671375 cbdata.result = LDAP_NO_SUCH_OBJECT;
1368 }
1369 slapi_log_error(SLAPI_LOG_PLUGIN,
1370 cbdata.state->plugin_desc->spd_id,
1371 "sending error %d with closest match = "
1372 "%s%s%s\n", cbdata.result,
1373 cbdata.closest_match ? "\"" : "",
1374 cbdata.closest_match ?
1375 cbdata.closest_match : "(null)",
1376 cbdata.closest_match ? "\"" : "");
1377 if (cbdata.matched || (cbdata.n_entries > 0)) {
1378 /* Just in case, free the closest-match that we've
1379 * recorded. */
1380 free(cbdata.closest_match);
1381 cbdata.closest_match = NULL;
1376 slapi_log_error(SLAPI_LOG_PLUGIN,
1377 cbdata.state->plugin_desc->spd_id,
1378 "sending error %d with closest match = "
1379 "\"%s\"\n", cbdata.result,
1380 cbdata.closest_match);
13821381 }
13831382 slapi_pblock_set(cbdata.pb, SLAPI_PLUGIN_OPRETURN,
13841383 &cbdata.result);