#include <stdio.h>
#include <stdarg.h>
-#define MODAUTHKERB_VERSION "5.1"
+#define MODAUTHKERB_VERSION "5.2"
#define MECH_NEGOTIATE "Negotiate"
#define SERVICE_NAME "HTTP"
#include <unistd.h>
#endif
+#ifndef KRB5_LIB_FUNCTION
+# if defined(_WIN32)
+# define KRB5_LIB_FUNCTION _stdcall
+# else
+# define KRB5_LIB_FUNCTION
+# endif
+#endif
+
#ifdef STANDARD20_MODULE_STUFF
module AP_MODULE_DECLARE_DATA auth_kerb_module;
#else
gss_buffer_desc status_string;
char *err_msg;
+ log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ "GSS-API major_status:%8.8x, minor_status:%8.8x",
+ err_maj, err_min);
+
err_msg = apr_pstrdup(p, prefix);
do {
maj_stat = gss_display_status (&min_stat,
GSS_C_NO_OID,
&msg_ctx,
&status_string);
- if (GSS_ERROR(maj_stat))
- break;
- err_msg = apr_pstrcat(p, err_msg, ": ", (char*) status_string.value, NULL);
- gss_release_buffer(&min_stat, &status_string);
-
+ if (!GSS_ERROR(maj_stat)) {
+ err_msg = apr_pstrcat(p, err_msg, ": ",
+ (char*) status_string.value, NULL);
+ gss_release_buffer(&min_stat, &status_string);
+ }
+ } while (!GSS_ERROR(maj_stat) && msg_ctx != 0);
+
+ msg_ctx = 0;
+ err_msg = apr_pstrcat(p, err_msg, " (", NULL);
+ do {
maj_stat = gss_display_status (&min_stat,
err_min,
GSS_C_MECH_CODE,
&msg_ctx,
&status_string);
if (!GSS_ERROR(maj_stat)) {
- err_msg = apr_pstrcat(p, err_msg,
- " (", (char*) status_string.value, ")", NULL);
+ err_msg = apr_pstrcat(p, err_msg, ", ",
+ (char *) status_string.value, NULL);
gss_release_buffer(&min_stat, &status_string);
}
} while (!GSS_ERROR(maj_stat) && msg_ctx != 0);
+ err_msg = apr_pstrcat(p, err_msg, ")", NULL);
return err_msg;
}
{
krb5_error_code ret;
krb5_context context;
- krb5_rcache id;
+ krb5_rcache id = NULL;
int found;
- memset(&id, 0, sizeof(id));
-
ret = krb5_init_context(&context);
if (ret)
return 0;
- ret = krb5_rc_resolve_type(context, &id, type);
+ ret = krb5_rc_resolve_full(context, &id, "none:");
found = (ret == 0);
+ if (ret == 0)
+ krb5_rc_destroy(context, id);
krb5_free_context(context);
return found;