]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
The cupstestppd program did not handle "maxsize(nnn)" entries in cupsFilter/
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Fri, 27 Feb 2015 14:06:20 +0000 (14:06 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Fri, 27 Feb 2015 14:06:20 +0000 (14:06 +0000)
cupsFilter2 values (<rdar://problem/18974858>)

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12536 a1ca3aef-8c08-0410-bb20-df032aa958be

CHANGES.txt
systemv/cupstestppd.c

index 09a1e6f4c9d9b90593b2e113a08db1666e7994ae..6d521e17b7e3c2cc1e28c2010ef7a7ff78869f53 100644 (file)
@@ -24,3 +24,5 @@ CHANGES IN CUPS V2.1b1
        - Added a PPD generator for IPP Everywhere printers (STR #4258)
        - Now install "default" versions of more configuration files
          (<rdar://problem/19024491>)
+       - The cupstestppd program did not handle "maxsize(nnn)" entries in
+         cupsFilter/cupsFilter2 values (<rdar://problem/18974858>)
index 7b4655eed6b08cb0773f05c33daeda679b32b5c9..23982829f4096242afa2f7ad4dce3f4500b11fb5 100644 (file)
@@ -2371,8 +2371,41 @@ check_filters(ppd_file_t *ppd,           /* I - PPD file */
 
       if (!warn)
         errors ++;
+
+      continue;
     }
-    else if (strcmp(program, "-"))
+
+    if (!strncmp(program, "maxsize(", 8))
+    {
+      size_t   maxsize;                /* Maximum file size */
+      char     *ptr;                   /* Pointer into maxsize(nnnn) program */
+
+      maxsize = (size_t)strtoll(program + 8, &ptr, 10);
+
+      if (*ptr != ')')
+      {
+       if (!warn && !errors && !verbose)
+         _cupsLangPuts(stdout, _(" FAIL"));
+
+       if (verbose >= 0)
+         _cupsLangPrintf(stdout,
+                         _("      %s  Bad cupsFilter value \"%s\"."),
+                         prefix, attr->value);
+
+       if (!warn)
+         errors ++;
+
+       continue;
+      }
+
+      ptr ++;
+      while (_cups_isspace(*ptr))
+       ptr ++;
+
+      _cups_strcpy(program, ptr);
+    }
+
+    if (strcmp(program, "-"))
     {
       if (program[0] == '/')
        snprintf(pathprog, sizeof(pathprog), "%s%s", root, program);
@@ -2457,8 +2490,41 @@ check_filters(ppd_file_t *ppd,           /* I - PPD file */
 
       if (!warn)
         errors ++;
+
+      continue;
     }
-    else if (strcmp(program, "-"))
+
+    if (!strncmp(program, "maxsize(", 8))
+    {
+      size_t   maxsize;                /* Maximum file size */
+      char     *ptr;                   /* Pointer into maxsize(nnnn) program */
+
+      maxsize = (size_t)strtoll(program + 8, &ptr, 10);
+
+      if (*ptr != ')')
+      {
+       if (!warn && !errors && !verbose)
+         _cupsLangPuts(stdout, _(" FAIL"));
+
+       if (verbose >= 0)
+         _cupsLangPrintf(stdout,
+                         _("      %s  Bad cupsFilter2 value \"%s\"."),
+                         prefix, attr->value);
+
+       if (!warn)
+         errors ++;
+
+       continue;
+      }
+
+      ptr ++;
+      while (_cups_isspace(*ptr))
+       ptr ++;
+
+      _cups_strcpy(program, ptr);
+    }
+
+    if (strcmp(program, "-"))
     {
       if (strncmp(program, "maxsize(", 8) &&
           (ptr = strchr(program + 8, ')')) != NULL)