From: jlovell Date: Mon, 26 Mar 2007 16:28:00 +0000 (+0000) Subject: Load cups into easysw/current. X-Git-Tag: release-1.6.3~218 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fcups.git;a=commitdiff_plain;h=f42414bf8a43f4c1b464bf1de9d357edba4fd439 Load cups into easysw/current. git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@299 a1ca3aef-8c08-0410-bb20-df032aa958be --- diff --git a/CHANGES-1.2.txt b/CHANGES-1.2.txt index d1fe1e763..4c1149982 100644 --- a/CHANGES-1.2.txt +++ b/CHANGES-1.2.txt @@ -1,6 +1,26 @@ CHANGES-1.2.txt --------------- +CHANGES IN CUPS V1.2.11 + + - The pstops filter did not handle %%EndFeature comments + properly (STR #2306) + - Fixed a problem with the Polish web page printer icons + (STR #2305) + - ppdLocalize() now also localizes the cupsICCProfile + attributes. + - The scheduler still had a reference to the incorrect + "notify-recipient" attribute (STR #2307) + - The "make check" and "make test" subscription tests did + not set the locale (STR #2307) + - The "make check" and "make test" subscription tests + incorrectly used the notify-recipient attribute instead + of notify-recipient-uri (STR #2307) + - cupsRasterInterpretPPD() incorrectly limited the + cupsBorderlessScalingFactor when specified in the + job options. + + CHANGES IN CUPS V1.2.10 - ppdLocalize() now supports localizing for Japanese diff --git a/CHANGES.txt b/CHANGES.txt index f48380842..98e0328a0 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,9 +1,10 @@ -CHANGES.txt - 2007-03-21 +CHANGES.txt - 2007-03-26 ------------------------ CHANGES IN CUPS V1.3 - - Documentation updates (STR #2130, STR #2131) + - Documentation updates (STR #1775, STR #2130, STR #2131) + - Added support for LPD "stream" mode (STR #2036) - The scheduler now reports the PostScript product string from PPD files in CUPS-Get-PPDs responses (STR #1900) - Raw printing with queues pointing to the file pseudo- diff --git a/backend/lpd.c b/backend/lpd.c index 6366a7fcc..1dee90bf6 100644 --- a/backend/lpd.c +++ b/backend/lpd.c @@ -1,9 +1,9 @@ /* - * "$Id: lpd.c 6058 2006-10-23 00:20:09Z mike $" + * "$Id: lpd.c 6398 2007-03-26 12:57:59Z mike $" * * Line Printer Daemon backend for the Common UNIX Printing System (CUPS). * - * Copyright 1997-2006 by Easy Software Products, all rights reserved. + * Copyright 1997-2007 by Easy Software Products, all rights reserved. * * These coded instructions, statements, and computer programs are the * property of Easy Software Products and are protected by Federal @@ -73,6 +73,14 @@ static char tmpfilename[1024] = ""; /* Temporary spool file name */ static int abort_job = 0; /* Non-zero if we get SIGTERM */ +/* + * Print mode... + */ + +#define MODE_STANDARD 0 /* Queue a copy */ +#define MODE_STREAM 1 /* Stream a copy */ + + /* * The order for control and data files in LPD requests... */ @@ -96,9 +104,9 @@ static int abort_job = 0; /* Non-zero if we get SIGTERM */ static int lpd_command(int lpd_fd, int timeout, char *format, ...); static int lpd_queue(const char *hostname, int port, const char *printer, - const char *filename, - const char *user, const char *title, int copies, - int banner, int format, int order, int reserve, + int print_fd, int mode, const char *user, + const char *title, int copies, int banner, + int format, int order, int reserve, int manual_copies, int timeout, int contimeout); static void lpd_timeout(int sig); static int lpd_write(int lpd_fd, char *buffer, int length); @@ -131,7 +139,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ *filename, /* File to print */ title[256]; /* Title string */ int port; /* Port number */ + int fd; /* Print file */ int status; /* Status of LPD job */ + int mode; /* Print mode */ int banner; /* Print banner page? */ int format; /* Print format */ int order; /* Order of control/data files */ @@ -189,44 +199,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ return (CUPS_BACKEND_FAILED); } - /* - * If we have 7 arguments, print the file named on the command-line. - * Otherwise, copy stdin to a temporary file and print the temporary - * file. - */ - - if (argc == 6) - { - /* - * Copy stdin to a temporary file... - */ - - int fd; /* Temporary file */ - char buffer[8192]; /* Buffer for copying */ - int bytes; /* Number of bytes read */ - - - if ((fd = cupsTempFd(tmpfilename, sizeof(tmpfilename))) < 0) - { - perror("ERROR: unable to create temporary file"); - return (CUPS_BACKEND_FAILED); - } - - while ((bytes = fread(buffer, 1, sizeof(buffer), stdin)) > 0) - if (write(fd, buffer, bytes) < bytes) - { - perror("ERROR: unable to write to temporary file"); - close(fd); - unlink(tmpfilename); - return (CUPS_BACKEND_FAILED); - } - - close(fd); - filename = tmpfilename; - } - else - filename = argv[6]; - /* * Extract the hostname and printer name from the URI... */ @@ -249,6 +221,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ * See if there are any options... */ + mode = MODE_STANDARD; banner = 0; format = 'l'; order = ORDER_CONTROL_DATA; @@ -353,6 +326,19 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ else fprintf(stderr, "ERROR: Unknown format character \"%c\"\n", value[0]); } + else if (!strcasecmp(name, "mode") && value[0]) + { + /* + * Set control/data order... + */ + + if (!strcasecmp(value, "standard")) + order = MODE_STANDARD; + else if (!strcasecmp(value, "stream")) + order = MODE_STREAM; + else + fprintf(stderr, "ERROR: Unknown print mode \"%s\"\n", value); + } else if (!strcasecmp(name, "order") && value[0]) { /* @@ -420,6 +406,64 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ } } + if (mode == MODE_STREAM) + order = ORDER_CONTROL_DATA; + + /* + * If we have 7 arguments, print the file named on the command-line. + * Otherwise, copy stdin to a temporary file and print the temporary + * file. + */ + + if (argc == 6 && mode == MODE_STANDARD) + { + /* + * Copy stdin to a temporary file... + */ + + char buffer[8192]; /* Buffer for copying */ + int bytes; /* Number of bytes read */ + + + if ((fd = cupsTempFd(tmpfilename, sizeof(tmpfilename))) < 0) + { + perror("ERROR: unable to create temporary file"); + return (CUPS_BACKEND_FAILED); + } + + while ((bytes = fread(buffer, 1, sizeof(buffer), stdin)) > 0) + if (write(fd, buffer, bytes) < bytes) + { + perror("ERROR: unable to write to temporary file"); + close(fd); + unlink(tmpfilename); + return (CUPS_BACKEND_FAILED); + } + + filename = tmpfilename; + } + else if (argc == 6) + { + /* + * Stream from stdin... + */ + + filename = NULL; + fd = 0; + } + else + { + filename = argv[6]; + fd = open(filename, O_RDONLY); + + if (fd == -1) + { + fprintf(stderr, "ERROR: Unable to open print file %s: %s\n", + filename, strerror(errno)); + return (CUPS_BACKEND_FAILED); + } + } + /* * Sanitize the document title... */ @@ -455,7 +499,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ copies = atoi(argv[4]); } - status = lpd_queue(hostname, port, resource + 1, filename, + status = lpd_queue(hostname, port, resource + 1, fd, mode, username, title, copies, banner, format, order, reserve, manual_copies, timeout, contimeout); @@ -464,7 +508,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ fprintf(stderr, "PAGE: 1 %d\n", atoi(argv[4])); } else - status = lpd_queue(hostname, port, resource + 1, filename, + status = lpd_queue(hostname, port, resource + 1, fd, mode, username, title, 1, banner, format, order, reserve, 1, timeout, contimeout); @@ -476,6 +520,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ if (tmpfilename[0]) unlink(tmpfilename); + if (fd) + close(fd); + /* * Return the queue status... */ @@ -560,7 +607,8 @@ static int /* O - Zero on success, non-zero on failure */ lpd_queue(const char *hostname, /* I - Host to connect to */ int port, /* I - Port to connect on */ const char *printer, /* I - Printer/queue name */ - const char *filename, /* I - File to print */ + int print_fd, /* I - File to print */ + int mode, /* I - Print mode */ const char *user, /* I - Requesting user */ const char *title, /* I - Job title */ int copies, /* I - Number of copies */ @@ -572,7 +620,6 @@ lpd_queue(const char *hostname, /* I - Host to connect to */ int timeout, /* I - Timeout... */ int contimeout) /* I - Connection timeout */ { - FILE *fp; /* Job file */ char localhost[255]; /* Local host name */ int error; /* Error number */ struct stat filestats; /* File statistics */ @@ -838,25 +885,25 @@ lpd_queue(const char *hostname, /* I - Host to connect to */ * Next, open the print file and figure out its size... */ - if (stat(filename, &filestats)) + if (print_fd) { - httpAddrFreeList(addrlist); - close(fd); - - perror("ERROR: unable to stat print file"); - return (CUPS_BACKEND_FAILED); - } - - filestats.st_size *= manual_copies; + if (fstat(print_fd, &filestats)) + { + httpAddrFreeList(addrlist); + close(fd); - if ((fp = fopen(filename, "rb")) == NULL) - { - httpAddrFreeList(addrlist); - close(fd); + perror("ERROR: unable to stat print file"); + return (CUPS_BACKEND_FAILED); + } - perror("ERROR: unable to open print file for reading"); - return (CUPS_BACKEND_FAILED); + filestats.st_size *= manual_copies; } + else +#ifdef _LARGEFILE_SOURCE + filestats.st_size = (size_t)(999999999999.0); +#else + filestats.st_size = 2147483647; +#endif /* _LARGEFILE_SOURCE */ /* * Send a job header to the printer, specifying no banner page and @@ -968,9 +1015,9 @@ lpd_queue(const char *hostname, /* I - Host to connect to */ tbytes = 0; for (copy = 0; copy < manual_copies; copy ++) { - rewind(fp); + lseek(print_fd, 0, SEEK_SET); - while ((nbytes = fread(buffer, 1, sizeof(buffer), fp)) > 0) + while ((nbytes = read(print_fd, buffer, sizeof(buffer))) > 0) { fprintf(stderr, "INFO: Spooling LPR job, %.0f%% complete...\n", 100.0 * tbytes / filestats.st_size); @@ -985,33 +1032,38 @@ lpd_queue(const char *hostname, /* I - Host to connect to */ } } - if (tbytes < filestats.st_size) - status = errno; - else if (lpd_write(fd, "", 1) < 1) + if (mode == MODE_STANDARD) { - perror("ERROR: Unable to send trailing nul to printer"); - status = errno; - } - else - { - /* - * Read the status byte from the printer; if we can't read the byte - * back now, we should set status to "errno", however at this point - * we know the printer got the whole file and we don't necessarily - * want to requeue it over and over... - */ + if (tbytes < filestats.st_size) + status = errno; + else if (lpd_write(fd, "", 1) < 1) + { + perror("ERROR: Unable to send trailing nul to printer"); + status = errno; + } + else + { + /* + * Read the status byte from the printer; if we can't read the byte + * back now, we should set status to "errno", however at this point + * we know the printer got the whole file and we don't necessarily + * want to requeue it over and over... + */ - alarm(timeout); + alarm(timeout); - if (recv(fd, &status, 1, 0) < 1) - { - fprintf(stderr, "WARNING: Remote host did not respond with data " - "status byte after %d seconds!\n", timeout); - status = 0; - } + if (recv(fd, &status, 1, 0) < 1) + { + fprintf(stderr, "WARNING: Remote host did not respond with data " + "status byte after %d seconds!\n", timeout); + status = 0; + } - alarm(0); + alarm(0); + } } + else + status = 0; if (status != 0) fprintf(stderr, "ERROR: Remote host did not accept data file (%d)\n", @@ -1065,7 +1117,6 @@ lpd_queue(const char *hostname, /* I - Host to connect to */ */ close(fd); - fclose(fp); if (status == 0) { @@ -1242,5 +1293,5 @@ sigterm_handler(int sig) /* I - Signal */ /* - * End of "$Id: lpd.c 6058 2006-10-23 00:20:09Z mike $". + * End of "$Id: lpd.c 6398 2007-03-26 12:57:59Z mike $". */ diff --git a/cgi-bin/help-index.c b/cgi-bin/help-index.c index df909a406..8be6bc3a5 100644 --- a/cgi-bin/help-index.c +++ b/cgi-bin/help-index.c @@ -1,5 +1,5 @@ /* - * "$Id: help-index.c 6258 2007-02-11 01:16:31Z mike $" + * "$Id: help-index.c 6394 2007-03-25 00:01:14Z mike $" * * On-line help index routines for the Common UNIX Printing System (CUPS). * @@ -899,6 +899,7 @@ help_load_file( cups_file_t *fp; /* HTML file */ help_node_t *node; /* Current node */ char line[1024], /* Line from file */ + temp[1024], /* Temporary word */ section[1024], /* Section */ *ptr, /* Pointer into line */ *anchor, /* Anchor name */ @@ -1150,6 +1151,7 @@ help_load_file( */ for (ptr ++; *ptr && *ptr != '>'; ptr ++) + { if (*ptr == '\"' || *ptr == '\'') { for (quote = *ptr++; *ptr && *ptr != quote; ptr ++); @@ -1157,6 +1159,7 @@ help_load_file( if (!*ptr) ptr --; } + } if (!*ptr) ptr --; @@ -1188,18 +1191,18 @@ help_load_file( wordlen = ptr - text; - if (*ptr) - *ptr = '\0'; - else - ptr --; + memcpy(temp, text, wordlen); + temp[wordlen] = '\0'; + + ptr --; - if (wordlen > 1 && !bsearch(text, help_common_words, + if (wordlen > 1 && !bsearch(temp, help_common_words, (sizeof(help_common_words) / sizeof(help_common_words[0])), sizeof(help_common_words[0]), (int (*)(const void *, const void *)) strcasecmp)) - help_add_word(node, text); + help_add_word(node, temp); } } @@ -1333,5 +1336,5 @@ help_sort_words(help_word_t *w1, /* I - Second word */ /* - * End of "$Id: help-index.c 6258 2007-02-11 01:16:31Z mike $". + * End of "$Id: help-index.c 6394 2007-03-25 00:01:14Z mike $". */ diff --git a/cgi-bin/testhi.html b/cgi-bin/testhi.html index b45399fdb..0000e9eff 100644 --- a/cgi-bin/testhi.html +++ b/cgi-bin/testhi.html @@ -12,7 +12,7 @@ up to 1024 bytes in length.

This is the First Anchor

-

This is some text for the first anchor.

+

This is some text for the first anchor.

This is the Second Anchor

diff --git a/config-scripts/cups-gssapi.m4 b/config-scripts/cups-gssapi.m4 index ebb8c12fc..e9b138081 100644 --- a/config-scripts/cups-gssapi.m4 +++ b/config-scripts/cups-gssapi.m4 @@ -32,9 +32,14 @@ LIBGSSAPI="" if test x$enable_gssapi != xno; then AC_PATH_PROG(KRB5CONFIG, krb5-config) if test "x$KRB5CONFIG" != x; then - CFLAGS="`$KRB5CONFIG --cflags gssapi` $CFLAGS" - CPPFLAGS="`$KRB5CONFIG --cflags gssapi` $CPPFLAGS" - LIBGSSAPI="`$KRB5CONFIG --libs gssapi`" + if test "x$uname" = "xDarwin"; then + # Mac OS X weak-links to the Kerberos framework... + LIBGSSAPI="-weak_framework Kerberos" + else + CFLAGS="`$KRB5CONFIG --cflags gssapi` $CFLAGS" + CPPFLAGS="`$KRB5CONFIG --cflags gssapi` $CPPFLAGS" + LIBGSSAPI="`$KRB5CONFIG --libs gssapi`" + fi AC_DEFINE(HAVE_GSSAPI, 1, [Whether GSSAPI is available]) else # Solaris provides its own GSSAPI implementation... diff --git a/cups/auth.c b/cups/auth.c index 9b67b0ee2..1ee0476f2 100644 --- a/cups/auth.c +++ b/cups/auth.c @@ -1,5 +1,5 @@ /* - * "$Id: auth.c 6253 2007-02-10 18:48:40Z mike $" + * "$Id: auth.c 6397 2007-03-25 23:33:32Z mike $" * * Authentication functions for the Common UNIX Printing System (CUPS). * @@ -198,6 +198,20 @@ cupsDoAuthentication(http_t *http, /* I - HTTP connection to server */ /* Pointer into Authorization string */ +# ifdef __APPLE__ + /* + * If the weak-linked GSSAPI/Kerberos library is not present, don't try + * to use it... + */ + + if (gss_init_sec_context == NULL) + { + DEBUG_puts("cupsDoAuthentication: Weak-linked GSSAPI/Kerberos framework " + "is not present"); + return (-1); + } +# endif /* __APPLE__ */ + if (http->gssname == GSS_C_NO_NAME) { if ((gss_service_name = getenv("CUPS_GSSSERVICENAME")) == NULL) @@ -569,5 +583,5 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */ /* - * End of "$Id: auth.c 6253 2007-02-10 18:48:40Z mike $". + * End of "$Id: auth.c 6397 2007-03-25 23:33:32Z mike $". */ diff --git a/cups/dest.c b/cups/dest.c index 240ebae8f..016ec8246 100644 --- a/cups/dest.c +++ b/cups/dest.c @@ -1,5 +1,5 @@ /* - * "$Id: dest.c 6265 2007-02-11 19:42:42Z mike $" + * "$Id: dest.c 6386 2007-03-23 19:03:01Z mike $" * * User-defined destination (and option) support for the Common UNIX * Printing System (CUPS). @@ -970,9 +970,11 @@ cups_get_sdests(http_t *http, /* I - HTTP connection */ change_time, /* printer-state-change-time attribute */ type; /* printer-type attribute */ const char *info, /* printer-info attribute */ + *location, /* printer-location attribute */ *make_model, /* printer-make-and-model attribute */ *name; /* printer-name attribute */ char job_sheets[1024], /* job-sheets-default attribute */ + auth_info_req[1024], /* auth-info-required attribute */ reasons[1024]; /* printer-state-reasons attribute */ int num_options; /* Number of options */ cups_option_t *options; /* Options */ @@ -981,10 +983,12 @@ cups_get_sdests(http_t *http, /* I - HTTP connection */ *ptr; /* Pointer into name/value */ static const char * const pattrs[] = /* Attributes we're interested in */ { + "auth-info-required", "job-sheets-default", "printer-info", "printer-is-accepting-jobs", "printer-is-shared", + "printer-location", "printer-make-and-model", "printer-name", "printer-state", @@ -1038,6 +1042,7 @@ cups_get_sdests(http_t *http, /* I - HTTP connection */ accepting = 0; change_time = 0; info = NULL; + location = NULL; make_model = NULL; name = NULL; num_options = 0; @@ -1046,14 +1051,30 @@ cups_get_sdests(http_t *http, /* I - HTTP connection */ state = IPP_PRINTER_IDLE; type = CUPS_PRINTER_LOCAL; - strcpy(job_sheets, ""); - strcpy(reasons, ""); + auth_info_req[0] = '\0'; + job_sheets[0] = '\0'; + reasons[0] = '\0'; while (attr != NULL && attr->group_tag == IPP_TAG_PRINTER) { - if (!strcmp(attr->name, "job-sheets-default") && - (attr->value_tag == IPP_TAG_KEYWORD || - attr->value_tag == IPP_TAG_NAME)) + if (!strcmp(attr->name, "auth-info-required") && + attr->value_tag == IPP_TAG_KEYWORD) + { + strlcpy(auth_info_req, attr->values[0].string.text, + sizeof(auth_info_req)); + + for (i = 1, ptr = auth_info_req + strlen(auth_info_req); + i < attr->num_values; + i ++) + { + snprintf(ptr, sizeof(auth_info_req) - (ptr - auth_info_req), ",%s", + attr->values[i].string.text); + ptr += strlen(ptr); + } + } + else if (!strcmp(attr->name, "job-sheets-default") && + (attr->value_tag == IPP_TAG_KEYWORD || + attr->value_tag == IPP_TAG_NAME)) { if (attr->num_values == 2) snprintf(job_sheets, sizeof(job_sheets), "%s,%s", @@ -1071,6 +1092,9 @@ cups_get_sdests(http_t *http, /* I - HTTP connection */ else if (!strcmp(attr->name, "printer-is-shared") && attr->value_tag == IPP_TAG_BOOLEAN) shared = attr->values[0].boolean; + else if (!strcmp(attr->name, "printer-location") && + attr->value_tag == IPP_TAG_TEXT) + location = attr->values[0].string.text; else if (!strcmp(attr->name, "printer-make-and-model") && attr->value_tag == IPP_TAG_TEXT) make_model = attr->values[0].string.text; @@ -1201,6 +1225,11 @@ cups_get_sdests(http_t *http, /* I - HTTP connection */ num_options = 0; options = NULL; + if (auth_info_req[0]) + dest->num_options = cupsAddOption("auth-info-required", auth_info_req, + dest->num_options, + &(dest->options)); + if (job_sheets[0]) dest->num_options = cupsAddOption("job-sheets", job_sheets, dest->num_options, @@ -1221,6 +1250,11 @@ cups_get_sdests(http_t *http, /* I - HTTP connection */ dest->num_options, &(dest->options)); + if (location) + dest->num_options = cupsAddOption("printer-location", + location, dest->num_options, + &(dest->options)); + if (make_model) dest->num_options = cupsAddOption("printer-make-and-model", make_model, dest->num_options, @@ -1268,5 +1302,5 @@ cups_get_sdests(http_t *http, /* I - HTTP connection */ /* - * End of "$Id: dest.c 6265 2007-02-11 19:42:42Z mike $". + * End of "$Id: dest.c 6386 2007-03-23 19:03:01Z mike $". */ diff --git a/cups/encode.c b/cups/encode.c index ed91a4ffc..686fb648a 100644 --- a/cups/encode.c +++ b/cups/encode.c @@ -1,5 +1,5 @@ /* - * "$Id: encode.c 6356 2007-03-19 13:54:48Z mike $" + * "$Id: encode.c 6386 2007-03-23 19:03:01Z mike $" * * Option encoding routines for the Common UNIX Printing System (CUPS). * @@ -52,6 +52,8 @@ static const _ipp_option_t ipp_options[] = { + { "auth-info", IPP_TAG_TEXT, IPP_TAG_JOB }, + { "auth-info-required", IPP_TAG_KEYWORD, IPP_TAG_PRINTER }, { "blackplot", IPP_TAG_BOOLEAN, IPP_TAG_JOB }, { "blackplot-default", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER }, { "brightness", IPP_TAG_INTEGER, IPP_TAG_JOB }, @@ -117,6 +119,7 @@ static const _ipp_option_t ipp_options[] = { "printer-info", IPP_TAG_TEXT, IPP_TAG_PRINTER }, { "printer-is-accepting-jobs",IPP_TAG_BOOLEAN, IPP_TAG_PRINTER }, { "printer-is-shared", IPP_TAG_BOOLEAN, IPP_TAG_PRINTER }, + { "printer-location", IPP_TAG_TEXT, IPP_TAG_PRINTER }, { "printer-make-and-model", IPP_TAG_TEXT, IPP_TAG_PRINTER }, { "printer-more-info", IPP_TAG_URI, IPP_TAG_PRINTER }, { "printer-op-policy", IPP_TAG_NAME, IPP_TAG_PRINTER }, @@ -570,5 +573,5 @@ compare_ipp_options(_ipp_option_t *a, /* I - First option */ /* - * End of "$Id: encode.c 6356 2007-03-19 13:54:48Z mike $". + * End of "$Id: encode.c 6386 2007-03-23 19:03:01Z mike $". */ diff --git a/cups/localize.c b/cups/localize.c index d38fdc384..ee88a790f 100644 --- a/cups/localize.c +++ b/cups/localize.c @@ -1,5 +1,5 @@ /* - * "$Id: localize.c 6367 2007-03-20 01:34:29Z mike $" + * "$Id: localize.c 6388 2007-03-24 14:21:31Z mike $" * * PPD custom option routines for the Common UNIX Printing System (CUPS). * @@ -69,6 +69,7 @@ ppdLocalize(ppd_file_t *ppd) /* I - PPD file */ ppd_choice_t *choice; /* Current choice */ ppd_coption_t *coption; /* Current custom option */ ppd_cparam_t *cparam; /* Current custom parameter */ + ppd_attr_t *attr; /* Current attribute */ cups_lang_t *lang; /* Current language */ char ckeyword[PPD_MAX_NAME], /* Custom keyword */ ll_CC[6], /* Language + country locale */ @@ -151,6 +152,29 @@ ppdLocalize(ppd_file_t *ppd) /* I - PPD file */ } } + /* + * Translate ICC profile names... + */ + + if ((attr = ppdFindAttr(ppd, "APCustomColorMatchingName", NULL)) != NULL) + { + if ((text = ppd_text(ppd, "APCustomColorMatchingName", attr->spec, + ll_CC, ll)) != NULL) + strlcpy(attr->text, text, sizeof(attr->text)); + } + + for (attr = ppdFindAttr(ppd, "cupsICCProfile", NULL); + attr; + attr = ppdFindNextAttr(ppd, "cupsICCProfile", NULL)) + { + cupsArraySave(ppd->sorted_attrs); + + if ((text = ppd_text(ppd, "cupsICCProfile", attr->spec, ll_CC, ll)) != NULL) + strlcpy(attr->text, text, sizeof(attr->text)); + + cupsArrayRestore(ppd->sorted_attrs); + } + return (0); } @@ -215,5 +239,5 @@ ppd_text(ppd_file_t *ppd, /* I - PPD file */ /* - * End of "$Id: localize.c 6367 2007-03-20 01:34:29Z mike $". + * End of "$Id: localize.c 6388 2007-03-24 14:21:31Z mike $". */ diff --git a/doc/help/options.html b/doc/help/options.html index e9311856c..20a17d3a8 100644 --- a/doc/help/options.html +++ b/doc/help/options.html @@ -106,6 +106,31 @@ listed using the lpoptions command:

lpoptions -p printer -l +

Creating Saved Options

+ +

Saved options are supported in CUPS through printer +instances. Printer instances are, as their name implies, copies +of a printer that have certain options associated with them. Use the +lpoptions command to create a printer instance:

+ +
+lpoptions -p printer/instance -o name=value ...
+
+ +

The -p printer/instance option provides the name of +the instance, which is always the printer name, a slash, and the +instance name which can contain any printable characters except +space and slash. The remaining options are then associated with the +instance instead of the main queue. For example, the following +command creates a duplex instance of the LaserJet queue:

+ +
+lpoptions -p LaserJet/duplex -o sides=two-sided-long-edge
+
+ +

Instances do not inherit lpoptions from the main +queue.

+

Printing Multiple Copies

Both the lp and lpr commands have options for diff --git a/filter/gziptoany.c b/filter/gziptoany.c index 9f246bd11..0fa4b9a1e 100644 --- a/filter/gziptoany.c +++ b/filter/gziptoany.c @@ -1,5 +1,5 @@ /* - * "$Id: gziptoany.c 6378 2007-03-21 07:18:18Z mike $" + * "$Id: gziptoany.c 6400 2007-03-26 14:29:40Z mike $" * * GZIP/raw pre-filter for the Common UNIX Printing System (CUPS). * @@ -91,6 +91,9 @@ main(int argc, /* I - Number of command-line arguments */ while (copies > 0) { + if (!getenv("FINAL_CONTENT_TYPE")) + fputs("PAGE: 1 1\n", stderr); + cupsFileRewind(fp); while ((bytes = cupsFileRead(fp, buffer, sizeof(buffer))) > 0) @@ -118,5 +121,5 @@ main(int argc, /* I - Number of command-line arguments */ /* - * End of "$Id: gziptoany.c 6378 2007-03-21 07:18:18Z mike $". + * End of "$Id: gziptoany.c 6400 2007-03-26 14:29:40Z mike $". */ diff --git a/filter/pstops.c b/filter/pstops.c index c7ee6fcaf..5aea4696b 100644 --- a/filter/pstops.c +++ b/filter/pstops.c @@ -1,5 +1,5 @@ /* - * "$Id: pstops.c 6320 2007-03-08 13:36:56Z mike $" + * "$Id: pstops.c 6391 2007-03-24 14:35:56Z mike $" * * PostScript filter for the Common UNIX Printing System (CUPS). * @@ -1537,7 +1537,7 @@ copy_page(cups_file_t *fp, /* I - File to read from */ if (doc->number_up > 1 || doc->fitplot) continue; } - else if (!strncmp(line, "%%EndFeature:", 13)) + else if (!strncmp(line, "%%EndFeature", 12)) { feature = 0; @@ -3288,5 +3288,5 @@ write_labels(pstops_doc_t *doc, /* I - Document information */ /* - * End of "$Id: pstops.c 6320 2007-03-08 13:36:56Z mike $". + * End of "$Id: pstops.c 6391 2007-03-24 14:35:56Z mike $". */ diff --git a/filter/rastertolabel.c b/filter/rastertolabel.c index 015447224..1c012e4ce 100644 --- a/filter/rastertolabel.c +++ b/filter/rastertolabel.c @@ -1,5 +1,5 @@ /* - * "$Id: rastertolabel.c 6235 2007-02-05 21:03:49Z mike $" + * "$Id: rastertolabel.c 6401 2007-03-26 14:36:01Z mike $" * * Label printer filter for the Common UNIX Printing System (CUPS). * @@ -336,7 +336,7 @@ StartPage(ppd_file_t *ppd, /* I - PPD file */ * Set label size... */ - printf("q%d\n", header->cupsWidth); + printf("q%d\n", (header->cupsWidth + 7) & ~7); break; case ZEBRA_ZPL : @@ -1306,5 +1306,5 @@ main(int argc, /* I - Number of command-line arguments */ /* - * End of "$Id: rastertolabel.c 6235 2007-02-05 21:03:49Z mike $". + * End of "$Id: rastertolabel.c 6401 2007-03-26 14:36:01Z mike $". */ diff --git a/scheduler/auth.c b/scheduler/auth.c index ddc31ce6d..d0cee777f 100644 --- a/scheduler/auth.c +++ b/scheduler/auth.c @@ -1,5 +1,5 @@ /* - * "$Id: auth.c 6361 2007-03-19 16:01:28Z mike $" + * "$Id: auth.c 6397 2007-03-25 23:33:32Z mike $" * * Authorization routines for the Common UNIX Printing System (CUPS). * @@ -849,6 +849,21 @@ cupsdAuthorize(cupsd_client_t *con) /* I - Client connection */ gss_name_t client_name; /* Client name */ +# ifdef __APPLE__ + /* + * If the weak-linked GSSAPI/Kerberos library is not present, don't try + * to use it... + */ + + if (gss_init_sec_context == NULL) + { + cupsdLogMessage(CUPSD_LOG_WARN, + "GSSAPI/Kerberos authentication failed because the " + "Kerberos framework is not present."); + return; + } +# endif /* __APPLE__ */ + con->gss_output_token.length = 0; /* @@ -2522,5 +2537,5 @@ to64(char *s, /* O - Output string */ /* - * End of "$Id: auth.c 6361 2007-03-19 16:01:28Z mike $". + * End of "$Id: auth.c 6397 2007-03-25 23:33:32Z mike $". */ diff --git a/scheduler/ipp.c b/scheduler/ipp.c index 186d14f3d..bb0645e45 100644 --- a/scheduler/ipp.c +++ b/scheduler/ipp.c @@ -1,5 +1,5 @@ /* - * "$Id: ipp.c 6383 2007-03-21 20:01:20Z mike $" + * "$Id: ipp.c 6397 2007-03-25 23:33:32Z mike $" * * IPP routines for the Common UNIX Printing System (CUPS) scheduler. * @@ -7869,6 +7869,21 @@ save_krb5_creds(cupsd_client_t *con, /* I - Client connection */ minor_status; /* Minor status code */ +# ifdef __APPLE__ + /* + * If the weak-linked GSSAPI/Kerberos library is not present, don't try + * to use it... + */ + + if (krb5_init_context == NULL) + { + cupsdLogMessage(CUPSD_LOG_DEBUG, + "save_krb5_creds: GSSAPI/Kerberos framework is not " + "present"); + return; + } +# endif /* __APPLE__ */ + /* * Setup a cached context for the job filters to use... */ @@ -9458,5 +9473,5 @@ validate_user(cupsd_job_t *job, /* I - Job */ /* - * End of "$Id: ipp.c 6383 2007-03-21 20:01:20Z mike $". + * End of "$Id: ipp.c 6397 2007-03-25 23:33:32Z mike $". */ diff --git a/scheduler/job.c b/scheduler/job.c index f18403c98..aa94e5b00 100644 --- a/scheduler/job.c +++ b/scheduler/job.c @@ -1,5 +1,5 @@ /* - * "$Id: job.c 6376 2007-03-21 06:39:10Z mike $" + * "$Id: job.c 6399 2007-03-26 14:27:48Z mike $" * * Job management routines for the Common UNIX Printing System (CUPS). * @@ -2934,7 +2934,8 @@ start_job(cupsd_job_t *job, /* I - Job ID */ envp[envc ++] = printer_name; if (!printer->remote && !printer->raw && - (filter = (mime_filter_t *)cupsArrayLast(filters)) != NULL) + (filter = (mime_filter_t *)cupsArrayLast(filters)) != NULL && + filter->dst) { snprintf(final_content_type, sizeof(final_content_type), "FINAL_CONTENT_TYPE=%s/%s", @@ -3535,5 +3536,5 @@ update_job(cupsd_job_t *job) /* I - Job to check */ /* - * End of "$Id: job.c 6376 2007-03-21 06:39:10Z mike $". + * End of "$Id: job.c 6399 2007-03-26 14:27:48Z mike $". */ diff --git a/templates/pl/printers.tmpl b/templates/pl/printers.tmpl index df0117dda..c548474a9 100644 --- a/templates/pl/printers.tmpl +++ b/templates/pl/printers.tmpl @@ -6,7 +6,7 @@
- + Opis: {printer_info}
Położenie: {printer_location}
diff --git a/test/run-stp-tests.sh b/test/run-stp-tests.sh index d47613d65..56ba53181 100755 --- a/test/run-stp-tests.sh +++ b/test/run-stp-tests.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# "$Id: run-stp-tests.sh 6380 2007-03-21 15:18:53Z mike $" +# "$Id: run-stp-tests.sh 6389 2007-03-24 14:26:04Z mike $" # # Perform the complete set of IPP compliance tests specified in the # CUPS Software Test Plan. @@ -404,6 +404,13 @@ CUPS_DATADIR=/tmp/cups-$user/share; export CUPS_DATADIR HOME=/tmp/cups-$user export HOME +# +# Force POSIX locale for tests... +# + +LANG=C +export LANG + # # Start the server; run as foreground daemon in the background... # @@ -584,5 +591,5 @@ echo "A HTML report was created in test/$strfile." echo "" # -# End of "$Id: run-stp-tests.sh 6380 2007-03-21 15:18:53Z mike $" +# End of "$Id: run-stp-tests.sh 6389 2007-03-24 14:26:04Z mike $" # diff --git a/tools/buttons.gif b/tools/buttons.gif deleted file mode 100644 index 080dc8614..000000000 Binary files a/tools/buttons.gif and /dev/null differ diff --git a/tools/makebuttons b/tools/makebuttons index 5723ab424..a6f5b41af 100755 --- a/tools/makebuttons +++ b/tools/makebuttons @@ -85,9 +85,6 @@ fi # Bitstream Vera font... font="fonts/Vera.ttf" -# Base image -base="tools/buttons.gif" - # Colors background="#d4d4a4" black="#000000" @@ -162,7 +159,7 @@ function generate_button() # First step: generate an image trimmed to the text. # -> annotate a 40x400 rectangle with the provided text # -> trim to the text - convert $base -extent 400x40 -fill "$fgclr" \ + convert xc:transparent -extent 400x40 -fill "$fgclr" \ -draw "rectangle 0,0 399,39" \ -fill "#ffffff" -encoding Unicode -pointsize 13 -font "$font" \ -gravity Center -annotate 0x0+0+0 "$txt" -trim $tmp_btn @@ -207,7 +204,7 @@ function generate_button() btn_w=`expr $txt_w + $rad + $rad` btn_top=`expr $btn_h - 1` - convert $base \ + convert xc:transparent \ -extent $btn_w'x'$btn_h -fill "$bgclr" \ -draw "rectangle 0,0 $btn_w,$btn_h" -fill "$fgclr" \ -draw "roundRectangle 0,0 `expr $btn_w - 1`,$btn_top `expr $rad - 1`,$rad" \