summaryrefslogtreecommitdiff
path: root/source4/auth
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2005-12-05 01:38:26 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:47:02 -0500
commit42f2bfbd9b13f0abec00d046f5e0b60fcaf343ef (patch)
treef82d1eaaecd0b5cd0217acf6205d5cfd2dc5897c /source4/auth
parentf8a44902f49605f1089284c0e7208ac934a04907 (diff)
downloadsamba-42f2bfbd9b13f0abec00d046f5e0b60fcaf343ef.tar.gz
samba-42f2bfbd9b13f0abec00d046f5e0b60fcaf343ef.tar.bz2
samba-42f2bfbd9b13f0abec00d046f5e0b60fcaf343ef.zip
r12059: Use random keytab names (so we get different keytabs, rather than
share the MEMORY: keytab). Andrew Bartlett (This used to be commit 6c43de27086d3c463891598eb55a44877194cb0d)
Diffstat (limited to 'source4/auth')
-rw-r--r--source4/auth/kerberos/kerberos_util.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/source4/auth/kerberos/kerberos_util.c b/source4/auth/kerberos/kerberos_util.c
index 3437c943bb..a9ea6f9db3 100644
--- a/source4/auth/kerberos/kerberos_util.c
+++ b/source4/auth/kerberos/kerberos_util.c
@@ -611,7 +611,8 @@ int create_memory_keytab(TALLOC_CTX *parent_ctx,
{
krb5_error_code ret;
TALLOC_CTX *mem_ctx = talloc_new(parent_ctx);
- const char *keytab_name = "MEMORY:";
+ const char *rand_string;
+ const char *keytab_name;
krb5_keytab keytab;
if (!mem_ctx) {
return ENOMEM;
@@ -619,6 +620,19 @@ int create_memory_keytab(TALLOC_CTX *parent_ctx,
*keytab_container = talloc(mem_ctx, struct keytab_container);
+ rand_string = generate_random_str(mem_ctx, 16);
+ if (!rand_string) {
+ talloc_free(mem_ctx);
+ return ENOMEM;
+ }
+
+ keytab_name = talloc_asprintf(mem_ctx, "MEMORY:%s",
+ rand_string);
+ if (!keytab_name) {
+ talloc_free(mem_ctx);
+ return ENOMEM;
+ }
+
/* Find the keytab */
ret = krb5_kt_resolve(smb_krb5_context->krb5_context, keytab_name, &keytab);
if (ret) {