#include <errno.h>
#include <stdlib.h>
#include <math.h>
+#ifdef WIN32
+# define X_OK 0
+#endif /* WIN32 */
/*
};
+/*
+ * File permissions...
+ */
+
+#define MODE_WRITE 0022 /* Group/other write */
+#define MODE_MASK 0555 /* Owner/group/other read+exec/search */
+#define MODE_DATAFILE 0444 /* Owner/group/other read */
+#define MODE_DIRECTORY 0555 /* Owner/group/other read+search */
+#define MODE_PROGRAM 0555 /* Owner/group/other read+exec */
+
+
/*
* Standard Adobe media keywords (must remain sorted)...
*/
int files; /* Number of files */
int verbose; /* Want verbose output? */
int warn; /* Which errors to just warn about */
+ int ignore; /* Which errors to ignore */
int status; /* Exit status */
int errors; /* Number of conformance errors */
int ppdversion; /* PPD spec version in PPD file */
status = ERROR_NONE;
root = "";
warn = WARN_NONE;
+ ignore = WARN_NONE;
for (i = 1; i < argc; i ++)
if (argv[i][0] == '-' && argv[i][1])
for (opt = argv[i] + 1; *opt; opt ++)
switch (*opt)
{
+ case 'I' : /* Ignore errors */
+ i ++;
+
+ if (i >= argc)
+ usage();
+
+ if (!strcmp(argv[i], "none"))
+ ignore = WARN_NONE;
+ else if (!strcmp(argv[i], "filters"))
+ ignore |= WARN_FILTERS;
+ else if (!strcmp(argv[i], "profiles"))
+ ignore |= WARN_PROFILES;
+ else if (!strcmp(argv[i], "all"))
+ ignore = WARN_FILTERS | WARN_PROFILES;
+ else
+ usage();
+ break;
+
case 'R' : /* Alternate root directory */
i ++;
root = argv[i];
break;
- case 'W' : /* Turn errors into warnings */
+ case 'W' : /* Turn errors into warnings */
i ++;
if (i >= argc)
_cupsLangPuts(stdout, _(" FAIL\n"));
_cupsLangPrintf(stdout,
- _(" **FAIL** BAD DefaultImageableArea %s!\n"
+ _(" **FAIL** BAD DefaultImageableArea %s\n"
" REF: Page 102, section 5.15.\n"),
attr->value);
}
_cupsLangPuts(stdout, _(" FAIL\n"));
_cupsLangPrintf(stdout,
- _(" **FAIL** BAD DefaultPaperDimension %s!\n"
+ _(" **FAIL** BAD DefaultPaperDimension %s\n"
" REF: Page 103, section 5.15.\n"),
attr->value);
}
_cupsLangPuts(stdout, _(" FAIL\n"));
_cupsLangPrintf(stdout,
- _(" **FAIL** Bad %s choice %s!\n"
+ _(" **FAIL** Bad %s choice %s\n"
" REF: Page 84, section 5.9\n"),
option->keyword, choice->choice);
}
_cupsLangPuts(stdout, _(" FAIL\n"));
_cupsLangPrintf(stdout,
- _(" **FAIL** %s must be 1284DeviceID!\n"
+ _(" **FAIL** %s must be 1284DeviceID\n"
" REF: Page 72, section 5.5\n"),
attr->name);
}
if (!(warn & WARN_CONSTRAINTS))
errors = check_constraints(ppd, errors, verbose, 0);
- if (!(warn & WARN_FILTERS))
+ if (!(warn & WARN_FILTERS) && !(ignore & WARN_FILTERS))
errors = check_filters(ppd, root, errors, verbose, 0);
- if (!(warn & WARN_PROFILES))
+ if (!(warn & WARN_PROFILES) && !(ignore & WARN_PROFILES))
errors = check_profiles(ppd, root, errors, verbose, 0);
if (!(warn & WARN_SIZES))
if (verbose >= 0)
_cupsLangPrintf(stdout,
_(" **FAIL** Bad LanguageEncoding %s - "
- "must be ISOLatin1!\n"),
+ "must be ISOLatin1\n"),
attr->value ? attr->value : "(null)");
errors ++;
if (verbose >= 0)
_cupsLangPrintf(stdout,
_(" **FAIL** Bad LanguageVersion %s - "
- "must be English!\n"),
+ "must be English\n"),
ppd->lang_version ? ppd->lang_version : "(null)");
errors ++;
_cupsLangPrintf(stdout,
_(" **FAIL** Default translation "
"string for option %s contains 8-bit "
- "characters!\n"),
+ "characters\n"),
option->keyword);
errors ++;
_cupsLangPrintf(stdout,
_(" **FAIL** Default translation "
"string for option %s choice %s contains "
- "8-bit characters!\n"),
+ "8-bit characters\n"),
option->keyword,
option->choices[j].choice);
{
check_basics(argv[i]);
- if (warn & WARN_CONSTRAINTS)
- errors = check_constraints(ppd, errors, verbose, 1);
-
if (warn & WARN_DEFAULTS)
errors = check_defaults(ppd, errors, verbose, 1);
- if (warn & WARN_PROFILES)
- errors = check_profiles(ppd, root, errors, verbose, 1);
+ if (warn & WARN_CONSTRAINTS)
+ errors = check_constraints(ppd, errors, verbose, 1);
- if (warn & WARN_FILTERS)
+ if ((warn & WARN_FILTERS) && !(ignore & WARN_FILTERS))
errors = check_filters(ppd, root, errors, verbose, 1);
+ if ((warn & WARN_PROFILES) && !(ignore & WARN_PROFILES))
+ errors = check_profiles(ppd, root, errors, verbose, 1);
+
if (warn & WARN_SIZES)
errors = check_sizes(ppd, errors, verbose, 1);
else
if (option)
_cupsLangPrintf(stdout,
_(" WARN Duplex option keyword %s may not "
- "work as expected and should be named Duplex!\n"
+ "work as expected and should be named Duplex\n"
" REF: Page 122, section 5.17\n"),
option->keyword);
!ppdFindOption(ppd, attr->name + 7))
_cupsLangPrintf(stdout,
_(" WARN %s has no corresponding "
- "options!\n"),
+ "options\n"),
attr->name);
}
if (ppdConflicts(ppd))
{
_cupsLangPuts(stdout,
- _(" WARN Default choices conflicting!\n"));
+ _(" WARN Default choices conflicting\n"));
show_conflicts(ppd);
}
if (ppdversion < 43)
{
_cupsLangPrintf(stdout,
- _(" WARN Obsolete PPD version %.1f!\n"
+ _(" WARN Obsolete PPD version %.1f\n"
" REF: Page 42, section 5.2.\n"),
0.1f * ppdversion);
}
for (j = 0, group = ppd->groups; j < ppd->num_groups; j ++, group ++)
for (k = 0, option = group->options; k < group->num_options; k ++, option ++)
{
- len = strlen(option->keyword);
+ len = (int)strlen(option->keyword);
for (m = 0, group2 = ppd->groups;
m < ppd->num_groups;
n < group2->num_options;
n ++, option2 ++)
if (option != option2 &&
- len < strlen(option2->keyword) &&
+ len < (int)strlen(option2->keyword) &&
!strncmp(option->keyword, option2->keyword, len))
{
_cupsLangPrintf(stdout,
if (col > 0 && whitespace)
_cupsLangPrintf(stdout,
- _(" WARN Line %d only contains whitespace!\n"),
+ _(" WARN Line %d only contains whitespace\n"),
linenum);
linenum ++;
if (mixed)
_cupsLangPuts(stdout,
_(" WARN File contains a mix of CR, LF, and "
- "CR LF line endings!\n"));
+ "CR LF line endings\n"));
if (eol == EOL_CRLF)
_cupsLangPuts(stdout,
_(" WARN Non-Windows PPD files should use lines "
- "ending with only LF, not CR LF!\n"));
+ "ending with only LF, not CR LF\n"));
cupsFileClose(fp);
}
_cupsLangPuts(stdout, _(" FAIL\n"));
_cupsLangPrintf(stdout,
- _(" %s Empty cupsUIConstraints %s!\n"),
+ _(" %s Empty cupsUIConstraints %s\n"),
prefix, constattr->spec);
if (!warn)
_cupsLangPuts(stdout, _(" FAIL\n"));
_cupsLangPrintf(stdout,
- _(" %s Bad cupsUIConstraints %s: \"%s\"!\n"),
+ _(" %s Bad cupsUIConstraints %s: \"%s\"\n"),
prefix, constattr->spec, constattr->value);
if (!warn)
_cupsLangPuts(stdout, _(" FAIL\n"));
_cupsLangPrintf(stdout,
- _(" %s Missing cupsUIResolver %s!\n"),
+ _(" %s Missing cupsUIResolver %s\n"),
prefix, constattr->spec);
if (!warn)
_cupsLangPrintf(stdout,
_(" %s Missing option %s in "
- "cupsUIConstraints %s: \"%s\"!\n"),
+ "cupsUIConstraints %s: \"%s\"\n"),
prefix, option, constattr->spec, constattr->value);
if (!warn)
_cupsLangPrintf(stdout,
_(" %s Missing choice *%s %s in "
- "cupsUIConstraints %s: \"%s\"!\n"),
+ "cupsUIConstraints %s: \"%s\"\n"),
prefix, option, choice, constattr->spec,
constattr->value);
_cupsLangPrintf(stdout,
_(" %s cupsUIResolver %s does not list at least "
- "two different options!\n"),
+ "two different options\n"),
prefix, constattr->spec);
if (!warn)
_cupsLangPuts(stdout, _(" FAIL\n"));
_cupsLangPrintf(stdout,
- _(" %s cupsUIResolver %s causes a loop!\n"),
+ _(" %s cupsUIResolver %s causes a loop\n"),
prefix, constattr->spec);
if (!warn)
_cupsLangPrintf(stdout,
_(" %s Missing option %s in "
- "UIConstraints \"*%s %s *%s %s\"!\n"),
+ "UIConstraints \"*%s %s *%s %s\"\n"),
prefix, c->option1,
c->option1, c->choice1, c->option2, c->choice2);
_cupsLangPrintf(stdout,
_(" %s Missing choice *%s %s in "
- "UIConstraints \"*%s %s *%s %s\"!\n"),
+ "UIConstraints \"*%s %s *%s %s\"\n"),
prefix, c->option1, c->choice1,
c->option1, c->choice1, c->option2, c->choice2);
_cupsLangPrintf(stdout,
_(" %s Missing option %s in "
- "UIConstraints \"*%s %s *%s %s\"!\n"),
+ "UIConstraints \"*%s %s *%s %s\"\n"),
prefix, c->option2,
c->option1, c->choice1, c->option2, c->choice2);
_cupsLangPrintf(stdout,
_(" %s Missing choice *%s %s in "
- "UIConstraints \"*%s %s *%s %s\"!\n"),
+ "UIConstraints \"*%s %s *%s %s\"\n"),
prefix, c->option2, c->choice2,
c->option1, c->choice1, c->option2, c->choice2);
if (verbose >= 0)
_cupsLangPrintf(stdout,
_(" **FAIL** Group names %s and %s differ only "
- "by case!\n"),
+ "by case\n"),
groupa->name, groupb->name);
errors ++;
if (verbose >= 0)
_cupsLangPrintf(stdout,
_(" **FAIL** Option names %s and %s differ only "
- "by case!\n"),
+ "by case\n"),
optiona->keyword, optionb->keyword);
errors ++;
if (verbose >= 0)
_cupsLangPrintf(stdout,
_(" **FAIL** Multiple occurrences of %s "
- "choice name %s!\n"),
+ "choice name %s\n"),
optiona->keyword, choicea->choice);
errors ++;
if (verbose >= 0)
_cupsLangPrintf(stdout,
_(" **FAIL** %s choice names %s and %s "
- "differ only by case!\n"),
+ "differ only by case\n"),
optiona->keyword, choicea->choice, choiceb->choice);
errors ++;
if (verbose >= 0)
_cupsLangPrintf(stdout,
- _(" %s %s %s does not exist!\n"),
+ _(" %s %s %s does not exist\n"),
prefix, attr->name, attr->value);
if (!warn)
_cupsLangPrintf(stdout,
_(" %s REQUIRED %s does not define "
- "choice None!\n"
+ "choice None\n"
" REF: Page 122, section 5.17\n"),
prefix, option->keyword);
}
_cupsLangPuts(stdout, _(" FAIL\n"));
_cupsLangPrintf(stdout,
- _(" %s Bad %s choice %s!\n"
+ _(" %s Bad %s choice %s\n"
" REF: Page 122, section 5.17\n"),
prefix, option->keyword, choice->choice);
}
pathprog[1024]; /* Complete path to program/filter */
int cost; /* Cost of filter */
const char *prefix; /* WARN/FAIL prefix */
+ struct stat fileinfo; /* File information */
prefix = warn ? " WARN " : "**FAIL**";
if (verbose >= 0)
_cupsLangPrintf(stdout,
- _(" %s Bad cupsFilter value \"%s\"!\n"),
+ _(" %s Bad cupsFilter value \"%s\"\n"),
prefix, ppd->filters[i]);
if (!warn)
program);
}
- if (access(pathprog, X_OK))
+ if (stat(pathprog, &fileinfo))
{
if (!warn && !errors && !verbose)
_cupsLangPuts(stdout, _(" FAIL\n"));
if (verbose >= 0)
_cupsLangPrintf(stdout, _(" %s Missing cupsFilter "
- "file \"%s\"\n"), prefix, program);
+ "file \"%s\"\n"), prefix, pathprog);
+
+ if (!warn)
+ errors ++;
+ }
+ else if (fileinfo.st_uid != 0 ||
+ (fileinfo.st_mode & MODE_WRITE) ||
+ (fileinfo.st_mode & MODE_MASK) != MODE_PROGRAM)
+ {
+ if (!warn && !errors && !verbose)
+ _cupsLangPuts(stdout, _(" FAIL\n"));
+
+ if (verbose >= 0)
+ _cupsLangPrintf(stdout, _(" %s Bad permissions on cupsFilter "
+ "file \"%s\"\n"), prefix, pathprog);
if (!warn)
errors ++;
attr;
attr = ppdFindNextAttr(ppd, "cupsPreFilter", NULL))
{
+ if (strcmp(attr->name, "cupsPreFilter"))
+ {
+ if (!warn && !errors && !verbose)
+ _cupsLangPuts(stdout, _(" FAIL\n"));
+
+ if (verbose >= 0)
+ _cupsLangPrintf(stdout,
+ _(" %s Bad spelling of %s - should be %s\n"),
+ prefix, attr->name, "cupsPreFilter");
+
+ if (!warn)
+ errors ++;
+ }
+
if (!attr->value ||
sscanf(attr->value, "%15[^/]/%255s%d%*[ \t]%1023[^\n]", super, type,
&cost, program) != 4)
if (verbose >= 0)
_cupsLangPrintf(stdout,
- _(" %s Bad cupsPreFilter value \"%s\"!\n"),
+ _(" %s Bad cupsPreFilter value \"%s\"\n"),
prefix, attr->value ? attr->value : "");
if (!warn)
program);
}
- if (access(pathprog, X_OK))
+ if (stat(pathprog, &fileinfo))
{
if (!warn && !errors && !verbose)
_cupsLangPuts(stdout, _(" FAIL\n"));
if (verbose >= 0)
_cupsLangPrintf(stdout, _(" %s Missing cupsPreFilter "
- "file \"%s\"\n"), prefix, program);
+ "file \"%s\"\n"), prefix, pathprog);
if (!warn)
errors ++;
}
+ else if (fileinfo.st_uid != 0 ||
+ (fileinfo.st_mode & MODE_WRITE) ||
+ (fileinfo.st_mode & MODE_MASK) != MODE_PROGRAM)
+ {
+ if (!warn && !errors && !verbose)
+ _cupsLangPuts(stdout, _(" FAIL\n"));
+
+ if (verbose >= 0)
+ _cupsLangPrintf(stdout, _(" %s Bad permissions on "
+ "cupsPreFilter file \"%s\"\n"), prefix,
+ pathprog);
+
+ if (!warn)
+ errors ++;
+ }
else
errors = valid_path("cupsPreFilter", pathprog, errors, verbose, warn);
}
attr != NULL;
attr = ppdFindNextAttr(ppd, "APDialogExtension", NULL))
{
- if (!attr->value || access(attr->value, 0))
+ if (strcmp(attr->name, "APDialogExtension"))
+ {
+ if (!warn && !errors && !verbose)
+ _cupsLangPuts(stdout, _(" FAIL\n"));
+
+ if (verbose >= 0)
+ _cupsLangPrintf(stdout,
+ _(" %s Bad spelling of %s - should be %s\n"),
+ prefix, attr->name, "APDialogExtension");
+
+ if (!warn)
+ errors ++;
+ }
+
+ snprintf(pathprog, sizeof(pathprog), "%s%s", root,
+ attr->value ? attr->value : "(null)");
+
+ if (!attr->value || stat(pathprog, &fileinfo))
{
if (!warn && !errors && !verbose)
_cupsLangPuts(stdout, _(" FAIL\n"));
if (verbose >= 0)
_cupsLangPrintf(stdout, _(" %s Missing "
"APDialogExtension file \"%s\"\n"),
- prefix, attr->value ? attr->value : "<NULL>");
+ prefix, pathprog);
+
+ if (!warn)
+ errors ++;
+ }
+ else if (fileinfo.st_uid != 0 ||
+ (fileinfo.st_mode & MODE_WRITE) ||
+ (fileinfo.st_mode & MODE_MASK) != MODE_DIRECTORY)
+ {
+ if (!warn && !errors && !verbose)
+ _cupsLangPuts(stdout, _(" FAIL\n"));
+
+ if (verbose >= 0)
+ _cupsLangPrintf(stdout, _(" %s Bad permissions on "
+ "APDialogExtension file \"%s\"\n"), prefix,
+ pathprog);
if (!warn)
errors ++;
}
else
- errors = valid_path("APDialogExtension", attr->value, errors, verbose,
+ errors = valid_path("APDialogExtension", pathprog, errors, verbose,
warn);
}
if ((attr = ppdFindAttr(ppd, "APPrinterIconPath", NULL)) != NULL)
{
- if (!attr->value || access(attr->value, 0))
+ if (strcmp(attr->name, "APPrinterIconPath"))
+ {
+ if (!warn && !errors && !verbose)
+ _cupsLangPuts(stdout, _(" FAIL\n"));
+
+ if (verbose >= 0)
+ _cupsLangPrintf(stdout,
+ _(" %s Bad spelling of %s - should be %s\n"),
+ prefix, attr->name, "APPrinterIconPath");
+
+ if (!warn)
+ errors ++;
+ }
+
+ snprintf(pathprog, sizeof(pathprog), "%s%s", root,
+ attr->value ? attr->value : "(null)");
+
+ if (!attr->value || stat(pathprog, &fileinfo))
{
if (!warn && !errors && !verbose)
_cupsLangPuts(stdout, _(" FAIL\n"));
if (verbose >= 0)
_cupsLangPrintf(stdout, _(" %s Missing "
"APPrinterIconPath file \"%s\"\n"),
- prefix, attr->value ? attr->value : "<NULL>");
+ prefix, pathprog);
+
+ if (!warn)
+ errors ++;
+ }
+ else if (fileinfo.st_uid != 0 ||
+ (fileinfo.st_mode & MODE_WRITE) ||
+ (fileinfo.st_mode & MODE_MASK) != MODE_DATAFILE)
+ {
+ if (!warn && !errors && !verbose)
+ _cupsLangPuts(stdout, _(" FAIL\n"));
+
+ if (verbose >= 0)
+ _cupsLangPrintf(stdout, _(" %s Bad permissions on "
+ "APPrinterIconPath file \"%s\"\n"), prefix,
+ pathprog);
if (!warn)
errors ++;
}
else
- errors = valid_path("APPrinterIconPath", attr->value, errors, verbose,
+ errors = valid_path("APPrinterIconPath", pathprog, errors, verbose,
warn);
}
if ((attr = ppdFindAttr(ppd, "APPrinterLowInkTool", NULL)) != NULL)
{
- if (!attr->value || access(attr->value, 0))
+ if (strcmp(attr->name, "APPrinterLowInkTool"))
+ {
+ if (!warn && !errors && !verbose)
+ _cupsLangPuts(stdout, _(" FAIL\n"));
+
+ if (verbose >= 0)
+ _cupsLangPrintf(stdout,
+ _(" %s Bad spelling of %s - should be %s\n"),
+ prefix, attr->name, "APPrinterLowInkTool");
+
+ if (!warn)
+ errors ++;
+ }
+
+ snprintf(pathprog, sizeof(pathprog), "%s%s", root,
+ attr->value ? attr->value : "(null)");
+
+ if (!attr->value || stat(pathprog, &fileinfo))
{
if (!warn && !errors && !verbose)
_cupsLangPuts(stdout, _(" FAIL\n"));
if (verbose >= 0)
_cupsLangPrintf(stdout, _(" %s Missing "
"APPrinterLowInkTool file \"%s\"\n"),
- prefix, attr->value ? attr->value : "<NULL>");
+ prefix, pathprog);
+
+ if (!warn)
+ errors ++;
+ }
+ else if (fileinfo.st_uid != 0 ||
+ (fileinfo.st_mode & MODE_WRITE) ||
+ (fileinfo.st_mode & MODE_MASK) != MODE_DIRECTORY)
+ {
+ if (!warn && !errors && !verbose)
+ _cupsLangPuts(stdout, _(" FAIL\n"));
+
+ if (verbose >= 0)
+ _cupsLangPrintf(stdout, _(" %s Bad permissions on "
+ "APPrinterLowInkTool file \"%s\"\n"), prefix,
+ pathprog);
if (!warn)
errors ++;
}
else
- errors = valid_path("APPrinterLowInkTool", attr->value, errors, verbose,
+ errors = valid_path("APPrinterLowInkTool", pathprog, errors, verbose,
warn);
}
if ((attr = ppdFindAttr(ppd, "APPrinterUtilityPath", NULL)) != NULL)
{
- if (!attr->value || access(attr->value, 0))
+ if (strcmp(attr->name, "APPrinterUtilityPath"))
+ {
+ if (!warn && !errors && !verbose)
+ _cupsLangPuts(stdout, _(" FAIL\n"));
+
+ if (verbose >= 0)
+ _cupsLangPrintf(stdout,
+ _(" %s Bad spelling of %s - should be %s\n"),
+ prefix, attr->name, "APPrinterUtilityPath");
+
+ if (!warn)
+ errors ++;
+ }
+
+ snprintf(pathprog, sizeof(pathprog), "%s%s", root,
+ attr->value ? attr->value : "(null)");
+
+ if (!attr->value || stat(pathprog, &fileinfo))
{
if (!warn && !errors && !verbose)
_cupsLangPuts(stdout, _(" FAIL\n"));
if (verbose >= 0)
_cupsLangPrintf(stdout, _(" %s Missing "
"APPrinterUtilityPath file \"%s\"\n"),
+ prefix, pathprog);
+
+ if (!warn)
+ errors ++;
+ }
+ else if (fileinfo.st_uid != 0 ||
+ (fileinfo.st_mode & MODE_WRITE) ||
+ (fileinfo.st_mode & MODE_MASK) != MODE_DIRECTORY)
+ {
+ if (!warn && !errors && !verbose)
+ _cupsLangPuts(stdout, _(" FAIL\n"));
+
+ if (verbose >= 0)
+ _cupsLangPrintf(stdout, _(" %s Bad permissions on "
+ "APPrinterUtilityPath file \"%s\"\n"), prefix,
+ pathprog);
+
+ if (!warn)
+ errors ++;
+ }
+ else
+ errors = valid_path("APPrinterUtilityPath", pathprog, errors, verbose,
+ warn);
+ }
+
+ /*
+ * APScanAppBundleID and APScanAppPath
+ */
+
+ if ((attr = ppdFindAttr(ppd, "APScanAppPath", NULL)) != NULL)
+ {
+ if (strcmp(attr->name, "APScanAppPath"))
+ {
+ if (!warn && !errors && !verbose)
+ _cupsLangPuts(stdout, _(" FAIL\n"));
+
+ if (verbose >= 0)
+ _cupsLangPrintf(stdout,
+ _(" %s Bad spelling of %s - should be %s\n"),
+ prefix, attr->name, "APScanAppPath");
+
+ if (!warn)
+ errors ++;
+ }
+
+ if (!attr->value || stat(attr->value, &fileinfo))
+ {
+ if (!warn && !errors && !verbose)
+ _cupsLangPuts(stdout, _(" FAIL\n"));
+
+ if (verbose >= 0)
+ _cupsLangPrintf(stdout, _(" %s Missing "
+ "APScanAppPath file \"%s\"\n"),
prefix, attr->value ? attr->value : "<NULL>");
if (!warn)
errors ++;
}
+ else if (fileinfo.st_uid != 0 ||
+ (fileinfo.st_mode & MODE_WRITE) ||
+ (fileinfo.st_mode & MODE_MASK) != MODE_DIRECTORY)
+ {
+ if (!warn && !errors && !verbose)
+ _cupsLangPuts(stdout, _(" FAIL\n"));
+
+ if (verbose >= 0)
+ _cupsLangPrintf(stdout, _(" %s Bad permissions on "
+ "APScanAppPath file \"%s\"\n"), prefix,
+ attr->value);
+
+ if (!warn)
+ errors ++;
+ }
else
- errors = valid_path("APPrinterUtilityPath", attr->value, errors, verbose,
+ errors = valid_path("APScanAppPath", attr->value, errors, verbose,
warn);
+
+ if (ppdFindAttr(ppd, "APScanAppBundleID", NULL))
+ {
+ if (!warn && !errors && !verbose)
+ _cupsLangPuts(stdout, _(" FAIL\n"));
+
+ if (verbose >= 0)
+ _cupsLangPrintf(stdout, _(" %s Cannot provide both "
+ "APScanAppPath and APScanAppBundleID\n"),
+ prefix);
+
+ if (!warn)
+ errors ++;
+ }
}
#endif /* __APPLE__ */
const char *ptr; /* Pointer into string */
const char *prefix; /* WARN/FAIL prefix */
char filename[1024]; /* Profile filename */
+ struct stat fileinfo; /* File information */
int num_profiles = 0; /* Number of profiles */
unsigned hash, /* Current hash value */
hashes[1000]; /* Hash values of profile names */
if (verbose >= 0)
_cupsLangPrintf(stdout,
- _(" %s Bad cupsICCProfile %s!\n"),
+ _(" %s Bad cupsICCProfile %s\n"),
prefix, attr->spec);
if (!warn)
attr->value);
}
- if (access(filename, 0))
+ if (stat(filename, &fileinfo))
{
if (!warn && !errors && !verbose)
_cupsLangPuts(stdout, _(" FAIL\n"));
if (verbose >= 0)
_cupsLangPrintf(stdout, _(" %s Missing cupsICCProfile "
- "file \"%s\"!\n"), prefix, attr->value);
+ "file \"%s\"\n"), prefix, filename);
+
+ if (!warn)
+ errors ++;
+ }
+ else if (fileinfo.st_uid != 0 ||
+ (fileinfo.st_mode & MODE_WRITE) ||
+ (fileinfo.st_mode & MODE_MASK) != MODE_DATAFILE)
+ {
+ if (!warn && !errors && !verbose)
+ _cupsLangPuts(stdout, _(" FAIL\n"));
+
+ if (verbose >= 0)
+ _cupsLangPrintf(stdout, _(" %s Bad permissions on "
+ "cupsICCProfile file \"%s\"\n"), prefix,
+ filename);
if (!warn)
errors ++;
if (verbose >= 0)
_cupsLangPrintf(stdout,
_(" %s cupsICCProfile %s hash value "
- "collides with %s!\n"), prefix, attr->spec,
+ "collides with %s\n"), prefix, attr->spec,
specs[i]);
if (!warn)
if (verbose >= 0)
_cupsLangPrintf(stdout,
- _(" %s Missing REQUIRED PageSize option!\n"
+ _(" %s Missing REQUIRED PageSize option\n"
" REF: Page 99, section 5.14.\n"),
prefix);
if (verbose >= 0)
_cupsLangPrintf(stdout,
- _(" %s Missing REQUIRED PageRegion option!\n"
+ _(" %s Missing REQUIRED PageRegion option\n"
" REF: Page 100, section 5.14.\n"),
prefix);
if (verbose >= 0)
_cupsLangPrintf(stdout,
_(" %s Size \"%s\" has unexpected dimensions "
- "(%gx%g)!\n"),
+ "(%gx%g)\n"),
prefix, size->name, size->width, size->length);
if (!warn)
(int (*)(const void *, const void *))strcmp))
{
_cupsLangPrintf(stdout,
- _(" %s Non-standard size name \"%s\"!\n"
+ _(" %s Non-standard size name \"%s\"\n"
" REF: Page 187, section B.2.\n"),
prefix, size->name);
}
if (verbose >= 0)
_cupsLangPrintf(stdout,
_(" %s Size \"%s\" defined for %s but not for "
- "%s!\n"),
+ "%s\n"),
prefix, size->name, "PageRegion", "PageSize");
if (!warn)
if (verbose >= 0)
_cupsLangPrintf(stdout,
_(" %s Size \"%s\" defined for %s but not for "
- "%s!\n"),
+ "%s\n"),
prefix, size->name, "PageSize", "PageRegion");
if (!warn)
language;
language = (char *)cupsArrayNext(languages))
{
- langlen = strlen(language);
+ langlen = (int)strlen(language);
if (langlen != 2 && langlen != 5)
{
if (!warn && !errors && !verbose)
if (verbose >= 0)
_cupsLangPrintf(stdout,
- _(" %s Bad language \"%s\"!\n"),
+ _(" %s Bad language \"%s\"\n"),
prefix, language);
if (!warn)
if (verbose >= 0)
_cupsLangPrintf(stdout,
_(" %s Missing \"%s\" translation "
- "string for option %s!\n"),
+ "string for option %s\n"),
prefix, language, option->keyword);
if (!warn)
if (verbose >= 0)
_cupsLangPrintf(stdout,
_(" %s Bad UTF-8 \"%s\" translation "
- "string for option %s!\n"),
+ "string for option %s\n"),
prefix, language, option->keyword);
if (!warn)
_cupsLangPrintf(stdout,
_(" %s Bad UTF-8 \"%s\" "
"translation string for option %s, "
- "choice %s!\n"),
+ "choice %s\n"),
prefix, language,
ckeyword + 1 + strlen(language),
"True");
_cupsLangPrintf(stdout,
_(" %s Missing \"%s\" "
"translation string for option %s, "
- "choice %s!\n"),
+ "choice %s\n"),
prefix, language,
ckeyword + 1 + strlen(language),
cparam->name);
_cupsLangPrintf(stdout,
_(" %s Bad UTF-8 \"%s\" "
"translation string for option %s, "
- "choice %s!\n"),
+ "choice %s\n"),
prefix, language,
ckeyword + 1 + strlen(language),
cparam->name);
_cupsLangPrintf(stdout,
_(" %s Missing \"%s\" "
"translation string for option %s, "
- "choice %s!\n"),
+ "choice %s\n"),
prefix, language, option->keyword,
option->choices[j].choice);
_cupsLangPrintf(stdout,
_(" %s Bad UTF-8 \"%s\" "
"translation string for option %s, "
- "choice %s!\n"),
+ "choice %s\n"),
prefix, language, option->keyword,
option->choices[j].choice);
if (verbose >= 0)
_cupsLangPrintf(stdout,
_(" %s No base translation \"%s\" "
- "is included in file!\n"), prefix, ll);
+ "is included in file\n"), prefix, ll);
if (!warn)
errors ++;
"\n"
"Options:\n"
"\n"
+ " -I {filters,profiles}\n"
+ " Ignore missing files\n"
" -R root-directory Set alternate root\n"
" -W {all,none,constraints,defaults,duplex,filters,"
"profiles,sizes,translations}\n"
if (verbose >= 0)
_cupsLangPrintf(stdout,
_(" %s %s file \"%s\" has the wrong "
- "capitalization!\n"), prefix, keyword, path);
+ "capitalization\n"), prefix, keyword, path);
if (!warn)
errors ++;