Comparar commits

..

1 Commits

Autor SHA1 Mensagem Data
msweet 89fbf56cfd Import cups.org releases
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/tags/release-1.3.6@4306 a1ca3aef-8c08-0410-bb20-df032aa958be
2013-05-10 18:56:23 +00:00
40 arquivos alterados com 444 adições e 751 exclusões
+1 -42
Ver Arquivo
@@ -1,47 +1,6 @@
CHANGES.txt - 2008-04-01
CHANGES.txt - 2008-02-15
------------------------
CHANGES IN CUPS V1.3.7
- CVE-2008-0047: cgiCompileSearch buffer overflow (STR #2729)
- CVE-2008-1373: CUPS GIF image filter overflow (STR #2765)
- Updated the "make check" tests to do a more thorough
automated test.
- cups-driverd complained about missing directories (STR
#2777)
- cupsaddsmb would leave the Samba username and password on
disk if no Windows drivers were installed (STR #2779)
- The Linux USB backend used 100% CPU when a printer was
disconnected (STR #2769)
- The sample raster drivers did not properly handle SIGTERM
(STR #2770)
- The scheduler sent notify_post() messages too often on
Mac OS X.
- Kerberos access to the web interface did not work
(STR #2748)
- The scheduler did not support "AuthType Default" in IPP
policies (STR #2749)
- The scheduler did not support the "HideImplicitMembers"
directive as documented (STR #2760)
- "make check" didn't return a non-zero exit code on
error (STR #2758)
- The scheduler incorrectly logged AUTH_foo environment
variables in debug mode (STR #2751)
- The image filters inverted PBM files (STR #2746)
- cupsctl would crash if the scheduler was not running
(STR #2741)
- The scheduler could crash when printing using a port
monitor (STR #2742)
- The scheduler would crash if PAM was broken (STR #2734)
- The image filters did not work with some CMYK JPEG files
produced by Adobe applications (STR #2727)
- The Mac OS X USB backend did not work with printers that
did not report a make or model.
- The job-sheets option was not encoded properly (STR #2715)
- The scheduler incorrectly complained about missing LSB
PPD directories.
CHANGES IN CUPS V1.3.6
- Documentation updates (STR #2646, STR #2647, STR #2649)
+1 -1
Ver Arquivo
@@ -1,4 +1,4 @@
INSTALL - CUPS v1.3.7 - 2008-04-01
INSTALL - CUPS v1.3.6 - 2008-02-15
----------------------------------
This file describes how to compile and install CUPS from source
+1 -1
Ver Arquivo
@@ -1,4 +1,4 @@
README - CUPS v1.3.7 - 2008-04-01
README - CUPS v1.3.6 - 2008-02-15
---------------------------------
Looking for compile instructions? Read the file "INSTALL.txt"
+14 -59
Ver Arquivo
@@ -64,23 +64,19 @@ backendGetDeviceID(
char *uri, /* O - Device URI */
int uri_size) /* I - Size of buffer */
{
#ifdef __APPLE__ /* This function is a no-op */
return (-1);
#else /* Get the device ID from the specified file descriptor... */
char *attr, /* 1284 attribute */
*delim, /* 1284 delimiter */
*uriptr, /* Pointer into URI */
manufacturer[256], /* Manufacturer string */
serial_number[1024]; /* Serial number string */
int manulen; /* Length of manufacturer string */
# ifdef __linux
#ifdef __linux
int length; /* Length of device ID info */
int got_id = 0;
# endif /* __linux */
# if defined(__sun) && defined(ECPPIOC_GETDEVID)
#endif /* __linux */
#if defined(__sun) && defined(ECPPIOC_GETDEVID)
struct ecpp_device_id did; /* Device ID buffer */
# endif /* __sun && ECPPIOC_GETDEVID */
#endif /* __sun && ECPPIOC_GETDEVID */
DEBUG_printf(("backendGetDeviceID(fd=%d, device_id=%p, device_id_size=%d, "
@@ -110,7 +106,7 @@ backendGetDeviceID(
*device_id = '\0';
# ifdef __linux
#ifdef __linux
if (ioctl(fd, LPIOC_GET_DEVICE_ID(device_id_size), device_id))
{
/*
@@ -217,13 +213,13 @@ backendGetDeviceID(
memmove(device_id, device_id + 2, length);
device_id[length] = '\0';
}
# ifdef DEBUG
# ifdef DEBUG
else
printf("backendGetDeviceID: ioctl failed - %s\n", strerror(errno));
# endif /* DEBUG */
# endif /* __linux */
# endif /* DEBUG */
#endif /* __linux */
# if defined(__sun) && defined(ECPPIOC_GETDEVID)
#if defined(__sun) && defined(ECPPIOC_GETDEVID)
did.mode = ECPP_CENTRONICS;
did.len = device_id_size - 1;
did.rlen = 0;
@@ -240,11 +236,11 @@ backendGetDeviceID(
else
device_id[device_id_size - 1] = '\0';
}
# ifdef DEBUG
# ifdef DEBUG
else
printf("backendGetDeviceID: ioctl failed - %s\n", strerror(errno));
# endif /* DEBUG */
# endif /* __sun && ECPPIOC_GETDEVID */
# endif /* DEBUG */
#endif /* __sun && ECPPIOC_GETDEVID */
}
DEBUG_printf(("backendGetDeviceID: device_id=\"%s\"\n", device_id));
@@ -373,7 +369,6 @@ backendGetDeviceID(
}
return (0);
#endif /* __APPLE__ */
}
@@ -479,41 +474,15 @@ backendGetMakeModel(
if (mfg)
{
/*
* Skip leading whitespace...
*/
while (isspace(*mfg & 255))
mfg ++;
/*
* Map common bad names to the ones we use for driver selection...
*/
if (!strncasecmp(mfg, "Hewlett-Packard", 15))
strlcpy(make_model, "HP", make_model_size);
else if (!strncasecmp(mfg, "Lexmark International", 21))
strlcpy(make_model, "Lexmark", make_model_size);
else
{
/*
* Use the manufacturer that is supplied...
*/
strlcpy(make_model, mfg, make_model_size);
if ((delim = strchr(make_model, ';')) != NULL)
*delim = '\0';
/*
* But strip trailing whitespace...
*/
for (delim = make_model + strlen(make_model) - 1;
delim > make_model && *delim == ' ';
delim --)
*delim = '\0';
}
if ((delim = strchr(make_model, ';')) != NULL)
*delim = '\0';
if (!strncasecmp(make_model, mdl, strlen(make_model)))
{
@@ -529,9 +498,6 @@ backendGetMakeModel(
* Concatenate the make and model...
*/
while (isspace(*mdl & 255))
mdl ++;
strlcat(make_model, " ", make_model_size);
strlcat(make_model, mdl, make_model_size);
}
@@ -542,9 +508,6 @@ backendGetMakeModel(
* Just copy model string, since it has the manufacturer...
*/
while (isspace(*mdl & 255))
mdl ++;
strlcpy(make_model, mdl, make_model_size);
}
}
@@ -554,9 +517,6 @@ backendGetMakeModel(
* Use description...
*/
while (isspace(*attr & 255))
attr ++;
if (!strncasecmp(attr, "Hewlett-Packard hp ", 19))
{
/*
@@ -592,11 +552,6 @@ backendGetMakeModel(
if ((delim = strchr(make_model, ';')) != NULL)
*delim = '\0';
for (delim = make_model + strlen(make_model) - 1;
delim > make_model && *delim == ' ';
delim --)
*delim = '\0';
/*
* Strip trailing whitespace...
*/
+26 -23
Ver Arquivo
@@ -92,7 +92,6 @@
#include <cups/debug.h>
#include <cups/sidechannel.h>
#include <cups/i18n.h>
#include "backend-private.h"
#include <CoreFoundation/CoreFoundation.h>
#include <IOKit/usb/IOUSBLib.h>
@@ -1009,21 +1008,25 @@ static Boolean list_device_cb(void *refcon,
{
CFStringRef make = NULL, model = NULL, serial = NULL;
char uristr[1024], makestr[1024], modelstr[1024], serialstr[1024];
char optionsstr[1024], idstr[1024], make_modelstr[1024];
char optionsstr[1024], idstr[1024];
copy_deviceinfo(deviceIDString, &make, &model, &serial);
CFStringGetCString(deviceIDString, idstr, sizeof(idstr),
kCFStringEncodingUTF8);
backendGetMakeModel(idstr, make_modelstr, sizeof(make_modelstr));
modelstr[0] = '/';
if (!CFStringGetCString(make, makestr, sizeof(makestr),
kCFStringEncodingUTF8))
CFStringGetCString(deviceIDString, idstr, sizeof(idstr),
kCFStringEncodingUTF8);
if (make)
CFStringGetCString(make, makestr, sizeof(makestr),
kCFStringEncodingUTF8);
else
strcpy(makestr, "Unknown");
if (!CFStringGetCString(model, &modelstr[1], sizeof(modelstr)-1,
kCFStringEncodingUTF8))
if (model)
CFStringGetCString(model, &modelstr[1], sizeof(modelstr)-1,
kCFStringEncodingUTF8);
else
strcpy(modelstr + 1, "Printer");
optionsstr[0] = '\0';
@@ -1038,8 +1041,18 @@ static Boolean list_device_cb(void *refcon,
httpAssembleURI(HTTP_URI_CODING_ALL, uristr, sizeof(uristr), "usb", NULL, makestr, 0, modelstr);
strncat(uristr, optionsstr, sizeof(uristr));
printf("direct %s \"%s\" \"%s USB\" \"%s\"\n", uristr, make_modelstr,
make_modelstr, idstr);
/*
* Fix common HP 1284 bug...
*/
if (!strcasecmp(makestr, "Hewlett-Packard"))
strcpy(makestr, "HP");
if (!strncasecmp(modelstr + 1, "hp ", 3))
_cups_strcpy(modelstr + 1, modelstr + 4);
printf("direct %s \"%s %s\" \"%s %s USB\" \"%s\"\n", uristr, makestr,
&modelstr[1], makestr, &modelstr[1], idstr);
release_deviceinfo(&make, &model, &serial);
CFRelease(deviceIDString);
@@ -1175,19 +1188,9 @@ static void copy_deviceinfo(CFStringRef deviceIDString,
CFStringRef serialKeys[] = { CFSTR("SN:"), CFSTR("SERN:"), NULL };
if (make != NULL)
{
if ((*make = copy_value_for_key(deviceIDString, makeKeys)) == NULL)
*make = CFStringCreateWithCString(kCFAllocatorDefault, "Unknown",
kCFStringEncodingUTF8);
}
*make = copy_value_for_key(deviceIDString, makeKeys);
if (model != NULL)
{
if ((*model = copy_value_for_key(deviceIDString, modelKeys)) == NULL)
*model = CFStringCreateWithCString(kCFAllocatorDefault, "Printer",
kCFStringEncodingUTF8);
}
*model = copy_value_for_key(deviceIDString, modelKeys);
if (serial != NULL)
*serial = copy_value_for_key(deviceIDString, serialKeys);
}
+3 -2
Ver Arquivo
@@ -414,10 +414,11 @@ open_device(const char *uri, /* I - Device URI */
*/
if (busy)
{
_cupsLangPuts(stderr,
_("INFO: Printer busy; will retry in 5 seconds...\n"));
sleep(5);
sleep(5);
}
}
}
#elif defined(__sun) && defined(ECPPIOC_GETDEVID)
+1 -3
Ver Arquivo
@@ -167,9 +167,7 @@ cgiCompileSearch(const char *query) /* I - Query string */
* string + RE overhead...
*/
wlen = (sptr - s) + 2 * 4 * wlen + 2 * strlen(prefix) + 11;
if (lword)
wlen += strlen(lword);
wlen = (sptr - s) + 4 * wlen + 2 * strlen(prefix) + 4;
if (wlen > slen)
{
+3 -3
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-common.m4 7329 2008-02-20 00:32:58Z mike $"
dnl "$Id: cups-common.m4 7325 2008-02-18 18:59:46Z mike $"
dnl
dnl Common configuration stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -20,7 +20,7 @@ dnl Set the name of the config header file...
AC_CONFIG_HEADER(config.h)
dnl Version number information...
CUPS_VERSION="1.3.7"
CUPS_VERSION="1.3.6"
CUPS_REVISION=""
AC_SUBST(CUPS_VERSION)
@@ -273,5 +273,5 @@ AC_SUBST(FONTS)
AC_SUBST(LEGACY_BACKENDS)
dnl
dnl End of "$Id: cups-common.m4 7329 2008-02-20 00:32:58Z mike $".
dnl End of "$Id: cups-common.m4 7325 2008-02-18 18:59:46Z mike $".
dnl
+2 -7
Ver Arquivo
@@ -1,5 +1,5 @@
dnl
dnl "$Id: cups-compiler.m4 7353 2008-02-28 00:54:04Z mike $"
dnl "$Id: cups-compiler.m4 7247 2008-01-23 15:13:56Z mike $"
dnl
dnl Compiler stuff for the Common UNIX Printing System (CUPS).
dnl
@@ -146,11 +146,6 @@ if test -n "$GCC"; then
# CUPS since we already use buffer-limited calls, but
# this will catch any additions that are broken.
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2"
if test x$enable_pie = xyes; then
# GCC 4 on Mac OS X needs -Wl,-pie as well
LDFLAGS="$LDFLAGS -Wl,-pie"
fi
;;
HP-UX*)
@@ -529,5 +524,5 @@ case $uname in
esac
dnl
dnl End of "$Id: cups-compiler.m4 7353 2008-02-28 00:54:04Z mike $".
dnl End of "$Id: cups-compiler.m4 7247 2008-01-23 15:13:56Z mike $".
dnl
+1
Ver Arquivo
@@ -91,6 +91,7 @@ HEADERS = \
dir.h \
file.h \
http.h \
i18n.h \
ipp.h \
language.h \
ppd.h \
-3
Ver Arquivo
@@ -808,9 +808,6 @@ cupsAdminExportSamba(
if (have_drivers == 0)
{
_cupsSetError(IPP_NOT_FOUND, message);
unlink(authfile);
return (0);
}
+2 -2
Ver Arquivo
@@ -59,10 +59,10 @@ extern "C" {
* Constants...
*/
# define CUPS_VERSION 1.0307
# define CUPS_VERSION 1.0306
# define CUPS_VERSION_MAJOR 1
# define CUPS_VERSION_MINOR 3
# define CUPS_VERSION_PATCH 7
# define CUPS_VERSION_PATCH 6
# define CUPS_DATE_ANY -1
+1 -3
Ver Arquivo
@@ -3,7 +3,7 @@
*
* Option encoding routines for the Common UNIX Printing System (CUPS).
*
* Copyright 2007-2008 by Apple Inc.
* Copyright 2007 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -67,8 +67,6 @@ static const _ipp_option_t ipp_options[] =
{ 0, "job-page-limit", IPP_TAG_INTEGER, IPP_TAG_JOB },
{ 0, "job-priority", IPP_TAG_INTEGER, IPP_TAG_JOB },
{ 0, "job-quota-period", IPP_TAG_INTEGER, IPP_TAG_JOB },
{ 1, "job-sheets", IPP_TAG_NAME, IPP_TAG_JOB },
{ 1, "job-sheets-default", IPP_TAG_NAME, IPP_TAG_PRINTER },
{ 0, "job-uuid", IPP_TAG_URI, IPP_TAG_JOB },
{ 0, "landscape", IPP_TAG_BOOLEAN, IPP_TAG_JOB },
{ 1, "media", IPP_TAG_KEYWORD, IPP_TAG_JOB },
+11 -7
Ver Arquivo
@@ -217,14 +217,18 @@ install: all $(INSTALL_LANGUAGES)
install-languages:
for lang in $(LANGUAGES); do \
if test -d $$lang; then \
$(INSTALL_DIR) -m 755 $(DOCDIR)/$$lang/images; \
$(INSTALL_MAN) $$lang/index.html $(DOCDIR)/$$lang 2>/dev/null || true; \
$(INSTALL_MAN) $$lang/cups.css $(DOCDIR)/$$lang 2>/dev/null || true; \
for file in $(WEBBUTTONS); do \
$(INSTALL_MAN) $$lang/$$file $(DOCDIR)/$$lang/images 2>/dev/null || true; \
done \
$(INSTALL_DIR) -m 755 $(DOCDIR)/$$lang/images; \
if test -f $$lang/index.html; then \
$(INSTALL_MAN) $$lang/index.html $(DOCDIR)/$$lang; \
fi; \
if test -f $$lang/cups.css; then \
$(INSTALL_MAN) $$lang/cups.css $(DOCDIR)/$$lang; \
fi; \
for file in $(WEBBUTTONS); do \
if test -f $$lang/$$file; then \
$(INSTALL_MAN) $$lang/$$file $(DOCDIR)/$$lang/images; \
fi; \
done \
done
+1 -2
Ver Arquivo
@@ -37,7 +37,6 @@
#define GIF_INTERLACE 0x40
#define GIF_COLORMAP 0x80
#define GIF_MAX_BITS 12
typedef cups_ib_t gif_cmap_t[256][4];
typedef short gif_table_t[4096];
@@ -463,7 +462,7 @@ gif_read_image(FILE *fp, /* I - Input file */
pass = 0;
code_size = getc(fp);
if (code_size > GIF_MAX_BITS || !pixels)
if (!pixels)
return (-1);
if (gif_read_lzw(fp, 1, code_size) < 0)
+11 -18
Ver Arquivo
@@ -47,8 +47,8 @@ _cupsImageReadJPEG(
struct jpeg_error_mgr jerr; /* Error handler info */
cups_ib_t *in, /* Input pixels */
*out; /* Output pixels */
jpeg_saved_marker_ptr marker; /* Pointer to marker data */
int psjpeg = 0; /* Non-zero if Photoshop CMYK JPEG */
char header[16]; /* Photoshop JPEG header */
int psjpeg; /* Non-zero if Photoshop JPEG */
static const char *cspaces[] =
{ /* JPEG colorspaces... */
"JCS_UNKNOWN",
@@ -60,31 +60,24 @@ _cupsImageReadJPEG(
};
/*
* Read the first 16 bytes to determine if this is a Photoshop JPEG file...
*/
fread(header, sizeof(header), 1, fp);
rewind(fp);
psjpeg = memcmp(header + 6, "Photoshop ", 10) == 0;
/*
* Read the JPEG header...
*/
cinfo.err = jpeg_std_error(&jerr);
jpeg_create_decompress(&cinfo);
jpeg_save_markers(&cinfo, JPEG_APP0 + 14, 0xffff); /* Adobe JPEG */
jpeg_stdio_src(&cinfo, fp);
jpeg_read_header(&cinfo, 1);
/*
* Parse any Adobe APPE data embedded in the JPEG file. Since Adobe doesn't
* bother following standards, we have to invert the CMYK JPEG data written by
* Adobe apps...
*/
for (marker = cinfo.marker_list; marker; marker = marker->next)
if (marker->marker == (JPEG_APP0 + 14) && marker->data_length >= 12 &&
!memcmp(marker->data, "Adobe", 5) && marker->data[11] == 2)
{
fputs("DEBUG: Adobe CMYK JPEG detected (inverting color values)\n",
stderr);
psjpeg = 1;
}
cinfo.quantize_colors = 0;
fprintf(stderr, "DEBUG: num_components = %d\n", cinfo.num_components);
+2 -7
Ver Arquivo
@@ -178,11 +178,6 @@ _cupsImageReadPNM(
switch (format)
{
case 1 :
for (x = img->xsize, inptr = in; x > 0; x --, inptr ++)
if (fscanf(fp, "%d", &val) == 1)
*inptr = val ? 0 : 255;
break;
case 2 :
for (x = img->xsize, inptr = in; x > 0; x --, inptr ++)
if (fscanf(fp, "%d", &val) == 1)
@@ -208,9 +203,9 @@ _cupsImageReadPNM(
x --, inptr ++)
{
if (*outptr & bit)
*inptr = 0;
else
*inptr = 255;
else
*inptr = 0;
if (bit > 1)
bit >>= 1;
+78 -52
Ver Arquivo
@@ -77,8 +77,7 @@ int DotBit, /* Bit in buffers */
LineCount, /* # of lines processed */
EvenOffset, /* Offset into 'even' buffers */
OddOffset, /* Offset into 'odd' buffers */
Shingling, /* Shingle output? */
Canceled; /* Has the current job been canceled? */
Shingling; /* Shingle output? */
/*
@@ -86,15 +85,15 @@ int DotBit, /* Bit in buffers */
*/
void Setup(void);
void StartPage(const ppd_file_t *ppd, const cups_page_header2_t *header);
void EndPage(const cups_page_header2_t *header);
void StartPage(const ppd_file_t *ppd, const cups_page_header_t *header);
void EndPage(const cups_page_header_t *header);
void Shutdown(void);
void CancelJob(int sig);
void CompressData(const unsigned char *line, int length, int plane,
int type, int xstep, int ystep);
void OutputLine(const cups_page_header2_t *header);
void OutputRows(const cups_page_header2_t *header, int row);
void OutputLine(const cups_page_header_t *header);
void OutputRows(const cups_page_header_t *header, int row);
/*
@@ -124,12 +123,32 @@ Setup(void)
void
StartPage(const ppd_file_t *ppd, /* I - PPD file */
const cups_page_header2_t *header) /* I - Page header */
const cups_page_header_t *header) /* I - Page header */
{
int n, t; /* Numbers */
int plane; /* Looping var */
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
struct sigaction action; /* Actions for POSIX signals */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
/*
* Register a signal handler to eject the current page if the
* job is cancelled.
*/
#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
sigset(SIGTERM, CancelJob);
#elif defined(HAVE_SIGACTION)
memset(&action, 0, sizeof(action));
sigemptyset(&action.sa_mask);
action.sa_handler = CancelJob;
sigaction(SIGTERM, &action, NULL);
#else
signal(SIGTERM, CancelJob);
#endif /* HAVE_SIGSET */
/*
* Send a reset sequence.
*/
@@ -320,7 +339,7 @@ StartPage(const ppd_file_t *ppd, /* I - PPD file */
*/
void
EndPage(const cups_page_header2_t *header) /* I - Page header */
EndPage(const cups_page_header_t *header) /* I - Page header */
{
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
struct sigaction action; /* Actions for POSIX signals */
@@ -358,6 +377,22 @@ EndPage(const cups_page_header2_t *header) /* I - Page header */
putchar(12); /* Form feed */
fflush(stdout);
/*
* Unregister the signal handler...
*/
#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
sigset(SIGTERM, SIG_IGN);
#elif defined(HAVE_SIGACTION)
memset(&action, 0, sizeof(action));
sigemptyset(&action.sa_mask);
action.sa_handler = SIG_IGN;
sigaction(SIGTERM, &action, NULL);
#else
signal(SIGTERM, SIG_IGN);
#endif /* HAVE_SIGSET */
/*
* Free memory...
*/
@@ -394,9 +429,31 @@ Shutdown(void)
void
CancelJob(int sig) /* I - Signal */
{
int i; /* Looping var */
(void)sig;
Canceled = 1;
/*
* Send out lots of NUL bytes to clear out any pending raster data...
*/
if (DotBytes)
i = DotBytes * 360 * 8;
else
i = 720;
for (; i > 0; i --)
putchar(0);
/*
* End the current page and exit...
*/
EndPage(NULL);
Shutdown();
exit(0);
}
@@ -613,7 +670,7 @@ CompressData(const unsigned char *line, /* I - Data to compress */
*/
void
OutputLine(const cups_page_header2_t *header) /* I - Page header */
OutputLine(const cups_page_header_t *header) /* I - Page header */
{
if (header->cupsRowCount)
{
@@ -781,7 +838,7 @@ OutputLine(const cups_page_header2_t *header) /* I - Page header */
*/
void
OutputRows(const cups_page_header2_t *header, /* I - Page image header */
OutputRows(const cups_page_header_t *header, /* I - Page image header */
int row) /* I - Row number (0 or 1) */
{
unsigned i, n; /* Looping vars */
@@ -955,19 +1012,16 @@ OutputRows(const cups_page_header2_t *header, /* I - Page image header */
* 'main()' - Main entry and processing of driver.
*/
int /* O - Exit status */
main(int argc, /* I - Number of command-line arguments */
char *argv[]) /* I - Command-line arguments */
int /* O - Exit status */
main(int argc, /* I - Number of command-line arguments */
char *argv[]) /* I - Command-line arguments */
{
int fd; /* File descriptor */
cups_raster_t *ras; /* Raster stream for printing */
cups_page_header2_t header; /* Page header from file */
ppd_file_t *ppd; /* PPD file */
int page; /* Current page */
int y; /* Current line */
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
struct sigaction action; /* Actions for POSIX signals */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
int fd; /* File descriptor */
cups_raster_t *ras; /* Raster stream for printing */
cups_page_header_t header; /* Page header from file */
ppd_file_t *ppd; /* PPD file */
int page; /* Current page */
int y; /* Current line */
/*
@@ -1010,25 +1064,6 @@ main(int argc, /* I - Number of command-line arguments */
ras = cupsRasterOpen(fd, CUPS_RASTER_READ);
/*
* Register a signal handler to eject the current page if the
* job is cancelled.
*/
Canceled = 0;
#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
sigset(SIGTERM, CancelJob);
#elif defined(HAVE_SIGACTION)
memset(&action, 0, sizeof(action));
sigemptyset(&action.sa_mask);
action.sa_handler = CancelJob;
sigaction(SIGTERM, &action, NULL);
#else
signal(SIGTERM, CancelJob);
#endif /* HAVE_SIGSET */
/*
* Initialize the print device...
*/
@@ -1045,15 +1080,12 @@ main(int argc, /* I - Number of command-line arguments */
page = 0;
while (cupsRasterReadHeader2(ras, &header))
while (cupsRasterReadHeader(ras, &header))
{
/*
* Write a status message with the page number and number of copies.
*/
if (Canceled)
break;
page ++;
fprintf(stderr, "PAGE: %d %d\n", page, header.NumCopies);
@@ -1074,9 +1106,6 @@ main(int argc, /* I - Number of command-line arguments */
* Let the user know how far we have progressed...
*/
if (Canceled)
break;
if ((y & 127) == 0)
fprintf(stderr, _("INFO: Printing page %d, %d%% complete...\n"), page,
100 * y / header.cupsHeight);
@@ -1100,9 +1129,6 @@ main(int argc, /* I - Number of command-line arguments */
*/
EndPage(&header);
if (Canceled)
break;
}
/*
+73 -47
Ver Arquivo
@@ -52,8 +52,7 @@ int NumPlanes, /* Number of color planes */
ColorBits, /* Number of bits per color */
Feed, /* Number of lines to skip */
Duplex, /* Current duplex mode */
Page, /* Current page number */
Canceled; /* Has the current job been canceled? */
Page; /* Current page number */
/*
@@ -61,13 +60,13 @@ int NumPlanes, /* Number of color planes */
*/
void Setup(void);
void StartPage(ppd_file_t *ppd, cups_page_header2_t *header);
void StartPage(ppd_file_t *ppd, cups_page_header_t *header);
void EndPage(void);
void Shutdown(void);
void CancelJob(int sig);
void CompressData(unsigned char *line, int length, int plane, int type);
void OutputLine(cups_page_header2_t *header);
void OutputLine(cups_page_header_t *header);
/*
@@ -92,11 +91,31 @@ Setup(void)
void
StartPage(ppd_file_t *ppd, /* I - PPD file */
cups_page_header2_t *header) /* I - Page header */
cups_page_header_t *header) /* I - Page header */
{
int plane; /* Looping var */
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
struct sigaction action; /* Actions for POSIX signals */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
/*
* Register a signal handler to eject the current page if the
* job is cancelled.
*/
#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
sigset(SIGTERM, CancelJob);
#elif defined(HAVE_SIGACTION)
memset(&action, 0, sizeof(action));
sigemptyset(&action.sa_mask);
action.sa_handler = CancelJob;
sigaction(SIGTERM, &action, NULL);
#else
signal(SIGTERM, CancelJob);
#endif /* HAVE_SIGSET */
/*
* Show page device dictionary...
*/
@@ -391,6 +410,11 @@ StartPage(ppd_file_t *ppd, /* I - PPD file */
void
EndPage(void)
{
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
struct sigaction action; /* Actions for POSIX signals */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
/*
* Eject the current page...
*/
@@ -412,6 +436,22 @@ EndPage(void)
fflush(stdout);
/*
* Unregister the signal handler...
*/
#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
sigset(SIGTERM, SIG_IGN);
#elif defined(HAVE_SIGACTION)
memset(&action, 0, sizeof(action));
sigemptyset(&action.sa_mask);
action.sa_handler = SIG_IGN;
sigaction(SIGTERM, &action, NULL);
#else
signal(SIGTERM, SIG_IGN);
#endif /* HAVE_SIGSET */
/*
* Free memory...
*/
@@ -449,9 +489,26 @@ Shutdown(void)
void
CancelJob(int sig) /* I - Signal */
{
int i; /* Looping var */
(void)sig;
Canceled = 1;
/*
* Send out lots of NUL bytes to clear out any pending raster data...
*/
for (i = 0; i < 600; i ++)
putchar(0);
/*
* End the current page and exit...
*/
EndPage();
Shutdown();
exit(0);
}
@@ -591,7 +648,7 @@ CompressData(unsigned char *line, /* I - Data to compress */
*/
void
OutputLine(cups_page_header2_t *header) /* I - Page header */
OutputLine(cups_page_header_t *header) /* I - Page header */
{
int plane, /* Current plane */
bytes, /* Bytes to write */
@@ -674,18 +731,15 @@ OutputLine(cups_page_header2_t *header) /* I - Page header */
* 'main()' - Main entry and processing of driver.
*/
int /* O - Exit status */
main(int argc, /* I - Number of command-line arguments */
char *argv[]) /* I - Command-line arguments */
int /* O - Exit status */
main(int argc, /* I - Number of command-line arguments */
char *argv[]) /* I - Command-line arguments */
{
int fd; /* File descriptor */
cups_raster_t *ras; /* Raster stream for printing */
cups_page_header2_t header; /* Page header from file */
int y; /* Current line */
ppd_file_t *ppd; /* PPD file */
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
struct sigaction action; /* Actions for POSIX signals */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
int fd; /* File descriptor */
cups_raster_t *ras; /* Raster stream for printing */
cups_page_header_t header; /* Page header from file */
int y; /* Current line */
ppd_file_t *ppd; /* PPD file */
/*
@@ -728,25 +782,6 @@ main(int argc, /* I - Number of command-line arguments */
ras = cupsRasterOpen(fd, CUPS_RASTER_READ);
/*
* Register a signal handler to eject the current page if the
* job is cancelled.
*/
Canceled = 0;
#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
sigset(SIGTERM, CancelJob);
#elif defined(HAVE_SIGACTION)
memset(&action, 0, sizeof(action));
sigemptyset(&action.sa_mask);
action.sa_handler = CancelJob;
sigaction(SIGTERM, &action, NULL);
#else
signal(SIGTERM, CancelJob);
#endif /* HAVE_SIGSET */
/*
* Initialize the print device...
*/
@@ -761,15 +796,12 @@ main(int argc, /* I - Number of command-line arguments */
Page = 0;
while (cupsRasterReadHeader2(ras, &header))
while (cupsRasterReadHeader(ras, &header))
{
/*
* Write a status message with the page number and number of copies.
*/
if (Canceled)
break;
Page ++;
fprintf(stderr, "PAGE: %d %d\n", Page, header.NumCopies);
@@ -790,9 +822,6 @@ main(int argc, /* I - Number of command-line arguments */
* Let the user know how far we have progressed...
*/
if (Canceled)
break;
if ((y & 127) == 0)
fprintf(stderr, _("INFO: Printing page %d, %d%% complete...\n"), Page,
100 * y / header.cupsHeight);
@@ -820,9 +849,6 @@ main(int argc, /* I - Number of command-line arguments */
*/
EndPage();
if (Canceled)
break;
}
/*
+47 -38
Ver Arquivo
@@ -3,7 +3,7 @@
*
* Label printer filter for the Common UNIX Printing System (CUPS).
*
* Copyright 2007-2008 by Apple Inc.
* Copyright 2007 by Apple Inc.
* Copyright 2001-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -90,10 +90,10 @@ int ModelNumber, /* cupsModelNumber attribute */
*/
void Setup(ppd_file_t *ppd);
void StartPage(ppd_file_t *ppd, cups_page_header2_t *header);
void EndPage(ppd_file_t *ppd, cups_page_header2_t *header);
void StartPage(ppd_file_t *ppd, cups_page_header_t *header);
void EndPage(ppd_file_t *ppd, cups_page_header_t *header);
void CancelJob(int sig);
void OutputLine(ppd_file_t *ppd, cups_page_header2_t *header, int y);
void OutputLine(ppd_file_t *ppd, cups_page_header_t *header, int y);
void PCLCompress(unsigned char *line, int length);
void ZPLCompress(char repeat_char, int repeat_count);
@@ -166,10 +166,13 @@ Setup(ppd_file_t *ppd) /* I - PPD file */
void
StartPage(ppd_file_t *ppd, /* I - PPD file */
cups_page_header2_t *header) /* I - Page header */
cups_page_header_t *header) /* I - Page header */
{
ppd_choice_t *choice; /* Marked choice */
int length; /* Actual label length */
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
struct sigaction action; /* Actions for POSIX signals */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
/*
@@ -223,6 +226,23 @@ StartPage(ppd_file_t *ppd, /* I - PPD file */
fprintf(stderr, "DEBUG: cupsRowFeed = %d\n", header->cupsRowFeed);
fprintf(stderr, "DEBUG: cupsRowStep = %d\n", header->cupsRowStep);
/*
* Register a signal handler to eject the current page if the
* job is canceled.
*/
#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
sigset(SIGTERM, CancelJob);
#elif defined(HAVE_SIGACTION)
memset(&action, 0, sizeof(action));
sigemptyset(&action.sa_mask);
action.sa_handler = CancelJob;
sigaction(SIGTERM, &action, NULL);
#else
signal(SIGTERM, CancelJob);
#endif /* HAVE_SIGSET */
switch (ModelNumber)
{
case DYMO_3x0 :
@@ -478,7 +498,7 @@ StartPage(ppd_file_t *ppd, /* I - PPD file */
void
EndPage(ppd_file_t *ppd, /* I - PPD file */
cups_page_header2_t *header) /* I - Page header */
cups_page_header_t *header) /* I - Page header */
{
int val; /* Option value */
ppd_choice_t *choice; /* Marked choice */
@@ -712,6 +732,22 @@ EndPage(ppd_file_t *ppd, /* I - PPD file */
fflush(stdout);
/*
* Unregister the signal handler...
*/
#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
sigset(SIGTERM, SIG_IGN);
#elif defined(HAVE_SIGACTION)
memset(&action, 0, sizeof(action));
sigemptyset(&action.sa_mask);
action.sa_handler = SIG_IGN;
sigaction(SIGTERM, &action, NULL);
#else
signal(SIGTERM, SIG_IGN);
#endif /* HAVE_SIGSET */
/*
* Free memory...
*/
@@ -743,7 +779,7 @@ CancelJob(int sig) /* I - Signal */
void
OutputLine(ppd_file_t *ppd, /* I - PPD file */
cups_page_header2_t *header, /* I - Page header */
cups_page_header_t *header, /* I - Page header */
int y) /* I - Line number */
{
int i; /* Looping var */
@@ -1109,14 +1145,11 @@ main(int argc, /* I - Number of command-line arguments */
{
int fd; /* File descriptor */
cups_raster_t *ras; /* Raster stream for printing */
cups_page_header2_t header; /* Page header from file */
cups_page_header_t header; /* Page header from file */
int y; /* Current line */
ppd_file_t *ppd; /* PPD file */
int num_options; /* Number of options */
cups_option_t *options; /* Options */
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
struct sigaction action; /* Actions for POSIX signals */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
/*
@@ -1159,25 +1192,6 @@ main(int argc, /* I - Number of command-line arguments */
ras = cupsRasterOpen(fd, CUPS_RASTER_READ);
/*
* Register a signal handler to eject the current page if the
* job is cancelled.
*/
Canceled = 0;
#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */
sigset(SIGTERM, CancelJob);
#elif defined(HAVE_SIGACTION)
memset(&action, 0, sizeof(action));
sigemptyset(&action.sa_mask);
action.sa_handler = CancelJob;
sigaction(SIGTERM, &action, NULL);
#else
signal(SIGTERM, CancelJob);
#endif /* HAVE_SIGSET */
/*
* Open the PPD file and apply options...
*/
@@ -1200,17 +1214,15 @@ main(int argc, /* I - Number of command-line arguments */
* Process pages as needed...
*/
Page = 0;
Page = 0;
Canceled = 0;
while (cupsRasterReadHeader2(ras, &header))
while (cupsRasterReadHeader(ras, &header))
{
/*
* Write a status message with the page number and number of copies.
*/
if (Canceled)
break;
Page ++;
fprintf(stderr, "PAGE: %d 1\n", Page);
@@ -1231,9 +1243,6 @@ main(int argc, /* I - Number of command-line arguments */
* Let the user know how far we have progressed...
*/
if (Canceled)
break;
if ((y & 15) == 0)
fprintf(stderr, _("INFO: Printing page %d, %d%% complete...\n"), Page,
100 * y / header.cupsHeight);
+4 -8
Ver Arquivo
@@ -340,7 +340,7 @@ cupsdAuthorize(cupsd_client_t *con) /* I - Client connection */
char *ptr, /* Pointer into string */
username[256], /* Username string */
password[33]; /* Password string */
cupsd_cert_t *localuser; /* Certificate username */
const char *localuser; /* Certificate username */
char nonce[HTTP_MAX_VALUE], /* Nonce value from client */
md5[33], /* MD5 password */
basicmd5[33]; /* MD5 of Basic password */
@@ -542,7 +542,7 @@ cupsdAuthorize(cupsd_client_t *con) /* I - Client connection */
if ((localuser = cupsdFindCert(authorization)) != NULL)
{
strlcpy(username, localuser->username, sizeof(username));
strlcpy(username, localuser, sizeof(username));
cupsdLogMessage(CUPSD_LOG_DEBUG,
"cupsdAuthorize: Authorized as %s using Local",
@@ -556,12 +556,7 @@ cupsdAuthorize(cupsd_client_t *con) /* I - Client connection */
return;
}
#ifdef HAVE_GSSAPI
if (localuser->ccache)
con->type = CUPSD_AUTH_NEGOTIATE;
else
#endif /* HAVE_GSSAPI */
con->type = CUPSD_AUTH_BASIC;
con->type = CUPSD_AUTH_BASIC;
}
else if (!strncmp(authorization, "Basic", 5))
{
@@ -664,6 +659,7 @@ cupsdAuthorize(cupsd_client_t *con) /* I - Client connection */
cupsdLogMessage(CUPSD_LOG_ERROR,
"cupsdAuthorize: pam_start() returned %d (%s)!\n",
pamerr, pam_strerror(pamh, pamerr));
pam_end(pamh, 0);
return;
}
+2 -2
Ver Arquivo
@@ -362,7 +362,7 @@ cupsdDeleteAllCerts(void)
* 'cupsdFindCert()' - Find a certificate.
*/
cupsd_cert_t * /* O - Matching certificate or NULL */
const char * /* O - Matching username or NULL */
cupsdFindCert(const char *certificate) /* I - Certificate */
{
cupsd_cert_t *cert; /* Current certificate */
@@ -373,7 +373,7 @@ cupsdFindCert(const char *certificate) /* I - Certificate */
if (!strcasecmp(certificate, cert->certificate))
{
DEBUG_printf((" returning %s...\n", cert->username));
return (cert);
return (cert->username);
}
DEBUG_puts(" certificate not found!");
+1 -1
Ver Arquivo
@@ -48,7 +48,7 @@ extern void cupsdAddCert(int pid, const char *username,
void *ccache);
extern void cupsdDeleteCert(int pid);
extern void cupsdDeleteAllCerts(void);
extern cupsd_cert_t *cupsdFindCert(const char *certificate);
extern const char *cupsdFindCert(const char *certificate);
extern void cupsdInitCerts(void);
-1
Ver Arquivo
@@ -113,7 +113,6 @@ static const cupsd_var_t variables[] =
#ifdef HAVE_GSSAPI
{ "GSSServiceName", &GSSServiceName, CUPSD_VARTYPE_STRING },
#endif /* HAVE_GSSAPI */
{ "HideImplicitMembers", &HideImplicitMembers, CUPSD_VARTYPE_BOOLEAN },
{ "ImplicitClasses", &ImplicitClasses, CUPSD_VARTYPE_BOOLEAN },
{ "ImplicitAnyClasses", &ImplicitAnyClasses, CUPSD_VARTYPE_BOOLEAN },
{ "JobRetryLimit", &JobRetryLimit, CUPSD_VARTYPE_INTEGER },
+8 -13
Ver Arquivo
@@ -684,12 +684,9 @@ list_ppds(int request_id, /* I - Request ID */
* Load PPDs from LSB-defined locations...
*/
if (!access("/usr/local/share/ppd", 0))
load_ppds("/usr/local/share/ppd", "lsb/local", 1);
if (!access("/usr/share/ppd", 0))
load_ppds("/usr/share/ppd", "lsb/usr", 1);
if (!access("/opt/share/ppd", 0))
load_ppds("/opt/share/ppd", "lsb/opt", 1);
load_ppds("/usr/local/share/ppd", "lsb/local", 1);
load_ppds("/usr/share/ppd", "lsb/usr", 1);
load_ppds("/opt/share/ppd", "lsb/opt", 1);
#endif /* __APPLE__ */
/*
@@ -1102,11 +1099,9 @@ load_ppds(const char *d, /* I - Actual directory */
if ((dir = cupsDirOpen(d)) == NULL)
{
if (errno != ENOENT)
fprintf(stderr,
"ERROR: [cups-driverd] Unable to open PPD directory \"%s\": %s\n",
d, strerror(errno));
fprintf(stderr,
"ERROR: [cups-driverd] Unable to open PPD directory \"%s\": %s\n",
d, strerror(errno));
return (0);
}
@@ -1584,8 +1579,8 @@ load_drivers(void)
if ((dir = cupsDirOpen(drivers)) == NULL)
{
fprintf(stderr, "ERROR: [cups-driverd] Unable to open driver directory "
"\"%s\": %s\n",
drivers, strerror(errno));
"\"%s\": %s\n",
drivers, strerror(errno));
return (0);
}
+7 -18
Ver Arquivo
@@ -8270,13 +8270,13 @@ save_auth_info(
cupsFilePrintf(fp, "%s\n", line);
if (!strcmp(dest->auth_info_required[i], "username"))
cupsdSetStringf(&job->auth_username, "AUTH_USERNAME=%s",
cupsdSetStringf(&job->auth_username, "CUPSD_AUTH_USERNAME=%s",
auth_info->values[i].string.text);
else if (!strcmp(dest->auth_info_required[i], "domain"))
cupsdSetStringf(&job->auth_domain, "AUTH_DOMAIN=%s",
cupsdSetStringf(&job->auth_domain, "CUPSD_AUTH_DOMAIN=%s",
auth_info->values[i].string.text);
else if (!strcmp(dest->auth_info_required[i], "password"))
cupsdSetStringf(&job->auth_password, "AUTH_PASSWORD=%s",
cupsdSetStringf(&job->auth_password, "CUPSD_AUTH_PASSWORD=%s",
auth_info->values[i].string.text);
}
}
@@ -8289,7 +8289,7 @@ save_auth_info(
httpEncode64_2(line, sizeof(line), con->username, strlen(con->username));
cupsFilePrintf(fp, "%s\n", line);
cupsdSetStringf(&job->auth_username, "AUTH_USERNAME=%s", con->username);
cupsdSetStringf(&job->auth_username, "CUPSD_AUTH_USERNAME=%s", con->username);
cupsdClearString(&job->auth_domain);
/*
@@ -8299,7 +8299,7 @@ save_auth_info(
httpEncode64_2(line, sizeof(line), con->password, strlen(con->password));
cupsFilePrintf(fp, "%s\n", line);
cupsdSetStringf(&job->auth_password, "AUTH_PASSWORD=%s", con->password);
cupsdSetStringf(&job->auth_password, "CUPSD_AUTH_PASSWORD=%s", con->password);
}
/*
@@ -8841,7 +8841,6 @@ send_http_error(
{
char resource[HTTP_MAX_URI]; /* Resource portion of URI */
cupsd_location_t *auth; /* Pointer to authentication element */
int auth_type; /* Type of authentication required */
if (printer->type & CUPS_PRINTER_CLASS)
@@ -8851,19 +8850,9 @@ send_http_error(
if ((auth = cupsdFindBest(resource, HTTP_POST)) == NULL ||
auth->type == CUPSD_AUTH_NONE)
auth = cupsdFindPolicyOp(printer->op_policy_ptr,
con->request ?
con->request->request.op.operation_id :
IPP_PRINT_JOB);
auth = cupsdFindPolicyOp(printer->op_policy_ptr, IPP_PRINT_JOB);
if (!auth)
auth_type = CUPSD_AUTH_NONE;
else if (auth->type == CUPSD_AUTH_DEFAULT)
auth_type = DefaultAuthType;
else
auth_type = auth->type;
cupsdSendError(con, status, auth_type);
cupsdSendError(con, status, auth ? auth->type : CUPSD_AUTH_NONE);
}
else
cupsdSendError(con, status, CUPSD_AUTH_NONE);
+13 -23
Ver Arquivo
@@ -2669,13 +2669,6 @@ start_job(cupsd_job_t *job, /* I - Job ID */
if (!filters)
filters = cupsArrayNew(NULL, NULL);
port_monitor.src = NULL;
port_monitor.dst = NULL;
port_monitor.cost = 0;
snprintf(port_monitor.filter, sizeof(port_monitor.filter),
"%s/monitor/%s", ServerBin, printer->port_monitor);
if (!cupsArrayAdd(filters, &port_monitor))
{
cupsdLogMessage(CUPSD_LOG_ERROR,
@@ -2691,6 +2684,9 @@ start_job(cupsd_job_t *job, /* I - Job ID */
return;
}
snprintf(port_monitor.filter, sizeof(port_monitor.filter),
"%s/monitor/%s", ServerBin, printer->port_monitor);
}
/*
@@ -3035,7 +3031,7 @@ start_job(cupsd_job_t *job, /* I - Job ID */
IPP_TAG_LANGUAGE);
#ifdef __APPLE__
strcpy(apple_language, "APPLE_LANGUAGE=");
strcpy(apple_language, "APPLE_LANGUAGE");
_cupsAppleLanguage(attr->values[0].string.text,
apple_language + 15, sizeof(apple_language) - 15);
#endif /* __APPLE__ */
@@ -3109,20 +3105,14 @@ start_job(cupsd_job_t *job, /* I - Job ID */
envp[envc ++] = device_uri;
envp[envc ++] = printer_name;
if (!printer->remote && !printer->raw)
if (!printer->remote && !printer->raw &&
(filter = (mime_filter_t *)cupsArrayLast(filters)) != NULL &&
filter->dst)
{
filter = (mime_filter_t *)cupsArrayLast(filters);
if (printer->port_monitor)
filter = (mime_filter_t *)cupsArrayPrev(filters);
if (filter && filter->dst)
{
snprintf(final_content_type, sizeof(final_content_type),
"FINAL_CONTENT_TYPE=%s/%s",
filter->dst->super, filter->dst->type);
envp[envc ++] = final_content_type;
}
snprintf(final_content_type, sizeof(final_content_type),
"FINAL_CONTENT_TYPE=%s/%s",
filter->dst->super, filter->dst->type);
envp[envc ++] = final_content_type;
}
if (Classification && !banner_page)
@@ -3163,8 +3153,8 @@ start_job(cupsd_job_t *job, /* I - Job ID */
envp[envc] = NULL;
for (i = 0; i < envc; i ++)
if (!strncmp(envp[i], "AUTH_", 5))
cupsdLogMessage(CUPSD_LOG_DEBUG, "[Job %d] envp[%d]=\"AUTH_%c****\"",
if (!strncmp(envp[i], "CUPSD_AUTH_", 5))
cupsdLogMessage(CUPSD_LOG_DEBUG, "[Job %d] envp[%d]=\"CUPSD_AUTH_%c****\"",
job->id, i, envp[i][5]);
else if (strncmp(envp[i], "DEVICE_URI=", 11))
cupsdLogMessage(CUPSD_LOG_DEBUG, "[Job %d] envp[%d]=\"%s\"",
+7 -12
Ver Arquivo
@@ -133,8 +133,7 @@ main(int argc, /* I - Number of command-line args */
browse_time, /* Next browse send time */
senddoc_time, /* Send-Document time */
expire_time, /* Subscription expire time */
report_time, /* Malloc/client/job report time */
event_time; /* Last time an event notification was done */
report_time; /* Malloc/client/job report time */
long timeout; /* Timeout for cupsdDoSelect() */
struct rlimit limit; /* Runtime limit */
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
@@ -643,13 +642,11 @@ main(int argc, /* I - Number of command-line args */
* Loop forever...
*/
current_time = time(NULL);
browse_time = current_time;
event_time = current_time;
expire_time = current_time;
browse_time = time(NULL);
expire_time = time(NULL);
fds = 1;
report_time = 0;
senddoc_time = current_time;
senddoc_time = time(NULL);
while (!stop_scheduler)
{
@@ -753,8 +750,7 @@ main(int argc, /* I - Number of command-line args */
* times.
*/
if ((timeout = select_timeout(fds)) > 1 && LastEvent)
timeout = 1;
timeout = select_timeout(fds);
#if HAVE_LAUNCHD
/*
@@ -1027,7 +1023,7 @@ main(int argc, /* I - Number of command-line args */
* accumulated. Don't send these more than once a second...
*/
if (LastEvent && (current_time - event_time) >= 1)
if (LastEvent)
{
#ifdef HAVE_NOTIFY_POST
if (LastEvent & (CUPSD_EVENT_PRINTER_ADDED |
@@ -1060,8 +1056,7 @@ main(int argc, /* I - Number of command-line args */
* Reset the accumulated events...
*/
LastEvent = CUPSD_EVENT_NONE;
event_time = current_time;
LastEvent = CUPSD_EVENT_NONE;
}
}
+2 -9
Ver Arquivo
@@ -3,7 +3,7 @@
*
* CUPS control program for the Common UNIX Printing System (CUPS).
*
* Copyright 2007-2008 by Apple Inc.
* Copyright 2007 by Apple Inc.
* Copyright 2006-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -27,7 +27,6 @@
#include <cups/adminutil.h>
#include <cups/string.h>
#include <cups/i18n.h>
#include <errno.h>
/*
@@ -147,13 +146,7 @@ main(int argc, /* I - Number of command-line args */
* Connect to the server using the defaults...
*/
if ((http = httpConnectEncrypt(cupsServer(), ippPort(),
cupsEncryption())) == NULL)
{
_cupsLangPrintf(stderr, _("cupsctl: Unable to connect to server: %s\n"),
strerror(errno));
return (1);
}
http = httpConnectEncrypt(cupsServer(), ippPort(), cupsEncryption());
/*
* Set the current configuration if we have anything on the command-line...
+1 -1
Ver Arquivo
@@ -125,7 +125,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 || true; \
done \
fi \
done
+49 -51
Ver Arquivo
@@ -1,5 +1,5 @@
#
# "$Id: 4.3-job-ops.test 7410 2008-03-29 00:34:23Z mike $"
# "$Id: 4.3-job-ops.test 6379 2007-03-21 14:57:22Z mike $"
#
# Verify that the IPP job operations work.
#
@@ -157,6 +157,31 @@
EXPECT attributes-natural-language
EXPECT job-id
}
{
# The name of the test...
NAME "Print Image Job to Test1"
# The operation to use
OPERATION print-job
RESOURCE /printers/Test1
# The attributes to send
GROUP operation
ATTR charset attributes-charset utf-8
ATTR language attributes-natural-language en
ATTR uri printer-uri $method://$hostname:$port/printers/Test1
ATTR name requesting-user-name $user
FILE testfile.jpg
# What statuses are OK?
STATUS successful-ok
# What attributes do we expect?
EXPECT attributes-charset
EXPECT attributes-natural-language
EXPECT job-id
}
{
# The name of the test...
NAME "Hold Job on Test1"
@@ -203,55 +228,6 @@
EXPECT attributes-charset
EXPECT attributes-natural-language
}
{
# The name of the test...
NAME "Print Held Image Job to Test1"
# The operation to use
OPERATION print-job
RESOURCE /printers/Test1
# The attributes to send
GROUP operation
ATTR charset attributes-charset utf-8
ATTR language attributes-natural-language en
ATTR uri printer-uri $method://$hostname:$port/printers/Test1
ATTR name requesting-user-name $user
GROUP job
ATTR keyword job-hold-until indefinite
FILE testfile.jpg
# What statuses are OK?
STATUS successful-ok
# What attributes do we expect?
EXPECT attributes-charset
EXPECT attributes-natural-language
EXPECT job-id
}
{
# The name of the test...
NAME "Cancel Job"
# The operation to use
OPERATION cancel-job
RESOURCE /jobs
# The attributes to send
GROUP operation
ATTR charset attributes-charset utf-8
ATTR language attributes-natural-language en
ATTR uri job-uri $method://$hostname:$port/jobs/$job-id
ATTR name requesting-user-name $user
# What statuses are OK?
STATUS successful-ok
# What attributes do we expect?
EXPECT attributes-charset
EXPECT attributes-natural-language
}
{
# The name of the test...
NAME "Get Job List on Test1"
@@ -297,7 +273,29 @@
EXPECT job-id
EXPECT job-state
}
{
# The name of the test...
NAME "Cancel Job"
# The operation to use
OPERATION cancel-job
RESOURCE /jobs
# The attributes to send
GROUP operation
ATTR charset attributes-charset utf-8
ATTR language attributes-natural-language en
ATTR uri job-uri $method://$hostname:$port/jobs/$job-id
ATTR name requesting-user-name $user
# What statuses are OK?
STATUS successful-ok
# What attributes do we expect?
EXPECT attributes-charset
EXPECT attributes-natural-language
}
#
# End of "$Id: 4.3-job-ops.test 7410 2008-03-29 00:34:23Z mike $"
# End of "$Id: 4.3-job-ops.test 6379 2007-03-21 14:57:22Z mike $"
#
+15 -31
Ver Arquivo
@@ -4,7 +4,7 @@
#
# Test the lp command.
#
# Copyright 2007-2008 by Apple Inc.
# Copyright 2007 by Apple Inc.
# Copyright 1997-2005 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
@@ -16,8 +16,8 @@
echo "LP Default Test"
echo ""
echo " lp testfile.pdf"
../systemv/lp testfile.pdf 2>&1
echo " lp testfile.jpg"
../systemv/lp testfile.jpg 2>&1
if test $? != 0; then
echo " FAILED"
exit 1
@@ -28,37 +28,23 @@ echo ""
echo "LP Destination Test"
echo ""
echo " lp -d Test2 testfile.jpg"
../systemv/lp -d Test2 testfile.jpg 2>&1
if test $? != 0; then
echo " FAILED"
exit 1
else
echo " PASSED"
fi
echo ""
echo "LP Options Test"
echo ""
echo " lp -d Test1 -P 1-4 -o job-sheets=classified,classified testfile.pdf"
../systemv/lp -d Test1 -P 1-4 -o job-sheets=classified,classified testfile.pdf 2>&1
if test $? != 0; then
echo " FAILED"
exit 1
else
echo " PASSED"
fi
echo ""
echo "LP Flood Test ($1 times in parallel)"
echo ""
echo " lp -d Test1 testfile.jpg"
echo " lp -d Test2 testfile.jpg"
../systemv/lp -d Test1 -o job-hold-until=indefinite testfile.jpg 2>&1
if test $? != 0; then
echo " FAILED"
exit 1
else
echo " PASSED"
fi
echo ""
echo "LP Flood Test"
echo ""
echo " lp -d Test1 testfile.jpg ($1 times in parallel)"
i=0
while test $i -lt $1; do
echo " flood copy $i..." 1>&2
../systemv/lp -d Test1 testfile.jpg 2>&1 &
../systemv/lp -d Test2 testfile.jpg 2>&1 &
lppid=$!
i=`expr $i + 1`
done
@@ -71,8 +57,6 @@ else
fi
echo ""
./waitjobs.sh
#
# End of "$Id$".
#
+15 -31
Ver Arquivo
@@ -4,7 +4,7 @@
#
# Test the lpr command.
#
# Copyright 2007-2008 by Apple Inc.
# Copyright 2007 by Apple Inc.
# Copyright 1997-2005 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
@@ -16,8 +16,8 @@
echo "LPR Default Test"
echo ""
echo " lpr testfile.pdf"
../berkeley/lpr testfile.pdf 2>&1
echo " lpr testfile.jpg"
../berkeley/lpr testfile.jpg 2>&1
if test $? != 0; then
echo " FAILED"
exit 1
@@ -28,37 +28,23 @@ echo ""
echo "LPR Destination Test"
echo ""
echo " lpr -P Test2 testfile.jpg"
../berkeley/lpr -P Test2 testfile.jpg 2>&1
if test $? != 0; then
echo " FAILED"
exit 1
else
echo " PASSED"
fi
echo ""
echo "LPR Options Test"
echo ""
echo " lpr -P Test1 -o number-up=4 -o job-sheets=standard,none testfile.pdf"
../berkeley/lpr -P Test1 -o number-up=4 -o job-sheets=standard,none testfile.pdf 2>&1
if test $? != 0; then
echo " FAILED"
exit 1
else
echo " PASSED"
fi
echo ""
echo "LPR Flood Test ($1 times in parallel)"
echo ""
echo " lpr -P Test1 testfile.jpg"
echo " lpr -P Test2 testfile.jpg"
../berkeley/lpr -P Test1 testfile.jpg 2>&1
if test $? != 0; then
echo " FAILED"
exit 1
else
echo " PASSED"
fi
echo ""
echo "LPR Flood Test"
echo ""
echo " lpr -P Test1 testfile.jpg ($1 times in parallel)"
i=0
while test $i -lt $1; do
echo " flood copy $i..." 1>&2
../berkeley/lpr -P Test1 testfile.jpg 2>&1 &
../berkeley/lpr -P Test2 testfile.jpg 2>&1 &
lprpid=$!
i=`expr $i + 1`
done
@@ -71,8 +57,6 @@ else
fi
echo ""
./waitjobs.sh
#
# End of "$Id$".
#
-4
Ver Arquivo
@@ -16,8 +16,6 @@
echo "LPRM Current Test"
echo ""
echo " lpr -o job-hold-until=indefinite testfile.jpg"
../berkeley/lpr -o job-hold-until=indefinite testfile.jpg 2>&1
echo " lprm"
../berkeley/lprm 2>&1
if test $? != 0; then
@@ -30,8 +28,6 @@ echo ""
echo "LPRM Destination Test"
echo ""
echo " lpr -P Test1 -o job-hold-until=indefinite testfile.jpg"
../berkeley/lpr -P Test1 -o job-hold-until=indefinite testfile.jpg 2>&1
echo " lprm Test1"
../berkeley/lprm Test1 2>&1
if test $? != 0; then
+1 -3
Ver Arquivo
@@ -4,7 +4,7 @@
#
# Test the cancel command.
#
# Copyright 2007-2008 by Apple Inc.
# Copyright 2007 by Apple Inc.
# Copyright 1997-2006 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
@@ -16,8 +16,6 @@
echo "Cancel Destination Test"
echo ""
echo " lp -d Test1 -o job-hold-until=indefinite testfile.jpg"
../systemv/lp -d Test1 -o job-hold-until=indefinite testfile.jpg 2>&1
echo " cancel Test1"
../systemv/cancel Test1 2>&1
if test $? != 0; then
+39 -179
Ver Arquivo
@@ -5,7 +5,7 @@
# Perform the complete set of IPP compliance tests specified in the
# CUPS Software Test Plan.
#
# Copyright 2007-2008 by Apple Inc.
# Copyright 2007 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
@@ -97,7 +97,7 @@ case "$testtype" in
echo "Running the timid tests (1)"
nprinters1=0
nprinters2=0
pjobs=10
pjobs=0
;;
esac
@@ -207,7 +207,6 @@ rm -rf /tmp/cups-$user
mkdir /tmp/cups-$user
mkdir /tmp/cups-$user/bin
mkdir /tmp/cups-$user/bin/backend
mkdir /tmp/cups-$user/bin/driver
mkdir /tmp/cups-$user/bin/filter
mkdir /tmp/cups-$user/certs
mkdir /tmp/cups-$user/share
@@ -233,10 +232,13 @@ ln -s $root/monitor /tmp/cups-$user/bin
ln -s $root/notifier /tmp/cups-$user/bin
ln -s $root/scheduler /tmp/cups-$user/bin/daemon
ln -s $root/filter/hpgltops /tmp/cups-$user/bin/filter
ln -s $root/filter/imagetops /tmp/cups-$user/bin/filter
ln -s $root/filter/imagetoraster /tmp/cups-$user/bin/filter
ln -s $root/filter/pstops /tmp/cups-$user/bin/filter
ln -s $root/filter/rastertoepson /tmp/cups-$user/bin/filter
ln -s $root/filter/rastertohp /tmp/cups-$user/bin/filter
ln -s $root/filter/texttops /tmp/cups-$user/bin/filter
ln -s $root/pdftops/pdftops /tmp/cups-$user/bin/filter
ln -s $root/data/classified /tmp/cups-$user/share/banners
ln -s $root/data/confidential /tmp/cups-$user/share/banners
@@ -270,12 +272,9 @@ if test `uname` = Darwin; then
ln -s /usr/libexec/cups/filter/pstopdffilter /tmp/cups-$user/bin/filter
ln -s /private/etc/cups/apple.* /tmp/cups-$user
else
ln -s $root/filter/imagetops /tmp/cups-$user/bin/filter
ln -s $root/filter/imagetoraster /tmp/cups-$user/bin/filter
ln -s $root/pdftops/pdftops /tmp/cups-$user/bin/filter
fi
#
# Then create the necessary config files...
#
@@ -431,6 +430,11 @@ echo ""
$valgrind ../scheduler/cupsd -c /tmp/cups-$user/cupsd.conf -f >/tmp/cups-$user/log/debug_log 2>&1 &
cupsd=$!
#if test -x /usr/bin/strace; then
# # Trace system calls in cupsd if we have strace...
# /usr/bin/strace -tt -o /tmp/cups-$user/log/cupsd.trace -p $cupsd &
#fi
if test "x$testtype" = x0; then
echo "Scheduler is PID $cupsd and is listening on port 8631."
echo ""
@@ -465,7 +469,7 @@ done
# Create the test report source file...
#
strfile=/tmp/cups-$user/cups-str-1.3-`date +%Y-%m-%d`-$user.html
strfile=cups-str-1.3-`date +%Y-%m-%d`-$user.html
rm -f $strfile
cat str-header.html >$strfile
@@ -488,7 +492,7 @@ for file in 4*.test; do
echo "Performing $file..."
echo "" >>$strfile
./ipptest ipp://localhost:$port/printers $file | tee -a $strfile
./ipptest ipp://localhost:$port/printers $file >>$strfile
status=$?
if test $status != 0; then
@@ -517,7 +521,7 @@ for file in 5*.sh; do
echo "" >>$strfile
echo "\"$file\":" >>$strfile
sh $file $pjobs | tee -a $strfile
sh $file $pjobs >>$strfile
status=$?
if test $status != 0; then
@@ -528,6 +532,20 @@ done
echo "</PRE>" >>$strfile
#
# Wait for jobs to complete...
#
while true; do
jobs=`../systemv/lpstat 2>/dev/null`
if test "x$jobs" = "x"; then
break
fi
echo "Waiting for jobs to complete..."
sleep 10
done
#
# Stop the server...
#
@@ -540,182 +558,28 @@ kill $cupsd
echo "<H1>3 - Log Files</H1>" >>$strfile
#
# Verify counts...
#
echo "Test Summary"
echo ""
echo "<H2>Summary</H2>" >>$strfile
# Pages printed on Test1
count=`grep '^Test1 ' /tmp/cups-$user/log/page_log | awk 'BEGIN{count=0}{count=count+$7}END{print count}'`
expected=`expr $pjobs \* 2 + 35`
if test $count != $expected; then
echo "FAIL: Printer 'Test1' produced $count page(s), expected $expected."
echo "<P>FAIL: Printer 'Test1' produced $count page(s), expected $expected.</P>" >>$strfile
fail=`expr $fail + 1`
else
echo "PASS: Printer 'Test1' correctly produced $count page(s)."
echo "<P>PASS: Printer 'Test1' correctly produced $count page(s).</P>" >>$strfile
fi
# Paged printed on Test2
count=`grep '^Test2 ' /tmp/cups-$user/log/page_log | awk 'BEGIN{count=0}{count=count+$7}END{print count}'`
expected=`expr $pjobs \* 2 + 3`
if test $count != $expected; then
echo "FAIL: Printer 'Test2' produced $count page(s), expected $expected."
echo "<P>FAIL: Printer 'Test2' produced $count page(s), expected $expected.</P>" >>$strfile
fail=`expr $fail + 1`
else
echo "PASS: Printer 'Test2' correctly produced $count page(s)."
echo "<P>PASS: Printer 'Test2' correctly produced $count page(s).</P>" >>$strfile
fi
# Requested processed
count=`wc -l /tmp/cups-$user/log/access_log | awk '{print $1}'`
echo "PASS: $count requests processed."
echo "<P>PASS: $count requests processed.</P>" >>$strfile
# Emergency log messages
count=`grep '^X ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'`
if test $count != 0; then
echo "FAIL: $count emergency messages, expected 0."
grep '^X ' /tmp/cups-$user/log/error_log
echo "<P>FAIL: $count emergency messages, expected 0.</P>" >>$strfile
echo "<PRE>" >>$strfile
grep '^X ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
echo "</PRE>" >>$strfile
fail=`expr $fail + 1`
else
echo "PASS: $count emergency messages."
echo "<P>PASS: $count emergency messages.</P>" >>$strfile
fi
# Alert log messages
count=`grep '^A ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'`
if test $count != 0; then
echo "FAIL: $count alert messages, expected 0."
grep '^A ' /tmp/cups-$user/log/error_log
echo "<P>FAIL: $count alert messages, expected 0.</P>" >>$strfile
echo "<PRE>" >>$strfile
grep '^A ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
echo "</PRE>" >>$strfile
fail=`expr $fail + 1`
else
echo "PASS: $count alert messages."
echo "<P>PASS: $count alert messages.</P>" >>$strfile
fi
# Critical log messages
count=`grep '^C ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'`
if test $count != 0; then
echo "FAIL: $count critical messages, expected 0."
grep '^C ' /tmp/cups-$user/log/error_log
echo "<P>FAIL: $count critical messages, expected 0.</P>" >>$strfile
echo "<PRE>" >>$strfile
grep '^C ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
echo "</PRE>" >>$strfile
fail=`expr $fail + 1`
else
echo "PASS: $count critical messages."
echo "<P>PASS: $count critical messages.</P>" >>$strfile
fi
# Error log messages
count=`grep '^E ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'`
if test $count != 9; then
echo "FAIL: $count error messages, expected 9."
grep '^E ' /tmp/cups-$user/log/error_log
echo "<P>FAIL: $count error messages, expected 9.</P>" >>$strfile
echo "<PRE>" >>$strfile
grep '^E ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
echo "</PRE>" >>$strfile
fail=`expr $fail + 1`
else
echo "PASS: $count error messages."
echo "<P>PASS: $count error messages.</P>" >>$strfile
fi
# Warning log messages
count=`grep '^W ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'`
if test $count != 0; then
echo "FAIL: $count warning messages, expected 0."
grep '^W ' /tmp/cups-$user/log/error_log
echo "<P>FAIL: $count warning messages, expected 0.</P>" >>$strfile
echo "<PRE>" >>$strfile
grep '^W ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
echo "</PRE>" >>$strfile
fail=`expr $fail + 1`
else
echo "PASS: $count warning messages."
echo "<P>PASS: $count warning messages.</P>" >>$strfile
fi
# Notice log messages
count=`grep '^N ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'`
if test $count != 0; then
echo "FAIL: $count notice messages, expected 0."
grep '^N ' /tmp/cups-$user/log/error_log
echo "<P>FAIL: $count notice messages, expected 0.</P>" >>$strfile
echo "<PRE>" >>$strfile
grep '^N ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
echo "</PRE>" >>$strfile
fail=`expr $fail + 1`
else
echo "PASS: $count notice messages."
echo "<P>PASS: $count notice messages.</P>" >>$strfile
fi
# Info log messages
count=`grep '^I ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'`
if test $count = 0; then
echo "FAIL: $count info messages, expected more than 0."
echo "<P>FAIL: $count info messages, expected more than 0.</P>" >>$strfile
fail=`expr $fail + 1`
else
echo "PASS: $count info messages."
echo "<P>PASS: $count info messages.</P>" >>$strfile
fi
# Debug log messages
count=`grep '^D ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'`
if test $count = 0; then
echo "FAIL: $count debug messages, expected more than 0."
echo "<P>FAIL: $count debug messages, expected more than 0.</P>" >>$strfile
fail=`expr $fail + 1`
else
echo "PASS: $count debug messages."
echo "<P>PASS: $count debug messages.</P>" >>$strfile
fi
# Debug2 log messages
count=`grep '^d ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'`
if test $count != 0; then
echo "FAIL: $count debug2 messages, expected 0."
echo "<P>FAIL: $count debug2 messages, expected 0.</P>" >>$strfile
fail=`expr $fail + 1`
else
echo "PASS: $count debug2 messages."
echo "<P>PASS: $count debug2 messages.</P>" >>$strfile
fi
# Log files...
echo "<H2>access_log</H2>" >>$strfile
echo "<PRE>" >>$strfile
sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' /tmp/cups-$user/log/access_log >>$strfile
cat /tmp/cups-$user/log/access_log >>$strfile
echo "</PRE>" >>$strfile
echo "<H2>error_log</H2>" >>$strfile
echo "<PRE>" >>$strfile
sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' /tmp/cups-$user/log/error_log >>$strfile
cat /tmp/cups-$user/log/error_log >>$strfile
echo "</PRE>" >>$strfile
echo "<H2>page_log</H2>" >>$strfile
echo "<PRE>" >>$strfile
sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' /tmp/cups-$user/log/page_log >>$strfile
cat /tmp/cups-$user/log/page_log >>$strfile
echo "</PRE>" >>$strfile
if test -f /tmp/cups-$user/log/cupsd.trace; then
echo "<H2>cupsd.trace</H2>" >>$strfile
echo "<PRE>" >>$strfile
cat /tmp/cups-$user/log/cupsd.trace >>$strfile
echo "</PRE>" >>$strfile
fi
#
# Format the reports and tell the user where to find them...
#
@@ -731,13 +595,9 @@ else
fi
echo "Log files can be found in /tmp/cups-$user/log."
echo "A HTML report was created in $strfile."
echo "A HTML report was created in test/$strfile."
echo ""
if test $fail != 0; then
exit 1
fi
#
# End of "$Id$"
#
+1 -7
Ver Arquivo
@@ -1,16 +1,10 @@
<HTML>
<HEAD>
<META NAME="Description" CONTENT="Common UNIX Printing System Software Test Report">
<META NAME="COPYRIGHT" CONTENT="Copyright 2007-2008, All Rights Reserved">
<META NAME="COPYRIGHT" CONTENT="Copyright 2007, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-STR-1.3">
<META NAME="Author" CONTENT="Apple Inc.">
<TITLE>CUPS 1.3 Software Test Report</TITLE>
<STYLE TYPE="text/css"><!--
PRE {
font-size: 80%;
margin-left: 2em;
}
--></STYLE>
</HEAD>
<BODY>
Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 199 KiB

Depois

Largura:  |  Altura:  |  Tamanho: 585 KiB

Arquivo binário não exibido.
-37
Ver Arquivo
@@ -1,37 +0,0 @@
#!/bin/sh
#
# "$Id$"
#
# Script to wait for jobs to complete.
#
# Copyright 2008 by Apple Inc.
#
# These coded instructions, statements, and computer programs are the
# property of Apple Inc. and are protected by Federal copyright
# law. Distribution and use rights are outlined in the file "LICENSE.txt"
# 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/".
#
# Get timeout from command-line
if test $# = 1; then
timeout=$1
else
timeout=60
fi
echo "Waiting for jobs to complete..."
while test $timeout -gt 0; do
jobs=`../systemv/lpstat 2>/dev/null`
if test "x$jobs" = "x"; then
break
fi
sleep 5
timeout=`expr $timeout - 5`
done
#
# End of "$Id$".
#