Hi, this patch fixes an issue which was introduced by using talloc_move() insttead of talloc_steal().
bye, Sumit
From 81fb08fc7e7fee13fdb09aeb6b7fafc8eba992b1 Mon Sep 17 00:00:00 2001 From: Sumit Bose <sb...@redhat.com> Date: Mon, 2 May 2011 14:54:20 +0200 Subject: [PATCH] Return pam data to the renewal item if renewal fails A previous patch changed a talloc_steal() into a talloc_move(). Now it is not enough to change the parent memory context with talloc_steal to give back the data, but it has to be assigned back too. Additionally this patch uses the missing pam data as an indication that a renewal request for this data is currently running. --- src/providers/krb5/krb5_renew_tgt.c | 13 +++++++++---- version.m4 | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/providers/krb5/krb5_renew_tgt.c b/src/providers/krb5/krb5_renew_tgt.c index cf50666..c848afb 100644 --- a/src/providers/krb5/krb5_renew_tgt.c +++ b/src/providers/krb5/krb5_renew_tgt.c @@ -72,7 +72,8 @@ static void renew_tgt(struct tevent_context *ev, struct tevent_timer *te, DEBUG(1, ("krb5_auth_send failed.\n")); /* Give back the pam data to the renewal item to be able to retry at the next * time the renewals re run. */ - talloc_steal(auth_data->renew_data, auth_data->pd); + auth_data->renew_data->pd = talloc_steal(auth_data->renew_data, + auth_data->pd); talloc_free(auth_data); return; } @@ -95,7 +96,8 @@ static void renew_tgt_done(struct tevent_req *req) DEBUG(1, ("krb5_auth request failed.\n")); if (auth_data->renew_data != NULL) { DEBUG(5, ("Giving back pam data.\n")); - talloc_steal(auth_data->renew_data, auth_data->pd); + auth_data->renew_data->pd = talloc_steal(auth_data->renew_data, + auth_data->pd); } } else { switch (pam_status) { @@ -130,7 +132,8 @@ static void renew_tgt_done(struct tevent_req *req) auth_data->pd->user)); if (auth_data->renew_data != NULL) { DEBUG(5, ("Giving back pam data.\n")); - talloc_steal(auth_data->renew_data, auth_data->pd); + auth_data->renew_data->pd = talloc_steal(auth_data->renew_data, + auth_data->pd); } break; default: @@ -169,7 +172,9 @@ static errno_t renew_all_tgts(struct renew_tgt_ctx *renew_tgt_ctx) renew_data = talloc_get_type(entries[c].value.ptr, struct renew_data); DEBUG(9, ("Checking [%s] for renewal at [%.24s].\n", renew_data->ccfile, ctime(&renew_data->start_renew_at))); - if (renew_data->start_renew_at < now) { + /* If renew_data->pd == NULL a renewal request for this data is + * currently running so we skip it. */ + if (renew_data->start_renew_at < now && renew_data->pd != NULL) { auth_data = talloc_zero(renew_tgt_ctx, struct auth_data); if (auth_data == NULL) { DEBUG(1, ("talloc_zero failed.\n")); diff --git a/version.m4 b/version.m4 index 86ff39a..8e892fa 100644 --- a/version.m4 +++ b/version.m4 @@ -8,5 +8,5 @@ m4_define([VERSION_NUMBER], [1.6.0]) # .20090915gitf1bcde7 # and would result in an SRPM looking like: # sssd-0.5.0-0.20090915gitf1bcde7.fc11.src.rpm -m4_define([PRERELEASE_VERSION_NUMBER], []) +m4_define([PRERELEASE_VERSION_NUMBER], [.20110502.1453.gite2be782]) -- 1.7.4.2
_______________________________________________ sssd-devel mailing list sssd-devel@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/sssd-devel