apple / ccs-pykerberos

Python Kerberos library used by CalendarServer
https://www.calendarserver.org
Apache License 2.0
117 stars 65 forks source link

support for heimdal #17

Closed macosforgebot closed 8 years ago

macosforgebot commented 13 years ago

Martin.vGagern@… originally submitted this as ticket:404


PyKerberos won't compile against Heimdal 1.3.3 on my Gentoo Linux system.

  1. Heimdal doesn't provide a gssapi/gssapi_generic.h header file
  2. The krb5_context type is declared in krb5.h
  3. krb5_kt_cursor isn't a pointer, so you can't assign NULL
  4. gss_krb5_nt_service_name is undefined, GSS_KRB5_NT_PRINCIPAL_NAME seems to be the heimdal replacement

Some of these, like the missing gss_krb5_nt_service_name, have been mentioned in ticket #⁠37 already, but it seems they never made it into the tree.

I'll attach a patch addressing the errors, but I assume it will break compatibility with MIT Kerberos. Don't know the best approach to cater for both. Maybe we should check some preprocessor macro. Or we could check the presence of certain header files in setup.py, and supply our own preprocessor macro from this information. Or we could investigate the list of libraries that krb5-config generates, as I believe e.g. libroken to be specific to Heimdal. Not sure, though.

Some functions used by the code are deprecated according to the Heimdal header file:

  1. Use krb5_xfree instead of krb5_free_unparsed_name
  2. Use krb5_get_init_creds_opt_alloc instead of krb5_get_init_creds_opt_init
  3. Use krb5_set_password instead of krb5_change_password

I haven't addressed these in my patch, as they are only warnings, but perhaps you should note them for future reference. And if MIT Kerberos provides the newer functions as well, you should switch as soon as possible.

macosforgebot commented 13 years ago

Martin.vGagern@… originally submitted this as attachment:heimdal.patch:⁠ticket:404


Fix things for Heimdal, likely break MIT

macosforgebot commented 13 years ago

@wsanchez originally submitted this as comment:1:⁠ticket:404

macosforgebot commented 13 years ago

@wsanchez originally submitted this as comment:2:⁠ticket:404

macosforgebot commented 12 years ago

@wsanchez originally submitted this as comment:3:⁠ticket:404


If I just try to change the includes:

-#include <gssapi/gssapi_generic.h>
+#include <krb5.h>

in kerberosbasic.h I get errors compiling on Mac OS, as krb5.h doesn't pull in all the symbols needed… someone with both versions needs to take the time to make a compatible fix, I guess.

macosforgebot commented 8 years ago

@wsanchez originally submitted this as comment:210:⁠ticket:404


Fixed via #⁠906