9db046f
From 7d54edf278380093a00fd850ca3f88d6e4777e46 Mon Sep 17 00:00:00 2001
9db046f
From: mike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
9db046f
Date: Wed, 12 Dec 2012 12:27:27 +0000
9db046f
Subject: [PATCH] Don't set auth-info-required all of the time (STR #4205)
9db046f
9db046f
git-svn-id: http://svn.easysw.com/public/cups/trunk@10749 7a7537e8-13f0-0310-91df-b6672ffda945
9db046f
9db046f
diff -up cups-1.5.4/scheduler/printers.c.str4205 cups-1.5.4/scheduler/printers.c
9db046f
--- cups-1.5.4/scheduler/printers.c.str4205	2012-12-18 14:15:01.000000000 +0100
9db046f
+++ cups-1.5.4/scheduler/printers.c	2012-12-18 14:24:12.269701428 +0100
9db046f
@@ -2213,8 +2213,6 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)
9db046f
   int		i,			/* Looping var */
9db046f
 		length;			/* Length of browse attributes */
9db046f
   char		resource[HTTP_MAX_URI];	/* Resource portion of URI */
9db046f
-  int		num_air;		/* Number of auth-info-required values */
9db046f
-  const char	* const *air;		/* auth-info-required values */
9db046f
   cupsd_location_t *auth;		/* Pointer to authentication element */
9db046f
   const char	*auth_supported;	/* Authentication supported */
9db046f
   ipp_t		*oldattrs;		/* Old printer attributes */
9db046f
@@ -2222,15 +2220,6 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)
9db046f
   cups_option_t	*option;		/* Current printer option */
9db046f
   char		*name,			/* Current user/group name */
9db046f
 		*filter;		/* Current filter */
9db046f
-  static const char * const air_none[] =
9db046f
-		{			/* No authentication */
9db046f
-		  "none"
9db046f
-		};
9db046f
-  static const char * const air_userpass[] =
9db046f
-		{			/* Basic/Digest authentication */
9db046f
-		  "username",
9db046f
-		  "password"
9db046f
-		};
9db046f
 
9db046f
 
9db046f
   DEBUG_printf(("cupsdSetPrinterAttrs: entering name = %s, type = %x\n", p->name,
9db046f
@@ -2254,20 +2243,6 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)
9db046f
   */
9db046f
 
9db046f
   auth_supported = "requesting-user-name";
9db046f
-  num_air        = 1;
9db046f
-  air            = air_none;
9db046f
-
9db046f
-  if (p->num_auth_info_required > 0 && strcmp(p->auth_info_required[0], "none"))
9db046f
-  {
9db046f
-    num_air = p->num_auth_info_required;
9db046f
-    air     = p->auth_info_required;
9db046f
-  }
9db046f
-  else if ((p->type & CUPS_PRINTER_AUTHENTICATED) &&
9db046f
-           (p->type & CUPS_PRINTER_DISCOVERED))
9db046f
-  {
9db046f
-    num_air = 2;
9db046f
-    air     = air_userpass;
9db046f
-  }
9db046f
 
9db046f
   if (p->type & CUPS_PRINTER_CLASS)
9db046f
     snprintf(resource, sizeof(resource), "/classes/%s", p->name);
9db046f
@@ -2349,8 +2324,10 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)
9db046f
                 "job-k-limit", p->k_limit);
9db046f
   ippAddInteger(p->attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER,
9db046f
                 "job-page-limit", p->page_limit);
9db046f
-  ippAddStrings(p->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
9db046f
-		"auth-info-required", num_air, NULL, air);
9db046f
+  if (p->num_auth_info_required > 0 && strcmp(p->auth_info_required[0], "none"))
9db046f
+    ippAddStrings(p->attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD,
9db046f
+		  "auth-info-required", p->num_auth_info_required, NULL,
9db046f
+		  p->auth_info_required);
9db046f
 
9db046f
   if (cupsArrayCount(Banners) > 0 && !(p->type & CUPS_PRINTER_DISCOVERED))
9db046f
   {