sysdb_subdomains.c revision 50936fc7230a9b3f01e285e72c4182013542f53e
/*
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,
{
struct sss_domain_info *dom;
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;
}
{
int i;
struct ldb_result *res;
const char *attrs[] = {"cn",
NULL};
struct sss_domain_info *dom;
const char *name;
const char *realm;
const char *flat;
const char *id;
const char *forest;
bool mpg;
bool enumerate;
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);
0);
/* explicitly use dom->next as we need to check 'disabled' domains */
/* 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;
struct ldb_result *res;
const char *attrs[] = {"cn",
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;
}
/* 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* forest)
{
struct ldb_message *msg;
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 (do_update == false) {
goto done;
}
if (ret != LDB_SUCCESS) {
goto done;
}
goto done;
}
done:
return ret;
}
{
struct ldb_message *msg;
struct ldb_result *res;
const char *attrs[] = {"cn",
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 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) {
}
}
&& td_flags == 0) {
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 (ret != LDB_SUCCESS) {
goto done;
}
done:
return ret;
}
{
int ret;
goto done;
}
goto done;
}
goto done;
}
done:
return ret;
}