diff options
author | Nalin Dahyabhai <nalin@dahyabhai.net> | 2013-09-12 17:26:53 -0400 |
---|---|---|
committer | Nalin Dahyabhai <nalin@dahyabhai.net> | 2013-09-12 17:26:53 -0400 |
commit | 1f1bd2eaaae965b61047882b71add6f0b91898bc (patch) | |
tree | 519bc3f41304b6ff7c9b260ab3ce1f42fbdf8a55 | |
parent | fc646c3c86afc0c7817207bb598deb0df11387fa (diff) | |
download | slapi-nis-1f1bd2eaaae965b61047882b71add6f0b91898bc.tar.gz slapi-nis-1f1bd2eaaae965b61047882b71add6f0b91898bc.tar.xz slapi-nis-1f1bd2eaaae965b61047882b71add6f0b91898bc.zip |
Add nis-relevant-subtree and nis-ignore-subtree
-rw-r--r-- | configure.ac | 12 | ||||
-rw-r--r-- | src/back-nis.c | 16 |
2 files changed, 21 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac index 44a665e..28d5ca4 100644 --- a/configure.ac +++ b/configure.ac @@ -425,6 +425,12 @@ AM_CONDITIONAL(NIS,true) nisbaseattr=nis-base AC_DEFINE_UNQUOTED(NIS_MAP_CONFIGURATION_BASE_ATTR,"$nisbaseattr", [Define to name of the attribute which lists the containers for entries for a given map.]) +nisrelevantsubtreeattr=nis-relevant-subtree +AC_DEFINE_UNQUOTED(NIS_MAP_CONFIGURATION_RELEVANT_SUBTREES_ATTR,"$nisrelevantsubtreeattr", + [Define to name of the attribute which lists the only subtrees which are relevant when locating entries and reading data to be used for constructing entries for a given container.]) +nisignoresubtreeattr=nis-ignore-subtree +AC_DEFINE_UNQUOTED(NIS_MAP_CONFIGURATION_IGNORE_SUBTREES_ATTR,"$nisignoresubtreeattr", + [Define to name of the attribute which lists the subtrees to ignore when locating entries and reading data to be used for constructing entries for a given container.]) nisfilterattr=nis-filter AC_DEFINE_UNQUOTED(NIS_MAP_CONFIGURATION_FILTER_ATTR,"$nisfilterattr", [Define to name of the attribute which holds the filter for selecting entries for a given map.]) @@ -466,12 +472,12 @@ AC_DEFINE_UNQUOTED(SCH_CONTAINER_CONFIGURATION_ACCESS_ATTR,"$checkaciattr", schbaseattr=schema-compat-search-base AC_DEFINE_UNQUOTED(SCH_CONTAINER_CONFIGURATION_BASE_ATTR,"$schbaseattr", [Define to name of the attribute which lists the containers to search when locating entries to be used for constructing entries for a given container.]) -schignoresubtreeattr=schema-compat-ignore-subtree -AC_DEFINE_UNQUOTED(SCH_CONTAINER_CONFIGURATION_IGNORE_SUBTREES_ATTR,"$schignoresubtreeattr", - [Define to name of the attribute which lists the subtrees to ignore when locating entries and reading data to be used for constructing entries for a given container.]) schrelevantsubtreeattr=schema-compat-relevant-subtree AC_DEFINE_UNQUOTED(SCH_CONTAINER_CONFIGURATION_RELEVANT_SUBTREES_ATTR,"$schrelevantsubtreeattr", [Define to name of the attribute which lists the only subtrees which are relevant when locating entries and reading data to be used for constructing entries for a given container.]) +schignoresubtreeattr=schema-compat-ignore-subtree +AC_DEFINE_UNQUOTED(SCH_CONTAINER_CONFIGURATION_IGNORE_SUBTREES_ATTR,"$schignoresubtreeattr", + [Define to name of the attribute which lists the subtrees to ignore when locating entries and reading data to be used for constructing entries for a given container.]) schfilterattr=schema-compat-search-filter AC_DEFINE_UNQUOTED(SCH_CONTAINER_CONFIGURATION_FILTER_ATTR,"$schfilterattr", [Define to name of the attribute which holds the filter for selecting entries to be used for constructing entries for a given container.]) diff --git a/src/back-nis.c b/src/back-nis.c index 69a9c73..8a8f89c 100644 --- a/src/back-nis.c +++ b/src/back-nis.c @@ -87,6 +87,8 @@ backend_free_set_data_contents(void *data) free(set_data->common.group); free(set_data->common.set); backend_shr_free_strlist(set_data->common.bases); + backend_shr_free_sdnlist(set_data->common.relevant_subtrees); + backend_shr_free_sdnlist(set_data->common.ignore_subtrees); format_free_attr_list(set_data->common.rel_attrs); free(set_data->common.rel_attr_list); format_free_attr_list(set_data->common.ref_attrs); @@ -121,8 +123,8 @@ backend_copy_set_data(const struct backend_set_data *data) ret->common.set = strdup(data->common.set); ret->common.bases = backend_shr_dup_strlist(data->common.bases); ret->common.entry_filter = strdup(data->common.entry_filter); - ret->common.relevant_subtrees = NULL; - ret->common.ignore_subtrees = NULL; + ret->common.relevant_subtrees = backend_shr_dup_sdnlist(data->common.relevant_subtrees); + ret->common.ignore_subtrees = backend_shr_dup_sdnlist(data->common.ignore_subtrees); ret->common.rel_attrs = data->common.rel_attrs ? format_dup_attr_list(data->common.rel_attrs) : NULL; @@ -515,7 +517,9 @@ backend_set_config_read_config(struct plugin_state *state, Slapi_Entry *e, char **use_bases, *use_entry_filter; char **use_key_formats, **use_keys_formats; char **use_value_formats, **use_values_formats, *use_disallowed_chars; + const Slapi_DN **relevant_subtrees, **ignore_subtrees; int i, j; + /* Read the hard-coded defaults for a map with this name. */ defaults_get_map_config(map, secure, &default_filter, &default_key_format, &default_keys_format, @@ -524,6 +528,10 @@ backend_set_config_read_config(struct plugin_state *state, Slapi_Entry *e, /* Read the values from the configuration entry. */ bases = backend_shr_get_vattr_strlist(state, e, NIS_MAP_CONFIGURATION_BASE_ATTR); + relevant_subtrees = backend_shr_get_vattr_sdnlist(state, e, + NIS_MAP_CONFIGURATION_RELEVANT_SUBTREES_ATTR); + ignore_subtrees = backend_shr_get_vattr_sdnlist(state, e, + NIS_MAP_CONFIGURATION_IGNORE_SUBTREES_ATTR); entry_filter = backend_shr_get_vattr_filter(state, e, NIS_MAP_CONFIGURATION_FILTER_ATTR); key_formats = backend_shr_get_vattr_strlist(state, e, @@ -605,9 +613,9 @@ backend_set_config_read_config(struct plugin_state *state, Slapi_Entry *e, ret.common.group = strdup(domain); ret.common.set = strdup(map); ret.common.bases = use_bases; + ret.common.relevant_subtrees = relevant_subtrees; + ret.common.ignore_subtrees = ignore_subtrees; ret.common.entry_filter = use_entry_filter; - ret.common.relevant_subtrees = NULL; - ret.common.ignore_subtrees = NULL; ret.common.rel_attrs = NULL; ret.common.rel_attr_list = NULL; ret.common.rel_attrs_list = NULL; |