apple / ccs-pykerberos

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

output of get_gss_error should be available to the caller #3

Closed macosforgebot closed 18 years ago

macosforgebot commented 18 years ago

agx@… originally submitted this as ticket:51


Errorhandling in pykerberos is currently very poor - especially in the gssapi case. We can only check for 0 and -1. I see two ways out of this: we modify the functions to also return the output of get_gss_error or (what I'd like better) throw an exception that has the get_gss_error output as textual represenations. Without this, the module is kind of hard to use since there are little ways to diagnose errors. Any thoughs?

macosforgebot commented 18 years ago

@cyrusdaboo originally submitted this as comment:1:⁠ticket:51


I agree - better error handling is needed in PyKerberos. I prefer the solution of raising an exception - new exception  type should be defined in PyKerberos for that.

macosforgebot commented 18 years ago

agx@… originally submitted this as comment:2:⁠ticket:51


Just for reference a patch that implements this is here: https://honk.sigxcpu.org/unsorted-patches/pykerberos-exception-handling.diff

In case that matters (contribution terms) it's APL 2.0. I keep the patch outside of the Trac since updating patches in Trac is so cumbersome and it might need a few revisions until you're happy with it. Any comments?

Cheers,

-- Guido

macosforgebot commented 18 years ago

agx@… originally submitted this as comment:3:⁠ticket:51


...and here's the patch to move calendarserver over to the new exception aware API:

https://honk.sigxcpu.org/unsorted-patches/calendarserver-pykerberos-exceptions.diff

Cheers,

-- Guido

macosforgebot commented 18 years ago

@cyrusdaboo originally submitted this as comment:4:⁠ticket:51


Patches applied, with some minor tweaks. r271 & r272.