summaryrefslogtreecommitdiff
path: root/source4/heimdal/lib/krb5
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2005-12-15 20:38:24 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:47:26 -0500
commitfbf106f6701c580f5839da575996de34fc953e1f (patch)
tree3691623409aab4ff0ede4b50cc4fcbfa255814f3 /source4/heimdal/lib/krb5
parentd8966dcd7e88df9817c81434056628c0beff21e3 (diff)
downloadsamba-fbf106f6701c580f5839da575996de34fc953e1f.tar.gz
samba-fbf106f6701c580f5839da575996de34fc953e1f.tar.bz2
samba-fbf106f6701c580f5839da575996de34fc953e1f.zip
r12269: Update to current lorikeet-heimdal. This changed the way the hdb
interface worked, so hdb-ldb.c and the glue have been updated. Andrew Bartlett (This used to be commit 8fd5224c6b5c17c3a2c04c7366b7e367012db77e)
Diffstat (limited to 'source4/heimdal/lib/krb5')
-rw-r--r--source4/heimdal/lib/krb5/cache.c14
-rw-r--r--source4/heimdal/lib/krb5/changepw.c11
-rw-r--r--source4/heimdal/lib/krb5/crypto.c13
-rw-r--r--source4/heimdal/lib/krb5/keytab_memory.c14
-rw-r--r--source4/heimdal/lib/krb5/krb5-protos.h9
-rw-r--r--source4/heimdal/lib/krb5/krb5_locl.h10
-rw-r--r--source4/heimdal/lib/krb5/principal.c2
-rw-r--r--source4/heimdal/lib/krb5/set_default_realm.c15
8 files changed, 48 insertions, 40 deletions
diff --git a/source4/heimdal/lib/krb5/cache.c b/source4/heimdal/lib/krb5/cache.c
index 0c821cb11d..efb2ad1374 100644
--- a/source4/heimdal/lib/krb5/cache.c
+++ b/source4/heimdal/lib/krb5/cache.c
@@ -33,7 +33,7 @@
#include "krb5_locl.h"
-RCSID("$Id: cache.c,v 1.76 2005/11/29 09:10:47 lha Exp $");
+RCSID("$Id: cache.c,v 1.77 2005/12/13 15:42:36 lha Exp $");
/*
* Add a new ccache type with operations `ops', overwriting any
@@ -358,14 +358,12 @@ krb5_cc_set_default_name(krb5_context context, const char *name)
if (e == NULL) {
e = krb5_config_get_string(context, NULL, "libdefaults",
"default_cc_name", NULL);
- if (e) {
- ret = _krb5_expand_default_cc_name(context, e, &p);
- if (ret)
- return ret;
- }
+ if (e == NULL)
+ e = KRB5_DEFAULT_CCNAME;
+ ret = _krb5_expand_default_cc_name(context, e, &p);
+ if (ret)
+ return ret;
}
- if (e == NULL)
- asprintf(&p,"FILE:/tmp/krb5cc_%u", (unsigned)getuid());
} else
p = strdup(name);
diff --git a/source4/heimdal/lib/krb5/changepw.c b/source4/heimdal/lib/krb5/changepw.c
index c3cd6d4db9..7907e1ad9c 100644
--- a/source4/heimdal/lib/krb5/changepw.c
+++ b/source4/heimdal/lib/krb5/changepw.c
@@ -33,7 +33,7 @@
#include <krb5_locl.h>
-RCSID("$Id: changepw.c,v 1.54 2005/09/08 11:38:01 lha Exp $");
+RCSID("$Id: changepw.c,v 1.55 2005/12/12 12:48:57 lha Exp $");
static void
str2data (krb5_data *d,
@@ -522,7 +522,12 @@ change_password_loop (krb5_context context,
int sock;
int i;
int done = 0;
- krb5_realm realm = creds->client->realm;
+ krb5_realm realm;
+
+ if (targprinc)
+ realm = targprinc->realm;
+ else
+ realm = creds->client->realm;
ret = krb5_auth_con_init (context, &auth_context);
if (ret)
@@ -712,7 +717,7 @@ krb5_set_password(krb5_context context,
for (i = 0; procs[i].name != NULL; i++) {
*result_code = 0;
- ret = change_password_loop(context, creds, targprinc, newpw,
+ ret = change_password_loop(context, creds, principal, newpw,
result_code, result_code_string,
result_string,
&procs[i]);
diff --git a/source4/heimdal/lib/krb5/crypto.c b/source4/heimdal/lib/krb5/crypto.c
index 2e23306c96..de40b059b8 100644
--- a/source4/heimdal/lib/krb5/crypto.c
+++ b/source4/heimdal/lib/krb5/crypto.c
@@ -32,7 +32,7 @@
*/
#include "krb5_locl.h"
-RCSID("$Id: crypto.c,v 1.129 2005/09/19 22:13:54 lha Exp $");
+RCSID("$Id: crypto.c,v 1.130 2005/12/02 14:47:44 lha Exp $");
#undef CRYPTO_DEBUG
#ifdef CRYPTO_DEBUG
@@ -3942,6 +3942,8 @@ krb5_derive_key(krb5_context context,
struct encryption_type *et;
struct key_data d;
+ *derived_key = NULL;
+
et = _find_enctype (etype);
if (et == NULL) {
krb5_set_error_string(context, "encryption type %d not supported",
@@ -3949,16 +3951,15 @@ krb5_derive_key(krb5_context context,
return KRB5_PROG_ETYPE_NOSUPP;
}
- ret = krb5_copy_keyblock(context, key, derived_key);
+ ret = krb5_copy_keyblock(context, key, &d.key);
if (ret)
return ret;
- d.key = *derived_key;
d.schedule = NULL;
ret = derive_key(context, et, &d, constant, constant_len);
- if (ret)
- return ret;
- ret = krb5_copy_keyblock(context, d.key, derived_key);
+ if (ret == 0)
+ ret = krb5_copy_keyblock(context, d.key, derived_key);
+ free_key_data(context, &d);
return ret;
}
diff --git a/source4/heimdal/lib/krb5/keytab_memory.c b/source4/heimdal/lib/krb5/keytab_memory.c
index 1039847de9..fa54ff43ce 100644
--- a/source4/heimdal/lib/krb5/keytab_memory.c
+++ b/source4/heimdal/lib/krb5/keytab_memory.c
@@ -33,7 +33,7 @@
#include "krb5_locl.h"
-RCSID("$Id: keytab_memory.c,v 1.7 2005/12/01 12:40:22 lha Exp $");
+RCSID("$Id: keytab_memory.c,v 1.8 2005/12/05 18:39:46 lha Exp $");
/* memory operations -------------------------------------------- */
@@ -214,15 +214,9 @@ mkt_remove_entry(krb5_context context,
krb5_clear_error_string (context);
return KRB5_KT_NOTFOUND;
}
- if (d->num_entries == 0) {
- free(d->entries);
- d->entries = NULL;
- } else {
- e = realloc(d->entries, d->num_entries * sizeof(*d->entries));
- if(e != NULL)
- d->entries = e;
- }
-
+ e = realloc(d->entries, d->num_entries * sizeof(*d->entries));
+ if(e != NULL || d->num_entries == 0)
+ d->entries = e;
return 0;
}
diff --git a/source4/heimdal/lib/krb5/krb5-protos.h b/source4/heimdal/lib/krb5/krb5-protos.h
index 301b8853e4..c08d8058a4 100644
--- a/source4/heimdal/lib/krb5/krb5-protos.h
+++ b/source4/heimdal/lib/krb5/krb5-protos.h
@@ -21,21 +21,12 @@ extern "C" {
#endif
void
-initialize_heim_error_table (void);
-
-void
initialize_heim_error_table_r (struct et_list **/*list*/);
void
-initialize_k524_error_table (void);
-
-void
initialize_k524_error_table_r (struct et_list **/*list*/);
void
-initialize_krb5_error_table (void);
-
-void
initialize_krb5_error_table_r (struct et_list **/*list*/);
krb5_error_code KRB5_LIB_FUNCTION
diff --git a/source4/heimdal/lib/krb5/krb5_locl.h b/source4/heimdal/lib/krb5/krb5_locl.h
index 4a02677239..60d72c8f80 100644
--- a/source4/heimdal/lib/krb5/krb5_locl.h
+++ b/source4/heimdal/lib/krb5/krb5_locl.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*/
-/* $Id: krb5_locl.h,v 1.83 2005/10/07 12:08:02 lha Exp $ */
+/* $Id: krb5_locl.h,v 1.84 2005/12/13 15:40:50 lha Exp $ */
#ifndef __KRB5_LOCL_H__
#define __KRB5_LOCL_H__
@@ -170,6 +170,14 @@ struct _krb5_krb_auth_data;
#define KRB5_BUFSIZ 1024
+#ifndef KRB5_DEFAULT_CCNAME
+#ifdef __APPLE__
+#define KRB5_DEFAULT_CCNAME "API:"
+#else
+#define KRB5_DEFAULT_CCNAME "FILE:/tmp/krb5cc_%{uid}"
+#endif
+#endif
+
typedef enum {
KRB5_PA_PAC_DONT_CARE = 0,
KRB5_PA_PAC_REQ_TRUE,
diff --git a/source4/heimdal/lib/krb5/principal.c b/source4/heimdal/lib/krb5/principal.c
index ae5c8c1de8..6cc49945cc 100644
--- a/source4/heimdal/lib/krb5/principal.c
+++ b/source4/heimdal/lib/krb5/principal.c
@@ -41,7 +41,7 @@
#include <fnmatch.h>
#include "resolve.h"
-RCSID("$Id: principal.c,v 1.91 2005/08/23 08:34:40 lha Exp $");
+RCSID("$Id: principal.c,v 1.92 2005/12/11 17:48:13 lha Exp $");
#define princ_num_comp(P) ((P)->name.name_string.len)
#define princ_type(P) ((P)->name.name_type)
diff --git a/source4/heimdal/lib/krb5/set_default_realm.c b/source4/heimdal/lib/krb5/set_default_realm.c
index 965883309c..fd57b6fe67 100644
--- a/source4/heimdal/lib/krb5/set_default_realm.c
+++ b/source4/heimdal/lib/krb5/set_default_realm.c
@@ -77,8 +77,19 @@ krb5_set_default_realm(krb5_context context,
"libdefaults",
"default_realm",
NULL);
- if (realms == NULL)
- ret = krb5_get_host_realm(context, NULL, &realms);
+ if (realms == NULL) {
+ char hostname[MAXHOSTNAMELEN];
+ if (gethostname (hostname, sizeof(hostname))) {
+ return errno;
+ }
+
+ if (strchr(hostname, '.') == NULL) {
+ /* There is no way we can get this mapping, as we can't do DNS */
+ return KRB5_CONFIG_NODEFREALM;
+ }
+ ret = krb5_get_host_realm(context, hostname,
+ &realms);
+ }
} else {
ret = string_to_list (context, realm, &realms);
}