ipa_subdomains.c revision 81165faf5d951aca69f410713730c26ff048ec44
/*
SSSD
IPA Subdomains Module
Authors:
Sumit Bose <sbose@redhat.com>
Copyright (C) 2011 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 "providers/ldap/sdap_async.h"
#include "providers/ipa/ipa_subdomains.h"
#include "providers/ipa/ipa_common.h"
#define SUBDOMAINS_FILTER "objectclass=ipaNTTrustedDomain"
#define IPA_CN "cn"
#define IPA_FLATNAME "ipaNTFlatName"
#define IPA_SID "ipaNTTrustedDomainSID"
{
}
static errno_t ipa_subdomains_parse_results(
struct be_get_subdomains_req *sd_data,
struct sysdb_attrs **reply)
{
const char *value;
size_t c;
int ret;
if (new_domain_list == NULL) {
return ENOMEM;
}
for (c = 0; c < count; c++) {
struct subdomain_info);
if (new_domain_list[c] == NULL) {
goto done;
}
goto done;
}
goto done;
}
value);
goto done;
}
goto done;
}
goto done;
}
goto done;
}
}
new_domain_list[c] = NULL;
done:
} else {
}
return ret;
}
struct ipa_subdomains_req_ctx {
struct ipa_subdomains_ctx *sd_ctx;
struct sdap_id_op *sdap_op;
struct be_get_subdomains_req *sd_data;
char *current_filter;
struct sdap_search_base **search_bases;
int search_base_iter;
struct sysdb_attrs **reply;
};
{
struct tevent_req *req;
int ret;
goto fail;
}
struct ipa_subdomains_ctx);
struct be_get_subdomains_req);
ctx->search_base_iter = 0;
ctx->reply_count = 0;
goto fail;
}
goto fail;
}
return;
fail:
}
{
int ret;
int dp_error = DP_ERR_FATAL;
struct ipa_subdomains_req_ctx);
if (ret) {
if (dp_error == DP_ERR_OFFLINE) {
("No IPA server is available, cannot get the "
"subdomain list while offline\n"));
/* FIXME: return saved results ?? */
} else {
("Failed to connect to IPA server: [%d](%s)\n",
}
goto fail;
}
goto fail;
}
return;
fail:
}
{
struct tevent_req *req;
struct sdap_search_base *base;
const char *attrs[] = {"cn",
"ipaNTFlatName",
"ipaNTTrustedDomainSID",
NULL};
return EOK;
}
return ENOMEM;
}
SDAP_SEARCH_TIMEOUT), false);
return ENOMEM;
}
return EAGAIN;
}
{
int ret;
struct ipa_subdomains_req_ctx);
goto done;
}
if (reply_count) {
goto done;
}
reply_count * sizeof(struct sysdb_attrs *));
}
ctx->search_base_iter++;
return;
goto done;
}
goto done;
}
goto done;
}
done:
}