domain_info_utils.c revision 33c865412732554ef255e93c4e7a58b0bce963c6
/*
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 */
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)
{
}
while (dom) {
return dom;
}
}
return NULL;
}
struct sss_domain_info *parent,
const char *name,
const char *realm,
const char *flat_name,
const char *id,
bool mpg,
bool enumerate)
{
struct sss_domain_info *dom;
return NULL;
}
goto fail;
}
goto fail;
}
goto fail;
}
goto fail;
}
}
goto fail;
}
}
goto fail;
}
}
/* FIXME: get ranges from the server */
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;
const char *mapping_file;
char *sanitized_domain;
int fd = -1;
int i;
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 (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;
}