From: msweet Date: Fri, 27 Feb 2015 14:06:20 +0000 (+0000) Subject: The cupstestppd program did not handle "maxsize(nnn)" entries in cupsFilter/ X-Git-Tag: v2.2b1~333 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea72cf2b56576f6b5332ba3bb0d3bf35039a46f6;p=thirdparty%2Fcups.git The cupstestppd program did not handle "maxsize(nnn)" entries in cupsFilter/ cupsFilter2 values () git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12536 a1ca3aef-8c08-0410-bb20-df032aa958be --- diff --git a/CHANGES.txt b/CHANGES.txt index 09a1e6f4c9..6d521e17b7 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -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 () + - The cupstestppd program did not handle "maxsize(nnn)" entries in + cupsFilter/cupsFilter2 values () diff --git a/systemv/cupstestppd.c b/systemv/cupstestppd.c index 7b4655eed6..23982829f4 100644 --- a/systemv/cupstestppd.c +++ b/systemv/cupstestppd.c @@ -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)