domain_info_utils.c revision a3c8390d19593b1e5277d95bfb4ab206d4785150
/*
Authors:
Sumit Bose <sbose@redhat.com>
Copyright (C) 2012 Red Hat
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 <utime.h>
/* the directory domain - realm mappings are written to */
{
/* get to the top level domain */
/* proceed to the list head */
return dom;
}
bool descend)
{
struct sss_domain_info *dom;
while (dom) {
} else {
}
}
return dom;
}
const char *sd_name)
{
"Subdomain_enumerate not set\n");
return false;
}
return true;
return false;
} else {
for (int i=0; parent->sd_enumerate[i]; i++) {
return true;
}
}
}
return false;
}
const char *name,
bool match_any)
{
return NULL;
}
}
while (dom) {
return dom;
}
}
return NULL;
}
const char *sid)
{
return NULL;
}
}
while (dom) {
if (dom_sid_len == sid_len) {
/* sid is domain sid */
return dom;
}
/* sid is object sid, check if domain sid is align with
* sid first subauthority component */
return dom;
}
}
}
}
return NULL;
}
struct sss_domain_info *
const char *object_name)
{
char *domainname = NULL;
return NULL;
}
&domainname, &name);
goto done;
}
if (domainname == NULL) {
} else {
}
done:
return dom;
}
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;
return NULL;
}
goto fail;
}
goto fail;
}
goto fail;
}
goto fail;
}
}
goto fail;
}
}
goto fail;
}
}
goto fail;
}
}
/* 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;
}
struct confdb_ctx *cdb,
const char *domain_name,
const char *db_path,
struct sss_domain_info **_domain)
{
int ret;
struct sss_domain_info *dom;
return ret;
}
return EEXIST;
}
return ret;
}
return EOK;
}
static errno_t
sss_krb5_touch_config(void)
{
}
if (ret == -1) {
return ret;
}
return EOK;
}
{
struct sss_domain_info *dom;
struct sss_domain_info *parent_dom;
const char *mapping_file;
char *sanitized_domain;
int fd = -1;
int i;
bool capaths_started;
char *uc_forest;
char *uc_parent;
return EINVAL;
}
if (sanitized_domain == NULL) {
return ENOMEM;
}
/* only alpha-numeric chars, dashes and underscores are allowed in
* krb5 include directory */
for (i = 0; sanitized_domain[i] != '\0'; i++) {
if (!isalnum(sanitized_domain[i])
sanitized_domain[i] = '_';
}
}
if (!mapping_file) {
goto done;
}
goto done;
}
if (fd < 0) {
"mappings failed.", tmp_file);
goto done;
}
if (!fstream) {
if (ret != 0) {
/* Nothing to do here, just report the failure */
}
goto done;
}
if (ret < 0) {
goto done;
}
if (ret < 0) {
goto done;
}
}
if (add_capaths) {
capaths_started = false;
parent_dom = domain;
goto done;
}
continue;
}
goto done;
}
if (!capaths_started) {
if (ret < 0) {
goto done;
}
capaths_started = true;
}
if (ret < 0) {
goto done;
}
}
}
if (ret != 0) {
goto done;
}
if (ret == -1) {
goto done;
}
if (ret == -1) {
goto done;
}
done:
err = sss_krb5_touch_config();
"of krb5.conf. Created mappings may not be loaded.\n");
/* Ignore */
}
if (fstream) {
if (err != 0) {
/* Nothing to do here, just report the failure */
}
}
if (tmp_file) {
if (err < 0) {
"Could not remove file [%s]: [%d]: %s",
}
}
return ret;
}