diff options
| author | Nalin Dahyabhai <nalin.dahyabhai@pobox.com> | 2008-06-30 18:29:23 -0400 |
|---|---|---|
| committer | Nalin Dahyabhai <nalin.dahyabhai@pobox.com> | 2008-06-30 18:29:23 -0400 |
| commit | 7222241a931fc18b3c11643b394a4e81aa199775 (patch) | |
| tree | e900e9b9bd11237db2e0ae821f3b062773d44ed8 /src | |
| parent | 15fdeee0bab953ce506468806e326a99acae0e5a (diff) | |
- refactor the is-this-a-valid-set-definition logicpost-sch
- make building of either module a conditional, not yet controllable by the
configure script
Diffstat (limited to 'src')
| -rw-r--r-- | src/Makefile.am | 10 | ||||
| -rw-r--r-- | src/back-shr.c | 54 |
2 files changed, 12 insertions, 52 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 809fe04..638f026 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -6,7 +6,15 @@ LIBWRAP = @LIBWRAP@ plugindir = $(libdir)/dirsrv/plugins dist_noinst_SCRIPTS = ypmaplist.py -plugin_LTLIBRARIES = nisserver-plugin.la schemacompat-plugin.la +plugin_LTLIBRARIES = +if NIS +plugin_LTLIBRARIES += nisserver-plugin.la +else +endif +if SCHEMA +plugin_LTLIBRARIES += schemacompat-plugin.la +endif + nisserver_plugin_la_SOURCES = \ back-nis.c \ backend.h \ diff --git a/src/back-shr.c b/src/back-shr.c index c61451b..bbae623 100644 --- a/src/back-shr.c +++ b/src/back-shr.c @@ -513,57 +513,9 @@ backend_shr_entry_is_a_set(struct plugin_state *state, Slapi_PBlock *pb, Slapi_Entry *e, const char *set_configuration_filter) { - Slapi_DN *entry_sdn, *plugin_sdn; - Slapi_Filter *filter; - bool_t ret; - - /* First, just do the scope test. */ - entry_sdn = slapi_sdn_new_ndn_byref(slapi_entry_get_ndn(e)); - if (entry_sdn == NULL) { - return FALSE; - } else { - plugin_sdn = slapi_sdn_new_dn_byval(state->plugin_base); - if (plugin_sdn == NULL) { - slapi_sdn_free(&entry_sdn); - return FALSE; - } - } - if (slapi_sdn_scope_test(entry_sdn, - plugin_sdn, - LDAP_SCOPE_ONE) == 0) { - /* Didn't match. */ - slapi_log_error(SLAPI_LOG_PLUGIN, - state->plugin_desc->spd_id, - "entry \"%s\" is not a child of \"%s\"\n", - slapi_sdn_get_ndn(entry_sdn), - slapi_sdn_get_ndn(plugin_sdn)); - ret = FALSE; - } else { - ret = TRUE; - } - slapi_sdn_free(&plugin_sdn); - slapi_sdn_free(&entry_sdn); - /* If it's actually part of our configuration tree, check if it's a - * valid entry. */ - if (ret) { - filter = slapi_str2filter((char *) set_configuration_filter); - if (filter != NULL) { - if (slapi_vattr_filter_test(pb, e, filter, 0) != 0) { - /* Didn't match. */ - slapi_log_error(SLAPI_LOG_PLUGIN, - state->plugin_desc->spd_id, - "entry \"%s\" doesn't look " - "like a map configuration " - "(didn't match filter " - "\"%s\")\n", - slapi_sdn_get_ndn(entry_sdn), - set_configuration_filter); - ret = FALSE; - } - slapi_filter_free(filter, 1); - } - } - return ret; + return backend_shr_entry_matches(pb, e, + state->plugin_base, LDAP_SCOPE_ONE, + set_configuration_filter); } /* Update any entries to which the passed-in entry in the passed-in map refers |
