File: mod_auth_kerb-5.4-longuser.patch

package info (click to toggle)
libapache-mod-auth-kerb 5.4-2.4
  • links: PTS
  • area: main
  • in suites: bullseye, sid
  • size: 636 kB
  • sloc: ansic: 3,236; makefile: 92; sh: 4
file content (31 lines) | stat: -rw-r--r-- 966 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

https://bugzilla.redhat.com/show_bug.cgi?id=867153

Patch by: jkaluza

--- a/src/mod_auth_kerb.c
+++ b/src/mod_auth_kerb.c
@@ -80,6 +80,7 @@
 
 #define MECH_NEGOTIATE "Negotiate"
 #define SERVICE_NAME "HTTP"
+#define MAX_LOCAL_USERNAME 255
 
 #include <httpd.h>
 #include <http_config.h>
@@ -1824,13 +1825,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,