File 0104-mod_auth_kerb-5.4-longuser.patch of Package apache2-mod_auth_kerb
https://bugzilla.redhat.com/show_bug.cgi?id=867153
Patch by: jkaluza
diff -rupN mod_auth_kerb-5.4/src/mod_auth_kerb.c mod_auth_kerb-5.4-patched/src/mod_auth_kerb.c
--- mod_auth_kerb-5.4/src/mod_auth_kerb.c 2015-05-11 14:10:49.207024052 +0200
+++ mod_auth_kerb-5.4-patched/src/mod_auth_kerb.c 2015-05-11 14:10:58.346115778 +0200
@@ -80,6 +80,7 @@
#define MECH_NEGOTIATE "Negotiate"
#define SERVICE_NAME "HTTP"
+#define MAX_LOCAL_USERNAME 255
#include <httpd.h>
#include <http_config.h>
@@ -1926,13 +1927,13 @@ do_krb5_an_to_ln(request_rec *r) {
krb5_get_err_text(kcontext, code));
goto end;
}
- MK_USER_LNAME = apr_pcalloc(r->pool, strlen(MK_USER)+1);
+ MK_USER_LNAME = apr_pcalloc(r->pool, MAX_LOCAL_USERNAME+1);
if (MK_USER_LNAME == NULL) {
log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
"ap_pcalloc() failed (not enough memory)");
goto end;
}
- code = krb5_aname_to_localname(kcontext, client, strlen(MK_USER), MK_USER_LNAME);
+ code = krb5_aname_to_localname(kcontext, client, MAX_LOCAL_USERNAME, MK_USER_LNAME);
if (code) {
if (code != KRB5_LNAME_NOTRANS) {
log_rerror(APLOG_MARK, APLOG_ERR, 0, r,