Raise an exception if we cannot find a matching principal.
--- PyKerberos/trunk/src/kerberosgss.c 2007-05-18 13:53:27 UTC (rev 1540)
+++ PyKerberos/trunk/src/kerberosgss.c 2007-05-21 18:01:59 UTC (rev 1541)
@@ -90,6 +90,12 @@
krb5_free_keytab_entry_contents(kcontext, &entry);
}
+ if (result == NULL)
+ {
+ PyErr_SetObject(KrbException_class, Py_BuildValue("((s:i))",
+ "Principal not found in keytab", -1));
+ }
+
end:
if (cursor)
krb5_kt_end_seq_get(kcontext, kt, &cursor);