The branch, master has been updated via e758f41 kdc: Add belts-and-braces check that we fail if the hdb version changes via 3682080 Support for Heimdal's unified krb5 and hdb plugin system. from 1db4d38 s3-winbind: separate child response sock write
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit e758f4111356fafce5b5c8393648c9ea5c400601 Author: Andrew Bartlett <abart...@samba.org> Date: Tue Jan 14 11:23:04 2014 +1300 kdc: Add belts-and-braces check that we fail if the hdb version changes This checks both if host system run-time Heimdal has changed version, and that the build-time version is supported. Signed-off-by: Andrew Bartlett <abart...@samba.org> Reviewed-By: Jelmer Vernooij <jel...@samba.org> Autobuild-User(master): Andrew Bartlett <abart...@samba.org> Autobuild-Date(master): Mon Jan 20 22:26:49 CET 2014 on sn-devel-104 commit 368208069e33a6d9b78a90f7326d5ac1bdd204f7 Author: Jeffrey Clark <d...@zaplabs.com> Date: Fri Jan 10 17:20:14 2014 -0600 Support for Heimdal's unified krb5 and hdb plugin system. Fixes exportkeytab and a kdc crash when building against heimdal master. Bug-Debian: http://bugs.debian.org/732342 Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Jelmer Vernooij <jel...@samba.org> ----------------------------------------------------------------------- Summary of changes: source4/kdc/hdb-samba4-plugin.c | 22 ++++++++++++++++++++++ source4/kdc/hdb-samba4.c | 5 +++++ 2 files changed, 27 insertions(+), 0 deletions(-) Changeset truncated at 500 lines: diff --git a/source4/kdc/hdb-samba4-plugin.c b/source4/kdc/hdb-samba4-plugin.c index 9135df8..6f76124 100644 --- a/source4/kdc/hdb-samba4-plugin.c +++ b/source4/kdc/hdb-samba4-plugin.c @@ -60,6 +60,8 @@ static krb5_error_code hdb_samba4_create(krb5_context context, struct HDB **db, if (NT_STATUS_IS_OK(nt_status)) { return 0; + } else if (NT_STATUS_EQUAL(nt_status, NT_STATUS_ERROR_DS_INCOMPATIBLE_VERSION)) { + return EINVAL; } else if (NT_STATUS_EQUAL(nt_status, NT_STATUS_CANT_ACCESS_DOMAIN_INFO)) { krb5_set_error_message(context, EINVAL, "Failed to open Samba4 LDB at %s", lpcfg_private_path(base_ctx, base_ctx->lp_ctx, "sam.ldb")); @@ -70,6 +72,22 @@ static krb5_error_code hdb_samba4_create(krb5_context context, struct HDB **db, return EINVAL; } +#if (HDB_INTERFACE_VERSION != 8 && HDB_INTERFACE_VERSION != 7) +#error "Unsupported Heimdal HDB version" +#endif + +#if HDB_INTERFACE_VERSION >= 8 +static krb5_error_code hdb_samba4_init(krb5_context context, void **ctx) +{ + *ctx = NULL; + return 0; +} + +static void hdb_samba4_fini(void *ctx) +{ +} +#endif + /* Only used in the hdb-backed keytab code * for a keytab of 'samba4&<address>' or samba4, to find * kpasswd's key in the main DB, and to @@ -79,6 +97,10 @@ static krb5_error_code hdb_samba4_create(krb5_context context, struct HDB **db, */ struct hdb_method hdb_samba4_interface = { HDB_INTERFACE_VERSION, +#if HDB_INTERFACE_VERSION >= 8 + .init = hdb_samba4_init, + .fini = hdb_samba4_fini, +#endif .prefix = "samba4", .create = hdb_samba4_create }; diff --git a/source4/kdc/hdb-samba4.c b/source4/kdc/hdb-samba4.c index 6a9e558..4519fb9 100644 --- a/source4/kdc/hdb-samba4.c +++ b/source4/kdc/hdb-samba4.c @@ -176,6 +176,11 @@ NTSTATUS hdb_samba4_create_kdc(struct samba_kdc_base_context *base_ctx, struct samba_kdc_db_context *kdc_db_ctx; NTSTATUS nt_status; + if (hdb_interface_version != HDB_INTERFACE_VERSION) { + krb5_set_error_message(context, EINVAL, "Heimdal HDB interface version mismatch between build-time and run-time libraries!"); + return NT_STATUS_ERROR_DS_INCOMPATIBLE_VERSION; + } + *db = talloc(base_ctx, HDB); if (!*db) { krb5_set_error_message(context, ENOMEM, "malloc: out of memory"); -- Samba Shared Repository