summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsbose <sbose@ipa18-devel.ipa18.devel>2013-02-11 15:39:22 +0100
committerMartin Kosek <mkosek@redhat.com>2013-02-14 10:12:24 +0100
commite8cf9dcf1974f27853459ff31019422f6af03831 (patch)
treeab17effc9d9dc62e2432bf936c366b1fbfb61fb1
parent4e9081f1e31195eded364c2a906eed4e660f5816 (diff)
downloadfreeipa.git-e8cf9dcf1974f27853459ff31019422f6af03831.tar.gz
freeipa.git-e8cf9dcf1974f27853459ff31019422f6af03831.tar.xz
freeipa.git-e8cf9dcf1974f27853459ff31019422f6af03831.zip
ipa-kdb: Free talloc autofree context when module is closed
Currently kdb5kdc crashes on exit if the ipadb KDB modules is loaded and trusts are configured. The reason is the talloc autofree context which get initialised during the ndr_push_union_blob() call. On exit the KDC module is unloaded an later on atexit() tries to free the context, but all related symbols are already unloaded with the module. This patch frees the talloc autofree context during the cleanup routine of the module. Since this is called only at exit and not during normal operations this is safe even if other KDC plugins use the talloc autofree context, e.g. via some Samba libraries, as well. Fixes https://fedorahosted.org/freeipa/ticket/3410
-rw-r--r--daemons/ipa-kdb/ipa_kdb.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/daemons/ipa-kdb/ipa_kdb.c b/daemons/ipa-kdb/ipa_kdb.c
index 55a932ab..2a344dc6 100644
--- a/daemons/ipa-kdb/ipa_kdb.c
+++ b/daemons/ipa-kdb/ipa_kdb.c
@@ -20,6 +20,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <talloc.h>
+
#include "ipa_kdb.h"
struct ipadb_context *ipadb_get_context(krb5_context kcontext)
@@ -456,6 +458,7 @@ static krb5_error_code ipadb_fini_module(krb5_context kcontext)
ipactx = ipadb_get_context(kcontext);
ipadb_context_free(kcontext, &ipactx);
+ talloc_free(talloc_autofree_context());
return 0;
}