From 7c9fe57ad82747a32721ca0a08c5569282f3e0c4 Mon Sep 17 00:00:00 2001 From: Pavel Březina Date: Fri, 19 Oct 2012 11:43:47 +0200 Subject: change responder contexts hierarchy https://fedorahosted.org/sssd/ticket/1575 The hierarchy is now: main_ctx -> responder_ctx -> specific_ctx where specific_ctx is one of sudo, pam, etc. --- src/responder/pac/pacsrv.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'src/responder/pac') diff --git a/src/responder/pac/pacsrv.c b/src/responder/pac/pacsrv.c index 29447c47..9bc27663 100644 --- a/src/responder/pac/pacsrv.c +++ b/src/responder/pac/pacsrv.c @@ -119,6 +119,7 @@ int pac_process_init(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct confdb_ctx *cdb) { + struct resp_ctx *rctx; struct sss_cmd_table *pac_cmds; struct be_conn *iter; struct pac_ctx *pac_ctx; @@ -127,15 +128,9 @@ int pac_process_init(TALLOC_CTX *mem_ctx, int fd_limit; char *uid_str; - pac_ctx = talloc_zero(mem_ctx, struct pac_ctx); - if (!pac_ctx) { - DEBUG(SSSDBG_FATAL_FAILURE, ("fatal error initializing pac_ctx\n")); - return ENOMEM; - } - pac_cmds = get_pac_cmds(); - ret = sss_process_init(pac_ctx, ev, cdb, + ret = sss_process_init(mem_ctx, ev, cdb, pac_cmds, SSS_PAC_SOCKET_NAME, NULL, CONFDB_PAC_CONF_ENTRY, @@ -143,10 +138,20 @@ int pac_process_init(TALLOC_CTX *mem_ctx, PAC_SBUS_SERVICE_VERSION, &monitor_pac_interface, "PAC", &pac_dp_interface, - &pac_ctx->rctx); + &rctx); if (ret != EOK) { + DEBUG(SSSDBG_FATAL_FAILURE, ("sss_process_init() failed\n")); + return ret; + } + + pac_ctx = talloc_zero(rctx, struct pac_ctx); + if (!pac_ctx) { + DEBUG(SSSDBG_FATAL_FAILURE, ("fatal error initializing pac_ctx\n")); + ret = ENOMEM; goto fail; } + + pac_ctx->rctx = rctx; pac_ctx->rctx->pvt_ctx = pac_ctx; @@ -207,7 +212,7 @@ int pac_process_init(TALLOC_CTX *mem_ctx, return EOK; fail: - talloc_free(pac_ctx); + talloc_free(rctx); return ret; } -- cgit