URL: https://github.com/SSSD/sssd/pull/587 Author: jhrozek Title: #587: AUTOFS: remove timed event if related object is removed Action: opened
PR body: """ autofs_map_result_timeout() is called as a timed event to free the autofs map data is the cache lifetime is exceeded. If the data is freed earlier the timed event should be removed as well to avoid a double free issue. Since talloc is used here the most easy way to achieve this is to allocate the timed event on the map object itself. Resolves: https://pagure.io/SSSD/sssd/issue/3752 """ To pull the PR as Git branch: git remote add ghsssd https://github.com/SSSD/sssd git fetch ghsssd pull/587/head:pr587 git checkout pr587
From 80baa362870193f5778b2a2003c91742dd68027c Mon Sep 17 00:00:00 2001 From: Jakub Hrozek <jhro...@redhat.com> Date: Thu, 31 May 2018 12:31:15 +0200 Subject: [PATCH] AUTOFS: remove timed event if related object is removed autofs_map_result_timeout() is called as a timed event to free the autofs map data is the cache lifetime is exceeded. If the data is freed earlier the timed event should be removed as well to avoid a double free issue. Since talloc is used here the most easy way to achieve this is to allocate the timed event on the map object itself. Resolves: https://pagure.io/SSSD/sssd/issue/3752 --- src/responder/autofs/autofssrv_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/responder/autofs/autofssrv_cmd.c b/src/responder/autofs/autofssrv_cmd.c index ec3d2f418..9ea2ab71b 100644 --- a/src/responder/autofs/autofssrv_cmd.c +++ b/src/responder/autofs/autofssrv_cmd.c @@ -401,7 +401,7 @@ set_autofs_map_lifetime(uint32_t lifetime, tv = tevent_timeval_current_ofs(lifetime, 0); te = tevent_add_timer(lookup_ctx->rctx->ev, - lookup_ctx->rctx, tv, + map, tv, autofs_map_result_timeout, map); if (!te) {
_______________________________________________ sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/sssd-devel@lists.fedorahosted.org/message/KAZZQS6V2BDD56T2Z3F3FWLX6Y5VPDWW/