diff options
author | Nalin Dahyabhai <nalin.dahyabhai@pobox.com> | 2008-07-01 17:08:46 -0400 |
---|---|---|
committer | Nalin Dahyabhai <nalin.dahyabhai@pobox.com> | 2008-07-01 17:08:46 -0400 |
commit | 373f0478bce52febe7eb336ebb05795a4e3f3fea (patch) | |
tree | 4057865edd186235d7876c2016e310f0cd95c13a | |
parent | deba0985db66e1ba3f524b9314a5f856270ebe77 (diff) | |
download | slapi-nis-373f0478bce52febe7eb336ebb05795a4e3f3fea.tar.gz slapi-nis-373f0478bce52febe7eb336ebb05795a4e3f3fea.tar.xz slapi-nis-373f0478bce52febe7eb336ebb05795a4e3f3fea.zip |
- use shared functionality for checking if an entry is a map
-rw-r--r-- | src/back-nis.c | 56 |
1 files changed, 4 insertions, 52 deletions
diff --git a/src/back-nis.c b/src/back-nis.c index 1361cb0..7d34079 100644 --- a/src/back-nis.c +++ b/src/back-nis.c @@ -945,58 +945,8 @@ bool_t backend_entry_is_a_set(struct plugin_state *state, Slapi_PBlock *pb, Slapi_Entry *e) { - Slapi_DN *entry_sdn, *plugin_sdn; - Slapi_Filter *filter; - bool_t ret; - char map_configuration_filter[] = NIS_MAP_CONFIGURATION_FILTER; - - /* 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(map_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), - NIS_MAP_CONFIGURATION_FILTER); - ret = FALSE; - } - slapi_filter_free(filter, 1); - } - } - return ret; + return backend_shr_entry_is_a_set(state, pb, e, + NIS_MAP_CONFIGURATION_FILTER); } /* Scan for the list of configured domains and maps. */ @@ -1010,5 +960,7 @@ backend_startup(struct plugin_state *state) void backend_init(Slapi_PBlock *pb, struct plugin_state *state) { + slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id, + "hooking up postoperation callbacks\n"); backend_shr_postop_init(pb, state); } |