summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2012-04-01 19:08:15 -0400
committerAndreas Schneider <asn@samba.org>2012-04-12 12:06:43 +0200
commita925c2c48d07cd4f074325954d933e194b4704d8 (patch)
treeecbe94783a4a9a1ccf8f9ddaad4d717dfe6a3f67 /source4
parentc13c065a9b92c1abf17e999649ea6bb620615d6f (diff)
downloadsamba-a925c2c48d07cd4f074325954d933e194b4704d8.tar.gz
samba-a925c2c48d07cd4f074325954d933e194b4704d8.tar.bz2
samba-a925c2c48d07cd4f074325954d933e194b4704d8.zip
srv_keytab: Pass krb5_context directly, it's all we use anyways.
Signed-off-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source4')
-rw-r--r--source4/auth/kerberos/srv_keytab.c27
-rw-r--r--source4/dsdb/samdb/ldb_modules/update_keytab.c2
2 files changed, 12 insertions, 17 deletions
diff --git a/source4/auth/kerberos/srv_keytab.c b/source4/auth/kerberos/srv_keytab.c
index cdf384e8b3..ca2d3853da 100644
--- a/source4/auth/kerberos/srv_keytab.c
+++ b/source4/auth/kerberos/srv_keytab.c
@@ -494,7 +494,7 @@ static krb5_error_code remove_old_entries(TALLOC_CTX *parent_ctx,
}
krb5_error_code smb_krb5_update_keytab(TALLOC_CTX *parent_ctx,
- struct smb_krb5_context *smb_krb5_context,
+ krb5_context context,
const char *keytab_name,
const char *samAccountName,
const char *realm,
@@ -519,12 +519,10 @@ krb5_error_code smb_krb5_update_keytab(TALLOC_CTX *parent_ctx,
return ENOENT;
}
- ret = krb5_kt_resolve(smb_krb5_context->krb5_context,
- keytab_name, &keytab);
+ ret = krb5_kt_resolve(context, keytab_name, &keytab);
if (ret) {
- *error_string = smb_get_krb5_error_message(
- smb_krb5_context->krb5_context,
- ret, parent_ctx);
+ *error_string = smb_get_krb5_error_message(context,
+ ret, parent_ctx);
return ret;
}
@@ -538,8 +536,7 @@ krb5_error_code smb_krb5_update_keytab(TALLOC_CTX *parent_ctx,
/* Get the principal we will store the new keytab entries under */
ret = principals_from_list(tmp_ctx,
samAccountName, realm, SPNs, num_SPNs,
- smb_krb5_context->krb5_context,
- &principals, error_string);
+ context, &principals, error_string);
if (ret != 0) {
*error_string = talloc_asprintf(parent_ctx,
@@ -549,8 +546,7 @@ krb5_error_code smb_krb5_update_keytab(TALLOC_CTX *parent_ctx,
}
ret = remove_old_entries(tmp_ctx, kvno, principals, delete_all_kvno,
- smb_krb5_context->krb5_context,
- keytab, &found_previous, error_string);
+ context, keytab, &found_previous, error_string);
if (ret != 0) {
*error_string = talloc_asprintf(parent_ctx,
"Failed to remove old principals from keytab: %s\n",
@@ -567,8 +563,7 @@ krb5_error_code smb_krb5_update_keytab(TALLOC_CTX *parent_ctx,
samAccountName, realm, saltPrincipal,
kvno, new_secret, old_secret,
supp_enctypes, principals,
- smb_krb5_context->krb5_context,
- keytab,
+ context, keytab,
found_previous ? false : true,
error_string);
if (ret) {
@@ -582,16 +577,16 @@ krb5_error_code smb_krb5_update_keytab(TALLOC_CTX *parent_ctx,
}
done:
- keytab_principals_free(smb_krb5_context->krb5_context, principals);
+ keytab_principals_free(context, principals);
if (ret != 0 || _keytab == NULL) {
- krb5_kt_close(smb_krb5_context->krb5_context, keytab);
+ krb5_kt_close(context, keytab);
}
talloc_free(tmp_ctx);
return ret;
}
krb5_error_code smb_krb5_create_memory_keytab(TALLOC_CTX *parent_ctx,
- struct smb_krb5_context *smb_krb5_context,
+ krb5_context context,
const char *new_secret,
const char *samAccountName,
const char *realm,
@@ -620,7 +615,7 @@ krb5_error_code smb_krb5_create_memory_keytab(TALLOC_CTX *parent_ctx,
}
- ret = smb_krb5_update_keytab(mem_ctx, smb_krb5_context,
+ ret = smb_krb5_update_keytab(mem_ctx, context,
*keytab_name, samAccountName, realm,
NULL, 0, NULL, new_secret, NULL,
kvno, ENC_ALL_TYPES,
diff --git a/source4/dsdb/samdb/ldb_modules/update_keytab.c b/source4/dsdb/samdb/ldb_modules/update_keytab.c
index f1ec9953fb..f07d9b2aad 100644
--- a/source4/dsdb/samdb/ldb_modules/update_keytab.c
+++ b/source4/dsdb/samdb/ldb_modules/update_keytab.c
@@ -431,7 +431,7 @@ static int update_kt_prepare_commit(struct ldb_module *module)
}
}
- krb5_ret = smb_krb5_update_keytab(tmp_ctx, smb_krb5_context,
+ krb5_ret = smb_krb5_update_keytab(tmp_ctx, smb_krb5_context->krb5_context,
keytab_name_from_msg(tmp_ctx, ldb, p->msg),
ldb_msg_find_attr_as_string(p->msg, "samAccountName", NULL),
realm, (const char **)SPNs, num_SPNs,