[PATCH v4] Support for Heimdal's unified krb5 and hdb plugin system.
Jelmer Vernooij
jelmer at samba.org
Thu Jan 16 04:51:51 MST 2014
On Thu, Jan 16, 2014 at 04:00:58PM +1300, Andrew Bartlett wrote:
> I've actually compiled and tested this version, and it works (with the
> matching Heimdal patch, attached for the interest of others). Can I get
> your review on this one?
Reviewed-By: Jelmer Vernooij <jelmer at samba.org>
> On Fri, 2014-01-10 at 17:20 -0600, Jeffrey Clark wrote:
> > Fixes exportkeytab and a kdc crash when building against heimdal master.
> >
> > Bug-Debian: http://bugs.debian.org/732342
> > ---
> > source4/kdc/hdb-samba4-plugin.c | 16 ++++++++++++++++
> > 1 file changed, 16 insertions(+)
> >
> > diff --git a/source4/kdc/hdb-samba4-plugin.c b/source4/kdc/hdb-samba4-plugin.c
> > index 9135df8..cc38a60 100644
> > --- a/source4/kdc/hdb-samba4-plugin.c
> > +++ b/source4/kdc/hdb-samba4-plugin.c
> > @@ -70,6 +70,18 @@ static krb5_error_code hdb_samba4_create(krb5_context context, struct HDB **db,
> > return EINVAL;
> > }
> >
> > +#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 +91,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
> > };
>
> --
> Andrew Bartlett
> http://samba.org/~abartlet/
> Authentication Developer, Samba Team http://samba.org
> Samba Developer, Catalyst IT http://catalyst.net.nz/services/samba
>
>
>
> Description: Fix HDB .so loading
> As suggeste by Love Hörnquist Åstrand <lha at kth.se>
> .
> Author: Love Hörnquist Åstrand <lha at kth.se>
> Bug-Debian: http://bugs.debian.org/732342
>
> ---
>
> --- heimdal-1.6~git20131117+dfsg.orig/lib/hdb/hdb.c
> +++ heimdal-1.6~git20131117+dfsg/lib/hdb/hdb.c
> @@ -391,10 +391,12 @@ struct cb_s {
> static krb5_error_code KRB5_LIB_CALL
> callback(krb5_context context, const void *plug, void *plugctx, void *userctx)
> {
> + const struct hdb_method *h = (const struct hdb_method *)plug;
> struct cb_s *cb_ctx = (struct cb_s *)userctx;
>
> - if (strncmp (cb_ctx->filename, cb_ctx->h->prefix, strlen(cb_ctx->h->prefix)) == 0) {
> - cb_ctx->residual = cb_ctx->filename + strlen(cb_ctx->h->prefix);
> + if (strncmp (cb_ctx->filename, h->prefix, strlen(h->prefix)) == 0) {
> + cb_ctx->residual = cb_ctx->filename + strlen(h->prefix);
> + cb_ctx->h = h;
> return 0;
> }
> return KRB5_PLUGIN_NO_HANDLE;
--
More information about the samba-technical
mailing list