Lines Matching refs:state
84 struct ipa_resolve_user_list_state *state;
86 req = tevent_req_create(memctx, &state,
93 state->ev = ev;
94 state->ipa_ctx = ipa_ctx;
95 state->domain_name = domain_name;
96 state->domain = find_domain_by_name(state->ipa_ctx->sdap_id_ctx->be->domain,
97 state->domain_name, true);
98 state->users = users;
99 state->user_idx = 0;
100 state->dp_error = DP_ERR_FATAL;
106 state->dp_error = DP_ERR_OK;
122 struct ipa_resolve_user_list_state *state = tevent_req_data(req,
125 if (state->user_idx >= state->users->num_values) {
129 ret = get_dp_id_data_for_user_name(state,
130 (char *) state->users->values[state->user_idx].data,
131 state->domain_name, &ar);
139 state->user_domain = find_domain_by_object_name_ex(
140 state->ipa_ctx->sdap_id_ctx->be->domain,
144 if (state->user_domain == NULL) {
145 state->user_domain = state->domain;
147 ar->domain = state->user_domain->name;
149 if (state->user_domain != state->ipa_ctx->sdap_id_ctx->be->domain) {
150 subreq = ipa_subdomain_account_send(state, state->ev, state->ipa_ctx,
153 subreq = ipa_id_get_account_info_send(state, state->ev, state->ipa_ctx,
170 struct ipa_resolve_user_list_state *state = tevent_req_data(req,
174 if (state->user_domain != state->ipa_ctx->sdap_id_ctx->be->domain) {
175 ret = ipa_subdomain_account_recv(subreq, &state->dp_error);
177 ret = ipa_id_get_account_info_recv(subreq, &state->dp_error);
185 state->user_idx++;
198 state->dp_error = DP_ERR_OK;
201 if (state->dp_error == DP_ERR_OK) {
202 state->dp_error = DP_ERR_FATAL;
211 struct ipa_resolve_user_list_state *state = tevent_req_data(req,
215 *dp_error = state->dp_error;
251 struct ipa_initgr_get_overrides_state *state;
253 req = tevent_req_create(memctx, &state,
259 state->ev = ev;
260 state->ipa_ctx = ipa_ctx;
261 state->user_dom = user_dom;
262 state->groups = groups;
263 state->group_count = groups_count;
264 state->group_idx = 0;
265 state->ar = NULL;
266 state->realm = dp_opt_get_string(state->ipa_ctx->ipa_options->basic,
268 if (state->realm == NULL) {
273 state->groups_id_attr = talloc_strdup(state, groups_id_attr);
274 if (state->groups_id_attr == NULL) {
300 struct ipa_initgr_get_overrides_state *state = tevent_req_data(req,
304 "Processing group %zu/%zu\n", state->group_idx, state->group_count);
306 if (state->group_idx >= state->group_count) {
310 ipa_uuid = ldb_msg_find_attr_as_string(state->groups[state->group_idx],
311 state->groups_id_attr, NULL);
318 ldb_dn_get_linearized(state->groups[state->group_idx]->dn),
319 state->groups_id_attr);
323 talloc_free(state->ar); /* Avoid spiking memory with many groups */
325 if (strcmp(state->groups_id_attr, SYSDB_UUID) == 0) {
326 ret = get_dp_id_data_for_uuid(state, ipa_uuid,
327 state->user_dom->name, &state->ar);
332 } else if (strcmp(state->groups_id_attr, SYSDB_SID_STR) == 0) {
333 ret = get_dp_id_data_for_sid(state, ipa_uuid,
334 state->user_dom->name, &state->ar);
341 state->groups_id_attr);
347 subreq = ipa_get_ad_override_send(state, state->ev,
348 state->ipa_ctx->sdap_id_ctx,
349 state->ipa_ctx->ipa_options,
350 state->realm,
351 state->ipa_ctx->view_name,
352 state->ar);
366 struct ipa_initgr_get_overrides_state *state = tevent_req_data(req,
371 ret = ipa_get_ad_override_recv(subreq, &state->dp_error, state,
380 if (is_default_view(state->ipa_ctx->view_name)) {
381 ret = sysdb_apply_default_override(state->user_dom, override_attrs,
382 state->groups[state->group_idx]->dn);
384 ret = sysdb_store_override(state->user_dom,
385 state->ipa_ctx->view_name,
388 state->groups[state->group_idx]->dn);
397 state->group_idx++;
412 struct ipa_initgr_get_overrides_state *state = tevent_req_data(req,
416 *dp_error = state->dp_error;
526 struct ipa_id_get_account_info_state *state;
528 req = tevent_req_create(memctx, &state,
535 state->ev = ev;
536 state->ipa_ctx = ipa_ctx;
537 state->ctx = ipa_ctx->sdap_id_ctx;
538 state->dp_error = DP_ERR_FATAL;
540 state->op = sdap_id_op_create(state, state->ctx->conn->conn_cache);
541 if (state->op == NULL) {
547 state->domain = find_domain_by_name(state->ctx->be->domain,
549 if (state->domain == NULL) {
554 state->sysdb = state->domain->sysdb;
555 state->ar = ar;
556 state->realm = dp_opt_get_string(state->ipa_ctx->ipa_options->basic,
558 if (state->realm == NULL) {
570 if (is_default_view(state->ipa_ctx->view_name)
571 || state->ar->filter_type == BE_FILTER_SECID
572 || state->ar->extra_value == NULL
573 || strcmp(state->ar->extra_value,
575 || ! is_object_overridable(state->ar)) {
583 subreq = sdap_id_op_connect_send(state->op, state, &ret);
603 struct ipa_id_get_account_info_state *state = tevent_req_data(req,
615 subreq = ipa_get_ad_override_send(state, state->ev, state->ctx,
616 state->ipa_ctx->ipa_options, state->realm,
617 state->ipa_ctx->view_name, state->ar);
629 state->dp_error = dp_error;
638 struct ipa_id_get_account_info_state *state = tevent_req_data(req,
646 ret = ipa_get_ad_override_recv(subreq, &dp_error, state,
647 &state->override_attrs);
654 if (state->override_attrs != NULL) {
655 ret = sysdb_attrs_get_string(state->override_attrs,
663 ret = split_ipa_anchor(state, anchor, &anchor_domain, &ipa_uuid);
671 if (strcmp(state->ar->domain, anchor_domain) == 0) {
673 state->orig_ar = state->ar;
675 ret = get_dp_id_data_for_uuid(state, ipa_uuid,
676 state->ar->domain,
677 &state->ar);
683 if ((state->orig_ar->entry_type & BE_REQ_TYPE_MASK)
687 state->ar->entry_type = BE_REQ_INITGROUPS;
688 state->ar->filter_type = BE_FILTER_UUID;
696 anchor_domain, state->ar->domain);
700 ret = ipa_id_get_account_info_get_original_step(req, state->ar);
710 state->dp_error = dp_error;
718 struct ipa_id_get_account_info_state *state = tevent_req_data(req,
722 subreq = sdap_handle_acct_req_send(state, state->ctx->be, ar,
723 state->ipa_ctx->sdap_id_ctx,
724 state->ipa_ctx->sdap_id_ctx->opts->sdom,
725 state->ipa_ctx->sdap_id_ctx->conn, true);
742 struct ipa_id_get_account_info_state *state = tevent_req_data(req,
762 if (! is_object_overridable(state->ar)) {
763 state->dp_error = DP_ERR_OK;
770 state->res = NULL;
771 state->res_index = 0;
772 if (state->ar->filter_type == BE_FILTER_CERT) {
773 ret = sysdb_search_object_by_cert(state, state->domain,
774 state->ar->filter_value, attrs,
775 &(state->res));
782 if (state->res->count == 0) {
788 state->obj_msg = state->res->msgs[0];
789 if (state->res->count == 1) {
791 state->res = NULL;
794 ret = get_object_from_cache(state, state->domain, state->ar,
795 &state->obj_msg);
798 state->dp_error = DP_ERR_OK;
815 state->dp_error = DP_ERR_OK;
820 state->dp_error = dp_error;
832 struct ipa_id_get_account_info_state *state = tevent_req_data(req,
835 class = ldb_msg_find_attr_as_string(state->obj_msg, SYSDB_OBJECTCATEGORY,
844 if (!is_default_view(state->ipa_ctx->view_name)) {
846 if ((state->ar->entry_type & BE_REQ_TYPE_MASK) == BE_REQ_GROUP
847 || ((state->ar->entry_type & BE_REQ_TYPE_MASK) == BE_REQ_BY_UUID
851 state->ghosts = ldb_msg_find_element(state->obj_msg, SYSDB_GHOST);
852 } else if ((state->ar->entry_type & BE_REQ_TYPE_MASK) == \
855 ret = ipa_id_get_group_uuids(state, state->sysdb,
856 &state->group_cnt,
857 &state->user_groups);
866 if (state->override_attrs == NULL) {
867 uuid = ldb_msg_find_attr_as_string(state->obj_msg, SYSDB_UUID, NULL);
874 ret = get_dp_id_data_for_uuid(state, uuid, state->domain->name,
875 &state->ar);
881 subreq = ipa_get_ad_override_send(state, state->ev,
882 state->ipa_ctx->sdap_id_ctx,
883 state->ipa_ctx->ipa_options,
884 state->realm,
885 state->ipa_ctx->view_name,
886 state->ar);
902 ret = sysdb_store_override(state->domain, state->ipa_ctx->view_name,
904 state->override_attrs, state->obj_msg->dn);
911 if (state->ghosts != NULL) {
913 subreq = ipa_resolve_user_list_send(state, state->ev,
914 state->ipa_ctx,
915 state->domain->name,
916 state->ghosts);
927 if (state->user_groups != NULL) {
928 subreq = ipa_initgr_get_overrides_send(state, state->ev, state->ipa_ctx,
929 state->domain, state->group_cnt,
930 state->user_groups,
945 if (ret == EOK && state->res != NULL
946 && ++state->res_index < state->res->count) {
947 state->obj_msg = state->res->msgs[state->res_index];
958 struct ipa_id_get_account_info_state *state = tevent_req_data(req,
965 ret = ipa_get_ad_override_recv(subreq, &dp_error, state,
966 &state->override_attrs);
973 class = ldb_msg_find_attr_as_string(state->obj_msg, SYSDB_OBJECTCATEGORY,
987 ret = sysdb_store_override(state->domain, state->ipa_ctx->view_name,
989 state->override_attrs, state->obj_msg->dn);
995 if (state->ghosts != NULL) {
997 subreq = ipa_resolve_user_list_send(state, state->ev,
998 state->ipa_ctx,
999 state->domain->name,
1000 state->ghosts);
1010 if (state->user_groups != NULL) {
1011 subreq = ipa_initgr_get_overrides_send(state, state->ev, state->ipa_ctx,
1012 state->domain, state->group_cnt,
1013 state->user_groups,
1024 if (state->res != NULL && ++state->res_index < state->res->count) {
1025 state->obj_msg = state->res->msgs[state->res_index];
1036 state->dp_error = DP_ERR_OK;
1041 state->dp_error = dp_error;
1050 struct ipa_id_get_account_info_state *state = tevent_req_data(req,
1062 if (state->res != NULL && ++state->res_index < state->res->count) {
1063 state->obj_msg = state->res->msgs[state->res_index];
1074 state->dp_error = DP_ERR_OK;
1079 state->dp_error = dp_error;
1088 struct ipa_id_get_account_info_state *state = tevent_req_data(req,
1100 if (state->res != NULL && ++state->res_index < state->res->count) {
1101 state->obj_msg = state->res->msgs[state->res_index];
1112 state->dp_error = DP_ERR_OK;
1117 state->dp_error = dp_error;
1124 struct ipa_id_get_account_info_state *state = tevent_req_data(req,
1128 *dp_error = state->dp_error;
1167 struct ipa_id_get_netgroup_state *state;
1175 req = tevent_req_create(memctx, &state, struct ipa_id_get_netgroup_state);
1178 state->ev = ev;
1179 state->ctx = ipa_ctx;
1180 state->dp_error = DP_ERR_FATAL;
1182 state->op = sdap_id_op_create(state, ctx->conn->conn_cache);
1183 if (!state->op) {
1189 state->sysdb = ctx->be->domain->sysdb;
1190 state->domain = ctx->be->domain;
1191 state->name = name;
1192 state->timeout = dp_opt_get_int(ctx->opts->basic, SDAP_SEARCH_TIMEOUT);
1194 ret = sss_filter_sanitize(state, name, &clean_name);
1199 state->filter = talloc_asprintf(state, "(&(%s=%s)(objectclass=%s))",
1203 if (!state->filter) {
1210 ret = build_attrs_from_map(state, ctx->opts->netgroup_map,
1212 &state->attrs, NULL);
1215 subreq = sdap_id_op_connect_send(state->op, state, &ret);
1233 struct ipa_id_get_netgroup_state *state =
1237 struct sdap_id_ctx *sdap_ctx = state->ctx->sdap_id_ctx;
1243 state->dp_error = dp_error;
1248 subreq = ipa_get_netgroups_send(state, state->ev, state->sysdb,
1249 state->domain, sdap_ctx->opts,
1250 state->ctx->ipa_options,
1251 sdap_id_op_handle(state->op),
1252 state->attrs, state->filter,
1253 state->timeout);
1267 struct ipa_id_get_netgroup_state *state =
1272 ret = ipa_get_netgroups_recv(subreq, state,
1273 &state->count, &state->netgroups);
1275 ret = sdap_id_op_done(state->op, ret, &dp_error);
1279 subreq = sdap_id_op_connect_send(state->op, state, &ret);
1289 state->dp_error = dp_error;
1294 if (ret == EOK && state->count > 1) {
1297 state->name);
1303 ret = sysdb_delete_netgroup(state->domain, state->name);
1310 state->dp_error = DP_ERR_OK;
1317 struct ipa_id_get_netgroup_state *state =
1321 *dp_error = state->dp_error;
1360 struct ipa_account_info_handler_state *state;
1365 req = tevent_req_create(mem_ctx, &state,
1372 state->type = ipa_decide_account_info_type(data, params->be_ctx);
1380 switch (state->type) {
1383 subreq = ipa_subdomain_account_send(state, params->ev, id_ctx, data);
1391 subreq = ipa_id_get_netgroup_send(state, params->ev, id_ctx,
1395 subreq = ipa_id_get_account_info_send(state, params->ev, id_ctx, data);
1409 dp_reply_std_set(&state->reply, DP_ERR_DECIDE, ret, NULL);
1420 struct ipa_account_info_handler_state *state;
1426 state = tevent_req_data(req, struct ipa_account_info_handler_state);
1428 switch (state->type) {
1442 dp_reply_std_set(&state->reply, dp_error, ret, NULL);
1450 struct ipa_account_info_handler_state *state = NULL;
1452 state = tevent_req_data(req, struct ipa_account_info_handler_state);
1456 *data = state->reply;