Hey,
I pushed the attached oneliner.

-- 
Simo Sorce * Red Hat, Inc * New York
>From 43701d273525b01fd7a0f3611166653218daf11d Mon Sep 17 00:00:00 2001
From: Simo Sorce <sso...@redhat.com>
Date: Tue, 29 May 2012 17:41:38 -0400
Subject: [PATCH] Fix setting domain_sid

'sid' is a stack variable, by assigning its address to the domain_sid pointer
we were later referencing grabage (whatever on the stack ha[ppened to be at
that address.
Properly copy the sid and allocate it on the provided memory context.
---
 daemons/ipa-kdb/ipa_kdb_mspac.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/daemons/ipa-kdb/ipa_kdb_mspac.c b/daemons/ipa-kdb/ipa_kdb_mspac.c
index c59dcbb32bb7f55bd98bfc7c100c6c3caa47cbcc..bb05dce9852c060b0689139a928c31a623f2b0a2 100644
--- a/daemons/ipa-kdb/ipa_kdb_mspac.c
+++ b/daemons/ipa-kdb/ipa_kdb_mspac.c
@@ -415,7 +415,7 @@ static krb5_error_code ipadb_fill_info3(struct ipadb_context *ipactx,
     }
 
     /* we got the domain SID for the user sid */
-    info3->base.domain_sid = &sid;
+    info3->base.domain_sid = talloc_memdup(memctx, &sid, sizeof(sid));
 
     /* always zero out, not used for Krb, only NTLM */
     memset(&info3->base.LMSessKey, '\0', sizeof(info3->base.key));
-- 
1.7.7.6

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to