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.
IPP backend fails to trigger authentication prompts when a username/password is required #3985
When printing from an Ubuntu client running CUPS 1.5 to a server requiring authentication, no prompting occurs for username and password. Originally, the bug was reported at https://bugs.launchpad.net/ubuntu/+source/cups/+bug/879625, and applied to connections over TLS. This looks almost like a duplicate of STR #3933. Unlike STR #3933, I have also replicated this behaviour without SSL.
The problem here seems to be with backend/ipp.c. After the Kerberos support was added, the auth_info_required variable was left blank by default. This is used to generate the "ATTR: auth_info_required=%s" text that specifies the authentication method needed. In the case of Kerberos authentication, this is set to "negotiate", but when non-Kerberos methods are used, this now remains unset, unlike CUPS 1.4. The attached patch restores the "username,password" text that is needed to trigger the authentication prompt, and works for applications in Ubuntu. There is no reason to think that this would not work for RedHat 5.7 too.
This patch is not correct; it will set auth-info-required to username,password even if the WWW-Authenticate header is blank.
What needs to happen is for the password callback to be set unconditionally - right now we only set auth_info_required to username,password when a username or password is passed in the URI or environment already...
Activity
michaelrsweet commentedon Feb 11, 2012
CUPS.org User: mike
This patch is not correct; it will set auth-info-required to username,password even if the WWW-Authenticate header is blank.
What needs to happen is for the password callback to be set unconditionally - right now we only set auth_info_required to username,password when a username or password is passed in the URI or environment already...
michaelrsweet commentedon Feb 11, 2012
CUPS.org User: mike
Actually, we are already setting the password callback unconditionally...
An alternate patch is attached that looks at the WWW-Authenticate header...
michaelrsweet commentedon Feb 11, 2012
"ipp-bug-879625-1.patch":
=== modified file 'backend/ipp.c'
--- old/backend/ipp.c 2011-10-27 23:13:49 +0000
+++ new/backend/ipp.c 2011-10-31 23:41:56 +0000
@@ -896,6 +896,8 @@
if (!strncmp(httpGetField(http, HTTP_FIELD_WWW_AUTHENTICATE),
"Negotiate", 9))
auth_info_required = "negotiate";
else
fprintf(stderr, "ATTR: auth-info-required=%s\n", auth_info_required);
return (CUPS_BACKEND_AUTH_REQUIRED);
@@ -1268,6 +1270,8 @@
if (!strncmp(httpGetField(http, HTTP_FIELD_WWW_AUTHENTICATE),
"Negotiate", 9))
auth_info_required = "negotiate";
goto cleanup;
}
@@ -1431,6 +1435,8 @@
if (!strncmp(httpGetField(http, HTTP_FIELD_WWW_AUTHENTICATE),
"Negotiate", 9))
auth_info_required = "negotiate";
}
else
sleep(10);
michaelrsweet commentedon Feb 11, 2012
"str3985.patch":
Index: backend/ipp.c
--- backend/ipp.c (revision 10249)
+++ backend/ipp.c (working copy)
@@ -898,9 +898,13 @@
}
else if (ipp_status == IPP_NOT_AUTHORIZED || ipp_status == IPP_FORBIDDEN)
{
if (!strncmp(httpGetField(http, HTTP_FIELD_WWW_AUTHENTICATE),
if (!strncmp(www_auth, "Negotiate", 9))
auth_info_required = "negotiate";
fprintf(stderr, "ATTR: auth-info-required=%s\n", auth_info_required);
return (CUPS_BACKEND_AUTH_REQUIRED);
@@ -1277,23 +1281,13 @@
else if (ipp_status == IPP_NOT_AUTHORIZED || ipp_status == IPP_FORBIDDEN ||
ipp_status == IPP_AUTHENTICATION_CANCELED)
{
- httpGetField(http, HTTP_FIELD_WWW_AUTHENTICATE));
- */
auth_info_required = "negotiate";
auth_info_required = "username,password";
goto cleanup;
}
@@ -1455,19 +1449,13 @@
if (ipp_status == IPP_NOT_AUTHORIZED || ipp_status == IPP_FORBIDDEN)
{
- httpGetField(http, HTTP_FIELD_WWW_AUTHENTICATE));
- */
else if (ipp_status == IPP_REQUEST_VALUE)
{