diff options
author | Pavel Březina <pbrezina@redhat.com> | 2012-10-19 11:43:47 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-03-20 13:29:29 +0100 |
commit | 7c9fe57ad82747a32721ca0a08c5569282f3e0c4 (patch) | |
tree | 05f8ba655d1f6a0a77ed0e823f7d5c422ad2cc93 /src/responder/pam | |
parent | 6f8ae17869f4f8a1496e3f171ae6b5c11af1845c (diff) | |
download | sssd-7c9fe57ad82747a32721ca0a08c5569282f3e0c4.tar.gz sssd-7c9fe57ad82747a32721ca0a08c5569282f3e0c4.tar.bz2 sssd-7c9fe57ad82747a32721ca0a08c5569282f3e0c4.zip |
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.
Diffstat (limited to 'src/responder/pam')
-rw-r--r-- | src/responder/pam/pamsrv.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/responder/pam/pamsrv.c b/src/responder/pam/pamsrv.c index e5bb9009..c71ef07c 100644 --- a/src/responder/pam/pamsrv.c +++ b/src/responder/pam/pamsrv.c @@ -107,6 +107,7 @@ static int pam_process_init(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct confdb_ctx *cdb) { + struct resp_ctx *rctx; struct sss_cmd_table *pam_cmds; struct be_conn *iter; struct pam_ctx *pctx; @@ -114,13 +115,8 @@ static int pam_process_init(TALLOC_CTX *mem_ctx, int id_timeout; int fd_limit; - pctx = talloc_zero(mem_ctx, struct pam_ctx); - if (!pctx) { - return ENOMEM; - } - pam_cmds = get_pam_cmds(); - ret = sss_process_init(pctx, ev, cdb, + ret = sss_process_init(mem_ctx, ev, cdb, pam_cmds, SSS_PAM_SOCKET_NAME, SSS_PAM_PRIV_SOCKET_NAME, @@ -129,11 +125,19 @@ static int pam_process_init(TALLOC_CTX *mem_ctx, SSS_PAM_SBUS_SERVICE_VERSION, &monitor_pam_interface, "PAM", &pam_dp_interface, - &pctx->rctx); + &rctx); if (ret != EOK) { + DEBUG(SSSDBG_FATAL_FAILURE, ("sss_process_init() failed\n")); + return ret; + } + + pctx = talloc_zero(rctx, struct pam_ctx); + if (!pctx) { + ret = ENOMEM; goto done; } + pctx->rctx = rctx; pctx->rctx->pvt_ctx = pctx; /* Enable automatic reconnection to the Data Provider */ @@ -203,7 +207,7 @@ static int pam_process_init(TALLOC_CTX *mem_ctx, done: if (ret != EOK) { - talloc_free(pctx); + talloc_free(rctx); } return ret; } |