summaryrefslogtreecommitdiffstats
path: root/source3
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2010-02-16 09:16:42 -0500
committerKarolin Seeger <kseeger@samba.org>2010-02-17 16:57:58 +0100
commit45b2e94043134673cd7a31cba23574cd2bddd298 (patch)
treed48efce6cc2b64d35f9ebf0d0d3e9c6336fe55e3 /source3
parent27b8ae5d61c91d84e34de66d4071a52bb5ca9751 (diff)
downloadsamba-45b2e94043134673cd7a31cba23574cd2bddd298.tar.gz
samba-45b2e94043134673cd7a31cba23574cd2bddd298.tar.xz
samba-45b2e94043134673cd7a31cba23574cd2bddd298.zip
cifs.upcall: allocate a talloc context for smb_krb5_unparse_name
cifs.upcall calls smb_krb5_unparse_name with a NULL talloc context. Older versions of this function though will conditionally use SMB_REALLOC instead of TALLOC_REALLOC when a NULL context is passed in. To make it more consistent, just spawn a talloc context that we can pass into this function. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=565446 https://bugzilla.samba.org/show_bug.cgi?id=6868 Reported-by: Ludek Finstrle <luf@seznam.cz> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Günther Deschner <gd@samba.org> (cherry picked from commit a8cc2fa09ed43a167f62711bef363a5ac335dc78) Fix bug #6868 (make bin/cifs.upcall fails). (cherry picked from commit fa8d57323c0ff4f92f0aca57b41d237340121720)
Diffstat (limited to 'source3')
-rw-r--r--source3/client/cifs.upcall.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/client/cifs.upcall.c b/source3/client/cifs.upcall.c
index 1617e0ef9a1..d573e76a6cd 100644
--- a/source3/client/cifs.upcall.c
+++ b/source3/client/cifs.upcall.c
@@ -55,6 +55,7 @@ get_tgt_time(const char *ccname) {
krb5_principal principal;
time_t credtime = 0;
char *realm = NULL;
+ TALLOC_CTX *mem_ctx;
if (krb5_init_context(&context)) {
syslog(LOG_DEBUG, "%s: unable to init krb5 context", __func__);
@@ -86,9 +87,10 @@ get_tgt_time(const char *ccname) {
goto err_ccstart;
}
+ mem_ctx = talloc_init("cifs.upcall");
while (!credtime && !krb5_cc_next_cred(context, ccache, &cur, &creds)) {
char *name;
- if (smb_krb5_unparse_name(NULL, context, creds.server, &name)) {
+ if (smb_krb5_unparse_name(mem_ctx, context, creds.server, &name)) {
syslog(LOG_DEBUG, "%s: unable to unparse name", __func__);
goto err_endseq;
}
@@ -101,6 +103,7 @@ get_tgt_time(const char *ccname) {
TALLOC_FREE(name);
}
err_endseq:
+ TALLOC_FREE(mem_ctx);
krb5_cc_end_seq_get(context, ccache, &cur);
err_ccstart:
krb5_free_principal(context, principal);