]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
The HTTP authentication cache was broken (STR #517)
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Thu, 26 Feb 2004 16:26:28 +0000 (16:26 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Thu, 26 Feb 2004 16:26:28 +0000 (16:26 +0000)
The cupstestppd utility now fails PPD files that have a
DefaultOption keyword for a non-existance option name (STR #476)

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@4095 7a7537e8-13f0-0310-91df-b6672ffda945

CHANGES.txt
cups/auth.c
systemv/cupstestppd.c

index 5eefa5da1b399e6f783c867e571490b74827a2fc..d023ec29a43009da7aced0cc4e961818a8454491 100644 (file)
@@ -3,6 +3,10 @@ CHANGES.txt - 02/26/2004
 
 CHANGES IN CUPS V1.1.21rc1
 
+       - The HTTP authentication cache was broken (STR #517)
+       - The cupstestppd utility now fails PPD files that have
+         a DefaultOption keyword for a non-existance option
+         name (STR #476)
        - Optimized the scanning of new PPD files on scheduler
          startup (STR #424)
        - The EPM list file did not include the bin, lib, or
index 251f9eb7bc78779507bc72d2a53933cd02a4ecf6..ab03e14afa2309beaf73ea67466c6260f87cc178 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: auth.c,v 1.7 2004/02/25 20:14:51 mike Exp $"
+ * "$Id: auth.c,v 1.8 2004/02/26 16:26:28 mike Exp $"
  *
  *   Authentication functions for the Common UNIX Printing System (CUPS).
  *
@@ -95,11 +95,10 @@ cupsDoAuthentication(http_t     *http,      /* I - HTTP connection to server */
   }
 
  /*
-  * Nope, see if we should retry the current digest password...
+  * Nope, see if we should retry the current username:password...
   */
 
-  if (strncasecmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE], "Basic", 5) == 0 ||
-      http->digest_tries > 1 || !http->userpass[0])
+  if (http->digest_tries > 1 || !http->userpass[0])
   {
    /*
     * Nope - get a new password from the user...
@@ -108,7 +107,8 @@ cupsDoAuthentication(http_t     *http,      /* I - HTTP connection to server */
     snprintf(prompt, sizeof(prompt), "Password for %s on %s? ", cupsUser(),
              http->hostname);
 
-    http->digest_tries  = 0;
+    http->digest_tries  = strncasecmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE],
+                                      "Basic", 5) == 0;
     http->userpass[0]   = '\0';
 
     if ((password = cupsGetPassword(prompt)) == NULL)
@@ -120,7 +120,7 @@ cupsDoAuthentication(http_t     *http,      /* I - HTTP connection to server */
     snprintf(http->userpass, sizeof(http->userpass), "%s:%s", cupsUser(),
              password);
   }
-  else
+  else if (http->status == HTTP_UNAUTHORIZED)
     http->digest_tries ++;
 
  /*
@@ -243,5 +243,5 @@ cups_local_auth(http_t *http)               /* I - HTTP connection to server */
 
 
 /*
- * End of "$Id: auth.c,v 1.7 2004/02/25 20:14:51 mike Exp $".
+ * End of "$Id: auth.c,v 1.8 2004/02/26 16:26:28 mike Exp $".
  */
index 632462871b615e6f1400a3c558486753192d9472..a8acc631b468c3f367a35e977c2d06acaa14dbaa 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: cupstestppd.c,v 1.29 2004/02/25 20:14:54 mike Exp $"
+ * "$Id: cupstestppd.c,v 1.30 2004/02/26 16:26:28 mike Exp $"
  *
  *   PPD test program for the Common UNIX Printing System (CUPS).
  *
@@ -310,12 +310,7 @@ main(int  argc,                    /* I - Number of command-line arguments */
         }
       }
 
-      if (ppdFindAttr(ppd, "DefaultImageableArea", NULL) != NULL)
-      {
-       if (verbose > 0)
-         puts("        PASS    DefaultImageableArea");
-      }
-      else
+      if ((attr = ppdFindAttr(ppd, "DefaultImageableArea", NULL)) == NULL)
       {
        if (verbose >= 0)
        {
@@ -328,13 +323,26 @@ main(int  argc,                   /* I - Number of command-line arguments */
 
        errors ++;
       }
+      else if (ppdPageSize(ppd, attr->value) == NULL)
+      {
+       if (verbose >= 0)
+       {
+         if (!errors && !verbose)
+           puts(" FAIL");
 
-      if (ppdFindAttr(ppd, "DefaultPaperDimension", NULL) != NULL)
+         printf("      **FAIL**  BAD DefaultImageableArea %s!\n", attr->value);
+         puts("                REF: Page 102, section 5.15.");
+        }
+
+       errors ++;
+      }
+      else
       {
        if (verbose > 0)
-         puts("        PASS    DefaultPaperDimension");
+         puts("        PASS    DefaultImageableArea");
       }
-      else
+
+      if (ppdFindAttr(ppd, "DefaultPaperDimension", NULL) == NULL)
       {
        if (verbose >= 0)
        {
@@ -347,6 +355,21 @@ main(int  argc,                    /* I - Number of command-line arguments */
 
        errors ++;
       }
+      else if (ppdPageSize(ppd, attr->value) == NULL)
+      {
+       if (verbose >= 0)
+       {
+         if (!errors && !verbose)
+           puts(" FAIL");
+
+         printf("      **FAIL**  BAD DefaultPaperDimension %s!\n", attr->value);
+         puts("                REF: Page 103, section 5.15.");
+        }
+
+       errors ++;
+      }
+      else if (verbose > 0)
+       puts("        PASS    DefaultPaperDimension");
 
       for (j = 0, group = ppd->groups; j < ppd->num_groups; j ++, group ++)
        for (k = 0, option = group->options; k < group->num_options; k ++, option ++)
@@ -357,7 +380,21 @@ main(int  argc,                    /* I - Number of command-line arguments */
 
          if (option->defchoice[0])
          {
-           if (verbose > 0)
+            if (ppdFindChoice(option, option->defchoice) == NULL)
+           {
+             if (verbose >= 0)
+             {
+               if (!errors && !verbose)
+                 puts(" FAIL");
+
+               printf("      **FAIL**  BAD Default%s %s\n", option->keyword,
+                      option->defchoice);
+               puts("                REF: Page 40, section 4.5.");
+              }
+
+             errors ++;
+           }
+           else if (verbose > 0)
              printf("        PASS    Default%s\n", option->keyword);
          }
          else
@@ -1121,5 +1158,5 @@ usage(void)
 
 
 /*
- * End of "$Id: cupstestppd.c,v 1.29 2004/02/25 20:14:54 mike Exp $".
+ * End of "$Id: cupstestppd.c,v 1.30 2004/02/26 16:26:28 mike Exp $".
  */