summaryrefslogtreecommitdiffstats
path: root/src/providers
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2013-08-14 13:21:31 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-08-19 10:05:17 +0200
commit7586fbe87f54c8b8ae0d44558bd4c2971839ef77 (patch)
tree7e97fec59373ce4ece6b99bf545aca425a6a9bf4 /src/providers
parent269c115496578dc9bc9f2d9b63e8343e76880a28 (diff)
downloadsssd-7586fbe87f54c8b8ae0d44558bd4c2971839ef77.tar.gz
sssd-7586fbe87f54c8b8ae0d44558bd4c2971839ef77.tar.xz
sssd-7586fbe87f54c8b8ae0d44558bd4c2971839ef77.zip
proxy: Alocate auth tokens in struct authtok_conv
Struct sss_auth_token became opaque in commit 9acfb09f7969a69f58bd45c856b01700541853ca. All ocasions of "struct sss_auth_token" was replaced with pointer to this struct, but proper initialization of auth_tokens was missing in struct authtok_conv. Resolves: https://fedorahosted.org/sssd/ticket/2046
Diffstat (limited to 'src/providers')
-rw-r--r--src/providers/proxy/proxy_child.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/providers/proxy/proxy_child.c b/src/providers/proxy/proxy_child.c
index efdf9120a..6f95ede6a 100644
--- a/src/providers/proxy/proxy_child.c
+++ b/src/providers/proxy/proxy_child.c
@@ -201,6 +201,23 @@ static errno_t call_pam_stack(const char *pam_target, struct pam_data *pd)
conv.conv=proxy_internal_conv;
}
auth_data = talloc_zero(pd, struct authtok_conv);
+ if (auth_data == NULL) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_zero failed.\n"));
+ return ENOMEM;
+ }
+ auth_data->authtok = sss_authtok_new(auth_data);
+ if (auth_data->authtok == NULL) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("sss_authtok_new failed.\n"));
+ ret = ENOMEM;
+ goto fail;
+ }
+ auth_data->newauthtok = sss_authtok_new(auth_data);
+ if (auth_data->newauthtok == NULL) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("sss_authtok_new failed.\n"));
+ ret = ENOMEM;
+ goto fail;
+ }
+
conv.appdata_ptr=auth_data;
ret = pam_start(pam_target, pd->user, &conv, &pamh);
@@ -279,6 +296,9 @@ static errno_t call_pam_stack(const char *pam_target, struct pam_data *pd)
pd->pam_status = pam_status;
return EOK;
+fail:
+ talloc_free(auth_data);
+ return ret;
}
static int pc_pam_handler(DBusMessage *message, struct sbus_connection *conn)