ldap_id_services.c revision dc30c60f166ad9adc63a47a1013508a71624ac87
/*
SSSD
Authors:
Stephen Gallagher <sgallagh@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 <errno.h>
#include "util/strtonum.h"
#include "db/sysdb_services.h"
#include "providers/ldap/ldap_common.h"
#include "providers/ldap/sdap_async.h"
struct sdap_services_get_state {
struct tevent_context *ev;
struct sdap_id_ctx *id_ctx;
struct sdap_domain *sdom;
struct sdap_id_op *op;
struct sss_domain_info *domain;
struct sdap_id_conn_ctx *conn;
const char *name;
const char *protocol;
char *filter;
const char **attrs;
int filter_type;
int dp_error;
int sdap_ret;
bool noexist_delete;
};
static errno_t
static void
static void
struct tevent_req *
struct tevent_context *ev,
struct sdap_id_ctx *id_ctx,
struct sdap_domain *sdom,
struct sdap_id_conn_ctx *conn,
const char *name,
const char *protocol,
int filter_type,
bool noexist_delete)
{
struct tevent_req *req;
struct sdap_services_get_state *state;
const char *attr_name;
char *clean_name;
char *clean_protocol = NULL;
goto error;
}
switch(filter_type) {
case BE_FILTER_NAME:
break;
case BE_FILTER_IDNUM:
break;
default:
goto error;
}
}
if (clean_protocol) {
state, "(&(%s=%s)(%s=%s)(objectclass=%s))",
} else {
}
"Failed to build the base filter\n");
goto error;
}
"Preparing to search for services with filter [%s]\n",
return req;
return req;
}
static errno_t
{
struct sdap_services_get_state *state =
struct tevent_req *subreq;
if (!subreq) {
return ret;
}
return EOK;
}
static void
{
struct tevent_req *req =
struct sdap_services_get_state *state =
int dp_error = DP_ERR_FATAL;
return;
}
false);
if (!subreq) {
return;
}
}
static void
{
struct tevent_req *req =
struct sdap_services_get_state *state =
int dp_error = DP_ERR_FATAL;
/* Check whether we need to try again with another
* failover server.
*/
/* retry */
return;
}
/* Return to the mainloop to retry */
return;
}
/* An error occurred. */
return;
}
/* Ensure that this entry is removed from the sysdb */
switch(state->filter_type) {
case BE_FILTER_NAME:
return;
}
break;
case BE_FILTER_IDNUM:
if (errno) {
return;
}
return;
}
break;
default:
return;
}
}
}
{
struct sdap_services_get_state *state =
if (dp_error_out) {
}
if (sdap_ret) {
}
return EOK;
}