Skip to content

Commit

Permalink
Merge changes from CUPS 1.4svn-r8540.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh:https://src.apple.com/svn/cups/easysw/current@1432 a1ca3aef-8c08-0410-bb20-df032aa958be
  • Loading branch information
msweet committed Apr 22, 2009
1 parent 38e73f8 commit e07d480
Show file tree
Hide file tree
Showing 102 changed files with 2,476 additions and 1,946 deletions.
17 changes: 12 additions & 5 deletions CHANGES-1.3.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
CHANGES-1.3.txt
---------------

CHANGES IN CUPS V1.3.11

- "lpstat -h server" showed non-shared printers (STR #3147)
- "make check" did not work on Linux (STR #3161)


CHANGES IN CUPS V1.3.10

- Documentation fixes (STR #2994, STR #2995, STR #3008, STR #3056,
STR #3057)
- SECURITY: The scheduler now protects against DNS rebinding attacks
(STR #3118)
- SECURITY: Fixed TIFF integer overflow in image filters (STR #3031)
- The scheduler did not support the job-hold-until attribute with the
Restart-Job operation (STR #3130)
- SECURITY: The PNG image reading code did not validate the
image size properly, leading to a potential buffer overflow
(STR #2974)
- The rastertohp driver did not set the 1-sided printing mode when
needed (STR #3131)
- Now use a wrapper program instead of our fork of the Xpdf code to
Expand Down Expand Up @@ -81,11 +93,6 @@ CHANGES IN CUPS V1.3.10
- The scheduler now rejects ATTR: messages with empty values.
- The scheduler could consume all CPU handling closed connections
(STR #2988)
- The scheduler now protects against DNS rebinding attacks on
localhost.
- SECURITY: The PNG image reading code did not validate the
image size properly, leading to a potential buffer overflow
(STR #2974)
- Fixed some configure script bugs with rc/xinetd directories
(STR #2970)
- The Epson sample driver PPDs contained errors (STR #2979)
Expand Down
19 changes: 15 additions & 4 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CHANGES.txt - 2009-04-03
CHANGES.txt - 2009-04-21
------------------------

CHANGES IN CUPS V1.4b3
Expand All @@ -8,6 +8,17 @@ CHANGES IN CUPS V1.4b3
Russian and partial localizations for Chinese, Danish, Finnish,
French, Italian, Korean, Norwegian, Portuguese, and Swedish
(STR #3096, STR #3098, STR #3109, STR #3111, STR #3141)
- Make some fairly substantial changes to the Kerberos support code so
that CUPS can work in multi-realm environments and does not require
delegatable credentials. Shared printing still requires delegation,
however "delegation by policy" can be enabled in the KDC to make this
all work.
- "AccessLogLevel actions" did not hide client-error-not-found errors.
- AP_FIRST_InputSlot did not work with number-up.
- cupsBackChannelRead() and cupsBackChannelWrite() could fail due to a
lack of kernel buffers.
- The IPP and LPD backends did not respond to side-channel requests
while copying print data to a temporary file.
- cupsWriteRequestData() flushed the output buffer unnecessarily,
causing reduced performance in some situations.
- If a CGI process died before sending its MIME headers, the request
Expand Down Expand Up @@ -43,9 +54,9 @@ CHANGES IN CUPS V1.4b3
status operations.
- ppdOpen*() incorrectly loaded PPDs with multiple JobPatchFile
keywords.
- The network backends no longer report the SNMP "offline" status bit
since some printers report this status when the printer is busy
printing, warming up, etc.
- The network backends no longer report the SNMP "offline" or
maintenance status bits since they are inconsistently implemented and
often unreliable.
- The scheduler no longer logs child processes killed via SIGKILL as
"crashed".
- The printer link shown on the "job moved" template was bad (STR #3085)
Expand Down
14 changes: 10 additions & 4 deletions INSTALL.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
INSTALL - CUPS v1.4b2 - 2008-12-15
INSTALL - CUPS v1.4b3 - 2009-04-20
----------------------------------

This file describes how to compile and install CUPS from source code. For more
Expand Down Expand Up @@ -179,9 +179,15 @@ GETTING DEBUG LOGGING FROM CUPS

When configured with the "--enable-debug-printfs" option, CUPS compiles in
additional debug logging support in the scheduler, CUPS API, and CUPS
Imaging API. Set the CUPS_DEBUG_LOG environment variable to a filename to
append logging information at run-time. Use the name "-" to send the
messages to stderr.
Imaging API. The following environment variables are used to enable and
control debug logging:

CUPS_DEBUG_FILTER Specifies a POSIX regular expression to control
which messages are logged.
CUPS_DEBUG_LEVEL Specifies a number from 0 to 9 to control the
verbosity of the logging. The default level is 1.
CUPS_DEBUG_LOG Specifies a log file to append to; use the name "-"
to send the messages to stderr.


REPORTING PROBLEMS
Expand Down
13 changes: 6 additions & 7 deletions Makedefs.in
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,17 @@ RMDIR = @RMDIR@
SED = @SED@
SHELL = /bin/sh


#
# Installation programs...
#

INSTALL_BIN = $(LIBTOOL) $(INSTALL) -m 755 @INSTALL_STRIP@
INSTALL_CONFIG = $(INSTALL) -m @CUPS_CONFIG_FILE_PERM@
INSTALL_DATA = $(INSTALL) -m 644
INSTALL_BIN = $(LIBTOOL) $(INSTALL) -c -m 555 @INSTALL_STRIP@
INSTALL_CONFIG = $(INSTALL) -c -m @CUPS_CONFIG_FILE_PERM@
INSTALL_DATA = $(INSTALL) -c -m 444
INSTALL_DIR = $(INSTALL) -d
INSTALL_LIB = $(LIBTOOL) $(INSTALL) -m 755 @INSTALL_STRIP@
INSTALL_MAN = $(INSTALL) -m 644
INSTALL_SCRIPT = $(INSTALL) -m 755
INSTALL_LIB = $(LIBTOOL) $(INSTALL) -c -m 555 @INSTALL_STRIP@
INSTALL_MAN = $(INSTALL) -c -m 444
INSTALL_SCRIPT = $(INSTALL) -c -m 555

#
# Default user, group, and system groups for the scheduler...
Expand Down
14 changes: 7 additions & 7 deletions backend/dnssd.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,13 +489,10 @@ exec_backend(char **argv) /* I - Command-line arguments */
* Resolve the device URI...
*/

job_canceled = -1;

if ((resolved_uri = cupsBackendDeviceURI(argv)) == NULL)
{
if (job_canceled)
exit(CUPS_BACKEND_OK);
else
exit(CUPS_BACKEND_FAILED);
}
exit(CUPS_BACKEND_FAILED);

/*
* Extract the scheme from the URI...
Expand Down Expand Up @@ -869,7 +866,10 @@ query_callback(
static void
sigterm_handler(int sig) /* I - Signal number (unused) */
{
job_canceled = 1;
if (job_canceled)
exit(CUPS_BACKEND_OK);
else
job_canceled = 1;
}


Expand Down
28 changes: 24 additions & 4 deletions backend/ipp.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,12 +412,22 @@ main(int argc, /* I - Number of command-line args */
* Copy stdin to a temporary file...
*/

int fd; /* File descriptor */
char buffer[8192]; /* Buffer for copying */
int bytes; /* Number of bytes read */
off_t tbytes; /* Total bytes copied */
int fd; /* File descriptor */
http_addrlist_t *addrlist; /* Address list */
char buffer[8192]; /* Buffer for copying */
int bytes; /* Number of bytes read */
off_t tbytes; /* Total bytes copied */


if ((addrlist = httpAddrGetList(hostname, AF_UNSPEC, "1")) == NULL)
{
_cupsLangPrintf(stderr, _("ERROR: Unable to locate printer \'%s\'!\n"),
hostname);
return (CUPS_BACKEND_STOP);
}

snmp_fd = _cupsSNMPOpen(addrlist->addr.addr.sa_family);

if ((fd = cupsTempFd(tmpfilename, sizeof(tmpfilename))) < 0)
{
_cupsLangPrintError(_("ERROR: Unable to create temporary file"));
Expand All @@ -429,6 +439,7 @@ main(int argc, /* I - Number of command-line args */
tbytes = 0;

while ((bytes = fread(buffer, 1, sizeof(buffer), stdin)) > 0)
{
if (write(fd, buffer, bytes) < bytes)
{
_cupsLangPrintError(_("ERROR: Unable to write to temporary file"));
Expand All @@ -439,6 +450,15 @@ main(int argc, /* I - Number of command-line args */
else
tbytes += bytes;

if (snmp_fd >= 0)
backendCheckSideChannel(snmp_fd, &(addrlist->addr));
}

if (snmp_fd >= 0)
_cupsSNMPClose(snmp_fd);

httpAddrFreeList(addrlist);

close(fd);

/*
Expand Down
25 changes: 23 additions & 2 deletions backend/lpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,10 +424,21 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Copy stdin to a temporary file...
*/

char buffer[8192]; /* Buffer for copying */
int bytes; /* Number of bytes read */
http_addrlist_t *addrlist; /* Address list */
int snmp_fd; /* SNMP socket */
char buffer[8192]; /* Buffer for copying */
int bytes; /* Number of bytes read */


if ((addrlist = httpAddrGetList(hostname, AF_UNSPEC, "1")) == NULL)
{
_cupsLangPrintf(stderr, _("ERROR: Unable to locate printer \'%s\'!\n"),
hostname);
return (CUPS_BACKEND_STOP);
}

snmp_fd = _cupsSNMPOpen(addrlist->addr.addr.sa_family);

if ((fd = cupsTempFd(tmpfilename, sizeof(tmpfilename))) < 0)
{
_cupsLangPrintError(_("ERROR: Unable to create temporary file"));
Expand All @@ -437,13 +448,23 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
_cupsLangPuts(stderr, _("INFO: Copying print data...\n"));

while ((bytes = fread(buffer, 1, sizeof(buffer), stdin)) > 0)
{
if (write(fd, buffer, bytes) < bytes)
{
_cupsLangPrintError(_("ERROR: Unable to write to temporary file"));
close(fd);
unlink(tmpfilename);
return (CUPS_BACKEND_FAILED);
}

if (snmp_fd >= 0)
backendCheckSideChannel(snmp_fd, &(addrlist->addr));
}

if (snmp_fd >= 0)
_cupsSNMPClose(snmp_fd);

httpAddrFreeList(addrlist);
}
else if (argc == 6)
{
Expand Down
2 changes: 1 addition & 1 deletion backend/snmp-supplies.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ static const backend_state_t const printer_states[] =
{ CUPS_TC_doorOpen, "door-open-report" },
{ CUPS_TC_jammed, "media-jam-warning" },
/* { CUPS_TC_offline, "offline-report" }, */ /* unreliable */
{ CUPS_TC_serviceRequested | CUPS_TC_overduePreventMaint, "service-needed-warning" },
/* { CUPS_TC_serviceRequested | CUPS_TC_overduePreventMaint, "service-needed-warning" }, */ /* unreliable */
{ CUPS_TC_inputTrayMissing, "input-tray-missing-warning" },
{ CUPS_TC_outputTrayMissing, "output-tray-missing-warning" },
{ CUPS_TC_markerSupplyMissing, "marker-supply-missing-warning" },
Expand Down
58 changes: 44 additions & 14 deletions backend/testbackend.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ main(int argc, /* I - Number of command-line args */
char *argv[]) /* I - Command-line arguments */
{
int first_arg, /* First argument for backend */
do_query = 0, /* Do PostScript query? */
do_ps = 0, /* Do PostScript query+test? */
do_pcl = 0, /* Do PCL query+test? */
do_side_tests = 0, /* Test side-channel ops? */
do_trickle = 0, /* Trickle data to backend */
do_walk = 0, /* Do OID lookup (0) or walking (1) */
Expand All @@ -84,8 +85,10 @@ main(int argc, /* I - Number of command-line args */
first_arg ++)
if (!strcmp(argv[first_arg], "-d"))
show_log = 1;
else if (!strcmp(argv[first_arg], "-pcl"))
do_pcl = 1;
else if (!strcmp(argv[first_arg], "-ps"))
do_query = 1;
do_ps = 1;
else if (!strcmp(argv[first_arg], "-s"))
do_side_tests = 1;
else if (!strcmp(argv[first_arg], "-t"))
Expand Down Expand Up @@ -157,15 +160,15 @@ main(int argc, /* I - Number of command-line args */
* Execute the trickle process as needed...
*/

if (do_trickle || do_query)
if (do_trickle || do_pcl || do_ps)
{
pipe(data_fds);

if ((pid = fork()) == 0)
{
/*
* Trickle/query child comes here... Rearrange file descriptors so that
* FD
* Trickle/query child comes here. Rearrange file descriptors so that
* FD 1, 3, and 4 point to the backend...
*/

close(0);
Expand Down Expand Up @@ -203,12 +206,25 @@ main(int argc, /* I - Number of command-line args */
else
{
/*
* Do a simple PostScript query job to get the default page size.
* Do PS or PCL query + test pages.
*/

char buffer[1024]; /* Buffer for response data */
ssize_t bytes; /* Number of bytes of response data */
static const char *ps_query = /* PostScript query file */
char buffer[1024]; /* Buffer for response data */
ssize_t bytes; /* Number of bytes of response data */
double timeout; /* Timeout */
const char *data; /* Data to send */
static const char *pcl_data = /* PCL data */
"\033%-12345X@PJL\r\n"
"@PJL JOB NAME = \"Hello, World!\"\r\n"
"@PJL INFO USTATUS\r\n"
"@PJL ENTER LANGUAGE = PCL\r\n"
"\033E"
"Hello, World!\n"
"\014"
"\033%-12345X@PJL\r\n"
"@PJL EOJ NAME=\"Hello, World!\"\r\n"
"\033%-12345X";
static const char *ps_data = /* PostScript data */
"%!\n"
"save\n"
"product = flush\n"
Expand Down Expand Up @@ -240,14 +256,27 @@ main(int argc, /* I - Number of command-line args */
" {exch pop exit} {pop} ifelse\n"
"} bind forall\n"
"= flush pop pop\n"
"/Courier findfont 12 scalefont setfont\n"
"0 setgray 36 720 moveto (Hello, ) show product show (!) show\n"
"showpage\n"
"restore\n"
"\004";


write(1, ps_query, strlen(ps_query));
if (do_pcl)
data = pcl_data;
else
data = ps_data;

write(1, data, strlen(data));
write(2, "DEBUG: START\n", 13);
while ((bytes = cupsBackChannelRead(buffer, sizeof(buffer), 60.0)) > 0)
timeout = 60.0;
while ((bytes = cupsBackChannelRead(buffer, sizeof(buffer),
timeout)) > 0)
{
write(2, buffer, bytes);
timeout = 5.0;
}
write(2, "\nDEBUG: END\n", 12);
}

Expand All @@ -272,7 +301,7 @@ main(int argc, /* I - Number of command-line args */
* Child comes here...
*/

if (do_trickle || do_query)
if (do_trickle || do_ps)
{
close(0);
dup(data_fds[0]);
Expand Down Expand Up @@ -311,7 +340,7 @@ main(int argc, /* I - Number of command-line args */
* Parent comes here, setup back and side channel file descriptors...
*/

if (do_trickle || do_query)
if (do_trickle || do_ps)
{
close(data_fds[0]);
close(data_fds[1]);
Expand Down Expand Up @@ -438,7 +467,8 @@ usage(void)
puts(" -d Show log messages from backend.");
puts(" -oid OID Lookup the specified SNMP OID.");
puts(" (.1.3.6.1.2.1.43.10.2.1.4.1.1 is a good one for printers)");
puts(" -ps Send PostScript query code to backend.");
puts(" -pcl Send PCL+PJL query and test page to backend.");
puts(" -ps Send PostScript query and test page to backend.");
puts(" -s Do side-channel + SNMP tests.");
puts(" -t Send spaces slowly to backend ('trickle').");
puts(" -walk OID Walk the specified SNMP OID.");
Expand Down

0 comments on commit e07d480

Please sign in to comment.