From 4f8ba5ad6ac9b7153b0e13654e59f47e67b3f608 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 13 Nov 2009 10:51:14 +1100 Subject: s4:heimdal: import lorikeet-heimdal-200911122202 (commit 9291fd2d101f3eecec550178634faa94ead3e9a1) --- source4/heimdal/lib/hdb/ext.c | 28 +++++++++++++++------------- source4/heimdal/lib/hdb/hdb.c | 2 +- source4/heimdal/lib/hdb/hdb.h | 3 +++ 3 files changed, 19 insertions(+), 14 deletions(-) (limited to 'source4/heimdal/lib/hdb') diff --git a/source4/heimdal/lib/hdb/ext.c b/source4/heimdal/lib/hdb/ext.c index 8248098dc5..a8a882c6b2 100644 --- a/source4/heimdal/lib/hdb/ext.c +++ b/source4/heimdal/lib/hdb/ext.c @@ -281,12 +281,11 @@ hdb_entry_get_password(krb5_context context, HDB *db, const hdb_entry *entry, char **p) { HDB_extension *ext; - char *str; int ret; ext = hdb_find_extension(entry, choice_HDB_extension_data_password); if (ext) { - heim_utf8_string str2; + heim_utf8_string str; heim_octet_string pw; if (db->hdb_master_key_set && ext->data.u.password.mkvno) { @@ -314,13 +313,13 @@ hdb_entry_get_password(krb5_context context, HDB *db, return ret; } - str2 = pw.data; - if (str2[pw.length - 1] != '\0') { + str = pw.data; + if (str[pw.length - 1] != '\0') { krb5_set_error_message(context, EINVAL, "password malformated"); return EINVAL; } - *p = strdup(str2); + *p = strdup(str); der_free_octet_string(&pw); if (*p == NULL) { @@ -330,14 +329,17 @@ hdb_entry_get_password(krb5_context context, HDB *db, return 0; } - ret = krb5_unparse_name(context, entry->principal, &str); - if (ret == 0) { - krb5_set_error_message(context, ENOENT, "no password attributefor %s", str); - free(str); - } else - krb5_clear_error_message(context); - - return ENOENT; + { + char *name; + ret = krb5_unparse_name(context, entry->principal, &name); + if (ret == 0) { + krb5_set_error_message(context, ENOENT, "no password attributefor %s", name); + free(name); + } else + krb5_clear_error_message(context); + + return ENOENT; + } } int diff --git a/source4/heimdal/lib/hdb/hdb.c b/source4/heimdal/lib/hdb/hdb.c index c5d91b8f9d..fa70c7778d 100644 --- a/source4/heimdal/lib/hdb/hdb.c +++ b/source4/heimdal/lib/hdb/hdb.c @@ -59,7 +59,7 @@ * */ - +const int hdb_interface_version = HDB_INTERFACE_VERSION; static struct hdb_method methods[] = { #if HAVE_DB1 || HAVE_DB3 diff --git a/source4/heimdal/lib/hdb/hdb.h b/source4/heimdal/lib/hdb/hdb.h index 8eba864fd3..f34c9fb36e 100644 --- a/source4/heimdal/lib/hdb/hdb.h +++ b/source4/heimdal/lib/hdb/hdb.h @@ -53,6 +53,7 @@ enum hdb_lockop{ HDB_RLOCK, HDB_WLOCK }; #define HDB_F_GET_KRBTGT 16 /* fetch krbtgt */ #define HDB_F_GET_ANY 28 /* fetch any of client,server,krbtgt */ #define HDB_F_CANON 32 /* want canonicalition */ +#define HDB_F_ADMIN_DATA 64 /* want data that kdc don't use */ /* hdb_capability_flags */ #define HDB_CAP_F_HANDLE_ENTERPRISE_PRINCIPAL 1 @@ -245,6 +246,8 @@ struct hdb_method { krb5_error_code (*create)(krb5_context, HDB **, const char *filename); }; +extern const int hdb_interface_version; + #include #endif /* __HDB_H__ */ -- cgit