From 7d54edf278380093a00fd850ca3f88d6e4777e46 Mon Sep 17 00:00:00 2001 From: mike Date: Wed, 12 Dec 2012 12:27:27 +0000 Subject: [PATCH] Don't set auth-info-required all of the time (STR #4205) git-svn-id: http://svn.easysw.com/public/cups/trunk@10749 7a7537e8-13f0-0310-91df-b6672ffda945 diff -up cups-1.5.4/scheduler/printers.c.str4205 cups-1.5.4/scheduler/printers.c --- cups-1.5.4/scheduler/printers.c.str4205 2012-12-18 14:15:01.000000000 +0100 +++ cups-1.5.4/scheduler/printers.c 2012-12-18 14:24:12.269701428 +0100 @@ -2213,8 +2213,6 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p) int i, /* Looping var */ length; /* Length of browse attributes */ 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 */ @@ -2222,15 +2220,6 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p) cups_option_t *option; /* Current printer option */ 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, @@ -2254,20 +2243,6 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p) */ 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) && - (p->type & CUPS_PRINTER_DISCOVERED)) - { - num_air = 2; - air = air_userpass; - } if (p->type & CUPS_PRINTER_CLASS) snprintf(resource, sizeof(resource), "/classes/%s", p->name); @@ -2349,8 +2324,10 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p) "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 && !(p->type & CUPS_PRINTER_DISCOVERED)) {