20d0bc6d587f346238062df4da5edfde815e59b1Jan Zeleny Sumit Bose <sbose@redhat.com>
20d0bc6d587f346238062df4da5edfde815e59b1Jan Zeleny Copyright (C) 2012 Red Hat
20d0bc6d587f346238062df4da5edfde815e59b1Jan Zeleny This program is free software; you can redistribute it and/or modify
20d0bc6d587f346238062df4da5edfde815e59b1Jan Zeleny it under the terms of the GNU General Public License as published by
20d0bc6d587f346238062df4da5edfde815e59b1Jan Zeleny the Free Software Foundation; either version 3 of the License, or
20d0bc6d587f346238062df4da5edfde815e59b1Jan Zeleny (at your option) any later version.
20d0bc6d587f346238062df4da5edfde815e59b1Jan Zeleny This program is distributed in the hope that it will be useful,
20d0bc6d587f346238062df4da5edfde815e59b1Jan Zeleny but WITHOUT ANY WARRANTY; without even the implied warranty of
20d0bc6d587f346238062df4da5edfde815e59b1Jan Zeleny MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20d0bc6d587f346238062df4da5edfde815e59b1Jan Zeleny GNU General Public License for more details.
20d0bc6d587f346238062df4da5edfde815e59b1Jan Zeleny You should have received a copy of the GNU General Public License
20d0bc6d587f346238062df4da5edfde815e59b1Jan Zeleny along with this program. If not, see <http://www.gnu.org/licenses/>.
cf1a8af5556b1d8eab68802918c881ae1a0b89ebPavel Březinastruct sss_domain_info *get_domains_head(struct sss_domain_info *domain)
cf1a8af5556b1d8eab68802918c881ae1a0b89ebPavel Březina /* get to the top level domain */
cf1a8af5556b1d8eab68802918c881ae1a0b89ebPavel Březina for (dom = domain; dom->parent != NULL; dom = dom->parent);
0232747f04b650796db56fd7b487aee8a96fab03Simo Sorcestruct sss_domain_info *get_next_domain(struct sss_domain_info *domain,
877b92e80bde510d5cd9f03dbf01e2bcf73ab072Michal Židek bool include_disabled = gnd_flags & SSS_GND_INCLUDE_DISABLED;
07b92f78d1751d8a2a538a440e1fdb24c59021e0Pavel Březina } else if (descend && IS_SUBDOMAIN(dom) && dom->parent->next) {
877b92e80bde510d5cd9f03dbf01e2bcf73ab072Michal Židek /* Next domain found. */
33c865412732554ef255e93c4e7a58b0bce963c6Jakub Hrozekbool subdomain_enumerates(struct sss_domain_info *parent,
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov "Subdomain_enumerate not set\n");
33c865412732554ef255e93c4e7a58b0bce963c6Jakub Hrozek return false;
33c865412732554ef255e93c4e7a58b0bce963c6Jakub Hrozek if (strcasecmp(parent->sd_enumerate[0], "all") == 0) {
33c865412732554ef255e93c4e7a58b0bce963c6Jakub Hrozek return true;
33c865412732554ef255e93c4e7a58b0bce963c6Jakub Hrozek } else if (strcasecmp(parent->sd_enumerate[0], "none") == 0) {
33c865412732554ef255e93c4e7a58b0bce963c6Jakub Hrozek return false;
33c865412732554ef255e93c4e7a58b0bce963c6Jakub Hrozek if (strcasecmp(parent->sd_enumerate[i], sd_name) == 0) {
33c865412732554ef255e93c4e7a58b0bce963c6Jakub Hrozek return true;
33c865412732554ef255e93c4e7a58b0bce963c6Jakub Hrozek return false;
db18dda869bc6c52a41797b2066cf121cf10f49cPavel Reichlstruct sss_domain_info *find_domain_by_name(struct sss_domain_info *domain,
db18dda869bc6c52a41797b2066cf121cf10f49cPavel Reichl const char *name,
b5825c74b6bf7a99ae2172392dbecb51179013a6Jakub Hrozek while (dom && sss_domain_get_state(dom) == DOM_DISABLED) {
bba1a5fd62cffcae076d1351df5a83fbc4a6ec17Simo Sorce ((match_any == true) && (dom->flat_name != NULL) &&
9ca0071db0e226e4e65b2a80fdeddd5048ca8990Pavel Reichlstruct sss_domain_info *find_domain_by_sid(struct sss_domain_info *domain,
e1f68731525116ce686ffcdc07ad3a14e4fb1cd7Pavel Březina const char *sid)
b5825c74b6bf7a99ae2172392dbecb51179013a6Jakub Hrozek while (dom && sss_domain_get_state(dom) == DOM_DISABLED) {
939246537b0b9a4af6862c513d3919501ad57d92Sumit Bose if (strncasecmp(dom->domain_id, sid, dom_sid_len) == 0) {
939246537b0b9a4af6862c513d3919501ad57d92Sumit Bose /* sid is domain sid */
939246537b0b9a4af6862c513d3919501ad57d92Sumit Bose /* sid is object sid, check if domain sid is align with
939246537b0b9a4af6862c513d3919501ad57d92Sumit Bose * sid first subauthority component */
b12e2500237f33c44807d7e5b377ec06007c7252Pavel Reichlsss_get_domain_by_sid_ldap_fallback(struct sss_domain_info *domain,
b12e2500237f33c44807d7e5b377ec06007c7252Pavel Reichl const char* sid)
b12e2500237f33c44807d7e5b377ec06007c7252Pavel Reichl /* LDAP provider doesn't know about sub-domains and hence can only
b12e2500237f33c44807d7e5b377ec06007c7252Pavel Reichl * have one configured domain
9ca0071db0e226e4e65b2a80fdeddd5048ca8990Pavel Reichl return find_domain_by_sid(get_domains_head(domain), sid);
b6d3da6cfe78c6d0ddb854088bc23e293b336401Sumit Bosefind_domain_by_object_name_ex(struct sss_domain_info *domain,
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n");
1f5f330f02a95abf76b46f42ce853d2a5a1f2a61Jakub Hrozek ret = sss_parse_internal_fqname(tmp_ctx, object_name,
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov DEBUG(SSSDBG_CRIT_FAILURE, "Unable to parse name '%s' [%d]: %s\n",
db18dda869bc6c52a41797b2066cf121cf10f49cPavel Reichl dom = find_domain_by_name(domain, domainname, true);
b6d3da6cfe78c6d0ddb854088bc23e293b336401Sumit Bosefind_domain_by_object_name(struct sss_domain_info *domain,
b6d3da6cfe78c6d0ddb854088bc23e293b336401Sumit Bose return find_domain_by_object_name_ex(domain, object_name, false);
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov DEBUG(SSSDBG_OP_FAILURE, "Error retrieving domain configuration.\n");
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov DEBUG(SSSDBG_OP_FAILURE, "Sysdb context already initialized.\n");
234958be042980242fff6da936af674da877c5efSimo Sorce ret = sysdb_domain_init(mem_ctx, dom, db_path, &sysdb);
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov DEBUG(SSSDBG_OP_FAILURE, "Error opening cache database.\n");
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov DEBUG(SSSDBG_CRIT_FAILURE, "Unable to change mtime of \"%s\" "
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov "[%d]: %s\n", config, ret, strerror(ret));
2efebde7ddd5f1729a70ef4ec9de607cc393214cSumit Boseerrno_t sss_get_domain_mappings_content(TALLOC_CTX *mem_ctx,
2efebde7ddd5f1729a70ef4ec9de607cc393214cSumit Bose DEBUG(SSSDBG_CRIT_FAILURE, "Missing parameter.\n");
2efebde7ddd5f1729a70ef4ec9de607cc393214cSumit Bose DEBUG(SSSDBG_OP_FAILURE, "talloc_strdup failed.\n");
2efebde7ddd5f1729a70ef4ec9de607cc393214cSumit Bose /* This loops skips the starting parent and start rigth with the first
2efebde7ddd5f1729a70ef4ec9de607cc393214cSumit Bose * subdomain. Although in all the interesting cases (AD and IPA) the
2efebde7ddd5f1729a70ef4ec9de607cc393214cSumit Bose * default is that realm and DNS domain are the same strings (expect case)
2efebde7ddd5f1729a70ef4ec9de607cc393214cSumit Bose * and no domain_realm mapping is needed we might consider to add this
2efebde7ddd5f1729a70ef4ec9de607cc393214cSumit Bose * domain here as well to cover corner cases? */
2efebde7ddd5f1729a70ef4ec9de607cc393214cSumit Bose for (dom = get_next_domain(domain, SSS_GND_DESCEND);
2efebde7ddd5f1729a70ef4ec9de607cc393214cSumit Bose dom && IS_SUBDOMAIN(dom); /* if we get back to a parent, stop */
2efebde7ddd5f1729a70ef4ec9de607cc393214cSumit Bose o = talloc_asprintf_append(o, ".%s = %s\n%s = %s\n",
2efebde7ddd5f1729a70ef4ec9de607cc393214cSumit Bose DEBUG(SSSDBG_OP_FAILURE, "talloc_asprintf_append failed.\n");
2efebde7ddd5f1729a70ef4ec9de607cc393214cSumit Bose uc_parent = get_uppercase_realm(mem_ctx, parent_dom->name);
2efebde7ddd5f1729a70ef4ec9de607cc393214cSumit Bose DEBUG(SSSDBG_OP_FAILURE, "get_uppercase_realm failed.\n");
2efebde7ddd5f1729a70ef4ec9de607cc393214cSumit Bose for (dom = get_next_domain(domain, SSS_GND_DESCEND);
2efebde7ddd5f1729a70ef4ec9de607cc393214cSumit Bose dom && IS_SUBDOMAIN(dom); /* if we get back to a parent, stop */
2efebde7ddd5f1729a70ef4ec9de607cc393214cSumit Bose uc_forest = get_uppercase_realm(mem_ctx, dom->forest);
2efebde7ddd5f1729a70ef4ec9de607cc393214cSumit Bose DEBUG(SSSDBG_OP_FAILURE, "get_uppercase_realm failed.\n");
2efebde7ddd5f1729a70ef4ec9de607cc393214cSumit Bose DEBUG(SSSDBG_OP_FAILURE, "talloc_asprintf_append failed.\n");
2efebde7ddd5f1729a70ef4ec9de607cc393214cSumit Bose o = talloc_asprintf_append(o, "%s = {\n %s = %s\n}\n",
2efebde7ddd5f1729a70ef4ec9de607cc393214cSumit Bose DEBUG(SSSDBG_OP_FAILURE, "talloc_asprintf_append failed.\n");
2efebde7ddd5f1729a70ef4ec9de607cc393214cSumit Bose parent_capaths = talloc_asprintf(mem_ctx, " %s = %s\n", dom->realm,
2efebde7ddd5f1729a70ef4ec9de607cc393214cSumit Bose parent_capaths = talloc_asprintf_append(parent_capaths,
2efebde7ddd5f1729a70ef4ec9de607cc393214cSumit Bose "talloc_asprintf/talloc_asprintf_append failed.\n");
2efebde7ddd5f1729a70ef4ec9de607cc393214cSumit Bose o = talloc_asprintf_append(o, "%s = {\n%s}\n", uc_parent,
2efebde7ddd5f1729a70ef4ec9de607cc393214cSumit Bose DEBUG(SSSDBG_OP_FAILURE, "talloc_asprintf_append failed.\n");
2efebde7ddd5f1729a70ef4ec9de607cc393214cSumit Bosesss_write_domain_mappings(struct sss_domain_info *domain)
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov DEBUG(SSSDBG_CRIT_FAILURE, "No domain name provided\n");
2efebde7ddd5f1729a70ef4ec9de607cc393214cSumit Bose ret = sss_get_domain_mappings_content(tmp_ctx, domain, &content);
2efebde7ddd5f1729a70ef4ec9de607cc393214cSumit Bose DEBUG(SSSDBG_OP_FAILURE, "sss_get_domain_mappings_content failed.\n");
58dd26b1c5b60ee992dd5d1214bb168aebb42d54Jakub Hrozek sanitized_domain = talloc_strdup(tmp_ctx, domain->name);
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov DEBUG(SSSDBG_CRIT_FAILURE, "talloc_strdup() failed\n");
58dd26b1c5b60ee992dd5d1214bb168aebb42d54Jakub Hrozek /* only alpha-numeric chars, dashes and underscores are allowed in
58dd26b1c5b60ee992dd5d1214bb168aebb42d54Jakub Hrozek * krb5 include directory */
58dd26b1c5b60ee992dd5d1214bb168aebb42d54Jakub Hrozek for (i = 0; sanitized_domain[i] != '\0'; i++) {
58dd26b1c5b60ee992dd5d1214bb168aebb42d54Jakub Hrozek && sanitized_domain[i] != '-' && sanitized_domain[i] != '_') {
58dd26b1c5b60ee992dd5d1214bb168aebb42d54Jakub Hrozek mapping_file = talloc_asprintf(tmp_ctx, "%s/domain_realm_%s",
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov DEBUG(SSSDBG_FUNC_DATA, "Mapping file for domain [%s] is [%s]\n",
58dd26b1c5b60ee992dd5d1214bb168aebb42d54Jakub Hrozek tmp_file = talloc_asprintf(tmp_ctx, "%sXXXXXX", mapping_file);
b07a3b729892d2bc2ffa73d93de95e19003cc6c8Pavel Reichl "creating the temp file [%s] for domain-realm mappings "
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov DEBUG(SSSDBG_OP_FAILURE, "fdopen failed [%d]: %s\n",
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov "fclose failed [%d][%s].\n", ret, strerror(ret));
58dd26b1c5b60ee992dd5d1214bb168aebb42d54Jakub Hrozek /* Nothing to do here, just report the failure */
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov DEBUG(SSSDBG_OP_FAILURE, "fprintf failed\n");
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov "fclose failed [%d][%s].\n", ret, strerror(ret));
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov "rename failed [%d][%s].\n", ret, strerror(ret));
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov "fchmod failed [%d][%s].\n", ret, strerror(ret));
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov DEBUG(SSSDBG_CRIT_FAILURE, "Unable to change last modification time "
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov "of krb5.conf. Created mappings may not be loaded.\n");
58dd26b1c5b60ee992dd5d1214bb168aebb42d54Jakub Hrozek /* Ignore */
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov "fclose failed [%d][%s].\n", err, strerror(err));
58dd26b1c5b60ee992dd5d1214bb168aebb42d54Jakub Hrozek /* Nothing to do here, just report the failure */
87f8bee53ee1b4ca87b602ff8536bc5fd5b5b595Lukas Slebodnik "Could not remove file [%s]: [%d]: %s\n",
830ded27453015080a54d6ba85fd4999ee7e9af1Pavel Reichl/* Save domain names, do not descend. */
830ded27453015080a54d6ba85fd4999ee7e9af1Pavel Reichl /* get count of domains*/
830ded27453015080a54d6ba85fd4999ee7e9af1Pavel Reichl dom_names = talloc_array(tmp_ctx, char*, count);
830ded27453015080a54d6ba85fd4999ee7e9af1Pavel Reichl /* copy names */
830ded27453015080a54d6ba85fd4999ee7e9af1Pavel Reichl dom_names[i] = talloc_strdup(dom_names, dom->name);
830ded27453015080a54d6ba85fd4999ee7e9af1Pavel Reichl *_dom_names = talloc_steal(mem_ctx, dom_names);
d278822ab3ab18f2c5b012cd055f01f06e687e49Sumit Bosestatic errno_t sss_write_krb5_snippet_common(const char *file_name,
4fa184e2c60b377fd71e0115a618bd68dc73627dSumit Bose DEBUG(SSSDBG_OP_FAILURE, "talloc_new failed.\n");
4fa184e2c60b377fd71e0115a618bd68dc73627dSumit Bose tmp_file = talloc_asprintf(tmp_ctx, "%sXXXXXX", file_name);
4fa184e2c60b377fd71e0115a618bd68dc73627dSumit Bose DEBUG(SSSDBG_OP_FAILURE, "talloc_asprintf failed.\n");
b07a3b729892d2bc2ffa73d93de95e19003cc6c8Pavel Reichl DEBUG(SSSDBG_OP_FAILURE, "creating the temp file [%s] for "
d278822ab3ab18f2c5b012cd055f01f06e687e49Sumit Bose written = sss_atomic_write_s(fd, discard_const(content), size);
4fa184e2c60b377fd71e0115a618bd68dc73627dSumit Bose "write failed [%d][%s]\n", ret, sss_strerror(ret));
4fa184e2c60b377fd71e0115a618bd68dc73627dSumit Bose "Wrote %zd bytes expected %zu\n", written, size);
4fa184e2c60b377fd71e0115a618bd68dc73627dSumit Bose "rename failed [%d][%s].\n", ret, sss_strerror(ret));
4fa184e2c60b377fd71e0115a618bd68dc73627dSumit Bose "chmod failed [%d][%s].\n", ret, sss_strerror(ret));
87f8bee53ee1b4ca87b602ff8536bc5fd5b5b595Lukas Slebodnik "Could not remove file [%s]: [%d]: %s\n",
d278822ab3ab18f2c5b012cd055f01f06e687e49Sumit Bose"[plugins]\n" \
d278822ab3ab18f2c5b012cd055f01f06e687e49Sumit Bose" localauth = {\n" \
d278822ab3ab18f2c5b012cd055f01f06e687e49Sumit Bose" module = sssd:"APP_MODULES_PATH"/sssd_krb5_localauth_plugin.so\n" \
d278822ab3ab18f2c5b012cd055f01f06e687e49Sumit Bosestatic errno_t sss_write_krb5_localauth_snippet(const char *path)
d278822ab3ab18f2c5b012cd055f01f06e687e49Sumit Bose DEBUG(SSSDBG_OP_FAILURE, "talloc_new failed.\n");
d278822ab3ab18f2c5b012cd055f01f06e687e49Sumit Bose file_name = talloc_asprintf(tmp_ctx, "%s/localauth_plugin", path);
d278822ab3ab18f2c5b012cd055f01f06e687e49Sumit Bose DEBUG(SSSDBG_OP_FAILURE, "talloc_asprintf failed.\n");
d278822ab3ab18f2c5b012cd055f01f06e687e49Sumit Bose DEBUG(SSSDBG_FUNC_DATA, "File for localauth plugin configuration is [%s]\n",
d278822ab3ab18f2c5b012cd055f01f06e687e49Sumit Bose ret = sss_write_krb5_snippet_common(file_name, LOCALAUTH_PLUGIN_CONFIG);
d278822ab3ab18f2c5b012cd055f01f06e687e49Sumit Bose DEBUG(SSSDBG_OP_FAILURE, "sss_write_krb5_snippet_common failed.\n");
4fa184e2c60b377fd71e0115a618bd68dc73627dSumit Bose DEBUG(SSSDBG_TRACE_ALL, "Kerberos localauth plugin not available.\n");
6bd6571dfe97fb9c6ce9040c3fcfb4965f95eda1Petr Čechstatic errno_t sss_write_krb5_libdefaults_snippet(const char *path,
e6b6b9fa79c67d7d2698bc7e33d2e2f6bb53d483Sumit Bose DEBUG(SSSDBG_OP_FAILURE, "talloc_new failed.\n");
e6b6b9fa79c67d7d2698bc7e33d2e2f6bb53d483Sumit Bose file_name = talloc_asprintf(tmp_ctx, "%s/krb5_libdefaults", path);
e6b6b9fa79c67d7d2698bc7e33d2e2f6bb53d483Sumit Bose DEBUG(SSSDBG_OP_FAILURE, "talloc_asprintf failed.\n");
e6b6b9fa79c67d7d2698bc7e33d2e2f6bb53d483Sumit Bose DEBUG(SSSDBG_FUNC_DATA, "File for KRB5 kibdefaults configuration is [%s]\n",
6bd6571dfe97fb9c6ce9040c3fcfb4965f95eda1Petr Čech file_contents = talloc_strdup(tmp_ctx, "[libdefaults]\n");
6bd6571dfe97fb9c6ce9040c3fcfb4965f95eda1Petr Čech "talloc_asprintf failed while creating the content\n");
6bd6571dfe97fb9c6ce9040c3fcfb4965f95eda1Petr Čech if (canonicalize == true) {
6bd6571dfe97fb9c6ce9040c3fcfb4965f95eda1Petr Čech file_contents = talloc_asprintf_append(file_contents,
6bd6571dfe97fb9c6ce9040c3fcfb4965f95eda1Petr Čech " canonicalize = true\n");
6bd6571dfe97fb9c6ce9040c3fcfb4965f95eda1Petr Čech "talloc_asprintf failed while appending to the content\n");
6bd6571dfe97fb9c6ce9040c3fcfb4965f95eda1Petr Čech if (udp_limit == true) {
6bd6571dfe97fb9c6ce9040c3fcfb4965f95eda1Petr Čech file_contents = talloc_asprintf_append(file_contents,
6bd6571dfe97fb9c6ce9040c3fcfb4965f95eda1Petr Čech " udp_preference_limit = 0\n");
6bd6571dfe97fb9c6ce9040c3fcfb4965f95eda1Petr Čech "talloc_asprintf failed while appending to the content\n");
6bd6571dfe97fb9c6ce9040c3fcfb4965f95eda1Petr Čech ret = sss_write_krb5_snippet_common(file_name, file_contents);
e6b6b9fa79c67d7d2698bc7e33d2e2f6bb53d483Sumit Bose DEBUG(SSSDBG_OP_FAILURE, "sss_write_krb5_snippet_common failed.\n");
6bd6571dfe97fb9c6ce9040c3fcfb4965f95eda1Petr Čecherrno_t sss_write_krb5_conf_snippet(const char *path, bool canonicalize,
4fa184e2c60b377fd71e0115a618bd68dc73627dSumit Bose if (path != NULL && (*path == '\0' || strcasecmp(path, "none") == 0)) {
4fa184e2c60b377fd71e0115a618bd68dc73627dSumit Bose DEBUG(SSSDBG_TRACE_FUNC, "Empty path, nothing to do.\n");
4fa184e2c60b377fd71e0115a618bd68dc73627dSumit Bose DEBUG(SSSDBG_CRIT_FAILURE, "Invalid or missing path [%s]-\n",
4fa184e2c60b377fd71e0115a618bd68dc73627dSumit Bose DEBUG(SSSDBG_OP_FAILURE, "sss_write_krb5_localauth_snippet failed.\n");
6bd6571dfe97fb9c6ce9040c3fcfb4965f95eda1Petr Čech ret = sss_write_krb5_libdefaults_snippet(path, canonicalize, udp_limit);
6bd6571dfe97fb9c6ce9040c3fcfb4965f95eda1Petr Čech DEBUG(SSSDBG_OP_FAILURE, "sss_write_krb5_libdefaults_snippet failed.\n");
4fa184e2c60b377fd71e0115a618bd68dc73627dSumit Bose DEBUG(SSSDBG_CRIT_FAILURE, "Unable to change last modification time "
4fa184e2c60b377fd71e0115a618bd68dc73627dSumit Bose "of krb5.conf. Created mappings may not be loaded.\n");
4fa184e2c60b377fd71e0115a618bd68dc73627dSumit Bose /* Ignore */
c109f063b4469818fd335b8b509f0458e7b33b0aJakub Hrozekstatic const char *domain_state_str(struct sss_domain_info *dom)
c109f063b4469818fd335b8b509f0458e7b33b0aJakub Hrozek return "Active";
c109f063b4469818fd335b8b509f0458e7b33b0aJakub Hrozek return "Disabled";
c109f063b4469818fd335b8b509f0458e7b33b0aJakub Hrozek return "Inactive";
c109f063b4469818fd335b8b509f0458e7b33b0aJakub Hrozek return "Inconsistent";
c109f063b4469818fd335b8b509f0458e7b33b0aJakub Hrozek return "Unknown";
b5825c74b6bf7a99ae2172392dbecb51179013a6Jakub Hrozekenum sss_domain_state sss_domain_get_state(struct sss_domain_info *dom)
c109f063b4469818fd335b8b509f0458e7b33b0aJakub Hrozek "Domain %s is %s\n", dom->name, domain_state_str(dom));
b5825c74b6bf7a99ae2172392dbecb51179013a6Jakub Hrozekvoid sss_domain_set_state(struct sss_domain_info *dom,
c109f063b4469818fd335b8b509f0458e7b33b0aJakub Hrozek "Domain %s is %s\n", dom->name, domain_state_str(dom));
712e5b2e4465812c00a8667c75813322373bc657Sumit Bosebool sss_domain_is_forest_root(struct sss_domain_info *dom)
04d4c4d45f3942a813b7f772737f801f877f4e64Sumit Bosebool is_email_from_domain(const char *email, struct sss_domain_info *dom)
04d4c4d45f3942a813b7f772737f801f877f4e64Sumit Bose const char *p;
04d4c4d45f3942a813b7f772737f801f877f4e64Sumit Bose return false;
04d4c4d45f3942a813b7f772737f801f877f4e64Sumit Bose "Input [%s] does not look like an email address.\n", email);
04d4c4d45f3942a813b7f772737f801f877f4e64Sumit Bose return false;
04d4c4d45f3942a813b7f772737f801f877f4e64Sumit Bose DEBUG(SSSDBG_TRACE_ALL, "Email [%s] is from domain [%s].\n", email,
04d4c4d45f3942a813b7f772737f801f877f4e64Sumit Bose return true;
04d4c4d45f3942a813b7f772737f801f877f4e64Sumit Bose DEBUG(SSSDBG_TRACE_ALL, "Email [%s] is not from domain [%s].\n", email,
04d4c4d45f3942a813b7f772737f801f877f4e64Sumit Bose return false;
e0e038218580166648ac24f23180f0f4c2769d99Michal Židekchar *subdomain_create_conf_path(TALLOC_CTX *mem_ctx,
e0e038218580166648ac24f23180f0f4c2769d99Michal Židek "The domain \"%s\" is not a subdomain.\n",
e0e038218580166648ac24f23180f0f4c2769d99Michal Židek return talloc_asprintf(mem_ctx, CONFDB_DOMAIN_PATH_TMPL "/%s",
6324eaf1fb321c41ca9883966118df6d45259b7eJakub Hrozekconst char *sss_domain_type_str(struct sss_domain_info *dom)
6324eaf1fb321c41ca9883966118df6d45259b7eJakub Hrozek return "BUG: Invalid domain";
6324eaf1fb321c41ca9883966118df6d45259b7eJakub Hrozek return "POSIX";
6324eaf1fb321c41ca9883966118df6d45259b7eJakub Hrozek return "Application";
6324eaf1fb321c41ca9883966118df6d45259b7eJakub Hrozek return "Unknown";
fa2fc8a2908619031292eaf375eb1a510b8b2ebaFabiano Fidênciovoid sss_domain_info_set_output_fqnames(struct sss_domain_info *domain,