sysdb_subdomains.c revision b5825c74b6bf7a99ae2172392dbecb51179013a6
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce System Database - Sub-domain related calls
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce Copyright (C) 2012 Jan Zeleny <jzeleny@redhat.com>
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce Copyright (C) 2012 Sumit Bose <sbose@redhat.com>
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce This program is free software; you can redistribute it and/or modify
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce it under the terms of the GNU General Public License as published by
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce the Free Software Foundation; either version 3 of the License, or
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce (at your option) any later version.
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce This program is distributed in the hope that it will be useful,
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce but WITHOUT ANY WARRANTY; without even the implied warranty of
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce GNU General Public License for more details.
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce You should have received a copy of the GNU General Public License
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce along with this program. If not, see <http://www.gnu.org/licenses/>.
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorcestruct sss_domain_info *new_subdomain(TALLOC_CTX *mem_ctx,
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce const char *name,
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce const char *realm,
edaadf8de0c86a2cfff2d29215775d42919476f3Pavel Březina const char *id,
22a21e910fd216ec1468fe769dcc29f1621a52a4Ondrej Kos "Creating [%s] as subdomain of [%s]!\n", name, parent->name);
b9c563c29243291f40489bb0dcbf3946fca72d58Jakub Hrozek dom = talloc_zero(mem_ctx, struct sss_domain_info);
ab967283b710dfa05d11ee5b30c7ac916486ceecSimo Sorce DEBUG(SSSDBG_OP_FAILURE, "talloc_zero failed.\n");
233a3c6c48972b177e60d6ef4cecfacd3cf31659Simo Sorce /* Sub-domains always have the same view as the parent */
7c69221077c780e62f6c536e78675f2dc1c131bcMichal Zidek dom->view_name = talloc_strdup(dom, parent->view_name);
f9961e5f82e0ef474d6492371bfdf9e74e208a99Pavel Březina DEBUG(SSSDBG_OP_FAILURE, "Failed to copy parent's view name.\n");
dcc6877aa2e2dd63a9dc9c411a9c58feaeb36b9aStephen Gallagher DEBUG(SSSDBG_OP_FAILURE, "Failed to copy domain name.\n");
4dd38025efda88f123eac672f87d3cda12f050c8Jakub Hrozek dom->provider = talloc_strdup(dom, parent->provider);
0161a3c5637a0c0092bf54c436bb3d6508d7df26Jakub Hrozek DEBUG(SSSDBG_OP_FAILURE, "Failed to copy provider name.\n");
1319e71fd1680ca4864afe0b1aca2b8c8e4a1ee4Stef Walter dom->conn_name = talloc_strdup(dom, parent->conn_name);
a2ea3f5d9ef9f17efbb61e942c2bc6cff7d1ebf2Jakub Hrozek DEBUG(SSSDBG_OP_FAILURE, "Failed to copy connection name.\n");
1243e093fd31c5660adf1bb3dd477d6935a755beJakub Hrozek DEBUG(SSSDBG_OP_FAILURE, "Failed to copy realm name.\n");
9118a539a5d59f669f551114f880fe91d6bb8741Jakub Hrozek DEBUG(SSSDBG_OP_FAILURE, "Failed to copy flat name.\n");
dd285415d7a8d8376207960cfa3e977524c3b98cJakub Hrozek DEBUG(SSSDBG_OP_FAILURE, "Failed to copy id.\n");
d4757440418c7b73bbecec7e40baf6dfe8cc9460Sumit Bose DEBUG(SSSDBG_OP_FAILURE, "Failed to copy forest.\n");
300b9e9217ee1ed8d845ed2370c5ccf5c87afb36Pavel Březina /* If the parent domain filters out group members, the subdomain should
300b9e9217ee1ed8d845ed2370c5ccf5c87afb36Pavel Březina * as well if configured */
c0f9f5a0f6d71a1596ee3cef549b4b02295313c3Jakub Hrozek inherit_option = string_in_list(CONFDB_DOMAIN_IGNORE_GROUP_MEMBERS,
ccd349f0274217e1f0cc118e3a6045e2235ce420Fabiano Fidêncio dom->ignore_group_members = parent->ignore_group_members;
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce /* If the parent domain explicitly limits ID ranges, the subdomain
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce * should honour the limits as well.
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce dom->id_min = parent->id_min ? parent->id_min : 0;
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce dom->id_max = parent->id_max ? parent->id_max : 0xffffffff;
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce dom->pwd_expiration_warning = parent->pwd_expiration_warning;
8bcabb97d988d1602882a1f036aac2eaf5e09234Simo Sorce dom->cache_credentials = parent->cache_credentials;
goto fail;
return dom;
fail:
return NULL;
struct sss_domain_info *d;
if (is_forest_root(d) == true) {
d->forest_root = d;
NULL};
const char *name;
const char *realm;
const char *flat;
const char *id;
const char *forest;
bool mpg;
bool enumerate;
goto done;
goto done;
goto done;
goto done;
goto done;
SYSDB_SUBDOMAIN_MPG, false);
SYSDB_SUBDOMAIN_ENUM, false);
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
done:
return ret;
const char *tmp_str;
NULL};
return ENOMEM;
goto done;
goto done;
goto done;
goto done;
NULL);
goto done;
NULL);
goto done;
NULL);
goto done;
NULL);
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
done:
return ret;
const char *realm,
const char *flat,
const char *id,
const char* forest)
int ret;
bool do_update = false;
return ENOMEM;
goto done;
goto done;
goto done;
goto done;
do_update = true;
goto done;
goto done;
do_update = true;
goto done;
goto done;
do_update = true;
goto done;
goto done;
do_update = true;
if (do_update == false) {
goto done;
goto done;
goto done;
done:
return ret;
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;
goto done;
if (ret) {
goto done;
store = true;
goto done;
if (realm) {
if (flat_name) {
if (domain_id) {
!mpg);
!enumerate);
if (forest) {
&& td_flags == 0) {
goto done;
goto done;
if (store) {
goto done;
goto done;
if (realm_flags) {
goto done;
goto done;
if (flat_flags) {
goto done;
goto done;
if (id_flags) {
goto done;
goto done;
if (mpg_flags) {
goto done;
goto done;
if (enum_flags) {
goto done;
goto done;
if (forest_flags) {
NULL);
goto done;
goto done;
if (td_flags) {
goto done;
goto done;
goto done;
done:
return ret;
int ret;
goto done;
goto done;
goto done;
done:
return ret;