Re: [LOW] STR #4205: CUPS-Get-Printers and auth-info-required

Michael Sweet <[email protected]> Wed, 12 Dec 2012 04:28:47 -0800 (PST)
Newsgroups gmane.comp.printing.cups.bugs
Message-ID <[email protected]>
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR Closed w/Resolution]

Fixed in Subversion repository.

Patch attached; basically, we can't just comment out that one line, but we
should only be setting auth-info-required when the queue is configured to
require third-party authentication.

Link: https://www.cups.org/str.php?L4205
Version: 1.3.11
Fix Version: 1.7-current (r10749)

_______________________________________________
cups-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/cups-bugs
str4205.patch (text/plain, 2.1 KB)
Index: scheduler/printers.c
===================================================================
--- scheduler/printers.c	(revision 10748)
+++ scheduler/printers.c	(working copy)
@@ -2030,23 +2030,12 @@
 {
   int		i;			/* Looping var */
   char		resource[HTTP_MAX_URI];	/* Resource portion of URI */
-  int		num_air;		/* Number of auth-info-required values */
-  const char	* const *air;		/* auth-info-required values */
   cupsd_location_t *auth;		/* Pointer to authentication element */
   const char	*auth_supported;	/* Authentication supported */
   ipp_t		*oldattrs;		/* Old printer attributes */
   ipp_attribute_t *attr;		/* Attribute data */
   char		*name,			/* Current user/group name */
 		*filter;		/* Current filter */
-  static const char * const air_none[] =
-		{			/* No authentication */
-		  "none"
-		};
-  static const char * const air_userpass[] =
-		{			/* Basic/Digest authentication */
-		  "username",
-		  "password"
-		};
 
 
   DEBUG_printf(("cupsdSetPrinterAttrs: entering name = %s, type = %x\n", p->name,
@@ -2070,20 +2059,7 @@
   */
 
   auth_supported = "requesting-user-name";
-  num_air        = 1;
-  air            = air_none;
 
-  if (p->num_auth_info_required > 0 && strcmp(p->auth_info_required[0], "none"))
-  {
-    num_air = p->num_auth_info_required;
-    air     = p->auth_info_required;
-  }
-  else if (p->type & CUPS_PRINTER_AUTHENTICATED)
-  {
-    num_air = 2;
-    air     = air_userpass;
-  }
-
   if (p->type & CUPS_PRINTER_CLASS)
     snprintf(resource, sizeof(resource), "/classes/%s", p->name);
   else
@@ -2161,8 +2137,10 @@
                 "job-k-limit", p->k_limit);
   ippAddInteger(p->attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER,
                 "job-page-limit", p->page_limit);
-  ippAddStrings(p->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
-		"auth-info-required", num_air, NULL, air);
+  if (p->num_auth_info_required > 0 && strcmp(p->auth_info_required[0], "none"))
+    ippAddStrings(p->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
+		  "auth-info-required", p->num_auth_info_required, NULL,
+		  p->auth_info_required);
 
   if (cupsArrayCount(Banners) > 0)
   {