From: msweet Date: Wed, 7 Oct 2009 18:20:31 +0000 (+0000) Subject: Merge changes from CUPS 1.5svn-r8842. X-Git-Tag: release-1.6.3~87 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fcups.git;a=commitdiff_plain;h=b226ab99134159fff1c3192d3bf22d2652db386b Merge changes from CUPS 1.5svn-r8842. git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@1709 a1ca3aef-8c08-0410-bb20-df032aa958be --- diff --git a/CHANGES-1.4.txt b/CHANGES-1.4.txt index 7bf0924d7..8d86a49ea 100644 --- a/CHANGES-1.4.txt +++ b/CHANGES-1.4.txt @@ -3,6 +3,20 @@ CHANGES-1.4.txt CHANGES IN CUPS V1.4.2 + - The documentation for classes.conf and printers.conf did not provide + the correct instructions for manual changes (STR #3351) + - The scheduler did not always rebuild printer cache files when the + driver was changed (STR #3356) + - The documentation makefile failed to install localizations when using + newer versions of Bash (STR #3360) + - The configure script did not use the --with-xinetd value for the + default LPD configuration path (STR #3347) + - The configure script incorrectly required glib for DBUS support + (STR #3346) + - The cupstestppd program incorrectly reported filters with bad + permisssions as missing (STR #3363) + - The Russian web interface templates had errors (STR #3359) + - The cups.desktop file used the wrong locale names (STR #3358) - cupsSideChannelRead() did not return an error for short reads. - The installed PAM configuration file did not use the correct options with the pam_unix2 module (STR #3313) diff --git a/config-scripts/cups-common.m4 b/config-scripts/cups-common.m4 index 8a744a745..8583acfaf 100644 --- a/config-scripts/cups-common.m4 +++ b/config-scripts/cups-common.m4 @@ -266,11 +266,6 @@ if test "x$enable_dbus" != xno; then dbus_message_iter_init_append, AC_DEFINE(HAVE_DBUS_MESSAGE_ITER_INIT_APPEND),, `$PKGCONFIG --libs dbus-1`) - if $PKGCONFIG --exists glib-2.0 && $PKGCONFIG --exists dbus-glib-1; then - DBUS_NOTIFIER="dbus" - DBUS_NOTIFIERLIBS="`$PKGCONFIG --libs glib-2.0` `$PKGCONFIG --libs dbus-glib-1` `$PKGCONFIG --libs dbus-1`" - CFLAGS="$CFLAGS `$PKGCONFIG --cflags glib-2.0`" - fi else AC_MSG_RESULT(no) fi @@ -289,7 +284,6 @@ LEGACY_BACKENDS="parallel scsi" case $uname in Darwin*) -# FONTS="" LEGACY_BACKENDS="" BACKLIBS="$BACKLIBS -framework IOKit" CUPSDLIBS="$CUPSDLIBS -sectorder __TEXT __text cupsd.order -e start -framework IOKit -framework SystemConfiguration -weak_framework ApplicationServices" diff --git a/config-scripts/cups-defaults.m4 b/config-scripts/cups-defaults.m4 index 53359e2a9..1a4eb7b89 100644 --- a/config-scripts/cups-defaults.m4 +++ b/config-scripts/cups-defaults.m4 @@ -325,8 +325,8 @@ if test x$default_lpdconfigfile != xno; then CUPS_DEFAULT_LPD_CONFIG_FILE="launchd:///System/Library/LaunchDaemons/org.cups.cups-lpd.plist" ;; *) - if test -d /etc/xinetd.d; then - CUPS_DEFAULT_LPD_CONFIG_FILE="xinetd:///etc/xinetd.d/cups-lpd" + if test "x$XINETD" != x; then + CUPS_DEFAULT_LPD_CONFIG_FILE="xinetd://$XINETD/cups-lpd" else CUPS_DEFAULT_LPD_CONFIG_FILE="" fi diff --git a/desktop/cups.desktop.in b/desktop/cups.desktop.in index d75b3ec17..44bb115f8 100644 --- a/desktop/cups.desktop.in +++ b/desktop/cups.desktop.in @@ -7,33 +7,33 @@ Terminal=false Type=Application Name=Manage Printing Comment=CUPS Web Interface -Name[de.UTF-8]=Druckerverwaltung -Comment[de.UTF-8]=CUPS Webinterface -Name[en_US.UTF-8]=Manage Printing -Comment[en_US.UTF-8]=CUPS Web Interface -Name[es.UTF-8]=Administrar impresión -Comment[es.UTF-8]=Interfaz Web de CUPS -Name[et.UTF-8]=Trükkimise haldur -Comment[et.UTF-8]=CUPS-i veebiliides -Name[eu.UTF-8]=Kudeatu inprimaketak -Comment[eu.UTF-8]=CUPSen web interfazea -Name[fr.UTF-8]=Gestionnaire d'impression -Comment[fr.UTF-8]=Interface Web de CUPS -Name[he.UTF-8]=נהל הדפסות -Comment[he.UTF-8]=ממשק דפדפן של CUPS -Name[id.UTF-8]=Manajemen Pencetakan -Comment[id.UTF-8]=Antarmuka Web CUPS -Name[it.UTF-8]=Gestione stampa -Comment[it.UTF-8]=Interfaccia web di CUPS -Name[ja.UTF-8]=印刷の管理 -Comment[ja.UTF-8]=CUPS Web インタフェース -Name[pl.UTF-8]=Zarządzanie drukowaniem -Comment[pl.UTF-8]=Interfejs WWW CUPS -Name[ru.UTF-8]=Настройка печати -Comment[ru.UTF-8]=Настройка CUPS -Name[sv.UTF-8]=Hantera skrivare -Comment[sv.UTF-8]=CUPS webb-gränssnitt -Name[zh.UTF-8]=打印机管理 -Comment[zh.UTF-8]=CUPS网页界面 -Name[zh_TW.UTF-8]=印表管理 -Comment[zh_TW.UTF-8]=CUPS 網頁介面 +Name[de]=Druckerverwaltung +Comment[de]=CUPS Webinterface +Name[en_US]=Manage Printing +Comment[en_US]=CUPS Web Interface +Name[es]=Administrar impresión +Comment[es]=Interfaz Web de CUPS +Name[et]=Trükkimise haldur +Comment[et]=CUPS-i veebiliides +Name[eu]=Kudeatu inprimaketak +Comment[eu]=CUPSen web interfazea +Name[fr]=Gestionnaire d'impression +Comment[fr]=Interface Web de CUPS +Name[he]=נהל הדפסות +Comment[he]=ממשק דפדפן של CUPS +Name[id]=Manajemen Pencetakan +Comment[id]=Antarmuka Web CUPS +Name[it]=Gestione stampa +Comment[it]=Interfaccia web di CUPS +Name[ja]=印刷の管理 +Comment[ja]=CUPS Web インタフェース +Name[pl]=Zarządzanie drukowaniem +Comment[pl]=Interfejs WWW CUPS +Name[ru]=Настройка печати +Comment[ru]=Настройка CUPS +Name[sv]=Hantera skrivare +Comment[sv]=CUPS webb-gränssnitt +Name[zh]=打印机管理 +Comment[zh]=CUPS网页界面 +Name[zh_TW]=印表管理 +Comment[zh_TW]=CUPS 網頁介面 diff --git a/doc/Makefile b/doc/Makefile index 0e3524cf8..be2d65e2b 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -190,8 +190,8 @@ install-languages: for lang in $(LANGUAGES); do \ if test -d $$lang; then \ $(INSTALL_DIR) -m 755 $(DOCDIR)/$$lang; \ - $(INSTALL_MAN) $$lang/index.html $(DOCDIR)/$$lang; \ - test -f $$lang/cups.css && $(INSTALL_MAN) $$lang/cups.css $(DOCDIR)/$$lang; \ + $(INSTALL_DATA) $$lang/index.html $(DOCDIR)/$$lang; \ + $(INSTALL_DATA) $$lang/cups.css $(DOCDIR)/$$lang >/dev/null 2>&1 || true; \ fi; \ done diff --git a/doc/help/ref-classes-conf.html b/doc/help/ref-classes-conf.html index 9224c5a60..40bc3d5e2 100644 --- a/doc/help/ref-classes-conf.html +++ b/doc/help/ref-classes-conf.html @@ -21,8 +21,8 @@ can be modified using your favorite text editor, you should normally use the lpadmin(8) command, web interface, or any of the available GUIs to manage your classes instead. If you do choose to edit this file -manually, you will need to restart the scheduler to make them -active.

+manually, you will need to stop the scheduler first, make your +changes, and then start the scheduler to make them active.

Accepting

diff --git a/doc/help/ref-printers-conf.html b/doc/help/ref-printers-conf.html index 3539f8cfe..9568fc7c8 100644 --- a/doc/help/ref-printers-conf.html +++ b/doc/help/ref-printers-conf.html @@ -21,8 +21,8 @@ and can be modified using your favorite text editor, you should normally use the lpadmin(8) command, web interface, or any of the available GUIs to manage your printers instead. If you do choose to edit this file -manually, you will need to restart the scheduler to make them -active.

+manually, you will need to stop the scheduler first, make your +changes, and then start the scheduler to make them active.

Accepting

diff --git a/man/cupstestppd.man b/man/cupstestppd.man index fbfb46b47..5287b76ea 100644 --- a/man/cupstestppd.man +++ b/man/cupstestppd.man @@ -12,12 +12,14 @@ .\" which should have been included with this file. If this file is .\" file is missing or damaged, see the license at "http://www.cups.org/". .\" -.TH cupstestppd 1 "CUPS" "2 March 2009" "Apple Inc." +.TH cupstestppd 1 "CUPS" "6 October 2009" "Apple Inc." .SH NAME cupstestppd \- test conformance of ppd files .SH SYNOPSIS .B cupstestppd -[ -R +[ -I +.I category +] [ -R .I rootdir ] [ -W .I category @@ -42,6 +44,14 @@ on the standard input. .SH OPTIONS \fIcupstestppd\fR supports the following options: .TP 5 +-I filters +.br +Ignores all filter errors. +.TP 5 +-I profiles +.br +Ignores all profile errors. +.TP 5 -R rootdir .br Specifies an alternate root directory for the filter, pre-filter, diff --git a/packaging/installer.gif b/packaging/installer.gif index bbbd24bed..3ae6ea77a 100644 Binary files a/packaging/installer.gif and b/packaging/installer.gif differ diff --git a/packaging/installer.tif b/packaging/installer.tif index 7eba7a2f9..cc52bc65a 100644 Binary files a/packaging/installer.tif and b/packaging/installer.tif differ diff --git a/scheduler/classes.c b/scheduler/classes.c index 87c3d07bc..77214aba6 100644 --- a/scheduler/classes.c +++ b/scheduler/classes.c @@ -728,6 +728,7 @@ cupsdSaveAllClasses(void) cupsFilePuts(fp, "# Class configuration file for " CUPS_SVERSION "\n"); cupsFilePrintf(fp, "# Written by cupsd on %s\n", temp); + cupsFilePuts(fp, "# DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING\n"); /* * Write each local class known to the system... diff --git a/scheduler/ipp.c b/scheduler/ipp.c index 60aa932ec..50b169195 100644 --- a/scheduler/ipp.c +++ b/scheduler/ipp.c @@ -2324,8 +2324,9 @@ add_printer(cupsd_client_t *con, /* I - Client connection */ dstfile[1024]; /* Destination Script/PPD file */ int modify; /* Non-zero if we are modifying */ char newname[IPP_MAX_NAME]; /* New printer name */ - int need_restart_job; /* Need to restart job? */ - int set_device_uri, /* Did we set the device URI? */ + int changed_driver, /* Changed the PPD/interface script? */ + need_restart_job, /* Need to restart job? */ + set_device_uri, /* Did we set the device URI? */ set_port_monitor; /* Did we set the port monitor? */ @@ -2469,6 +2470,7 @@ add_printer(cupsd_client_t *con, /* I - Client connection */ * Look for attributes and copy them over as needed... */ + changed_driver = 0; need_restart_job = 0; if ((attr = ippFindAttribute(con->request, "printer-location", @@ -2722,6 +2724,7 @@ add_printer(cupsd_client_t *con, /* I - Client connection */ if (con->filename) { need_restart_job = 1; + changed_driver = 1; strlcpy(srcfile, con->filename, sizeof(srcfile)); @@ -2792,18 +2795,6 @@ add_printer(cupsd_client_t *con, /* I - Client connection */ cupsdLogMessage(CUPSD_LOG_DEBUG, "Copied PPD file successfully!"); chmod(dstfile, 0644); - -#ifdef __APPLE__ - /* - * (Re)register color profiles... - */ - - if (!RunUser) - { - apple_unregister_profiles(printer); - apple_register_profiles(printer); - } -#endif /* __APPLE__ */ } else { @@ -2820,6 +2811,7 @@ add_printer(cupsd_client_t *con, /* I - Client connection */ IPP_TAG_NAME)) != NULL) { need_restart_job = 1; + changed_driver = 1; if (!strcmp(attr->values[0].string.text, "raw")) { @@ -2857,19 +2849,33 @@ add_printer(cupsd_client_t *con, /* I - Client connection */ cupsdLogMessage(CUPSD_LOG_DEBUG, "Copied PPD file successfully!"); chmod(dstfile, 0644); + } + } + + if (changed_driver) + { + /* + * If we changed the PPD/interface script, then remove the printer's cache + * file... + */ + + char cache_name[1024]; /* Cache filename for printer attrs */ + + snprintf(cache_name, sizeof(cache_name), "%s/%s.ipp", CacheDir, + printer->name); + unlink(cache_name); #ifdef __APPLE__ - /* - * (Re)register color profiles... - */ + /* + * (Re)register color profiles... + */ - if (!RunUser) - { - apple_unregister_profiles(printer); - apple_register_profiles(printer); - } -#endif /* __APPLE__ */ + if (!RunUser) + { + apple_unregister_profiles(printer); + apple_register_profiles(printer); } +#endif /* __APPLE__ */ } /* diff --git a/scheduler/printers.c b/scheduler/printers.c index 844000854..60028a722 100644 --- a/scheduler/printers.c +++ b/scheduler/printers.c @@ -1518,6 +1518,7 @@ cupsdSaveAllPrinters(void) cupsFilePuts(fp, "# Printer configuration file for " CUPS_SVERSION "\n"); cupsFilePrintf(fp, "# Written by cupsd on %s\n", temp); + cupsFilePuts(fp, "# DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING\n"); /* * Write each local printer known to the system... diff --git a/systemv/cupstestppd.c b/systemv/cupstestppd.c index dda0f0e75..dbda500e0 100644 --- a/systemv/cupstestppd.c +++ b/systemv/cupstestppd.c @@ -100,6 +100,17 @@ enum }; +/* + * 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)... */ @@ -304,6 +315,7 @@ main(int argc, /* I - Number of command-line args */ 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 */ @@ -341,6 +353,7 @@ main(int argc, /* I - Number of command-line args */ status = ERROR_NONE; root = ""; warn = WARN_NONE; + ignore = WARN_NONE; for (i = 1; i < argc; i ++) if (argv[i][0] == '-' && argv[i][1]) @@ -348,6 +361,24 @@ main(int argc, /* I - Number of command-line args */ 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 ++; @@ -357,7 +388,7 @@ main(int argc, /* I - Number of command-line args */ root = argv[i]; break; - case 'W' : /* Turn errors into warnings */ + case 'W' : /* Turn errors into warnings */ i ++; if (i >= argc) @@ -1256,10 +1287,10 @@ main(int argc, /* I - Number of command-line args */ 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)) @@ -1387,18 +1418,18 @@ main(int argc, /* I - Number of command-line args */ { 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 @@ -2411,6 +2442,7 @@ check_filters(ppd_file_t *ppd, /* I - PPD file */ 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**"; @@ -2452,14 +2484,28 @@ check_filters(ppd_file_t *ppd, /* I - PPD file */ 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 ++; @@ -2523,18 +2569,33 @@ check_filters(ppd_file_t *ppd, /* I - PPD file */ 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); } @@ -2562,8 +2623,11 @@ check_filters(ppd_file_t *ppd, /* I - PPD file */ if (!warn) errors ++; } + + snprintf(pathprog, sizeof(pathprog), "%s%s", root, + attr->value ? attr->value : "(null)"); - if (!attr->value || access(attr->value, 0)) + if (!attr->value || stat(pathprog, &fileinfo)) { if (!warn && !errors && !verbose) _cupsLangPuts(stdout, _(" FAIL\n")); @@ -2571,13 +2635,28 @@ check_filters(ppd_file_t *ppd, /* I - PPD file */ if (verbose >= 0) _cupsLangPrintf(stdout, _(" %s Missing " "APDialogExtension file \"%s\"\n"), - prefix, attr->value ? attr->value : ""); + 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); } @@ -2601,7 +2680,10 @@ check_filters(ppd_file_t *ppd, /* I - PPD file */ errors ++; } - if (!attr->value || access(attr->value, 0)) + 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")); @@ -2609,13 +2691,28 @@ check_filters(ppd_file_t *ppd, /* I - PPD file */ if (verbose >= 0) _cupsLangPrintf(stdout, _(" %s Missing " "APPrinterIconPath file \"%s\"\n"), - prefix, attr->value ? attr->value : ""); + 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); } @@ -2639,7 +2736,10 @@ check_filters(ppd_file_t *ppd, /* I - PPD file */ errors ++; } - if (!attr->value || access(attr->value, 0)) + 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")); @@ -2647,13 +2747,28 @@ check_filters(ppd_file_t *ppd, /* I - PPD file */ if (verbose >= 0) _cupsLangPrintf(stdout, _(" %s Missing " "APPrinterLowInkTool file \"%s\"\n"), - prefix, attr->value ? attr->value : ""); + 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); } @@ -2677,7 +2792,10 @@ check_filters(ppd_file_t *ppd, /* I - PPD file */ errors ++; } - if (!attr->value || access(attr->value, 0)) + 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")); @@ -2685,13 +2803,28 @@ check_filters(ppd_file_t *ppd, /* I - PPD file */ if (verbose >= 0) _cupsLangPrintf(stdout, _(" %s Missing " "APPrinterUtilityPath file \"%s\"\n"), - prefix, attr->value ? attr->value : ""); + 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", attr->value, errors, verbose, + errors = valid_path("APPrinterUtilityPath", pathprog, errors, verbose, warn); } @@ -2715,7 +2848,7 @@ check_filters(ppd_file_t *ppd, /* I - PPD file */ errors ++; } - if (!attr->value || access(attr->value, 0)) + if (!attr->value || stat(attr->value, &fileinfo)) { if (!warn && !errors && !verbose) _cupsLangPuts(stdout, _(" FAIL\n")); @@ -2728,6 +2861,21 @@ check_filters(ppd_file_t *ppd, /* I - PPD file */ 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("APScanAppPath", attr->value, errors, verbose, warn); @@ -2768,6 +2916,7 @@ check_profiles(ppd_file_t *ppd, /* I - PPD file */ 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 */ @@ -2822,14 +2971,29 @@ check_profiles(ppd_file_t *ppd, /* I - PPD file */ 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 ++; @@ -3489,6 +3653,8 @@ usage(void) "\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" diff --git a/templates/Makefile b/templates/Makefile index 6ea624aba..14235fd78 100644 --- a/templates/Makefile +++ b/templates/Makefile @@ -3,7 +3,7 @@ # # Template makefile for the Common UNIX Printing System (CUPS). # -# Copyright 2007-2008 by Apple Inc. +# Copyright 2007-2009 by Apple Inc. # Copyright 1993-2007 by Easy Software Products. # # These coded instructions, statements, and computer programs are the @@ -149,7 +149,7 @@ install-languages: if test -d $$lang; then \ $(INSTALL_DIR) -m 755 $(DATADIR)/templates/$$lang; \ for file in $(FILES); do \ - $(INSTALL_DATA) $$lang/$$file $(DATADIR)/templates/$$lang 2>/dev/null || true; \ + $(INSTALL_DATA) $$lang/$$file $(DATADIR)/templates/$$lang >/dev/null 2>&1 || true; \ done \ fi \ done diff --git a/templates/ru/printer-purge.tmpl b/templates/ru/printer-purge.tmpl index e00f4b347..44fda0d1f 100644 --- a/templates/ru/printer-purge.tmpl +++ b/templates/ru/printer-purge.tmpl @@ -3,7 +3,7 @@

Очистка всех заданий для {is_class?группы:принтера} {printer_name}

Все задания для {is_class?группы:принтера} «{printer_name}» +HREF="/{is_class?classes:printers}/{printer_name}">{printer_name}» очищены.

- \ No newline at end of file + diff --git a/templates/ru/printer-reject.tmpl b/templates/ru/printer-reject.tmpl index 5e34253d6..488203c92 100644 --- a/templates/ru/printer-reject.tmpl +++ b/templates/ru/printer-reject.tmpl @@ -3,7 +3,7 @@

Отмена заданий для {is_class?группы:принтера} {printer_name}

{is_class?Группа:Принтер} «{printer_name}» +HREF="/{is_class?classes:printers}/{printer_name}">{printer_name}» больше не принимает задания.

diff --git a/templates/ru/printer-start.tmpl b/templates/ru/printer-start.tmpl index 55c68a7fc..69ffa7ef5 100644 --- a/templates/ru/printer-start.tmpl +++ b/templates/ru/printer-start.tmpl @@ -3,7 +3,7 @@

Возобновить работу {is_class?группы:принтера} {printer_name}

{is_class?Группа:Принтер} «{printer_name}» +HREF="/{is_class?classes:printers}/{printer_name}">{printer_name}» теперь принимают задания.

- \ No newline at end of file + diff --git a/templates/ru/printer-stop.tmpl b/templates/ru/printer-stop.tmpl index e7a46ea28..3fecd1e73 100644 --- a/templates/ru/printer-stop.tmpl +++ b/templates/ru/printer-stop.tmpl @@ -3,7 +3,7 @@

Приостановить {is_class?группу:принтер} {printer_name}

{is_class?Группа:Принтер} «{printer_name}» +HREF="/{is_class?classes:printers}/{printer_name}">{printer_name}» {is_class?была приостановлена:был приостановлен}.

- \ No newline at end of file + diff --git a/tools/testosx b/tools/testosx index 918e7a41c..4547977f2 100755 --- a/tools/testosx +++ b/tools/testosx @@ -20,7 +20,7 @@ fi rev=`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[a-zA-Z]*//g'` if test $# = 0; then - version="1.4svn-r$rev" + version="1.5svn-r$rev" else version=$1 fi @@ -99,7 +99,7 @@ for file in packaging/cups-desc.plist packaging/cups-info.plist \ echo Updating $file... sed -e '1,$s/@CUPS_VERSION@/'$version'/g' \ -e '1,$s/@CUPS_REVISION@//g' \ - -e '1,$s/@CUPS_RELEASE@/1.4.'$rev'/g' \ + -e '1,$s/@CUPS_RELEASE@/1.5.'$rev'/g' \ <$file.in >$file done