|
|
|
@ -46,7 +46,7 @@ Index: spnegokrb5/der_put.c
|
|
|
|
|
--- spnegokrb5/der_put.c.orig 2003-09-05 10:54:08 +0200
|
|
|
|
|
+++ spnegokrb5/der_put.c 2007-12-22 14:24:51 +0100
|
|
|
|
|
@@ -37,6 +37,16 @@
|
|
|
|
|
RCSID("$Id: apache-kerberos.patch,v 1.4 2008/12/19 08:13:46 rse Exp $");
|
|
|
|
|
RCSID("$Id: apache-kerberos.patch,v 1.5 2009/03/26 18:58:04 rse Exp $");
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
+#include "config.h"
|
|
|
|
@ -62,3 +62,67 @@ Index: spnegokrb5/der_put.c
|
|
|
|
|
/*
|
|
|
|
|
* All encoding functions take a pointer `p' to first position in
|
|
|
|
|
* which to write, from the right, `len' which means the maximum
|
|
|
|
|
Index: src/mod_auth_kerb.c
|
|
|
|
|
--- src/mod_auth_kerb.c.orig 2008-12-04 11:14:03 +0100
|
|
|
|
|
+++ src/mod_auth_kerb.c 2009-03-26 19:47:27 +0100
|
|
|
|
|
@@ -170,6 +170,7 @@
|
|
|
|
|
char *krb_4_srvtab;
|
|
|
|
|
int krb_method_k4pass;
|
|
|
|
|
#endif
|
|
|
|
|
+ int krb_append_realm;
|
|
|
|
|
} kerb_auth_config;
|
|
|
|
|
|
|
|
|
|
typedef struct krb5_conn_data {
|
|
|
|
|
@@ -247,6 +248,9 @@
|
|
|
|
|
FLAG, "Enable Kerberos V4 password authentication."),
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
+ command("KrbAppendRealm", ap_set_flag_slot, krb_append_realm,
|
|
|
|
|
+ FLAG, "Append the realm name when setting $REMOTE_USER."),
|
|
|
|
|
+
|
|
|
|
|
{ NULL }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@@ -336,6 +340,7 @@
|
|
|
|
|
#ifdef KRB4
|
|
|
|
|
((kerb_auth_config *)rec)->krb_method_k4pass = 1;
|
|
|
|
|
#endif
|
|
|
|
|
+ ((kerb_auth_config *)rec)->krb_append_realm = 1;
|
|
|
|
|
return rec;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -525,6 +530,8 @@
|
|
|
|
|
if (sent_instance)
|
|
|
|
|
user = apr_pstrcat(r->pool, user, ".", sent_instance, NULL);
|
|
|
|
|
user = apr_pstrcat(r->pool, user, "@", realm, NULL);
|
|
|
|
|
+ if (conf->krb_append_realm)
|
|
|
|
|
+ user = apr_pstrcat(r->pool, user, "@", realm, NULL);
|
|
|
|
|
|
|
|
|
|
MK_USER = user;
|
|
|
|
|
MK_AUTH_TYPE = "Basic";
|
|
|
|
|
@@ -1064,6 +1071,8 @@
|
|
|
|
|
MK_AUTH_TYPE = "Basic";
|
|
|
|
|
free(name);
|
|
|
|
|
|
|
|
|
|
+ if (!conf->krb_append_realm && (name = strchr(MK_USER, '@')))
|
|
|
|
|
+ *name = '\0';
|
|
|
|
|
if (conf->krb_save_credentials)
|
|
|
|
|
store_krb5_creds(kcontext, r, conf, ccache);
|
|
|
|
|
|
|
|
|
|
@@ -1327,6 +1336,7 @@
|
|
|
|
|
gss_ctx_id_t context = GSS_C_NO_CONTEXT;
|
|
|
|
|
gss_cred_id_t server_creds = GSS_C_NO_CREDENTIAL;
|
|
|
|
|
OM_uint32 ret_flags = 0;
|
|
|
|
|
+ char *name = NULL;
|
|
|
|
|
|
|
|
|
|
*negotiate_ret_value = "\0";
|
|
|
|
|
|
|
|
|
|
@@ -1461,6 +1471,8 @@
|
|
|
|
|
MK_AUTH_TYPE = MECH_NEGOTIATE;
|
|
|
|
|
MK_USER = apr_pstrdup(r->pool, output_token.value);
|
|
|
|
|
|
|
|
|
|
+ if (!conf->krb_append_realm && (name = strchr(MK_USER, '@')))
|
|
|
|
|
+ *name = '\0';
|
|
|
|
|
if (conf->krb_save_credentials && delegated_cred != GSS_C_NO_CREDENTIAL)
|
|
|
|
|
store_gss_creds(r, conf, (char *)output_token.value, delegated_cred);
|
|
|
|
|
|
|
|
|
|