Lines Matching defs:target
42 struct dp_target *target;
54 target = provider->targets[type];
55 if (target == NULL || target->module_name == NULL) {
56 DEBUG(SSSDBG_MINOR_FAILURE, "Uninitialized target %s\n",
66 if (strcmp(target->module_name, module_name) == 0) {
78 enum dp_targets target)
84 if (target >= DP_TARGET_SENTINEL || provider->targets[target] == NULL) {
88 return provider->targets[target]->module;
96 const char *dp_target_to_string(enum dp_targets target)
98 switch (target) {
209 enum dp_targets target)
211 switch (target) {
225 static errno_t dp_target_run_constructor(struct dp_target *target,
233 fn_name = talloc_asprintf(target, DP_TARGET_INIT_FN,
234 target->module->name, target->name);
241 fn = (dp_target_init_fn)dlsym(target->module->libhandle, fn_name);
243 DEBUG(SSSDBG_TRACE_FUNC, "Executing target [%s] constructor\n",
244 target->name);
246 ret = fn(target, be_ctx, target->module->module_data, target->methods);
249 "[%d]: %s\n", target->name, ret, sss_strerror(ret));
254 if (error == NULL || !target->explicitly_configured) {
260 DEBUG(SSSDBG_FATAL_FAILURE, "Unable to load target [%s] "
261 "constructor: %s\n", target->name, error);
267 target->initialized = true;
276 struct dp_target *target,
281 target->name);
282 target->initialized = false;
283 target->module = NULL;
287 if (target->target == DPT_ACCESS) {
289 dp_set_method(target->methods, DPM_ACCESS_HANDLER,
292 target->module = NULL;
293 target->initialized = true;
298 dp_set_method(target->methods, DPM_ACCESS_HANDLER,
301 target->module = NULL;
302 target->initialized = true;
307 if (target->target == DPT_SUDO) {
311 target->module = NULL;
312 target->initialized = false;
323 struct dp_target *target)
327 DEBUG(SSSDBG_TRACE_FUNC, "Initializing target [%s] with module [%s]\n",
328 target->name, target->module_name);
330 /* We have already name, module name and target set. We just load
333 target->methods = talloc_zero_array(target, struct dp_method,
335 if (target->methods == NULL) {
342 ret = dp_target_special(be_ctx, target, target->module_name);
347 /* Load module first. Memory context is modules, not target here. */
348 target->module = dp_load_module(modules, be_ctx, provider, modules,
349 target->module_name);
350 if (target->module == NULL) {
352 target->module_name);
358 ret = dp_target_run_constructor(target, be_ctx);
359 if (!target->explicitly_configured && (ret == ELIBBAD || ret == ENOTSUP)) {
363 "module [%s].\n", target->name, target->module_name);
374 talloc_free(target->methods);
454 targets[type]->target = type;
472 /* We load the configuration first and store module name to each target.
486 DEBUG(SSSDBG_CRIT_FAILURE, "Unable to load target [%s] "
510 * all private data are attached to the target they belong to. */