You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 10, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 10, 2026. It is now read-only.
Kerberos authentication fails with large tickets #2695
Kerberos authentication is likely to fail with Active Directory tickets due to their relatively large size, and limited allowed sizes within CUPS.
A fix has already been made to cups/auth.c, but cupsdSendHeader() in scheduler/client.c looks to be similarly restricted, as it looks like it uses a 2048 byte buffer.
I also wasn't sure whether you wanted to lose the test for the token length being zero from cups/auth.c.
Your patch wouldn't compile, but I changed the cupsd code to allocate the buffer and keep it around for the life of the scheduler, resizing as needed, so we aren't allocating and freeing all the time. The code includes an error message for tokens larger than 64k so it will be possible to debug size problems more easily.
I also added a 0-length token check to the client side - not strictly necessary, but there is no sense sending a 0-length token...
if (output_token.length > 0 && output_token.length <= 65536)
{
/*
Allocate the authorization string since Windows KDCs can have
Index: scheduler/client.c
--- scheduler/client.c (revision 7271)
+++ scheduler/client.c (working copy)
@@ -2369,7 +2369,11 @@
char type, / I - MIME type of document /
int auth_type) / I - Type of authentication */
{
Activity
michaelrsweet commentedon Jan 30, 2008
CUPS.org User: mike
Your patch wouldn't compile, but I changed the cupsd code to allocate the buffer and keep it around for the life of the scheduler, resizing as needed, so we aren't allocating and freeing all the time. The code includes an error message for tokens larger than 64k so it will be possible to debug size problems more easily.
I also added a 0-length token check to the client side - not strictly necessary, but there is no sense sending a 0-length token...
michaelrsweet commentedon Jan 30, 2008
"patch":
Index: scheduler/client.c
--- scheduler/client.c (revision 7271)
+++ scheduler/client.c (working copy)
@@ -2478,12 +2478,17 @@
*/
{
OM_uint32 minor_status; / Minor status code */
httpEncode64_2(buf, sizeof(buf),
con->gss_output_token.value,
con->gss_output_token.length);
@@ -2493,7 +2498,11 @@
"cupsdSendHeader: WWW-Authenticate: Negotiate %s", buf);
if (httpPrintf(HTTP(con), "WWW-Authenticate: Negotiate %s\r\n", buf) < 0)
}
#endif /* HAVE_GSSAPI */
michaelrsweet commentedon Jan 30, 2008
"str2695.patch":
Index: cups/auth.c
--- cups/auth.c (revision 7271)
+++ cups/auth.c (working copy)
@@ -300,7 +300,7 @@
if (major_status == GSS_S_CONTINUE_NEEDED)
DEBUG_gss_printf(major_status, minor_status, "Continuation needed!");
{
/*
Allocate the authorization string since Windows KDCs can have
--- scheduler/client.c (revision 7271)Index: scheduler/client.c
+++ scheduler/client.c (working copy)
@@ -2369,7 +2369,11 @@
char type, / I - MIME type of document /
int auth_type) / I - Type of authentication */
{
+#ifdef HAVE_GSSAPI
+#endif / HAVE_GSSAPI */
/*
@@ -2478,23 +2482,57 @@
*/
{
OM_uint32 minor_status; / Minor status code */
httpEncode64_2(gss_buf, gss_bufsize,
gss_release_buffer(&minor_status, &con->gss_output_token);
cupsdLogMessage(CUPSD_LOG_DEBUG,
if (httpPrintf(HTTP(con), "WWW-Authenticate: Negotiate %s\r\n", buf) < 0)
if (httpPrintf(HTTP(con), "WWW-Authenticate: Negotiate %s\r\n",
return (0);
}
else if (con->gss_output_token.length > 65536)
{
cupsdLogMessage(CUPSD_LOG_ERROR,
return (0);
}
#endif /* HAVE_GSSAPI */
if (con->language && strcmp(con->language->language, "C"))