summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin@redhat.com>2010-11-22 11:07:45 -0500
committerNalin Dahyabhai <nalin@redhat.com>2010-11-22 11:07:45 -0500
commitc067125f9150e452fdfe9885d757224bd5ec5795 (patch)
treea7ab23762d6eb71c2a8ed71da435b13472b39c3e
parent36ab51ed90303787670711c1be6b9b5564267635 (diff)
downloadslapi-nis-c067125f9150e452fdfe9885d757224bd5ec5795.tar.gz
slapi-nis-c067125f9150e452fdfe9885d757224bd5ec5795.tar.xz
slapi-nis-c067125f9150e452fdfe9885d757224bd5ec5795.zip
Check that the search base is serviced by a real backend before we'll attempt to participate in a search request.
-rw-r--r--NEWS2
-rw-r--r--src/back-sch.c9
2 files changed, 11 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 6b122e2..8dac9bf 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+0.18 * Check that the search base is serviced by a real backend before
+ we'll attempt to participate in a search request.
0.17 * Actually send portmap registrations to the right address.
0.16 * Fix NIS server startup problem when no listening port is explicitly
configured and we're using portmap instead of rpcbind (#500903).
diff --git a/src/back-sch.c b/src/back-sch.c
index eba778a..6fc9c30 100644
--- a/src/back-sch.c
+++ b/src/back-sch.c
@@ -893,6 +893,15 @@ backend_search_cb(Slapi_PBlock *pb)
"searching from \"%s\" for \"%s\" with scope %d\n",
cbdata.target, cbdata.strfilter, cbdata.scope);
cbdata.target_dn = slapi_sdn_new_dn_byval(cbdata.target);
+ /* Check if there's a backend handling this search. */
+ if (!slapi_be_exist(cbdata.target_dn)) {
+ slapi_log_error(SLAPI_LOG_PLUGIN,
+ cbdata.state->plugin_desc->spd_id,
+ "slapi_be_exists(\"%s\") = 0, ignoring search\n",
+ cbdata.target);
+ slapi_sdn_free(&cbdata.target_dn);
+ return 0;
+ }
/* Walk the list of groups. */
wrap_inc_call_level();
map_rdlock();