/*
SSSD
AD Domain Info Module
Authors:
Sumit Bose <sbose@redhat.com>
Copyright (C) 2013 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 <errno.h>
#include <tevent.h>
#include <ctype.h>
#include <ndr.h>
#include "providers/ldap/sdap_async.h"
#include "providers/ldap/sdap_idmap.h"
#include "providers/ad/ad_domain_info.h"
#include "providers/ad/ad_common.h"
struct sysdb_attrs *reply,
char **_flat_name,
char **_site,
char **_forest)
{
return ret;
}
if (el->num_values == 0) {
return ENOENT;
return EIO;
}
return ENOMEM;
}
/* The ndr_pull_* calls do not use ndr_pull as a talloc context to
* allocate memory but the second argument of ndr_pull_init_blob(). To
* make sure no memory is leaked here a temporary talloc context is
* needed. */
goto done;
}
&response);
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
"failed [%d]\n", ndr_err);
goto done;
}
goto done;
}
/* get flat domain name */
if (_flat_name != NULL) {
if (*_flat_name == NULL) {
goto done;
}
} else {
"No netlogon flat domain name data available.\n");
*_flat_name = NULL;
}
}
/* get forest */
goto done;
}
} else {
}
}
/* get site name */
goto done;
}
} else {
"No netlogon site name data available.\n");
goto done;
}
} else {
"No netlogon next closest site name data "
"available.\n");
}
}
}
}
done:
return ret;
}
struct ad_master_domain_state {
const char *dom_name;
int base_iter;
char *flat;
char *site;
char *forest;
char *sid;
};
struct tevent_req *
struct tevent_context *ev,
struct sdap_id_conn_ctx *conn,
struct sdap_id_op *op,
const char *dom_name)
{
goto immediate;
}
return req;
} else {
}
return req;
}
static errno_t
{
return EOK;
}
NULL, 0,
false);
return ENOMEM;
}
return EAGAIN;
}
static void
{
char *sid_str;
char *filter;
char *ntver;
struct tevent_req);
goto done;
}
if (reply_count == 0) {
/* Async request will get us back here again */
return;
goto done;
}
/* EOK */
return;
} else if (reply_count == 1) {
goto done;
}
&sid_str);
if (err != IDMAP_SUCCESS) {
goto done;
}
} else {
"More than one result for domain SID found.\n");
goto done;
}
goto done;
}
goto done;
}
false);
goto done;
}
return;
done:
}
static void
{
int ret;
struct tevent_req);
return;
}
/* Failure to get the flat name is not fatal. Just quit. */
if (reply_count == 0) {
"might not be usable\n");
goto done;
} else if (reply_count > 1) {
"More than one netlogon info returned.\n");
goto done;
}
/* Exactly one flat name. Carry on */
"Could not get the flat name or forest: %d:[%s]\n",
/* Not fatal. Just quit. */
goto done;
}
done:
return;
}
char **_flat,
char **_id,
char **_site,
char **_forest)
{
struct ad_master_domain_state);
if (_flat) {
}
if (_site) {
}
if (_forest) {
}
if (_id) {
}
return EOK;
}