summaryrefslogtreecommitdiff
path: root/source4/auth/gensec
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-12-29 22:33:27 +1100
committerAndrew Bartlett <abartlet@samba.org>2011-12-29 22:33:27 +1100
commit5316e86f5c8e2aaf4cc58d9329c7f9d58156eb88 (patch)
treec3432a39ad664b34e9d152b9be59fa81e9a494b1 /source4/auth/gensec
parenta085446d0c204aecaad2c45b8364dc7c5b1cbc6e (diff)
downloadsamba-5316e86f5c8e2aaf4cc58d9329c7f9d58156eb88.tar.gz
samba-5316e86f5c8e2aaf4cc58d9329c7f9d58156eb88.tar.bz2
samba-5316e86f5c8e2aaf4cc58d9329c7f9d58156eb88.zip
s4-gensec: Rename memory contexts in gensec_krb5 for greater clarity
This should better follow the mem_ctx/tmp_ctx pattern used elsewhere in Samba. Thankyou Simo for the suggestion. Andrew Bartlett
Diffstat (limited to 'source4/auth/gensec')
-rw-r--r--source4/auth/gensec/gensec_krb5.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/source4/auth/gensec/gensec_krb5.c b/source4/auth/gensec/gensec_krb5.c
index d5f5f8a438..573a4c9a67 100644
--- a/source4/auth/gensec/gensec_krb5.c
+++ b/source4/auth/gensec/gensec_krb5.c
@@ -612,7 +612,7 @@ static NTSTATUS gensec_krb5_session_key(struct gensec_security *gensec_security,
}
static NTSTATUS gensec_krb5_session_info(struct gensec_security *gensec_security,
- TALLOC_CTX *mem_ctx_out,
+ TALLOC_CTX *mem_ctx,
struct auth_session_info **_session_info)
{
NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
@@ -628,8 +628,8 @@ static NTSTATUS gensec_krb5_session_info(struct gensec_security *gensec_security
krb5_error_code ret;
- TALLOC_CTX *mem_ctx = talloc_new(mem_ctx_out);
- if (!mem_ctx) {
+ TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
+ if (!tmp_ctx) {
return NT_STATUS_NO_MEMORY;
}
@@ -637,8 +637,8 @@ static NTSTATUS gensec_krb5_session_info(struct gensec_security *gensec_security
if (ret) {
DEBUG(5, ("krb5_ticket_get_client failed to get cleint principal: %s\n",
smb_get_krb5_error_message(context,
- ret, mem_ctx)));
- talloc_free(mem_ctx);
+ ret, tmp_ctx)));
+ talloc_free(tmp_ctx);
return NT_STATUS_NO_MEMORY;
}
@@ -647,9 +647,9 @@ static NTSTATUS gensec_krb5_session_info(struct gensec_security *gensec_security
if (ret) {
DEBUG(1, ("Unable to parse client principal: %s\n",
smb_get_krb5_error_message(context,
- ret, mem_ctx)));
+ ret, tmp_ctx)));
krb5_free_principal(context, client_principal);
- talloc_free(mem_ctx);
+ talloc_free(tmp_ctx);
return NT_STATUS_NO_MEMORY;
}
@@ -661,14 +661,14 @@ static NTSTATUS gensec_krb5_session_info(struct gensec_security *gensec_security
/* NO pac */
DEBUG(5, ("krb5_ticket_get_authorization_data_type failed to find PAC: %s\n",
smb_get_krb5_error_message(context,
- ret, mem_ctx)));
+ ret, tmp_ctx)));
} else {
/* Found pac */
- pac_blob = data_blob_talloc(mem_ctx, pac_data.data, pac_data.length);
+ pac_blob = data_blob_talloc(tmp_ctx, pac_data.data, pac_data.length);
if (!pac_blob.data) {
free(principal_string);
krb5_free_principal(context, client_principal);
- talloc_free(mem_ctx);
+ talloc_free(tmp_ctx);
return NT_STATUS_NO_MEMORY;
}
@@ -683,14 +683,14 @@ static NTSTATUS gensec_krb5_session_info(struct gensec_security *gensec_security
if (!NT_STATUS_IS_OK(nt_status)) {
free(principal_string);
krb5_free_principal(context, client_principal);
- talloc_free(mem_ctx);
+ talloc_free(tmp_ctx);
return nt_status;
}
pac_blob_ptr = &pac_blob;
}
- nt_status = gensec_generate_session_info_pac(mem_ctx,
+ nt_status = gensec_generate_session_info_pac(tmp_ctx,
gensec_security,
gensec_krb5_state->smb_krb5_context,
pac_blob_ptr, principal_string,
@@ -701,20 +701,20 @@ static NTSTATUS gensec_krb5_session_info(struct gensec_security *gensec_security
krb5_free_principal(context, client_principal);
if (!NT_STATUS_IS_OK(nt_status)) {
- talloc_free(mem_ctx);
+ talloc_free(tmp_ctx);
return nt_status;
}
nt_status = gensec_krb5_session_key(gensec_security, session_info, &session_info->session_key);
if (!NT_STATUS_IS_OK(nt_status)) {
- talloc_free(mem_ctx);
+ talloc_free(tmp_ctx);
return nt_status;
}
- *_session_info = talloc_steal(mem_ctx_out, session_info);
+ *_session_info = talloc_steal(mem_ctx, session_info);
- talloc_free(mem_ctx);
+ talloc_free(tmp_ctx);
return NT_STATUS_OK;
}