0022-Fix-keytab-option-for-MIT-Kerberos.patch 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. From: Debian Cyrus SASL Team
  2. <pkg-cyrus-sasl2-debian-devel@lists.alioth.debian.org>
  3. Date: Thu, 24 Mar 2016 11:35:05 +0100
  4. Subject: Fix keytab option for MIT Kerberos
  5. ---
  6. m4/sasl2.m4 | 1 +
  7. plugins/gssapi.c | 11 ++++++++---
  8. 2 files changed, 9 insertions(+), 3 deletions(-)
  9. diff --git a/m4/sasl2.m4 b/m4/sasl2.m4
  10. index 56e0504..a90f7b4 100644
  11. --- a/m4/sasl2.m4
  12. +++ b/m4/sasl2.m4
  13. @@ -282,6 +282,7 @@ if test "$gssapi" != no; then
  14. ])
  15. fi
  16. fi
  17. + AC_CHECK_FUNCS(krb5_gss_register_acceptor_identity)
  18. AC_CHECK_FUNCS(gss_decapsulate_token)
  19. AC_CHECK_FUNCS(gss_encapsulate_token)
  20. AC_CHECK_FUNCS(gss_oid_equal)
  21. diff --git a/plugins/gssapi.c b/plugins/gssapi.c
  22. index ff663da..7c69ac2 100644
  23. --- a/plugins/gssapi.c
  24. +++ b/plugins/gssapi.c
  25. @@ -1545,7 +1545,7 @@ static sasl_server_plug_t gssapi_server_plugins[] =
  26. };
  27. int gssapiv2_server_plug_init(
  28. -#ifndef HAVE_GSSKRB5_REGISTER_ACCEPTOR_IDENTITY
  29. +#if !defined(HAVE_GSSKRB5_REGISTER_ACCEPTOR_IDENTITY) && !defined(HAVE_KRB5_GSS_REGISTER_ACCEPTOR_IDENTITY)
  30. const sasl_utils_t *utils __attribute__((unused)),
  31. #else
  32. const sasl_utils_t *utils,
  33. @@ -1555,7 +1555,7 @@ int gssapiv2_server_plug_init(
  34. sasl_server_plug_t **pluglist,
  35. int *plugcount)
  36. {
  37. -#ifdef HAVE_GSSKRB5_REGISTER_ACCEPTOR_IDENTITY
  38. +#if defined(HAVE_GSSKRB5_REGISTER_ACCEPTOR_IDENTITY) || defined(HAVE_KRB5_GSS_REGISTER_ACCEPTOR_IDENTITY)
  39. const char *keytab = NULL;
  40. char keytab_path[1024];
  41. unsigned int rl;
  42. @@ -1565,7 +1565,7 @@ int gssapiv2_server_plug_init(
  43. return SASL_BADVERS;
  44. }
  45. -#ifdef HAVE_GSSKRB5_REGISTER_ACCEPTOR_IDENTITY
  46. +#if defined(HAVE_GSSKRB5_REGISTER_ACCEPTOR_IDENTITY) || defined(HAVE_KRB5_GSS_REGISTER_ACCEPTOR_IDENTITY)
  47. /* unfortunately, we don't check for readability of keytab if it's
  48. the standard one, since we don't know where it is */
  49. @@ -1587,7 +1587,12 @@ int gssapiv2_server_plug_init(
  50. strncpy(keytab_path, keytab, 1024);
  51. +#ifdef HAVE_GSSKRB5_REGISTER_ACCEPTOR_IDENTITY
  52. gsskrb5_register_acceptor_identity(keytab_path);
  53. +#endif
  54. +#ifdef HAVE_KRB5_GSS_REGISTER_ACCEPTOR_IDENTITY
  55. + krb5_gss_register_acceptor_identity(keytab_path);
  56. +#endif
  57. }
  58. #endif