ipa_hostid.c revision 7b1f8721183647546e0da1aa458c02495f84a995
/*
Authors:
Jan Cholasta <jcholast@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 "util/crypto/sss_crypto.h"
#include "db/sysdb_ssh.h"
#include "providers/ldap/ldap_common.h"
#include "providers/ipa/ipa_common.h"
#include "providers/ipa/ipa_hostid.h"
#include "providers/ipa/ipa_hosts.h"
struct hosts_get_state {
struct tevent_context *ev;
struct ipa_hostid_ctx *ctx;
struct sdap_id_op *op;
struct sss_domain_info *domain;
const char *name;
const char *alias;
struct sysdb_attrs **hosts;
int dp_error;
};
struct tevent_req *
struct tevent_context *ev,
struct ipa_hostid_ctx *hostid_ctx,
const char *name,
const char *alias);
static errno_t
int *dp_error_out);
static void
void
{
struct ipa_hostid_ctx *hostid_ctx;
struct sdap_id_ctx *ctx;
struct be_host_req *hr;
struct tevent_req *req;
int dp_error = DP_ERR_FATAL;
const char *err = "Unknown Error";
struct ipa_hostid_ctx);
err = "Offline";
goto done;
}
err = "Invalid filter type";
goto done;
}
if (!req) {
err = "Out of memory";
goto done;
}
done:
}
static void
{
const char* error_text;
error_text = NULL;
} else {
("Bug: dp_error is OK on failed request"));
}
} else if (dp_error == DP_ERR_OFFLINE) {
error_text = "Offline";
error_text = "Out of memory";
} else {
}
}
static void
{
}
static errno_t
static void
static void
struct tevent_req *
struct tevent_context *ev,
struct ipa_hostid_ctx *hostid_ctx,
const char *name,
const char *alias)
{
struct tevent_req *req;
struct hosts_get_state *state;
struct sdap_id_ctx *ctx;
goto fail;
}
goto fail;
}
return req;
fail:
return req;
}
static errno_t
{
struct hosts_get_state);
struct tevent_req *subreq;
if (!subreq) {
return ret;
}
return EOK;
}
static void
{
struct tevent_req);
struct hosts_get_state);
int dp_error = DP_ERR_FATAL;
return;
}
if (!subreq) {
return;
}
}
static void
{
struct tevent_req);
struct hosts_get_state);
int dp_error = DP_ERR_FATAL;
struct sysdb_attrs *attrs;
/* retry */
goto done;
}
return;
}
goto done;
}
goto done;
}
goto done;
}
goto done;
}
if (!attrs) {
goto done;
}
/* we are interested only in the host keys */
goto done;
}
attrs);
goto done;
}
done:
} else {
}
}
static errno_t
int *dp_error_out)
{
struct hosts_get_state);
if (dp_error_out) {
}
return EOK;
}