From 07725fee410af68be5081d9b1af3536eff5326b8 Mon Sep 17 00:00:00 2001 From: jlovell Date: Fri, 22 Sep 2006 05:53:50 +0000 Subject: [PATCH] Load cups into easysw/current. git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@216 a1ca3aef-8c08-0410-bb20-df032aa958be --- CHANGES.txt | 45 ++- backend/ipp.c | 30 +- backend/snmp.c | 14 +- backend/socket.c | 8 +- berkeley/Dependencies | 10 +- berkeley/lpc.c | 6 +- berkeley/lpq.c | 6 +- berkeley/lpr.c | 6 +- berkeley/lprm.c | 6 +- cgi-bin/Dependencies | 24 +- cgi-bin/search.c | 8 +- config-scripts/cups-common.m4 | 6 +- config-scripts/cups-defaults.m4 | 8 +- cups/Dependencies | 6 +- cups/adminutil.c | 27 +- cups/auth.c | 6 +- cups/cups.h | 8 +- cups/dir.c | 39 +-- cups/emit.c | 10 +- cups/http.c | 11 +- cups/i18n.h | 6 +- cups/langprintf.c | 53 +++- cups/language.c | 19 +- doc/help/ref-classes-conf.html | 4 +- doc/help/ref-printers-conf.html | 4 +- filter/Dependencies | 24 +- filter/interpret.c | 7 +- man/classes.conf.man | 6 +- man/lpadmin.man | 6 +- man/printers.conf.man | 6 +- notifier/Dependencies | 2 +- packaging/cups.list.in | 19 +- pdftops/Dependencies | 45 --- scheduler/Dependencies | 3 + scheduler/Makefile | 18 +- scheduler/auth.c | 8 +- scheduler/banners.c | 6 +- scheduler/client.c | 82 +++-- scheduler/client.h | 6 +- scheduler/dirsvc.c | 10 +- scheduler/ipp.c | 40 +-- scheduler/job.c | 204 +++++++----- scheduler/job.h | 7 +- scheduler/listen.c | 11 +- scheduler/printers.c | 23 +- scheduler/quotas.c | 10 +- scheduler/testsub.c | 531 ++++++++++++++++++++++++++++++++ systemv/accept.c | 6 +- systemv/cancel.c | 6 +- systemv/cupsaddsmb.c | 6 +- systemv/cupstestdsc.c | 6 +- systemv/cupstestppd.c | 6 +- systemv/lp.c | 6 +- systemv/lpadmin.c | 6 +- systemv/lpinfo.c | 6 +- systemv/lpmove.c | 6 +- systemv/lpoptions.c | 6 +- systemv/lppasswd.c | 6 +- systemv/lpstat.c | 6 +- templates/de/help-header.tmpl | 2 +- templates/de/printers.tmpl | 2 +- templates/es/help-header.tmpl | 2 +- templates/help-header.tmpl | 2 +- templates/ja/help-header.tmpl | 2 +- templates/pl/help-header.tmpl | 2 +- templates/pl/jobs-header.tmpl | 12 +- templates/sv/help-header.tmpl | 2 +- tools/testosx | 2 +- 68 files changed, 1124 insertions(+), 420 deletions(-) create mode 100644 scheduler/testsub.c diff --git a/CHANGES.txt b/CHANGES.txt index 5ac921349..de49e923b 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,49 @@ -CHANGES.txt - 2006-08-29 +CHANGES.txt - 2006-09-21 ------------------------ +CHANGES IN CUPS V1.2.4 + + - The --with-printcap configure option did not work (STR + #1984) + - The character set reported by cupsLangGet() did not + always reflect the default character set of a given + locale (STR #1983) + - Older Lexmark and Tektronix printers did not work with + IPP (STR #1980) + - Failsafe printing did not work (PR #6328) + - Some web interface redirects did not work (STR #1978) + - The web interface change settings button could + introduce a "Port 0" line in cupsd.conf if there was no + loopback connection available (STR #1979) + - The web interface change settings and edit + configuration file buttons would truncate the + cupsd.conf file (STR #1976) + - The German web interface used the wrong printer icon + images (STR #1973) + - The "All Documents" link in the on-line help was + missing a trailing slash (STR #1971) + - The Polish web interface translation used the wrong + URLs for the job history (STR #1963) + - The "reprint job" button did not work (STR #1956) + - The scheduler did not always report printer or job + events properly (STR #1955) + - The scheduler always stopped the queue on error, + regardless of the exit code, if the error policy was + set to "stop-printer" (STR #1959) + - ppdEmitJCL() included UTF-8 characters in the JCL job + name, which caused problems on some printers (STR + #1959) + - Fixed a buffering problem that cause high CPU usage + (STR #1968) + - The command-line applications did not convert + command-line strings to UTF-8 as needed (STR #1958) + - cupsDirRead() incorrectly aborted when reading a + symbolic link that pointed to a file/directory that did + not exist (STR #1953) + - The cupsInterpretRasterPPD() function did not handle + custom page sizes properly. + + CHANGES IN CUPS V1.2.3 - The scheduler did not send job-state or diff --git a/backend/ipp.c b/backend/ipp.c index 73ad5f6f4..a5408059b 100644 --- a/backend/ipp.c +++ b/backend/ipp.c @@ -1,5 +1,5 @@ /* - * "$Id: ipp.c 5889 2006-08-24 21:44:35Z mike $" + * "$Id: ipp.c 5956 2006-09-13 18:22:34Z mike $" * * IPP backend for the Common UNIX Printing System (CUPS). * @@ -855,15 +855,15 @@ main(int argc, /* I - Number of command-line args */ num_options, &options); } - if (copies_sup) + if (copies_sup && version > 0) { /* * Only send options if the destination printer supports the copies - * attribute. This is a hack for the HP JetDirect implementation of - * IPP, which does not accept extension attributes and incorrectly - * reports a client-error-bad-request error instead of the - * successful-ok-unsupported-attributes status. In short, at least - * some HP implementations of IPP are non-compliant. + * attribute and IPP/1.1. This is a hack for the HP and Lexmark + * implementations of IPP, which do not accept extension attributes + * and incorrectly report a client-error-bad-request error instead of + * the successful-ok-unsupported-attributes status. In short, at least + * some HP and Lexmark implementations of IPP are non-compliant. */ cupsEncodeOptions(request, num_options, options); @@ -877,7 +877,7 @@ main(int argc, /* I - Number of command-line args */ /* * If copies aren't supported, then we are likely dealing with an HP * JetDirect. The HP IPP implementation seems to close the connection - * after every request (that is, it does *not* implement HTTP Keep- + * after every request - that is, it does *not* implement HTTP Keep- * Alive, which is REQUIRED by HTTP/1.1... */ @@ -908,6 +908,18 @@ main(int argc, /* I - Number of command-line args */ fputs("INFO: Printer is busy; retrying print job...\n", stderr); sleep(10); } + else if ((ipp_status == IPP_BAD_REQUEST || + ipp_status == IPP_VERSION_NOT_SUPPORTED) && version == 1) + { + /* + * Switch to IPP/1.0... + */ + + fputs("INFO: Printer does not support IPP/1.1, trying IPP/1.0...\n", + stderr); + version = 0; + httpReconnect(http); + } else fprintf(stderr, "ERROR: Print file was not accepted (%s)!\n", cupsLastErrorString()); @@ -1641,5 +1653,5 @@ sigterm_handler(int sig) /* I - Signal */ /* - * End of "$Id: ipp.c 5889 2006-08-24 21:44:35Z mike $". + * End of "$Id: ipp.c 5956 2006-09-13 18:22:34Z mike $". */ diff --git a/backend/snmp.c b/backend/snmp.c index 4a90f2ebc..c1af7cefc 100644 --- a/backend/snmp.c +++ b/backend/snmp.c @@ -1,5 +1,5 @@ /* - * "$Id: snmp.c 5898 2006-08-28 18:54:10Z mike $" + * "$Id: snmp.c 5976 2006-09-20 22:46:15Z mike $" * * SNMP discovery backend for the Common UNIX Printing System (CUPS). * @@ -1728,12 +1728,14 @@ probe_device(snmp_cache_t *device) /* I - Device */ debug_printf("DEBUG: %.3f Probing %s...\n", run_time(), device->addrname); if (device->make_and_model && - (!strncasecmp(device->make_and_model, "Xerox", 5) || - !strncasecmp(device->make_and_model, "Kyocera", 7))) + (!strncasecmp(device->make_and_model, "Kyocera", 7) || + !strncasecmp(device->make_and_model, "Lexmark", 7) || + !strncasecmp(device->make_and_model, "Tektronix", 9) || + !strncasecmp(device->make_and_model, "Xerox", 5))) { /* - * Xerox and Kyocera printers often lock up on IPP probes, so exclude - * them from the IPP connection test... + * Kyocera, Lexmark, Tektronix, and Xerox printers often lock up on + * IPP probes, so exclude them from the IPP connection test... */ http = NULL; @@ -2452,5 +2454,5 @@ update_cache(snmp_cache_t *device, /* I - Device */ /* - * End of "$Id: snmp.c 5898 2006-08-28 18:54:10Z mike $". + * End of "$Id: snmp.c 5976 2006-09-20 22:46:15Z mike $". */ diff --git a/backend/socket.c b/backend/socket.c index 266fe7781..265e142e3 100644 --- a/backend/socket.c +++ b/backend/socket.c @@ -1,5 +1,5 @@ /* - * "$Id: socket.c 5591 2006-05-26 19:51:59Z mike $" + * "$Id: socket.c 5948 2006-09-12 13:58:39Z mike $" * * AppSocket backend for the Common UNIX Printing System (CUPS). * @@ -340,11 +340,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ FD_ZERO(&input); FD_SET(device_fd, &input); -#ifdef __hpux - if (select(device_fd + 1, (int *)&input, NULL, NULL, &timeout) > 0) -#else if (select(device_fd + 1, &input, NULL, NULL, &timeout) > 0) -#endif /* __hpux */ { /* * Grab the data coming back and spit it out to stderr... @@ -387,5 +383,5 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ /* - * End of "$Id: socket.c 5591 2006-05-26 19:51:59Z mike $". + * End of "$Id: socket.c 5948 2006-09-12 13:58:39Z mike $". */ diff --git a/berkeley/Dependencies b/berkeley/Dependencies index d8db9344a..767d33e1c 100644 --- a/berkeley/Dependencies +++ b/berkeley/Dependencies @@ -2,13 +2,15 @@ lpc.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h lpc.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h -lpc.o: ../cups/i18n.h ../cups/debug.h ../cups/string.h ../config.h +lpc.o: ../cups/i18n.h ../cups/transcode.h ../cups/debug.h ../cups/string.h +lpc.o: ../config.h lpq.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h lpq.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/array.h -lpq.o: ../cups/file.h ../cups/language.h ../cups/i18n.h ../cups/debug.h +lpq.o: ../cups/file.h ../cups/language.h ../cups/i18n.h ../cups/transcode.h +lpq.o: ../cups/debug.h lpr.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h lpr.o: ../cups/http.h ../cups/md5.h ../cups/ppd.h ../cups/array.h -lpr.o: ../cups/file.h ../cups/language.h ../cups/i18n.h +lpr.o: ../cups/file.h ../cups/language.h ../cups/i18n.h ../cups/transcode.h lprm.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h lprm.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h -lprm.o: ../cups/i18n.h ../cups/string.h ../config.h +lprm.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h diff --git a/berkeley/lpc.c b/berkeley/lpc.c index c00a23a7a..96aca4b00 100644 --- a/berkeley/lpc.c +++ b/berkeley/lpc.c @@ -1,5 +1,5 @@ /* - * "$Id: lpc.c 5833 2006-08-16 20:05:58Z mike $" + * "$Id: lpc.c 5926 2006-09-05 20:45:47Z mike $" * * "lpc" command for the Common UNIX Printing System (CUPS). * @@ -65,7 +65,7 @@ main(int argc, /* I - Number of command-line arguments */ *params; /* Pointer to parameters */ - _cupsSetLocale(); + _cupsSetLocale(argv); /* * Connect to the scheduler... @@ -520,5 +520,5 @@ show_status(http_t *http, /* I - HTTP connection to server */ /* - * End of "$Id: lpc.c 5833 2006-08-16 20:05:58Z mike $". + * End of "$Id: lpc.c 5926 2006-09-05 20:45:47Z mike $". */ diff --git a/berkeley/lpq.c b/berkeley/lpq.c index 78387fd5d..1feacaaf4 100644 --- a/berkeley/lpq.c +++ b/berkeley/lpq.c @@ -1,5 +1,5 @@ /* - * "$Id: lpq.c 5838 2006-08-17 14:41:42Z mike $" + * "$Id: lpq.c 5926 2006-09-05 20:45:47Z mike $" * * "lpq" command for the Common UNIX Printing System (CUPS). * @@ -78,7 +78,7 @@ main(int argc, /* I - Number of command-line arguments */ cups_dest_t *dests; /* Destinations */ - _cupsSetLocale(); + _cupsSetLocale(argv); /* * Check for command-line options... @@ -676,5 +676,5 @@ usage(void) /* - * End of "$Id: lpq.c 5838 2006-08-17 14:41:42Z mike $". + * End of "$Id: lpq.c 5926 2006-09-05 20:45:47Z mike $". */ diff --git a/berkeley/lpr.c b/berkeley/lpr.c index 90b73bf4d..1597aef2f 100644 --- a/berkeley/lpr.c +++ b/berkeley/lpr.c @@ -1,5 +1,5 @@ /* - * "$Id: lpr.c 5838 2006-08-17 14:41:42Z mike $" + * "$Id: lpr.c 5926 2006-09-05 20:45:47Z mike $" * * "lpr" command for the Common UNIX Printing System (CUPS). * @@ -93,7 +93,7 @@ main(int argc, /* I - Number of command-line arguments */ #endif /* HAVE_SIGACTION && !HAVE_SIGSET */ - _cupsSetLocale(); + _cupsSetLocale(argv); deletefile = 0; printer = NULL; @@ -529,5 +529,5 @@ sighandler(int s) /* I - Signal number */ /* - * End of "$Id: lpr.c 5838 2006-08-17 14:41:42Z mike $". + * End of "$Id: lpr.c 5926 2006-09-05 20:45:47Z mike $". */ diff --git a/berkeley/lprm.c b/berkeley/lprm.c index 574f26507..0551dbbd4 100644 --- a/berkeley/lprm.c +++ b/berkeley/lprm.c @@ -1,5 +1,5 @@ /* - * "$Id: lprm.c 5878 2006-08-24 15:55:42Z mike $" + * "$Id: lprm.c 5926 2006-09-05 20:45:47Z mike $" * * "lprm" command for the Common UNIX Printing System (CUPS). * @@ -61,7 +61,7 @@ main(int argc, /* I - Number of command-line arguments */ http_encryption_t encryption; /* Encryption? */ - _cupsSetLocale(); + _cupsSetLocale(argv); /* * Setup to cancel individual print jobs... @@ -294,5 +294,5 @@ main(int argc, /* I - Number of command-line arguments */ /* - * End of "$Id: lprm.c 5878 2006-08-24 15:55:42Z mike $". + * End of "$Id: lprm.c 5926 2006-09-05 20:45:47Z mike $". */ diff --git a/cgi-bin/Dependencies b/cgi-bin/Dependencies index a1e09d398..7e976859d 100644 --- a/cgi-bin/Dependencies +++ b/cgi-bin/Dependencies @@ -3,47 +3,49 @@ help-index.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h help-index.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h help-index.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h -help-index.o: ../cups/i18n.h ../cups/string.h ../config.h ../cups/dir.h +help-index.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h +help-index.o: ../cups/dir.h html.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h html.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h html.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h -html.o: ../cups/i18n.h ../cups/string.h ../config.h +html.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h ipp-var.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h ipp-var.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h ipp-var.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h -ipp-var.o: ../cups/i18n.h ../cups/string.h ../config.h +ipp-var.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h search.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h search.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h search.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h -search.o: ../cups/i18n.h ../cups/string.h ../config.h +search.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h template.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h template.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h template.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h -template.o: ../cups/i18n.h ../cups/string.h ../config.h +template.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h var.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h var.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h var.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h -var.o: ../cups/i18n.h ../cups/string.h ../config.h +var.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h admin.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h admin.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h admin.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h -admin.o: ../cups/i18n.h ../cups/string.h ../config.h ../cups/file.h +admin.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h +admin.o: ../cups/adminutil.h ../cups/cups.h ../cups/file.h classes.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h classes.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h classes.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h -classes.o: ../cups/i18n.h ../cups/string.h ../config.h +classes.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h help.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h help.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h help.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h -help.o: ../cups/i18n.h ../cups/string.h ../config.h +help.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h jobs.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h jobs.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h jobs.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h -jobs.o: ../cups/i18n.h ../cups/string.h ../config.h +jobs.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h printers.o: cgi-private.h cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h printers.o: ../cups/md5.h ../cups/ppd.h ../cups/array.h ../cups/file.h printers.o: ../cups/language.h ../cups/array.h help-index.h ../cups/debug.h -printers.o: ../cups/i18n.h ../cups/string.h ../config.h +printers.o: ../cups/i18n.h ../cups/transcode.h ../cups/string.h ../config.h testcgi.o: cgi.h ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/md5.h testcgi.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h testcgi.o: ../cups/array.h help-index.h diff --git a/cgi-bin/search.c b/cgi-bin/search.c index 4f1ea072a..205a40cff 100644 --- a/cgi-bin/search.c +++ b/cgi-bin/search.c @@ -1,9 +1,9 @@ /* - * "$Id: search.c 4859 2005-11-30 23:45:24Z mike $" + * "$Id: search.c 5963 2006-09-17 19:01:47Z mike $" * * Search routines for the Common UNIX Printing System (CUPS). * - * Copyright 1997-2005 by Easy Software Products. + * Copyright 1997-2006 by Easy Software Products. * * These coded instructions, statements, and computer programs are the * property of Easy Software Products and are protected by Federal @@ -225,6 +225,8 @@ cgiCompileSearch(const char *query) /* I - Query string */ *sptr++ = *qptr++; } + *sptr = '\0'; + /* * For "word1 AND word2", add reciprocal "word2 AND word1"... */ @@ -364,5 +366,5 @@ cgiFreeSearch(void *search) /* I - Search context */ /* - * End of "$Id: search.c 4859 2005-11-30 23:45:24Z mike $". + * End of "$Id: search.c 5963 2006-09-17 19:01:47Z mike $". */ diff --git a/config-scripts/cups-common.m4 b/config-scripts/cups-common.m4 index d8c4d01f2..5674a8d3a 100644 --- a/config-scripts/cups-common.m4 +++ b/config-scripts/cups-common.m4 @@ -1,5 +1,5 @@ dnl -dnl "$Id: cups-common.m4 5843 2006-08-17 18:49:31Z mike $" +dnl "$Id: cups-common.m4 5930 2006-09-07 19:49:34Z mike $" dnl dnl Common configuration stuff for the Common UNIX Printing System (CUPS). dnl @@ -29,7 +29,7 @@ dnl Set the name of the config header file... AC_CONFIG_HEADER(config.h) dnl Versio number information... -CUPS_VERSION="1.2.3" +CUPS_VERSION="1.2.4" CUPS_REVISION="" if test -z "$CUPS_REVISION" -a -d .svn; then CUPS_REVISION="-r`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[[a-zA-Z]]*//g'`" @@ -265,5 +265,5 @@ AC_SUBST(DEFAULT_IPP_PORT) AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT) dnl -dnl End of "$Id: cups-common.m4 5843 2006-08-17 18:49:31Z mike $". +dnl End of "$Id: cups-common.m4 5930 2006-09-07 19:49:34Z mike $". dnl diff --git a/config-scripts/cups-defaults.m4 b/config-scripts/cups-defaults.m4 index a46cf3835..15d75de1e 100644 --- a/config-scripts/cups-defaults.m4 +++ b/config-scripts/cups-defaults.m4 @@ -1,5 +1,5 @@ dnl -dnl "$Id: cups-defaults.m4 5804 2006-08-04 16:51:58Z mike $" +dnl "$Id: cups-defaults.m4 5980 2006-09-21 19:01:55Z mike $" dnl dnl Default cupsd configuration settings for the Common UNIX Printing System dnl (CUPS). @@ -225,7 +225,7 @@ AC_ARG_WITH(printcap, [ --with-printcap set default printcap file], default_printcap="$withval", default_printcap="default") -if test x$enable_printcap != xno -a x$default_printcap != xno; then +if test x$default_printcap != xno; then if test "x$default_printcap" = "xdefault"; then case $uname in Darwin*) @@ -242,6 +242,8 @@ if test x$enable_printcap != xno -a x$default_printcap != xno; then CUPS_DEFAULT_PRINTCAP="/etc/printcap" ;; esac + else + CUPS_DEFAULT_PRINTCAP="$default_printcap" fi else CUPS_DEFAULT_PRINTCAP="" @@ -250,5 +252,5 @@ fi AC_DEFINE_UNQUOTED(CUPS_DEFAULT_PRINTCAP, "$CUPS_DEFAULT_PRINTCAP") dnl -dnl End of "$Id: cups-defaults.m4 5804 2006-08-04 16:51:58Z mike $". +dnl End of "$Id: cups-defaults.m4 5980 2006-09-21 19:01:55Z mike $". dnl diff --git a/cups/Dependencies b/cups/Dependencies index fda8a6ae8..cedd9bded 100644 --- a/cups/Dependencies +++ b/cups/Dependencies @@ -82,7 +82,7 @@ transcode.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h transcode.o: i18n.h transcode.h debug.h usersys.o: http-private.h ../config.h http.h md5.h ipp-private.h ipp.h usersys.o: globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h -usersys.o: transcode.h +usersys.o: transcode.h debug.h util.o: globals.h string.h ../config.h http-private.h http.h md5.h util.o: ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h util.o: transcode.h debug.h @@ -180,7 +180,7 @@ transcode.32.o: transcode.c ipp-private.h ipp.h cups.h ppd.h array.h file.h lan transcode.32.o: transcode.c i18n.h transcode.h debug.h usersys.32.o: usersys.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h usersys.32.o: usersys.c globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h -usersys.32.o: usersys.c transcode.h +usersys.32.o: usersys.c transcode.h debug.h util.32.o: util.c globals.h string.h ../config.h http-private.h http.h md5.h util.32.o: util.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h util.32.o: util.c transcode.h debug.h @@ -278,7 +278,7 @@ transcode.64.o: transcode.c ipp-private.h ipp.h cups.h ppd.h array.h file.h lan transcode.64.o: transcode.c i18n.h transcode.h debug.h usersys.64.o: usersys.c http-private.h ../config.h http.h md5.h ipp-private.h ipp.h usersys.64.o: usersys.c globals.h string.h cups.h ppd.h array.h file.h language.h i18n.h -usersys.64.o: usersys.c transcode.h +usersys.64.o: usersys.c transcode.h debug.h util.64.o: util.c globals.h string.h ../config.h http-private.h http.h md5.h util.64.o: util.c ipp-private.h ipp.h cups.h ppd.h array.h file.h language.h i18n.h util.64.o: util.c transcode.h debug.h diff --git a/cups/adminutil.c b/cups/adminutil.c index 710780029..edef4f909 100644 --- a/cups/adminutil.c +++ b/cups/adminutil.c @@ -1,5 +1,5 @@ /* - * "$Id: adminutil.c 5878 2006-08-24 15:55:42Z mike $" + * "$Id: adminutil.c 5970 2006-09-19 20:11:08Z mike $" * * Administration utility API definitions for the Common UNIX Printing * System (CUPS). @@ -953,6 +953,8 @@ _cupsAdminSetServerSettings( { int i; /* Looping var */ http_status_t status; /* GET/PUT status */ + const char *server_port_env; /* SERVER_PORT env var */ + int server_port; /* IPP port for server */ cups_file_t *cupsd; /* cupsd.conf file */ char cupsdconf[1024]; /* cupsd.conf filename */ int remote; /* Remote cupsd.conf file? */ @@ -1086,6 +1088,17 @@ _cupsAdminSetServerSettings( wrote_root_location = 0; indent = 0; + if ((server_port_env = getenv("SERVER_PORT")) != NULL) + { + if ((server_port = atoi(server_port_env)) <= 0) + server_port = ippPort(); + } + else + server_port = ippPort(); + + if (server_port <= 0) + server_port = IPP_PORT; + while (cupsFileGetConf(cupsd, line, sizeof(line), &value, &linenum)) { if (!strcasecmp(line, "Port") || !strcasecmp(line, "Listen")) @@ -1097,20 +1110,24 @@ _cupsAdminSetServerSettings( if (share_printers || remote_admin) { cupsFilePuts(temp, "# Allow remote access\n"); - cupsFilePrintf(temp, "Port %d\n", ippPort()); + cupsFilePrintf(temp, "Port %d\n", server_port); } else { cupsFilePuts(temp, "# Only listen for connections from the local " "machine.\n"); - cupsFilePrintf(temp, "Listen localhost:%d\n", ippPort()); + cupsFilePrintf(temp, "Listen localhost:%d\n", server_port); } #ifdef CUPS_DEFAULT_DOMAINSOCKET - if (!access(CUPS_DEFAULT_DOMAINSOCKET, 0)) + if ((!value || strcmp(CUPS_DEFAULT_DOMAINSOCKET, value)) && + !access(CUPS_DEFAULT_DOMAINSOCKET, 0)) cupsFilePuts(temp, "Listen " CUPS_DEFAULT_DOMAINSOCKET "\n"); #endif /* CUPS_DEFAULT_DOMAINSOCKET */ } + else if (value && value[0] == '/' && + strcmp(CUPS_DEFAULT_DOMAINSOCKET, value)) + cupsFilePrintf(temp, "Listen %s\n", value); } else if (!strcasecmp(line, "Browsing") || !strcasecmp(line, "BrowseAddress") || @@ -1948,5 +1965,5 @@ write_option(cups_file_t *dstfp, /* I - PPD file */ /* - * End of "$Id: adminutil.c 5878 2006-08-24 15:55:42Z mike $". + * End of "$Id: adminutil.c 5970 2006-09-19 20:11:08Z mike $". */ diff --git a/cups/auth.c b/cups/auth.c index 8f515f8e0..4c7318ce7 100644 --- a/cups/auth.c +++ b/cups/auth.c @@ -1,5 +1,5 @@ /* - * "$Id: auth.c 5559 2006-05-21 13:59:42Z mike $" + * "$Id: auth.c 5961 2006-09-16 19:08:36Z mike $" * * Authentication functions for the Common UNIX Printing System (CUPS). * @@ -81,6 +81,8 @@ cupsDoAuthentication(http_t *http, /* I - HTTP connection to server */ http, method, resource)); DEBUG_printf(("cupsDoAuthentication: digest_tries=%d, userpass=\"%s\"\n", http->digest_tries, http->userpass)); + DEBUG_printf(("cupsDoAuthentication: WWW-Authenticate=\"%s\"\n", + httpGetField(http, HTTP_FIELD_WWW_AUTHENTICATE))); /* * Clear the current authentication string... @@ -249,5 +251,5 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */ /* - * End of "$Id: auth.c 5559 2006-05-21 13:59:42Z mike $". + * End of "$Id: auth.c 5961 2006-09-16 19:08:36Z mike $". */ diff --git a/cups/cups.h b/cups/cups.h index c74e52209..ec4f21b96 100644 --- a/cups/cups.h +++ b/cups/cups.h @@ -1,5 +1,5 @@ /* - * "$Id: cups.h 5805 2006-08-04 16:52:31Z mike $" + * "$Id: cups.h 5930 2006-09-07 19:49:34Z mike $" * * API definitions for the Common UNIX Printing System (CUPS). * @@ -61,10 +61,10 @@ extern "C" { * Constants... */ -# define CUPS_VERSION 1.0203 +# define CUPS_VERSION 1.0204 # define CUPS_VERSION_MAJOR 1 # define CUPS_VERSION_MINOR 2 -# define CUPS_VERSION_PATCH 3 +# define CUPS_VERSION_PATCH 4 # define CUPS_DATE_ANY -1 @@ -244,5 +244,5 @@ extern cups_file_t *cupsTempFile2(char *filename, int len); #endif /* !_CUPS_CUPS_H_ */ /* - * End of "$Id: cups.h 5805 2006-08-04 16:52:31Z mike $". + * End of "$Id: cups.h 5930 2006-09-07 19:49:34Z mike $". */ diff --git a/cups/dir.c b/cups/dir.c index e06edea91..1b6bc4369 100644 --- a/cups/dir.c +++ b/cups/dir.c @@ -366,7 +366,7 @@ cupsDirRead(cups_dir_t *dp) /* I - Directory */ * Try reading an entry that is not "." or ".."... */ - do + for (;;) { if (readdir_r(dp->dir, (struct dirent *)buffer, &entry)) { @@ -381,28 +381,31 @@ cupsDirRead(cups_dir_t *dp) /* I - Directory */ } DEBUG_printf((" readdir_r() returned \"%s\"...\n", entry->d_name)); - } - while (!strcmp(entry->d_name, ".") || !strcmp(entry->d_name, "..")); - /* - * Copy the name over and get the file information... - */ + if (!strcmp(entry->d_name, ".") || !strcmp(entry->d_name, "..")) + continue; - strlcpy(dp->entry.filename, entry->d_name, sizeof(dp->entry.filename)); + /* + * Copy the name over and get the file information... + */ - snprintf(filename, sizeof(filename), "%s/%s", dp->directory, entry->d_name); - if (stat(filename, &(dp->entry.fileinfo))) - { - DEBUG_printf((" stat() failed for \"%s\" - %s...\n", filename, - strerror(errno))); - return (NULL); - } + strlcpy(dp->entry.filename, entry->d_name, sizeof(dp->entry.filename)); - /* - * Return the entry... - */ + snprintf(filename, sizeof(filename), "%s/%s", dp->directory, entry->d_name); - return (&(dp->entry)); + if (stat(filename, &(dp->entry.fileinfo))) + { + DEBUG_printf((" stat() failed for \"%s\" - %s...\n", filename, + strerror(errno))); + continue; + } + + /* + * Return the entry... + */ + + return (&(dp->entry)); + } } diff --git a/cups/emit.c b/cups/emit.c index dd650c61d..c62cbf6ab 100644 --- a/cups/emit.c +++ b/cups/emit.c @@ -1,5 +1,5 @@ /* - * "$Id: emit.c 5700 2006-06-26 19:20:39Z mike $" + * "$Id: emit.c 5934 2006-09-11 14:54:40Z mike $" * * PPD code emission routines for the Common UNIX Printing System (CUPS). * @@ -391,8 +391,8 @@ ppdEmitJCL(ppd_file_t *ppd, /* I - PPD file record */ title = ptr + 1; /* - * Replace double quotes with single quotes so that the title - * does not cause a PJL syntax error. + * Replace double quotes with single quotes and 8-bit characters with + * question marks so that the title does not cause a PJL syntax error. */ strlcpy(temp, title, sizeof(temp)); @@ -400,6 +400,8 @@ ppdEmitJCL(ppd_file_t *ppd, /* I - PPD file record */ for (ptr = temp; *ptr; ptr ++) if (*ptr == '\"') *ptr = '\''; + else if (*ptr & 128) + *ptr = '?'; /* * Send PJL JOB and PJL RDYMSG commands before we enter PostScript mode... @@ -940,5 +942,5 @@ ppd_sort(ppd_choice_t **c1, /* I - First choice */ /* - * End of "$Id: emit.c 5700 2006-06-26 19:20:39Z mike $". + * End of "$Id: emit.c 5934 2006-09-11 14:54:40Z mike $". */ diff --git a/cups/http.c b/cups/http.c index 504be39cf..169aece66 100644 --- a/cups/http.c +++ b/cups/http.c @@ -1,5 +1,5 @@ /* - * "$Id: http.c 5889 2006-08-24 21:44:35Z mike $" + * "$Id: http.c 5961 2006-09-16 19:08:36Z mike $" * * HTTP routines for the Common UNIX Printing System (CUPS). * @@ -222,7 +222,10 @@ httpClearFields(http_t *http) /* I - HTTP connection */ if (http) { memset(http->fields, 0, sizeof(http->fields)); - httpSetField(http, HTTP_FIELD_HOST, http->hostname); + if (http->hostname[0] == '/') + httpSetField(http, HTTP_FIELD_HOST, "localhost"); + else + httpSetField(http, HTTP_FIELD_HOST, http->hostname); http->expect = (http_status_t)0; } @@ -1893,7 +1896,7 @@ httpWrite2(http_t *http, /* I - HTTP connection */ httpFlushWrite(http); } - if ((length + http->wused) < sizeof(http->wbuffer)) + if ((length + http->wused) <= sizeof(http->wbuffer)) { /* * Write to buffer... @@ -2826,5 +2829,5 @@ http_write_ssl(http_t *http, /* I - HTTP connection */ /* - * End of "$Id: http.c 5889 2006-08-24 21:44:35Z mike $". + * End of "$Id: http.c 5961 2006-09-16 19:08:36Z mike $". */ diff --git a/cups/i18n.h b/cups/i18n.h index 14a5c1dd5..720ff0cd5 100644 --- a/cups/i18n.h +++ b/cups/i18n.h @@ -1,5 +1,5 @@ /* - * "$Id: i18n.h 5833 2006-08-16 20:05:58Z mike $" + * "$Id: i18n.h 5926 2006-09-05 20:45:47Z mike $" * * (Private) localization support for the Common UNIX Printing System (CUPS). * @@ -105,7 +105,7 @@ extern const char *_cupsLangString(cups_lang_t *lang, const char *message); extern void _cupsMessageFree(cups_array_t *a); extern cups_array_t *_cupsMessageLoad(const char *filename); extern const char *_cupsMessageLookup(cups_array_t *a, const char *m); -extern void _cupsSetLocale(void); +extern void _cupsSetLocale(char *argv[]); # ifdef __cplusplus } @@ -114,5 +114,5 @@ extern void _cupsSetLocale(void); #endif /* !_CUPS_I18N_H_ */ /* - * End of "$Id: i18n.h 5833 2006-08-16 20:05:58Z mike $". + * End of "$Id: i18n.h 5926 2006-09-05 20:45:47Z mike $". */ diff --git a/cups/langprintf.c b/cups/langprintf.c index 909692347..da835dc28 100644 --- a/cups/langprintf.c +++ b/cups/langprintf.c @@ -1,5 +1,5 @@ /* - * "$Id: langprintf.c 5833 2006-08-16 20:05:58Z mike $" + * "$Id: langprintf.c 5926 2006-09-05 20:45:47Z mike $" * * Localized printf/puts functions for the Common UNIX Printing * System (CUPS). @@ -28,7 +28,7 @@ * * _cupsLangPrintf() - Print a formatted message string to a file. * _cupsLangPuts() - Print a static message string to a file. - * _cupsSetLocale() - Set the current locale. + * _cupsSetLocale() - Set the current locale and transcode the command-line. */ /* @@ -140,15 +140,18 @@ _cupsLangPuts(FILE *fp, /* I - File to write to */ /* - * '_cupsSetLocale()' - Set the current locale. + * '_cupsSetLocale()' - Set the current locale and transcode the command-line. */ void -_cupsSetLocale(void) +_cupsSetLocale(char *argv[]) /* IO - Command-line arguments */ { + int i; /* Looping var */ + char buffer[8192]; /* Command-line argument buffer */ + _cups_globals_t *cg; /* Global data */ #ifdef LC_TIME - const char *lc_time; /* Current LC_TIME value */ - char new_lc_time[255], /* New LC_TIME value */ + const char *lc_time; /* Current LC_TIME value */ + char new_lc_time[255], /* New LC_TIME value */ *charset; /* Pointer to character set */ #endif /* LC_TIME */ @@ -181,9 +184,45 @@ _cupsSetLocale(void) setlocale(LC_TIME, new_lc_time); #endif /* LC_TIME */ + + /* + * Initialize the default language info... + */ + + cg = _cupsGlobals(); + + if (!cg->lang_default) + cg->lang_default = cupsLangDefault(); + + /* + * Transcode the command-line arguments from the locale charset to + * UTF-8... + */ + + if (cg->lang_default->encoding != CUPS_US_ASCII && + cg->lang_default->encoding != CUPS_UTF8) + { + for (i = 1; argv[i]; i ++) + { + /* + * Try converting from the locale charset to UTF-8... + */ + + if (cupsCharsetToUTF8((cups_utf8_t *)buffer, argv[i], sizeof(buffer), + cg->lang_default->encoding) < 0) + continue; + + /* + * Save the new string if it differs from the original... + */ + + if (strcmp(buffer, argv[i])) + argv[i] = strdup(buffer); + } + } } /* - * End of "$Id: langprintf.c 5833 2006-08-16 20:05:58Z mike $". + * End of "$Id: langprintf.c 5926 2006-09-05 20:45:47Z mike $". */ diff --git a/cups/language.c b/cups/language.c index d46c9fea9..35b1944b4 100644 --- a/cups/language.c +++ b/cups/language.c @@ -1,5 +1,5 @@ /* - * "$Id: language.c 5769 2006-07-20 17:17:14Z mike $" + * "$Id: language.c 5980 2006-09-21 19:01:55Z mike $" * * I18N/language support for the Common UNIX Printing System (CUPS). * @@ -406,14 +406,6 @@ cupsLangGet(const char *language) /* I - Language or locale */ *ptr = '\0'; } - else - { - /* - * Default to UTF-8... - */ - - strcpy(charset, "UTF8"); - } /* * Get the locale for messages from the LC_MESSAGES locale setting... @@ -473,6 +465,13 @@ cupsLangGet(const char *language) /* I - Language or locale */ } #endif /* CODESET */ + /* + * If we don't have a character set by now, default to UTF-8... + */ + + if (!charset[0]) + strcpy(charset, "UTF8"); + /* * Parse the language string passed in to a locale string. "C" is the * standard POSIX locale and is copied unchanged. Otherwise the @@ -1314,5 +1313,5 @@ cups_unquote(char *d, /* O - Unquoted string */ /* - * End of "$Id: language.c 5769 2006-07-20 17:17:14Z mike $". + * End of "$Id: language.c 5980 2006-09-21 19:01:55Z mike $". */ diff --git a/doc/help/ref-classes-conf.html b/doc/help/ref-classes-conf.html index 082c8ba68..d638b4625 100644 --- a/doc/help/ref-classes-conf.html +++ b/doc/help/ref-classes-conf.html @@ -162,7 +162,7 @@ HREF="#AllowUser">AllowUser

 <Class name>
   ...
-  ErrorPolicy cancel-job
+  ErrorPolicy abort-job
 </Class>
 
@@ -181,7 +181,7 @@ error policy: