/*
SSSD
System Database - Sub-domain related calls
Copyright (C) 2012 Jan Zeleny <jzeleny@redhat.com>
Copyright (C) 2012 Sumit Bose <sbose@redhat.com>
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "db/sysdb_private.h"
struct sss_domain_info *parent,
const char *name,
const char *realm,
const char *flat_name,
const char *id,
bool mpg,
bool enumerate,
const char *forest,
{
bool inherit_option;
return NULL;
}
/* Sub-domains always have the same view as the parent */
goto fail;
}
}
goto fail;
}
goto fail;
}
goto fail;
}
goto fail;
}
}
goto fail;
}
}
goto fail;
}
}
goto fail;
}
}
/* If the parent domain filters out group members, the subdomain should
* as well if configured */
parent->sd_inherit, false);
if (inherit_option) {
}
/* If the parent domain explicitly limits ID ranges, the subdomain
* should honour the limits as well.
*/
dom->case_sensitive = false;
goto fail;
}
return dom;
fail:
return NULL;
}
{
* without the forest attribute. Those are automatically forest
* roots
*/
return true;
}
return true;
}
return false;
}
struct sss_domain_info *member)
{
return true;
}
return false;
}
{
struct sss_domain_info *d;
d->forest_root = NULL;
}
if (d->forest_root != NULL) {
continue;
}
if (is_forest_root(d) == true) {
d->forest_root = d;
continue;
}
if (is_same_forest(d, dd) == true) {
dd->forest_root = d;
"[%s] is a forest root of [%s]\n",
d->forest_root->name,
}
}
}
}
}
{
int i;
NULL};
const char *name;
const char *realm;
const char *flat;
const char *id;
const char *forest;
bool mpg;
bool enumerate;
const char **upn_suffixes;
goto done;
}
goto done;
}
if (ret != LDB_SUCCESS) {
goto done;
}
/* disable all domains,
* let the search result refresh any that are still valid */
}
goto done;
}
"The object [%s] doesn't have a name\n",
goto done;
}
SYSDB_SUBDOMAIN_MPG, false);
SYSDB_SUBDOMAIN_ENUM, false);
upn_suffixes = NULL;
if (upn_suffixes == NULL) {
goto done;
}
}
0);
/* in theory these may change, but it should never happen */
"Realm name changed from [%s] to [%s]!\n",
goto done;
}
}
"Flat name changed from [%s] to [%s]!\n",
goto done;
}
}
"Domain changed from [%s] to [%s]!\n",
goto done;
}
}
"MPG state change from [%s] to [%s]!\n",
}
"enumerate state change from [%s] to [%s]!\n",
}
"Forest changed from [%s] to [%s]!\n",
goto done;
}
}
/* maybe views are not initialized, copy from parent */
"Failed to copy parent's view name.\n");
goto done;
}
}
} else {
"Sub-domain [%s][%s] and parent [%s][%s] " \
"views are different.\n",
goto done;
}
}
"Trust direction change from [%d] to [%d]!\n",
}
break;
}
}
/* If not found in loop it is a new subdomain */
goto done;
}
}
}
done:
return ret;
}
{
const char *tmp_str;
NULL};
return ENOMEM;
}
goto done;
}
if (ret != LDB_SUCCESS) {
goto done;
}
goto done;
}
goto done;
}
NULL);
goto done;
}
}
NULL);
goto done;
}
}
NULL);
goto done;
}
}
NULL);
goto done;
}
}
goto done;
}
} else {
}
goto done;
}
/* If no view is defined the default view will be used. In this case
* domain->has_views is FALSE and
* domain->view_name is set to SYSDB_DEFAULT_VIEW_NAME
*
* If there is a view defined
* domain->has_views is TRUE and
* domain->view_name is set to the given view name
*
* Currently changing the view is not supported hence we have to check for
* changes and error out accordingly.
*/
/* handle default view */
"View name change is currently not supported. " \
"New view is the default view while current view is [%s]. " \
} else {
goto done;
}
} else {
"Domain [%s] has no view but view name [%s] " \
"is not the default view name [%s].\n",
goto done;
}
}
}
} else {
/* handle view other than default */
"View name change is currently not supported. " \
"New view is [%s] while current view is [%s]. " \
"View name is not changed!\n",
}
} else {
goto done;
}
} else {
"View name change is currently not supported. " \
"New view is [%s] while current is the default view. " \
"View name is not changed!\n", view_name);
} else {
"Domain currently has no views, " \
"but current view name is set to [%s] " \
"and new view name is [%s].\n",
goto done;
}
}
}
}
done:
return ret;
}
const char *realm,
const char *flat,
const char *id,
const char *forest,
struct ldb_message_element *upn_suffixes)
{
int ret;
bool do_update = false;
return ENOMEM;
}
goto done;
}
goto done;
}
if (ret != LDB_SUCCESS) {
goto done;
}
if (ret != LDB_SUCCESS) {
goto done;
}
do_update = true;
}
if (ret != LDB_SUCCESS) {
goto done;
}
if (ret != LDB_SUCCESS) {
goto done;
}
do_update = true;
}
if (ret != LDB_SUCCESS) {
goto done;
}
if (ret != LDB_SUCCESS) {
goto done;
}
do_update = true;
}
if (ret != LDB_SUCCESS) {
goto done;
}
if (ret != LDB_SUCCESS) {
goto done;
}
do_update = true;
}
if (upn_suffixes != NULL) {
goto done;
}
if (ret != LDB_SUCCESS) {
goto done;
}
do_update = true;
} else {
/* Remove alternative_domain_suffixes from the cache */
if (ret != LDB_SUCCESS) {
goto done;
}
do_update = true;
}
}
if (do_update == false) {
goto done;
}
if (ret != LDB_SUCCESS) {
goto done;
}
goto done;
}
done:
return ret;
}
struct ldb_message_element *upn_suffixes)
{
NULL};
const char *tmp_str;
bool tmp_bool;
bool store = false;
int realm_flags = 0;
int flat_flags = 0;
int id_flags = 0;
int mpg_flags = 0;
int enum_flags = 0;
int forest_flags = 0;
int td_flags = 0;
int upn_flags = 0;
int ret;
return ENOMEM;
}
goto done;
}
if (ret != LDB_SUCCESS) {
goto done;
}
if (ret) {
goto done;
}
store = true;
goto done;
} else { /* 1 found */
if (realm) {
}
}
if (flat_name) {
}
}
if (domain_id) {
}
}
!mpg);
}
!enumerate);
}
if (forest) {
}
}
0);
if (tmp_td != trust_direction) {
}
if (upn_suffixes) {
/* Luckily ldb_msg_element_compare() only compares the values and
* not the name. */
}
}
}
goto done;
}
goto done;
}
if (store) {
if (ret != LDB_SUCCESS) {
goto done;
}
if (ret != LDB_SUCCESS) {
goto done;
}
}
if (realm_flags) {
if (ret != LDB_SUCCESS) {
goto done;
}
if (ret != LDB_SUCCESS) {
goto done;
}
}
if (flat_flags) {
if (ret != LDB_SUCCESS) {
goto done;
}
if (ret != LDB_SUCCESS) {
goto done;
}
}
if (id_flags) {
if (ret != LDB_SUCCESS) {
goto done;
}
if (ret != LDB_SUCCESS) {
goto done;
}
}
if (mpg_flags) {
if (ret != LDB_SUCCESS) {
goto done;
}
if (ret != LDB_SUCCESS) {
goto done;
}
}
if (enum_flags) {
if (ret != LDB_SUCCESS) {
goto done;
}
if (ret != LDB_SUCCESS) {
goto done;
}
}
if (forest_flags) {
NULL);
if (ret != LDB_SUCCESS) {
goto done;
}
if (ret != LDB_SUCCESS) {
goto done;
}
}
if (td_flags) {
if (ret != LDB_SUCCESS) {
goto done;
}
"%u", trust_direction);
if (ret != LDB_SUCCESS) {
goto done;
}
}
if (upn_flags) {
goto done;
}
if (ret != LDB_SUCCESS) {
goto done;
}
}
if (ret != LDB_SUCCESS) {
goto done;
}
done:
return ret;
}
{
int ret;
goto done;
}
goto done;
}
goto done;
}
done:
return ret;
}
struct sysdb_attrs **usr_attrs,
const char *dom_basedn,
struct sysdb_attrs **_result)
{
const char *orig_dn;
char *cn_users_basedn;
if (cn_users_basedn == NULL) {
goto done;
}
goto done;
}
if (dn_len > cn_users_basedn_len
cn_users_basedn) == 0) {
"Found matching dn [%s].\n", orig_dn);
"Found 2 matching DN [%s] and [%s], expecting only 1.\n",
goto done;
}
}
}
done:
return ret;
}
struct sss_domain_info *dom,
struct sysdb_attrs **usr_attrs,
struct ldb_dn *ldb_basedn,
const char *basedn,
const char *domain_component_name,
struct sysdb_attrs **_result)
{
const char *orig_dn;
int dn_comp_num;
int basedn_comp_num;
const char *component_name;
goto done;
}
goto done;
}
if (orig_dn_len > basedn_len
/* Does the user's original DN with the non-domain part
* stripped match the domain base DN?
*/
basedn) == 0) {
if (ldb_orig_dn == NULL) {
goto done;
}
if (dn_comp_num > basedn_comp_num) {
(dn_comp_num - basedn_comp_num));
/* If the component is NOT a DC component, then the entry
* must come from our domain, perhaps from a child container.
* If it matched the DC component, the entry was from a child
* subdomain different from this one.
*/
if (component_name != NULL
domain_component_name) != 0) {
"Found matching dn [%s].\n", orig_dn);
"Found 2 matching DN [%s] and [%s], "
goto done;
}
}
}
}
}
done:
return ret;
}
struct sss_domain_info *dom,
struct sysdb_attrs **usr_attrs,
const char *dom_basedn,
const char *domain_component_name,
struct sysdb_attrs **_result)
{
return EINVAL;
}
if (ldb_dom_basedn == NULL) {
return ENOMEM;
}
_result);
}
struct sss_domain_info *dom,
const char *domain_component_name,
const char *domain_search_base,
struct sysdb_attrs **usr_attrs,
struct sysdb_attrs **_result)
{
bool ok;
const char *search_base;
int search_base_comp_num;
int non_dc_comp_num;
const char *component_name;
goto done;
}
if (ldb_search_base == NULL) {
goto done;
}
/* strip non-DC components from the search base */
for (non_dc_comp_num = 0;
non_dc_comp_num++) {
break;
}
}
if (non_dc_comp_num == search_base_comp_num) {
/* The search base does not have any non-DC components, the search wouldn't
* match anyway
*/
goto done;
}
if (!ok) {
goto done;
}
if (search_base == NULL) {
goto done;
}
goto done;
}
&result);
goto done;
}
}
done:
return ret;
}
const char *domain_component_name,
const char *domain_search_base,
struct sysdb_attrs **usr_attrs,
struct sysdb_attrs **exp_usr)
{
char *dom_basedn;
int ret;
|| domain_search_base == NULL
return EINVAL;
}
return ENOMEM;
}
goto done;
}
goto done;
}
&result);
goto done;
}
}
&result);
goto done;
}
}
goto done;
}
done:
return ret;
}