Lines Matching defs:pr_ctx

72 static errno_t pac_resolve_user_sid_next(struct pac_req_ctx *pr_ctx);
81 struct pac_req_ctx *pr_ctx;
90 pr_ctx = talloc_zero(cctx, struct pac_req_ctx);
91 if (pr_ctx == NULL) {
96 pr_ctx->cctx = cctx;
97 pr_ctx->blob = body;
98 pr_ctx->blen = blen;
100 pr_ctx->pac_ctx = talloc_get_type(cctx->rctx->pvt_ctx, struct pac_ctx);
101 if (pr_ctx->pac_ctx == NULL) {
106 ret = ad_get_data_from_pac(pr_ctx, body, blen,
107 &pr_ctx->logon_info);
113 pr_ctx->domain_name = pr_ctx->logon_info->info3.base.logon_domain.string;
114 if (pr_ctx->domain_name == NULL) {
120 err = sss_idmap_smb_sid_to_sid(pr_ctx->pac_ctx->idmap_ctx,
121 pr_ctx->logon_info->info3.base.domain_sid,
122 &pr_ctx->user_dom_sid_str);
129 talloc_steal(pr_ctx, pr_ctx->user_dom_sid_str);
131 pr_ctx->user_sid_str = talloc_asprintf(pr_ctx, "%s-%"PRIu32,
132 pr_ctx->user_dom_sid_str,
133 pr_ctx->logon_info->info3.base.rid);
134 if (pr_ctx->user_sid_str == NULL) {
140 ret = responder_get_domain_by_id(cctx->rctx, pr_ctx->user_dom_sid_str,
141 &pr_ctx->dom);
144 pr_ctx->domain_name);
148 tevent_req_set_callback(req, pac_get_domains_done, pr_ctx);
157 ret = pac_resolve_user_sid_next(pr_ctx);
161 talloc_free(pr_ctx);
168 struct pac_req_ctx *pr_ctx = tevent_req_callback_data(req,
170 struct cli_ctx *cctx = pr_ctx->cctx;
179 ret = responder_get_domain_by_id(cctx->rctx, pr_ctx->user_dom_sid_str,
180 &pr_ctx->dom);
183 "found\n", pr_ctx->user_dom_sid_str);
188 ret = pac_resolve_user_sid_next(pr_ctx);
192 talloc_free(pr_ctx);
197 static errno_t pac_resolve_user_sid_next(struct pac_req_ctx *pr_ctx)
204 req = cache_req_object_by_sid_send(pr_ctx, pr_ctx->cctx->ev,
205 pr_ctx->cctx->rctx,
206 pr_ctx->pac_ctx->rctx->ncache,
207 0, pr_ctx->dom->name,
208 pr_ctx->user_sid_str,
215 tevent_req_set_callback(req, pac_resolve_user_sid_done, pr_ctx);
225 struct pac_req_ctx *pr_ctx = tevent_req_callback_data(req,
227 struct cli_ctx *cctx = pr_ctx->cctx;
233 ret = cache_req_object_by_sid_recv(pr_ctx, req, &res, &dom);
237 talloc_free(pr_ctx);
250 user_attrs = sysdb_new_attrs(pr_ctx);
257 ret = sysdb_attrs_add_mem(user_attrs, SYSDB_PAC_BLOB, pr_ctx->blob,
258 pr_ctx->blen);
265 (time(NULL) + pr_ctx->pac_ctx->pac_lifetime));
279 talloc_free(pr_ctx);