Comparar commits
1 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| a95630d541 |
@@ -1,6 +1,13 @@
|
||||
CHANGES-1.4.txt
|
||||
---------------
|
||||
|
||||
CHANGES IN CUPS V1.4.8
|
||||
|
||||
- The scheduler would delete job data files when restarted (STR #3880)
|
||||
- The network backends could crash if a printer returned a value of 0
|
||||
for the maximum capacity for a supply (STR #3875)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.4.7
|
||||
|
||||
- Documentation changes (STR #3710, STR #3720, STR #3745, STR #3750,
|
||||
@@ -9,6 +16,7 @@ CHANGES IN CUPS V1.4.7
|
||||
STR #3755, STR #3769, STR #3783)
|
||||
- Configure script fixes (STR #3659, STR #3691)
|
||||
- Compilation fixes (STR #3718, STR #3771, STR #3774)
|
||||
- The imageto* filters could crash with bad GIF files (STR #3867)
|
||||
- The scheduler might leave old job data files in the spool directory
|
||||
(STR #3795)
|
||||
- CUPS did not work with locales using the ASCII character set
|
||||
|
||||
+124
-1
@@ -1,6 +1,129 @@
|
||||
CHANGES.txt - 2011-05-26
|
||||
CHANGES.txt - 2012-02-05
|
||||
------------------------
|
||||
|
||||
CHANGES IN CUPS V1.5.2
|
||||
|
||||
- Reposted what should have been CUPS 1.5.1.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.5.1
|
||||
|
||||
- Documentation updates (STR #3885, STR #3886, STR #3946, STR #3969)
|
||||
- Localization updates (STR #3840, STR #3989, STR #3997)
|
||||
- Build fixes (STR #3956, STR #3999)
|
||||
- The SNMP backend did not validate the device URIs reported by printers
|
||||
(STR #4004)
|
||||
- cupsBackendReport() did not handle newlines in 1284 Device IDs
|
||||
(STR #4005)
|
||||
- USB backend fixes for libusb (STR #3965, STR #3978)
|
||||
- The DBUS notifier did not validate string parameters (STR #3984)
|
||||
- Group quota ACLs did not work with Kerberos (STR #3972)
|
||||
- The IPP backend did not retry when a printer responded with
|
||||
client-error-not-possible (STR #3963)
|
||||
- PostScript PPDs with filters used the wrong command filter (STR #3973)
|
||||
- The scheduler incorrectly used free() on a POSIX ACL value, which
|
||||
could cause a crash (STR #3970)
|
||||
- PPD files using the MacStandard encoding did not work.
|
||||
- The web interface did not work on some platforms (STR #3902)
|
||||
- The lpstat command would crash when then "-u" option was used by a
|
||||
non-administrator (STR #3953)
|
||||
- Japanese supply level reporting did not always work.
|
||||
- The DBUS notifier could crash (STR #3947)
|
||||
- Relaxed some of the page size checks in cupstestppd.
|
||||
- The ipptool program now reports attributes that are repeated within
|
||||
the same attribute group.
|
||||
- Updated the PWG raster support to match the current draft
|
||||
specification.
|
||||
- Fixed some IPP conformance issues in the scheduler.
|
||||
- Added ipptool support for repeating requests.
|
||||
- Added IPP/2.2 conformance tests and greatly improved the IPP/1.1,
|
||||
IPP/2.0, and IPP/2.1 conformance testing.
|
||||
- IPP messages containing mixed integer/rangeOfInteger values did not
|
||||
work (STR #3942)
|
||||
- The ipptool program now provides additional diagnostics for badly-
|
||||
formatted responses (STR #3857)
|
||||
- When possible, the IPP backend now stops sending job data early on a
|
||||
cancel.
|
||||
- cupsSendRequest and cupsWriteRequestData did not properly read all
|
||||
HTTP headers, preventing authentication and encryption upgrades from
|
||||
working in all cases.
|
||||
- The client.conf Server directive is no longer supported on Mac OS X
|
||||
10.7 and later.
|
||||
- The IPP backend sent the wrong margins in media-col.
|
||||
- The scheduler did not save or restore large Kerberos credentials for
|
||||
jobs.
|
||||
- The dnssd backend did not properly browse for secure IPP printers.
|
||||
- httpAssembleURI* did not properly escape all special characters in the
|
||||
username/password field.
|
||||
- The scheduler now logs config file errors to stderr (STR #3936)
|
||||
- The configure script incorrectly used bundle-based localizations on
|
||||
Linux (STR #3938)
|
||||
- The cups-driverd helper program did not cache .drv files properly,
|
||||
sometimes leading to a crash (STR #3921)
|
||||
- CUPS did not build on stock Mac OS X installations.
|
||||
- Encryption was broken with OpenSSL.
|
||||
- ipptool's XML output used date/time values with timezone offsets,
|
||||
which are not supported by Mac OS X's NSDate class.
|
||||
- Several programs did not support the cupsFilter2 keyword in PPD files.
|
||||
- The IPP backend incorrectly reported spool-area-full states.
|
||||
- cupsMarkOptions() did not protect against a bad PPD that was missing
|
||||
one or more standard Duplex options.
|
||||
- The PostScript filter did not mirror N-up output properly.
|
||||
- The ipptool program did not validate UTF-8 strings in XML output.
|
||||
- Fixed supply level reporting for some printers.
|
||||
- The scheduler no longer automatically logs debug messages for jobs
|
||||
that were held or canceled.
|
||||
- The cupsSendRequest function did not flush remaining response data
|
||||
from a previous request, leading to apparent chunking issues.
|
||||
- The scheduler did not report the correct version in the Server: header
|
||||
(STR #3903)
|
||||
- The scheduler did not support 1284 device IDs reported by driver
|
||||
interface programs longer than 127 characters (STR #3871)
|
||||
- The image filters did not support loading images larger than the
|
||||
RIPCache setting (STR #3901)
|
||||
- "PAGE: total NNN" messages did not get logged properly (STR #3887)
|
||||
- Updated the PWG Raster support to conform to the current draft of the
|
||||
PWG Raster Format specification.
|
||||
- The PWG Raster filter did not always write the correct number of
|
||||
padding lines on the bottom of the page (STR #3904)
|
||||
- When reporting a denial-of-service attack from the domain socket, the
|
||||
address reported does not always contain the correct path (STR #3888)
|
||||
- Badly formed GIF files could cause the image filters to crash
|
||||
(STR #3914)
|
||||
- Jobs canceled at the printer were retried by the IPP backend.
|
||||
- "cupsfilter -u" deleted the input file instead of the PPD file.
|
||||
- The scheduler did not compute the cost of PPD filters defined using
|
||||
the cupsFilter2 keyword properly.
|
||||
- The scheduler did not correctly support the maxsize() attribute for
|
||||
PPD filters.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.5.0
|
||||
|
||||
- Documentation updates.
|
||||
- Localization update (STR #3865)
|
||||
- Needed to limit TLS to v1.0 on some versions of Mac OS X.
|
||||
- The snmp backend did not work with some printers.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.5rc1
|
||||
|
||||
- Compile fixes (STR #3849, STR #3850)
|
||||
- The scheduler didn't check for empty values for several configuration
|
||||
directives (STR #3861)
|
||||
- ipptool didn't generate valid XML when a test was skipped.
|
||||
- Added additional error checking to the 1284 device ID code (STR #3858)
|
||||
- Fixed some compatibility issues migrating from the old usblp backend
|
||||
to the libusb backend (STR #3860)
|
||||
- Fixed the wake-from-sleep printing behavior on Mac OS X.
|
||||
- The scheduler incorrectly allowed jobs to be held from a terminating
|
||||
state.
|
||||
- The cups-driverd program could crash when a PPD was renamed.
|
||||
- The dnssd backend took too long to discover printers on large or busy
|
||||
networks with the new default timeout used by lpinfo and the web
|
||||
interface. This resulted in "lost" printers.
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.5b2
|
||||
|
||||
- Documentation updates.
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
INSTALL - CUPS v1.5b2 - 2011-05-26
|
||||
INSTALL - CUPS v1.5.2 - 2012-02-05
|
||||
----------------------------------
|
||||
|
||||
This file describes how to compile and install CUPS from source code. For more
|
||||
|
||||
+38
-7
@@ -1,4 +1,4 @@
|
||||
IPPTOOL.txt - 2011-05-20
|
||||
IPPTOOL.txt - 2011-09-20
|
||||
------------------------
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ BASIC USAGE
|
||||
|
||||
ipptool -c ipp://localhost/printers/myprinter get-jobs.test
|
||||
|
||||
which would produce something like this:
|
||||
which will produce something like this:
|
||||
|
||||
job-id,job-state,job-name,job-originating-user-name
|
||||
72,pending,testfile.pdf,msweet
|
||||
@@ -46,12 +46,43 @@ BASIC USAGE
|
||||
|
||||
CONFORMANCE TESTS
|
||||
|
||||
We provide basic IPP conformance tests for IPP/1.1, IPP/2.0, and IPP/2.1.
|
||||
For a given printer URI, the following commands perform tests at each level:
|
||||
We provide basic IPP conformance tests for IPP/1.1, IPP/2.0, IPP/2.1, and
|
||||
IPP/2.2. For a given printer URI, the following commands perform tests at
|
||||
each level:
|
||||
|
||||
ipptool -t printer-uri ipp-1.1.test
|
||||
ipptool -t -V 2.0 printer-uri ipp-2.0.test
|
||||
ipptool -t -V 2.1 printer-uri ipp-2.1.test
|
||||
ipptool -tf filename [options] -I printer-uri ipp-1.1.test
|
||||
ipptool -tf filename [options] -I -V 2.0 printer-uri ipp-2.0.test
|
||||
ipptool -tf filename [options] -I -V 2.1 printer-uri ipp-2.1.test
|
||||
ipptool -tf filename [options] -I -V 2.2 printer-uri ipp-2.2.test
|
||||
|
||||
The filename must use a format supported by the printer; ipptool will guess
|
||||
the MIME media type using the extension, otherwise application/octet stream
|
||||
will be used. The following standard test files are included:
|
||||
|
||||
color.jpg
|
||||
document-a4.pdf
|
||||
document-a4.ps
|
||||
document-letter.pdf
|
||||
document-letter.ps
|
||||
gray.jpg
|
||||
onepage-a4.pdf
|
||||
onepage-a4.ps
|
||||
onepage-letter.pdf
|
||||
onepage-letter.ps
|
||||
|
||||
Print-by-reference (URL) printing can be tested by defining the document-uri
|
||||
variable to a URL, for example:
|
||||
|
||||
ipptool -tf filename -d document-uri=url -I printer-uri ipp-1.1.test
|
||||
|
||||
The standard test files are available on cups.org under the "test"
|
||||
directory, for example:
|
||||
|
||||
http://www.cups.org/test/document-a4.pdf
|
||||
|
||||
The "document" test files contain 4 pages each. Doing the IPP conformance
|
||||
tests will will produce up to 90 pages on various media, depending on the
|
||||
printer.
|
||||
|
||||
|
||||
READING THE DOCUMENTATION
|
||||
|
||||
+1
-1
@@ -285,7 +285,7 @@ docset: apihelp
|
||||
#
|
||||
|
||||
sloc:
|
||||
for dir in cups cupslite scheduler; do \
|
||||
for dir in cups scheduler; do \
|
||||
(cd $$dir; $(MAKE) $(MFLAGS) sloc) || exit 1;\
|
||||
done
|
||||
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
README - CUPS v1.5b2 - 2011-05-26
|
||||
README - CUPS v1.5.2 - 2012-02-05
|
||||
---------------------------------
|
||||
|
||||
Looking for compile instructions? Read the file "INSTALL.txt"
|
||||
@@ -150,7 +150,7 @@ PRINTING FILES
|
||||
|
||||
LEGAL STUFF
|
||||
|
||||
CUPS is Copyright 2007-2011 by Apple Inc. CUPS and the CUPS logo are
|
||||
CUPS is Copyright 2007-2012 by Apple Inc. CUPS and the CUPS logo are
|
||||
trademarks of Apple Inc.
|
||||
|
||||
The MD5 Digest code is Copyright 1999 Aladdin Enterprises.
|
||||
|
||||
@@ -274,6 +274,7 @@ extern "C" {
|
||||
#define CUPS_TC_csUTF32 1017
|
||||
#define CUPS_TC_csUTF32BE 1018
|
||||
#define CUPS_TC_csUTF32LE 1019
|
||||
#define CUPS_TC_csWindows31J 2024
|
||||
|
||||
|
||||
/*
|
||||
|
||||
+54
-10
@@ -44,6 +44,7 @@ typedef enum
|
||||
{
|
||||
CUPS_DEVICE_PRINTER = 0, /* lpd://... */
|
||||
CUPS_DEVICE_IPP, /* ipp://... */
|
||||
CUPS_DEVICE_IPPS, /* ipps://... */
|
||||
CUPS_DEVICE_FAX_IPP, /* ipp://... */
|
||||
CUPS_DEVICE_PDL_DATASTREAM, /* socket://... */
|
||||
CUPS_DEVICE_RIOUSBPRINT /* riousbprint://... */
|
||||
@@ -123,9 +124,11 @@ main(int argc, /* I - Number of command-line args */
|
||||
fax_ipp_ref, /* IPP fax service reference */
|
||||
ipp_ref, /* IPP service reference */
|
||||
ipp_tls_ref, /* IPP w/TLS service reference */
|
||||
ipps_ref, /* IPP service reference */
|
||||
local_fax_ipp_ref, /* Local IPP fax service reference */
|
||||
local_ipp_ref, /* Local IPP service reference */
|
||||
local_ipp_tls_ref, /* Local IPP w/TLS service reference */
|
||||
local_ipps_ref, /* Local IPP service reference */
|
||||
local_printer_ref, /* Local LPD service reference */
|
||||
pdl_datastream_ref, /* AppSocket service reference */
|
||||
printer_ref, /* LPD service reference */
|
||||
@@ -215,6 +218,10 @@ main(int argc, /* I - Number of command-line args */
|
||||
DNSServiceBrowse(&ipp_tls_ref, kDNSServiceFlagsShareConnection, 0,
|
||||
"_ipp-tls._tcp", NULL, browse_callback, devices);
|
||||
|
||||
ipps_ref = main_ref;
|
||||
DNSServiceBrowse(&ipps_ref, kDNSServiceFlagsShareConnection, 0,
|
||||
"_ipps._tcp", NULL, browse_callback, devices);
|
||||
|
||||
local_fax_ipp_ref = main_ref;
|
||||
DNSServiceBrowse(&local_fax_ipp_ref, kDNSServiceFlagsShareConnection,
|
||||
kDNSServiceInterfaceIndexLocalOnly,
|
||||
@@ -230,6 +237,11 @@ main(int argc, /* I - Number of command-line args */
|
||||
kDNSServiceInterfaceIndexLocalOnly,
|
||||
"_ipp-tls._tcp", NULL, browse_local_callback, devices);
|
||||
|
||||
local_ipps_ref = main_ref;
|
||||
DNSServiceBrowse(&local_ipps_ref, kDNSServiceFlagsShareConnection,
|
||||
kDNSServiceInterfaceIndexLocalOnly,
|
||||
"_ipps._tcp", NULL, browse_local_callback, devices);
|
||||
|
||||
local_printer_ref = main_ref;
|
||||
DNSServiceBrowse(&local_printer_ref, kDNSServiceFlagsShareConnection,
|
||||
kDNSServiceInterfaceIndexLocalOnly,
|
||||
@@ -256,8 +268,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
FD_ZERO(&input);
|
||||
FD_SET(fd, &input);
|
||||
|
||||
timeout.tv_sec = 1;
|
||||
timeout.tv_usec = 0;
|
||||
timeout.tv_sec = 0;
|
||||
timeout.tv_usec = 250000;
|
||||
|
||||
if (select(fd + 1, &input, NULL, NULL, &timeout) < 0)
|
||||
continue;
|
||||
@@ -280,19 +292,26 @@ main(int argc, /* I - Number of command-line args */
|
||||
cups_device_t *best; /* Best matching device */
|
||||
char device_uri[1024]; /* Device URI */
|
||||
int count; /* Number of queries */
|
||||
|
||||
int sent; /* Number of sent */
|
||||
|
||||
for (device = (cups_device_t *)cupsArrayFirst(devices),
|
||||
best = NULL, count = 0;
|
||||
best = NULL, count = 0, sent = 0;
|
||||
device;
|
||||
device = (cups_device_t *)cupsArrayNext(devices))
|
||||
{
|
||||
if (device->sent)
|
||||
sent ++;
|
||||
|
||||
if (device->ref)
|
||||
count ++;
|
||||
|
||||
if (!device->ref && !device->sent)
|
||||
{
|
||||
/*
|
||||
* Found the device, now get the TXT record(s) for it...
|
||||
*/
|
||||
|
||||
if (count < 10)
|
||||
if (count < 20)
|
||||
{
|
||||
device->ref = main_ref;
|
||||
|
||||
@@ -338,6 +357,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
best->name, best->device_id, NULL);
|
||||
best->sent = 1;
|
||||
best = device;
|
||||
|
||||
sent ++;
|
||||
}
|
||||
else if (best->priority > device->priority ||
|
||||
(best->priority == device->priority &&
|
||||
@@ -345,10 +366,17 @@ main(int argc, /* I - Number of command-line args */
|
||||
{
|
||||
best->sent = 1;
|
||||
best = device;
|
||||
|
||||
sent ++;
|
||||
}
|
||||
else
|
||||
{
|
||||
device->sent = 1;
|
||||
|
||||
sent ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (best)
|
||||
{
|
||||
@@ -361,7 +389,11 @@ main(int argc, /* I - Number of command-line args */
|
||||
cupsBackendReport("network", device_uri, best->make_and_model,
|
||||
best->name, best->device_id, NULL);
|
||||
best->sent = 1;
|
||||
sent ++;
|
||||
}
|
||||
|
||||
if (sent == cupsArrayCount(devices))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -558,9 +590,11 @@ get_device(cups_array_t *devices, /* I - Device array */
|
||||
|
||||
key.name = (char *)serviceName;
|
||||
|
||||
if (!strcmp(regtype, "_ipp._tcp.") ||
|
||||
!strcmp(regtype, "_ipp-tls._tcp."))
|
||||
if (!strcmp(regtype, "_ipp._tcp."))
|
||||
key.type = CUPS_DEVICE_IPP;
|
||||
else if (!strcmp(regtype, "_ipps._tcp.") ||
|
||||
!strcmp(regtype, "_ipp-tls._tcp."))
|
||||
key.type = CUPS_DEVICE_IPPS;
|
||||
else if (!strcmp(regtype, "_fax-ipp._tcp."))
|
||||
key.type = CUPS_DEVICE_FAX_IPP;
|
||||
else if (!strcmp(regtype, "_printer._tcp."))
|
||||
@@ -680,9 +714,11 @@ query_callback(
|
||||
if ((ptr = strstr(name, "._")) != NULL)
|
||||
*ptr = '\0';
|
||||
|
||||
if (strstr(fullName, "_ipp._tcp.") ||
|
||||
strstr(fullName, "_ipp-tls._tcp."))
|
||||
if (strstr(fullName, "_ipp._tcp."))
|
||||
dkey.type = CUPS_DEVICE_IPP;
|
||||
else if (strstr(fullName, "_ipps._tcp.") ||
|
||||
strstr(fullName, "_ipp-tls._tcp."))
|
||||
dkey.type = CUPS_DEVICE_IPPS;
|
||||
else if (strstr(fullName, "_fax-ipp._tcp."))
|
||||
dkey.type = CUPS_DEVICE_FAX_IPP;
|
||||
else if (strstr(fullName, "_printer._tcp."))
|
||||
@@ -738,7 +774,7 @@ query_callback(
|
||||
|
||||
datalen = *data++;
|
||||
|
||||
if (!datalen || (data + datalen) >= dataend)
|
||||
if (!datalen || (data + datalen) > dataend)
|
||||
break;
|
||||
|
||||
datanext = data + datalen;
|
||||
@@ -754,9 +790,16 @@ query_callback(
|
||||
if (data < datanext)
|
||||
memcpy(value, data, datanext - data);
|
||||
value[datanext - data] = '\0';
|
||||
|
||||
fprintf(stderr, "DEBUG2: query_callback: \"%s=%s\".\n",
|
||||
key, value);
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "DEBUG2: query_callback: \"%s\" with no value.\n",
|
||||
key);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!_cups_strncasecmp(key, "usb_", 4))
|
||||
{
|
||||
@@ -800,6 +843,7 @@ query_callback(
|
||||
else if (!_cups_strcasecmp(key, "priority"))
|
||||
device->priority = atoi(value);
|
||||
else if ((device->type == CUPS_DEVICE_IPP ||
|
||||
device->type == CUPS_DEVICE_IPPS ||
|
||||
device->type == CUPS_DEVICE_PRINTER) &&
|
||||
!_cups_strcasecmp(key, "printer-type"))
|
||||
{
|
||||
|
||||
+21
-3
@@ -65,6 +65,7 @@ backendGetDeviceID(
|
||||
# if defined(__sun) && defined(ECPPIOC_GETDEVID)
|
||||
struct ecpp_device_id did; /* Device ID buffer */
|
||||
# endif /* __sun && ECPPIOC_GETDEVID */
|
||||
char *ptr; /* Pointer into device ID */
|
||||
|
||||
|
||||
DEBUG_printf(("backendGetDeviceID(fd=%d, device_id=%p, device_id_size=%d, "
|
||||
@@ -186,7 +187,7 @@ backendGetDeviceID(
|
||||
* and then limit the length to the size of our buffer...
|
||||
*/
|
||||
|
||||
if (length > device_id_size)
|
||||
if (length > device_id_size || length < 14)
|
||||
length = (((unsigned)device_id[1] & 255) << 8) +
|
||||
((unsigned)device_id[0] & 255);
|
||||
|
||||
@@ -224,11 +225,12 @@ backendGetDeviceID(
|
||||
device_id[length] = '\0';
|
||||
}
|
||||
}
|
||||
# ifdef DEBUG
|
||||
else
|
||||
{
|
||||
DEBUG_printf(("backendGetDeviceID: ioctl failed - %s\n",
|
||||
strerror(errno)));
|
||||
# endif /* DEBUG */
|
||||
*device_id = '\0';
|
||||
}
|
||||
# endif /* __linux */
|
||||
|
||||
# if defined(__sun) && defined(ECPPIOC_GETDEVID)
|
||||
@@ -256,6 +258,22 @@ backendGetDeviceID(
|
||||
# endif /* __sun && ECPPIOC_GETDEVID */
|
||||
}
|
||||
|
||||
/*
|
||||
* Check whether device ID is valid. Turn line breaks and tabs to spaces and
|
||||
* reject device IDs with non-printable characters.
|
||||
*/
|
||||
|
||||
for (ptr = device_id; *ptr; ptr ++)
|
||||
if (_cups_isspace(*ptr))
|
||||
*ptr = ' ';
|
||||
else if ((*ptr & 255) < ' ' || *ptr == 127)
|
||||
{
|
||||
DEBUG_printf(("backendGetDeviceID: Bad device_id character %d.",
|
||||
*ptr & 255));
|
||||
*device_id = '\0';
|
||||
break;
|
||||
}
|
||||
|
||||
DEBUG_printf(("backendGetDeviceID: device_id=\"%s\"\n", device_id));
|
||||
|
||||
if (scheme && uri)
|
||||
|
||||
+18
-8
@@ -111,7 +111,7 @@ static const char * const pattrs[] = /* Printer attributes we want */
|
||||
"printer-is-accepting-jobs",
|
||||
"printer-state",
|
||||
"printer-state-message",
|
||||
"printer-state-reasons",
|
||||
"printer-state-reasons"
|
||||
};
|
||||
static const char * const remote_job_states[] =
|
||||
{ /* Remote job state keywords */
|
||||
@@ -1340,7 +1340,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
http_status = cupsWriteRequestData(http, buffer, bytes);
|
||||
}
|
||||
|
||||
while (http_status == HTTP_CONTINUE)
|
||||
while (http_status == HTTP_CONTINUE &&
|
||||
(!job_canceled || compatsize > 0))
|
||||
{
|
||||
/*
|
||||
* Check for side-channel requests and more print data...
|
||||
@@ -1392,6 +1393,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
break;
|
||||
|
||||
if (ipp_status == IPP_SERVICE_UNAVAILABLE ||
|
||||
ipp_status == IPP_NOT_POSSIBLE ||
|
||||
ipp_status == IPP_PRINTER_BUSY)
|
||||
{
|
||||
_cupsLangPrintFilter(stderr, "INFO", _("The printer is busy."));
|
||||
@@ -1407,6 +1409,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
else if (ipp_status == IPP_ERROR_JOB_CANCELED)
|
||||
goto cleanup;
|
||||
else
|
||||
{
|
||||
/*
|
||||
@@ -1506,7 +1510,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
if (http_status == HTTP_CONTINUE && request->state == IPP_DATA &&
|
||||
(fd = open(files[i], O_RDONLY)) >= 0)
|
||||
{
|
||||
while ((bytes = read(fd, buffer, sizeof(buffer))) > 0)
|
||||
while (!job_canceled &&
|
||||
(bytes = read(fd, buffer, sizeof(buffer))) > 0)
|
||||
{
|
||||
if (cupsWriteRequestData(http, buffer, bytes) != HTTP_CONTINUE)
|
||||
break;
|
||||
@@ -1546,6 +1551,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
copies_remaining --;
|
||||
}
|
||||
else if (ipp_status == IPP_SERVICE_UNAVAILABLE ||
|
||||
ipp_status == IPP_NOT_POSSIBLE ||
|
||||
ipp_status == IPP_PRINTER_BUSY)
|
||||
continue;
|
||||
else
|
||||
@@ -1618,6 +1624,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
if (ipp_status > IPP_OK_CONFLICT)
|
||||
{
|
||||
if (ipp_status != IPP_SERVICE_UNAVAILABLE &&
|
||||
ipp_status != IPP_NOT_POSSIBLE &&
|
||||
ipp_status != IPP_PRINTER_BUSY)
|
||||
{
|
||||
ippDelete(response);
|
||||
@@ -1665,7 +1672,9 @@ main(int argc, /* I - Number of command-line args */
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (ipp_status != IPP_SERVICE_UNAVAILABLE &&
|
||||
ipp_status != IPP_NOT_POSSIBLE &&
|
||||
ipp_status != IPP_PRINTER_BUSY)
|
||||
{
|
||||
/*
|
||||
* If the printer does not return a job-state attribute, it does not
|
||||
@@ -1768,7 +1777,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
else if (ipp_status == IPP_DOCUMENT_FORMAT ||
|
||||
ipp_status == IPP_CONFLICT)
|
||||
return (CUPS_BACKEND_FAILED);
|
||||
else if (ipp_status > IPP_OK_CONFLICT)
|
||||
else if (ipp_status > IPP_OK_CONFLICT && ipp_status != IPP_ERROR_JOB_CANCELED)
|
||||
return (CUPS_BACKEND_RETRY_CURRENT);
|
||||
else
|
||||
{
|
||||
@@ -2192,15 +2201,15 @@ new_request(
|
||||
else if (!strcmp(media_col_sup->values[i].string.text,
|
||||
"media-bottom-margin"))
|
||||
ippAddInteger(media_col, IPP_TAG_ZERO, IPP_TAG_INTEGER,
|
||||
"media-bottom-margin", size->left);
|
||||
"media-bottom-margin", size->bottom);
|
||||
else if (!strcmp(media_col_sup->values[i].string.text,
|
||||
"media-right-margin"))
|
||||
ippAddInteger(media_col, IPP_TAG_ZERO, IPP_TAG_INTEGER,
|
||||
"media-right-margin", size->left);
|
||||
"media-right-margin", size->right);
|
||||
else if (!strcmp(media_col_sup->values[i].string.text,
|
||||
"media-top-margin"))
|
||||
ippAddInteger(media_col, IPP_TAG_ZERO, IPP_TAG_INTEGER,
|
||||
"media-top-margin", size->left);
|
||||
"media-top-margin", size->top);
|
||||
else if (!strcmp(media_col_sup->values[i].string.text,
|
||||
"media-source") && media_source)
|
||||
ippAddString(media_col, IPP_TAG_ZERO, IPP_TAG_KEYWORD,
|
||||
@@ -2822,6 +2831,7 @@ update_reasons(ipp_attribute_t *attr, /* I - printer-state-reasons or NULL */
|
||||
if (strcmp(reason, "none") &&
|
||||
strcmp(reason, "none-report") &&
|
||||
strcmp(reason, "paused") &&
|
||||
strncmp(reason, "spool-area-full", 15) &&
|
||||
strcmp(reason, "com.apple.print.recoverable-warning") &&
|
||||
strncmp(reason, "cups-", 5))
|
||||
cupsArrayAdd(new_reasons, reason);
|
||||
|
||||
+1
-4
@@ -436,10 +436,7 @@ backendWaitLoop(
|
||||
{
|
||||
fd_set input; /* Input set for reading */
|
||||
time_t curtime, /* Current time */
|
||||
snmp_update = 0;
|
||||
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
|
||||
struct sigaction action; /* Actions for POSIX signals */
|
||||
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
|
||||
snmp_update = 0; /* Last SNMP status update */
|
||||
|
||||
|
||||
fprintf(stderr, "DEBUG: backendWaitLoop(snmp_fd=%d, addr=%p, side_cb=%p)\n",
|
||||
|
||||
@@ -229,12 +229,12 @@ backendSNMPSupplies(
|
||||
|
||||
for (i = 0, ptr = value; i < num_supplies; i ++, ptr += strlen(ptr))
|
||||
{
|
||||
if (supplies[i].max_capacity > 0)
|
||||
if (supplies[i].max_capacity > 0 && supplies[i].level >= 0)
|
||||
percent = 100 * supplies[i].level / supplies[i].max_capacity;
|
||||
else
|
||||
percent = 50;
|
||||
|
||||
if (percent <= 10)
|
||||
if (percent <= 5)
|
||||
{
|
||||
switch (supplies[i].type)
|
||||
{
|
||||
@@ -279,7 +279,7 @@ backendSNMPSupplies(
|
||||
if (i)
|
||||
*ptr++ = ',';
|
||||
|
||||
if (supplies[i].max_capacity > 0)
|
||||
if (supplies[i].max_capacity > 0 && supplies[i].level >= 0)
|
||||
sprintf(ptr, "%d", percent);
|
||||
else
|
||||
strcpy(ptr, "-1");
|
||||
@@ -801,6 +801,7 @@ backend_walk_cb(cups_snmp_t *packet, /* I - SNMP packet */
|
||||
break;
|
||||
|
||||
case CUPS_TC_csShiftJIS :
|
||||
case CUPS_TC_csWindows31J : /* Close enough for our purposes */
|
||||
cupsCharsetToUTF8((cups_utf8_t *)supplies[i - 1].name,
|
||||
(char *)packet->object_value.string.bytes,
|
||||
sizeof(supplies[0].name), CUPS_JIS_X0213);
|
||||
|
||||
+16
-4
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* SNMP discovery backend for CUPS.
|
||||
*
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 2006-2007 by Easy Software Products, all rights reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -948,7 +948,7 @@ read_snmp_response(int fd) /* I - SNMP socket file descriptor */
|
||||
debug_printf("DEBUG: request-id=%d\n", packet.request_id);
|
||||
debug_printf("DEBUG: error-status=%d\n", packet.error_status);
|
||||
|
||||
if (packet.error_status)
|
||||
if (packet.error_status && packet.request_id != DEVICE_TYPE)
|
||||
return;
|
||||
|
||||
/*
|
||||
@@ -1112,12 +1112,18 @@ read_snmp_response(int fd) /* I - SNMP socket file descriptor */
|
||||
|
||||
case DEVICE_URI :
|
||||
if (device && packet.object_type == CUPS_ASN1_OCTET_STRING &&
|
||||
!device->uri && packet.object_value.string.num_bytes > 0)
|
||||
!device->uri && packet.object_value.string.num_bytes > 3)
|
||||
{
|
||||
/*
|
||||
* Update an existing cache entry...
|
||||
*/
|
||||
|
||||
char scheme[32], /* URI scheme */
|
||||
userpass[256], /* Username:password in URI */
|
||||
hostname[256], /* Hostname in URI */
|
||||
resource[1024]; /* Resource path in URI */
|
||||
int port; /* Port number in URI */
|
||||
|
||||
if (!strncmp((char *)packet.object_value.string.bytes, "lpr:", 4))
|
||||
{
|
||||
/*
|
||||
@@ -1127,7 +1133,13 @@ read_snmp_response(int fd) /* I - SNMP socket file descriptor */
|
||||
packet.object_value.string.bytes[2] = 'd';
|
||||
}
|
||||
|
||||
device->uri = strdup((char *)packet.object_value.string.bytes);
|
||||
if (httpSeparateURI(HTTP_URI_CODING_ALL,
|
||||
(char *)packet.object_value.string.bytes,
|
||||
scheme, sizeof(scheme),
|
||||
userpass, sizeof(userpass),
|
||||
hostname, sizeof(hostname), &port,
|
||||
resource, sizeof(resource)) >= HTTP_URI_OK)
|
||||
device->uri = strdup((char *)packet.object_value.string.bytes);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
+23
-51
@@ -761,24 +761,8 @@ print_device(const char *uri, /* I - Device URI */
|
||||
|
||||
fprintf(stderr, "DEBUG: Sent %lld bytes...\n", (off_t)total_bytes);
|
||||
|
||||
if (!print_fd)
|
||||
{
|
||||
/*
|
||||
* Re-enable the SIGTERM handler so pthread_kill() will work...
|
||||
*/
|
||||
|
||||
struct sigaction action; /* POSIX signal action */
|
||||
|
||||
memset(&action, 0, sizeof(action));
|
||||
|
||||
sigemptyset(&action.sa_mask);
|
||||
sigaddset(&action.sa_mask, SIGTERM);
|
||||
action.sa_handler = sigterm_handler;
|
||||
sigaction(SIGTERM, &action, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Wait for the side channel thread to exit...
|
||||
* Signal the side channel thread to exit...
|
||||
*/
|
||||
|
||||
if (have_sidechannel)
|
||||
@@ -805,44 +789,23 @@ print_device(const char *uri, /* I - Device URI */
|
||||
&cond_timeout) != 0)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!g.sidechannel_thread_done)
|
||||
{
|
||||
/*
|
||||
* Force the side-channel thread to exit...
|
||||
*/
|
||||
|
||||
fputs("DEBUG: Force the side-channel thread to exit...\n", stderr);
|
||||
pthread_kill(sidechannel_thread_id, SIGTERM);
|
||||
}
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&g.sidechannel_thread_mutex);
|
||||
|
||||
pthread_join(sidechannel_thread_id, NULL);
|
||||
|
||||
pthread_cond_destroy(&g.sidechannel_thread_cond);
|
||||
pthread_mutex_destroy(&g.sidechannel_thread_mutex);
|
||||
}
|
||||
|
||||
pthread_cond_destroy(&g.readwrite_lock_cond);
|
||||
pthread_mutex_destroy(&g.readwrite_lock_mutex);
|
||||
|
||||
/*
|
||||
* Signal the read thread to stop...
|
||||
* Signal the read thread to exit then wait 7 seconds for it to complete...
|
||||
*/
|
||||
|
||||
g.read_thread_stop = 1;
|
||||
|
||||
/*
|
||||
* Give the read thread WAIT_EOF_DELAY seconds to complete all the data. If
|
||||
* we are not signaled in that time then force the thread to exit.
|
||||
*/
|
||||
|
||||
pthread_mutex_lock(&g.read_thread_mutex);
|
||||
|
||||
if (!g.read_thread_done)
|
||||
{
|
||||
fputs("DEBUG: Waiting for read thread to exit...\n", stderr);
|
||||
|
||||
gettimeofday(&tv, NULL);
|
||||
cond_timeout.tv_sec = tv.tv_sec + WAIT_EOF_DELAY;
|
||||
cond_timeout.tv_nsec = tv.tv_usec * 1000;
|
||||
@@ -854,25 +817,34 @@ print_device(const char *uri, /* I - Device URI */
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* If it didn't exit abort the pending read and wait an additional second...
|
||||
*/
|
||||
|
||||
if (!g.read_thread_done)
|
||||
{
|
||||
/*
|
||||
* Force the read thread to exit...
|
||||
*/
|
||||
fputs("DEBUG: Read thread still active, aborting the pending read...\n",
|
||||
stderr);
|
||||
|
||||
g.wait_eof = 0;
|
||||
fputs("DEBUG: Force the read thread to exit...\n", stderr);
|
||||
pthread_kill(read_thread_id, SIGTERM);
|
||||
|
||||
(*g.classdriver)->Abort(g.classdriver);
|
||||
|
||||
gettimeofday(&tv, NULL);
|
||||
cond_timeout.tv_sec = tv.tv_sec + 1;
|
||||
cond_timeout.tv_nsec = tv.tv_usec * 1000;
|
||||
|
||||
while (!g.read_thread_done)
|
||||
{
|
||||
if (pthread_cond_timedwait(&g.read_thread_cond, &g.read_thread_mutex,
|
||||
&cond_timeout) != 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&g.read_thread_mutex);
|
||||
|
||||
pthread_join(read_thread_id, NULL); /* wait for the read thread to return */
|
||||
|
||||
pthread_cond_destroy(&g.read_thread_cond);
|
||||
pthread_mutex_destroy(&g.read_thread_mutex);
|
||||
|
||||
/*
|
||||
* Close the connection and input file and general clean up...
|
||||
*/
|
||||
|
||||
+155
-47
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Libusb interface code for CUPS.
|
||||
*
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Apple Inc. and are protected by Federal copyright
|
||||
@@ -423,22 +423,34 @@ get_device_id(usb_printer_t *printer, /* I - Printer */
|
||||
* bytes. The 1284 spec says the length is stored MSB first...
|
||||
*/
|
||||
|
||||
length = (((unsigned)buffer[0] & 255) << 8) +
|
||||
length = (((unsigned)buffer[0] & 255) << 8) |
|
||||
((unsigned)buffer[1] & 255);
|
||||
|
||||
/*
|
||||
* Check to see if the length is larger than our buffer; first
|
||||
* assume that the vendor incorrectly implemented the 1284 spec,
|
||||
* and then limit the length to the size of our buffer...
|
||||
* Check to see if the length is larger than our buffer or less than 14 bytes
|
||||
* (the minimum valid device ID is "MFG:x;MDL:y;" with 2 bytes for the length).
|
||||
*
|
||||
* If the length is out-of-range, assume that the vendor incorrectly
|
||||
* implemented the 1284 spec and re-read the length as LSB first,..
|
||||
*/
|
||||
|
||||
if (length > bufsize)
|
||||
length = (((unsigned)buffer[1] & 255) << 8) +
|
||||
if (length > bufsize || length < 14)
|
||||
length = (((unsigned)buffer[1] & 255) << 8) |
|
||||
((unsigned)buffer[0] & 255);
|
||||
|
||||
if (length > bufsize)
|
||||
length = bufsize;
|
||||
|
||||
if (length < 14)
|
||||
{
|
||||
/*
|
||||
* Invalid device ID, clear it!
|
||||
*/
|
||||
|
||||
*buffer = '\0';
|
||||
return (-1);
|
||||
}
|
||||
|
||||
length -= 2;
|
||||
|
||||
/*
|
||||
@@ -505,6 +517,7 @@ make_device_uri(
|
||||
*mdl, /* Model */
|
||||
*des, /* Description */
|
||||
*sern; /* Serial number */
|
||||
size_t mfglen; /* Length of manufacturer string */
|
||||
char tempmfg[256], /* Temporary manufacturer string */
|
||||
tempsern[256], /* Temporary serial number string */
|
||||
*tempptr; /* Pointer into temp string */
|
||||
@@ -584,6 +597,16 @@ make_device_uri(
|
||||
mfg = tempmfg;
|
||||
}
|
||||
|
||||
mfglen = strlen(mfg);
|
||||
|
||||
if (!strncasecmp(mdl, mfg, mfglen) && _cups_isspace(mdl[mfglen]))
|
||||
{
|
||||
mdl += mfglen + 1;
|
||||
|
||||
while (_cups_isspace(*mdl))
|
||||
mdl ++;
|
||||
}
|
||||
|
||||
/*
|
||||
* Generate the device URI from the manufacturer, model, serial number,
|
||||
* and interface number...
|
||||
@@ -620,6 +643,7 @@ open_device(usb_printer_t *printer, /* I - Printer */
|
||||
int verbose) /* I - Update connecting-to-device state? */
|
||||
{
|
||||
int number; /* Configuration/interface/altset numbers */
|
||||
char current; /* Current configuration */
|
||||
|
||||
|
||||
/*
|
||||
@@ -636,27 +660,37 @@ open_device(usb_printer_t *printer, /* I - Printer */
|
||||
if ((printer->handle = usb_open(printer->device)) == NULL)
|
||||
return (-1);
|
||||
|
||||
/*
|
||||
* Then set the desired configuration...
|
||||
*/
|
||||
|
||||
if (verbose)
|
||||
fputs("STATE: +connecting-to-device\n", stderr);
|
||||
|
||||
/*
|
||||
* Set the desired configuration, but only if it needs changing. Some
|
||||
* printers (e.g., Samsung) don't like usb_set_configuration. It will succeed,
|
||||
* but the following print job is sometimes silently lost by the printer.
|
||||
*/
|
||||
|
||||
if (usb_control_msg(printer->handle,
|
||||
USB_TYPE_STANDARD | USB_ENDPOINT_IN | USB_RECIP_DEVICE,
|
||||
8, /* GET_CONFIGURATION */
|
||||
0, 0, ¤t, 1, 5000) != 1)
|
||||
current = 0; /* Assume not configured */
|
||||
|
||||
number = printer->device->config[printer->conf].bConfigurationValue;
|
||||
|
||||
if (usb_set_configuration(printer->handle, number) < 0)
|
||||
if (number != current)
|
||||
{
|
||||
/*
|
||||
* If the set fails, chances are that the printer only supports a
|
||||
* single configuration. Technically these printers don't conform to
|
||||
* the USB printer specification, but otherwise they'll work...
|
||||
*/
|
||||
if (usb_set_configuration(printer->handle, number) < 0)
|
||||
{
|
||||
/*
|
||||
* If the set fails, chances are that the printer only supports a
|
||||
* single configuration. Technically these printers don't conform to
|
||||
* the USB printer specification, but otherwise they'll work...
|
||||
*/
|
||||
|
||||
if (errno != EBUSY)
|
||||
fprintf(stderr, "DEBUG: Failed to set configuration %d for %04x:%04x\n",
|
||||
number, printer->device->descriptor.idVendor,
|
||||
printer->device->descriptor.idProduct);
|
||||
if (errno != EBUSY)
|
||||
fprintf(stderr, "DEBUG: Failed to set configuration %d for %04x:%04x\n",
|
||||
number, printer->device->descriptor.idVendor,
|
||||
printer->device->descriptor.idProduct);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -668,41 +702,35 @@ open_device(usb_printer_t *printer, /* I - Printer */
|
||||
while (usb_claim_interface(printer->handle, number) < 0)
|
||||
{
|
||||
if (errno != EBUSY)
|
||||
fprintf(stderr, "DEBUG: Failed to claim interface %d for %04x:%04x: %s\n",
|
||||
fprintf(stderr,
|
||||
"DEBUG: Failed to claim interface %d for %04x:%04x: %s\n",
|
||||
number, printer->device->descriptor.idVendor,
|
||||
printer->device->descriptor.idProduct, strerror(errno));
|
||||
|
||||
goto error;
|
||||
}
|
||||
|
||||
#if 0 /* STR #3801: Claiming interface 0 causes problems with some printers */
|
||||
if (number != 0)
|
||||
while (usb_claim_interface(printer->handle, 0) < 0)
|
||||
/*
|
||||
* Set alternate setting, but only if there is more than one option. Some
|
||||
* printers (e.g., Samsung) don't like usb_set_altinterface.
|
||||
*/
|
||||
|
||||
if (printer->device->config[printer->conf].interface[printer->iface].
|
||||
num_altsetting > 1)
|
||||
{
|
||||
number = printer->device->config[printer->conf].interface[printer->iface].
|
||||
altsetting[printer->altset].bAlternateSetting;
|
||||
|
||||
while (usb_set_altinterface(printer->handle, number) < 0)
|
||||
{
|
||||
if (errno != EBUSY)
|
||||
fprintf(stderr, "DEBUG: Failed to claim interface 0 for %04x:%04x: %s\n",
|
||||
printer->device->descriptor.idVendor,
|
||||
printer->device->descriptor.idProduct, strerror(errno));
|
||||
fprintf(stderr,
|
||||
"DEBUG: Failed to set alternate interface %d for %04x:%04x: "
|
||||
"%s\n", number, printer->device->descriptor.idVendor,
|
||||
printer->device->descriptor.idProduct, strerror(errno));
|
||||
|
||||
goto error;
|
||||
}
|
||||
#endif /* 0 */
|
||||
|
||||
/*
|
||||
* Set alternate setting...
|
||||
*/
|
||||
|
||||
number = printer->device->config[printer->conf].interface[printer->iface].
|
||||
altsetting[printer->altset].bAlternateSetting;
|
||||
while (usb_set_altinterface(printer->handle, number) < 0)
|
||||
{
|
||||
if (errno != EBUSY)
|
||||
fprintf(stderr,
|
||||
"DEBUG: Failed to set alternate interface %d for %04x:%04x: %s\n",
|
||||
number, printer->device->descriptor.idVendor,
|
||||
printer->device->descriptor.idProduct, strerror(errno));
|
||||
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (verbose)
|
||||
@@ -736,7 +764,87 @@ print_cb(usb_printer_t *printer, /* I - Printer */
|
||||
const char *device_id, /* I - IEEE-1284 device ID */
|
||||
const void *data) /* I - User data (make, model, S/N) */
|
||||
{
|
||||
return (!strcmp((char *)data, device_uri));
|
||||
char requested_uri[1024], /* Requested URI */
|
||||
*requested_ptr, /* Pointer into requested URI */
|
||||
detected_uri[1024], /* Detected URI */
|
||||
*detected_ptr; /* Pointer into detected URI */
|
||||
|
||||
|
||||
/*
|
||||
* If we have an exact match, stop now...
|
||||
*/
|
||||
|
||||
if (!strcmp((char *)data, device_uri))
|
||||
return (1);
|
||||
|
||||
/*
|
||||
* Work on copies of the URIs...
|
||||
*/
|
||||
|
||||
strlcpy(requested_uri, (char *)data, sizeof(requested_uri));
|
||||
strlcpy(detected_uri, device_uri, sizeof(detected_uri));
|
||||
|
||||
/*
|
||||
* libusb-discovered URIs can have an "interface" specification and this
|
||||
* never happens for usblp-discovered URIs, so remove the "interface"
|
||||
* specification from the URI which we are checking currently. This way a
|
||||
* queue for a usblp-discovered printer can now be accessed via libusb.
|
||||
*
|
||||
* Similarly, strip "?serial=NNN...NNN" as needed.
|
||||
*/
|
||||
|
||||
if ((requested_ptr = strstr(requested_uri, "?interface=")) == NULL)
|
||||
requested_ptr = strstr(requested_uri, "&interface=");
|
||||
if ((detected_ptr = strstr(detected_uri, "?interface=")) == NULL)
|
||||
detected_ptr = strstr(detected_uri, "&interface=");
|
||||
|
||||
if (!requested_ptr && detected_ptr)
|
||||
{
|
||||
/*
|
||||
* Strip "[?&]interface=nnn" from the detected printer.
|
||||
*/
|
||||
|
||||
*detected_ptr = '\0';
|
||||
}
|
||||
else if (requested_ptr && !detected_ptr)
|
||||
{
|
||||
/*
|
||||
* Strip "[?&]interface=nnn" from the requested printer.
|
||||
*/
|
||||
|
||||
*requested_ptr = '\0';
|
||||
}
|
||||
|
||||
if ((requested_ptr = strstr(requested_uri, "?serial=?")) != NULL)
|
||||
{
|
||||
/*
|
||||
* Strip "?serial=?" from the requested printer. This is a special
|
||||
* case, as "?serial=?" means no serial number and not the serial
|
||||
* number '?'. This is not covered by the checks below...
|
||||
*/
|
||||
|
||||
*requested_ptr = '\0';
|
||||
}
|
||||
|
||||
if ((requested_ptr = strstr(requested_uri, "?serial=")) == NULL &&
|
||||
(detected_ptr = strstr(detected_uri, "?serial=")) != NULL)
|
||||
{
|
||||
/*
|
||||
* Strip "?serial=nnn" from the detected printer.
|
||||
*/
|
||||
|
||||
*detected_ptr = '\0';
|
||||
}
|
||||
else if (requested_ptr && !detected_ptr)
|
||||
{
|
||||
/*
|
||||
* Strip "?serial=nnn" from the requested printer.
|
||||
*/
|
||||
|
||||
*requested_ptr = '\0';
|
||||
}
|
||||
|
||||
return (!strcmp(requested_uri, detected_uri));
|
||||
}
|
||||
|
||||
|
||||
|
||||
+5
-5
@@ -452,19 +452,19 @@ cgiSetCookie(const char *name, /* I - Name */
|
||||
|
||||
printf("Set-Cookie: %s=%s;", name, value);
|
||||
if (path)
|
||||
printf("; path=%s", path);
|
||||
printf(" path=%s;", path);
|
||||
if (domain)
|
||||
printf("; domain=%s", domain);
|
||||
printf(" domain=%s;", domain);
|
||||
if (expires)
|
||||
{
|
||||
char date[256]; /* Date string */
|
||||
|
||||
printf("; expires=%s", httpGetDateString2(expires, date, sizeof(date)));
|
||||
printf(" expires=%s;", httpGetDateString2(expires, date, sizeof(date)));
|
||||
}
|
||||
if (secure)
|
||||
puts("; secure;");
|
||||
puts(" secure;");
|
||||
else
|
||||
puts(";");
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# "$Id: mime.types 9667 2011-04-01 04:48:21Z mike $"
|
||||
# "$Id: mime.types 9871 2011-08-06 06:34:46Z mike $"
|
||||
#
|
||||
# Base MIME types file for CUPS.
|
||||
#
|
||||
@@ -92,7 +92,7 @@ image/jpeg jpeg jpg jpe string(0,<FFD8FF>) +\
|
||||
char(3,0xe4) char(3,0xe5) char(3,0xe6) char(3,0xe7)\
|
||||
char(3,0xe8) char(3,0xe9) char(3,0xea) char(3,0xeb)\
|
||||
char(3,0xec) char(3,0xed) char(3,0xee) char(3,0xef))
|
||||
image/pwg-raster string(0,"RaS2") + string(356,<0000000000000000>) priority(100)
|
||||
image/pwg-raster string(0,"RaS2") + string(4,PwgRaster<00>) priority(100)
|
||||
image/tiff tiff tif string(0,MM<002A>) string(0,II<2A00>)
|
||||
image/x-photocd pcd string(2048,PCD_IPI)
|
||||
image/x-portable-anymap pnm
|
||||
@@ -170,5 +170,5 @@ application/vnd.cups-raw (string(0,<1B>E) + !string(2,<1B>%0B)) \
|
||||
application/octet-stream
|
||||
|
||||
#
|
||||
# End of "$Id: mime.types 9667 2011-04-01 04:48:21Z mike $".
|
||||
# End of "$Id: mime.types 9871 2011-08-06 06:34:46Z mike $".
|
||||
#
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-common.m4 9810 2011-05-26 12:34:56Z mike $"
|
||||
dnl "$Id: cups-common.m4 10067 2011-10-13 05:44:32Z mike $"
|
||||
dnl
|
||||
dnl Common configuration stuff for 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.5b2"
|
||||
CUPS_VERSION="1.5.1"
|
||||
CUPS_REVISION=""
|
||||
#if test -z "$CUPS_REVISION" -a -d .svn; then
|
||||
# CUPS_REVISION="-r`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[[a-zA-Z]]*//g'`"
|
||||
@@ -92,6 +92,7 @@ dnl Check for pkg-config, which is used for some other tests later on...
|
||||
AC_PATH_PROG(PKGCONFIG, pkg-config)
|
||||
|
||||
dnl Check for libraries...
|
||||
AC_SEARCH_LIBS(fmod, m)
|
||||
AC_SEARCH_LIBS(crypt, crypt)
|
||||
AC_SEARCH_LIBS(getspent, sec gen)
|
||||
|
||||
@@ -380,7 +381,17 @@ case $uname in
|
||||
|
||||
dnl Check for sandbox/Seatbelt support
|
||||
if test $uversion -ge 100; then
|
||||
AC_CHECK_HEADER(sandbox.h,AC_DEFINE(HAVE_SANDBOX_H))
|
||||
AC_CHECK_HEADER(sandbox.h,AC_DEFINE(HAVE_SANDBOX_H))
|
||||
fi
|
||||
if test $uversion -ge 110; then
|
||||
# Broken public headers in 10.7...
|
||||
AC_MSG_CHECKING(for sandbox/private.h presence)
|
||||
if test -f /usr/local/include/sandbox/private.h; then
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR(Run 'sudo mkdir -p /usr/local/include/sandbox' and 'sudo touch /usr/local/include/sandbox/private.h' to build CUPS.)
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Check for XPC support
|
||||
@@ -406,7 +417,7 @@ AC_ARG_WITH(components, [ --with-components set components to build:
|
||||
|
||||
case "$COMPONENTS" in
|
||||
all)
|
||||
BUILDDIRS="filter backend berkeley cgi-bin driver monitor notifier ppdc scheduler systemv conf data locale man doc examples templates"
|
||||
BUILDDIRS="filter backend berkeley cgi-bin driver monitor notifier ppdc scheduler systemv conf data desktop locale man doc examples templates"
|
||||
;;
|
||||
|
||||
core)
|
||||
@@ -421,5 +432,5 @@ esac
|
||||
AC_SUBST(BUILDDIRS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-common.m4 9810 2011-05-26 12:34:56Z mike $".
|
||||
dnl End of "$Id: cups-common.m4 10067 2011-10-13 05:44:32Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-compiler.m4 9809 2011-05-26 12:24:20Z mike $"
|
||||
dnl "$Id: cups-compiler.m4 9981 2011-09-09 17:28:58Z mike $"
|
||||
dnl
|
||||
dnl Compiler stuff for CUPS.
|
||||
dnl
|
||||
@@ -156,13 +156,12 @@ if test -n "$GCC"; then
|
||||
|
||||
# Additional warning options for development testing...
|
||||
if test -d .svn; then
|
||||
OPTIM="-Wshadow $OPTIM"
|
||||
CFLAGS="-Werror-implicit-function-declaration $CFLAGS"
|
||||
OPTIM="-Wshadow -Werror $OPTIM"
|
||||
PHPOPTIONS="-Wno-shadow"
|
||||
else
|
||||
AC_MSG_CHECKING(if GCC supports -Wno-tautological-compare)
|
||||
OLDCFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -Wno-tautological-compare"
|
||||
CFLAGS="$CFLAGS -Werror -Wno-tautological-compare"
|
||||
AC_TRY_COMPILE(,,
|
||||
[OPTIM="$OPTIM -Wno-tautological-compare"
|
||||
AC_MSG_RESULT(yes)],
|
||||
@@ -560,5 +559,5 @@ case $uname in
|
||||
esac
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-compiler.m4 9809 2011-05-26 12:24:20Z mike $".
|
||||
dnl End of "$Id: cups-compiler.m4 9981 2011-09-09 17:28:58Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-gssapi.m4 9771 2011-05-12 05:21:56Z mike $"
|
||||
dnl "$Id: cups-gssapi.m4 10083 2011-10-19 20:21:16Z mike $"
|
||||
dnl
|
||||
dnl GSSAPI/Kerberos library detection for CUPS.
|
||||
dnl
|
||||
@@ -71,10 +71,45 @@ if test x$enable_gssapi != xno; then
|
||||
if test "x$LIBGSSAPI" != x; then
|
||||
AC_CHECK_HEADER(krb5.h, AC_DEFINE(HAVE_KRB5_H))
|
||||
if test -d /System/Library/Frameworks/GSS.framework; then
|
||||
AC_CHECK_HEADER(GSS/gssapi.h, AC_DEFINE(HAVE_GSS_GSSAPI_H))
|
||||
AC_CHECK_HEADER(GSS/gssapi_generic.h, AC_DEFINE(HAVE_GSSAPI_GENERIC_H))
|
||||
AC_CHECK_HEADER(GSS/gssapi_krb5.h, AC_DEFINE(HAVE_GSSAPI_KRB5_H))
|
||||
AC_CHECK_HEADER(GSS/gssapi_spi.h, AC_DEFINE(HAVE_GSS_GSSAPI_SPI_H))
|
||||
gssdir="/System/Library/Frameworks/GSS.framework"
|
||||
AC_MSG_CHECKING(for GSS/gssapi.h presence)
|
||||
if test -f $gssdir/Headers/gssapi.h; then
|
||||
AC_DEFINE(HAVE_GSS_GSSAPI_H)
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
AC_MSG_CHECKING(for GSS/gssapi_generic.h presence)
|
||||
if test -f $gssdir/Headers/gssapi_generic.h; then
|
||||
AC_DEFINE(HAVE_GSSAPI_GENERIC_H)
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
AC_MSG_CHECKING(for GSS/gssapi_krb5.h presence)
|
||||
if test -f $gssdir/Headers/gssapi_krb5.h; then
|
||||
AC_DEFINE(HAVE_GSSAPI_KRB5_H)
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
AC_MSG_CHECKING(for GSS/gssapi_spi.h presence)
|
||||
if test -f $gssdir/PrivateHeaders/gssapi_spi.h; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_MSG_CHECKING(for GSS/gssapi_spi.h usability)
|
||||
if test -s $gssdir/PrivateHeaders/gssapi_spi.h; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_GSS_GSSAPI_SPI_H)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
if test $uversion -ge 110; then
|
||||
# Broken public headers in 10.7...
|
||||
AC_MSG_ERROR(Run 'sudo mkdir -p $gssdir/PrivateHeaders' and 'sudo touch $gssdir/PrivateHeaders/gssapi_spi.h' to build CUPS.)
|
||||
fi
|
||||
fi
|
||||
else
|
||||
AC_CHECK_HEADER(gssapi.h, AC_DEFINE(HAVE_GSSAPI_H))
|
||||
AC_CHECK_HEADER(gssapi/gssapi.h, AC_DEFINE(HAVE_GSSAPI_GSSAPI_H))
|
||||
@@ -131,5 +166,5 @@ fi
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_GSSSERVICENAME, "$CUPS_DEFAULT_GSSSERVICENAME")
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-gssapi.m4 9771 2011-05-12 05:21:56Z mike $".
|
||||
dnl End of "$Id: cups-gssapi.m4 10083 2011-10-19 20:21:16Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-ssl.m4 9756 2011-05-11 00:52:08Z mike $"
|
||||
dnl "$Id: cups-ssl.m4 9837 2011-06-16 20:12:16Z mike $"
|
||||
dnl
|
||||
dnl OpenSSL/GNUTLS stuff for CUPS.
|
||||
dnl
|
||||
@@ -56,6 +56,12 @@ if test x$enable_ssl != xno; then
|
||||
AC_CHECK_HEADER(Security/SecIdentitySearchPriv.h,
|
||||
AC_DEFINE(HAVE_SECIDENTITYSEARCHPRIV_H))
|
||||
|
||||
dnl Check for SSLSetProtocolVersionMax...
|
||||
SAVELIBS="$LIBS"
|
||||
LIBS="$LIBS -framework Security"
|
||||
AC_CHECK_FUNC(SSLSetProtocolVersionMax)
|
||||
LIBS="$SAVELIBS"
|
||||
|
||||
dnl Check for SecCertificateCopyData..
|
||||
AC_MSG_CHECKING(for SecCertificateCopyData)
|
||||
if test $uversion -ge 100; then
|
||||
@@ -169,5 +175,5 @@ AC_SUBST(EXPORT_SSLLIBS)
|
||||
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-ssl.m4 9756 2011-05-11 00:52:08Z mike $".
|
||||
dnl End of "$Id: cups-ssl.m4 9837 2011-06-16 20:12:16Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -342,6 +342,13 @@
|
||||
#undef HAVE_SECPOLICYCREATESSL
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the SSLSetProtocolVersionMax function?
|
||||
*/
|
||||
|
||||
#undef HAVE_SSLSETPROTOCOLVERSIONMAX
|
||||
|
||||
|
||||
/*
|
||||
* Do we have the cssmErrorString function?
|
||||
*/
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ if test "x$LANGUAGES" != x; then
|
||||
LANGFILES="$LANGFILES templates/$lang/header.tmpl"
|
||||
fi
|
||||
done
|
||||
elif test "x$CUPS_BUNDLEDIR" != ""; then
|
||||
elif test "x$CUPS_BUNDLEDIR" != x; then
|
||||
INSTALL_LANGUAGES="install-langbundle"
|
||||
UNINSTALL_LANGUAGES="uninstall-langbundle"
|
||||
fi
|
||||
|
||||
+1
-1
@@ -376,7 +376,7 @@ libcups_s.a: $(LIBOBJS) libcups_s.exp
|
||||
echo Creating $@...
|
||||
$(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o \
|
||||
$(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
|
||||
$(COMMONLIBS) $(LIBZ) -lm
|
||||
$(COMMONLIBS) $(LIBZ)
|
||||
$(RM) $@
|
||||
$(AR) $(ARFLAGS) $@ libcups_s.o
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
# include "array.h"
|
||||
# include <cups/array.h>
|
||||
|
||||
|
||||
/*
|
||||
|
||||
+2
-1
@@ -65,6 +65,8 @@ extern const char *cssmErrorString(int error);
|
||||
# ifdef HAVE_GSS_GSSAPI_SPI_H
|
||||
# include <GSS/gssapi_spi.h>
|
||||
# else
|
||||
# define GSS_AUTH_IDENTITY_TYPE_1 1
|
||||
# define gss_acquire_cred_ex_f __ApplePrivate_gss_acquire_cred_ex_f
|
||||
typedef struct gss_auth_identity
|
||||
{
|
||||
uint32_t type;
|
||||
@@ -419,7 +421,6 @@ _cupsSetNegotiateAuthString(
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif /* HAVE_GSS_ACQUIRED_CRED_EX_F */
|
||||
|
||||
if (GSS_ERROR(major_status))
|
||||
|
||||
+5
-2
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Backend functions for CUPS.
|
||||
*
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 2007-2012 by Apple Inc.
|
||||
* Copyright 2006 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -125,7 +125,10 @@ quote_string(const char *s) /* I - String to write */
|
||||
if (*s == '\\' || *s == '\"')
|
||||
putchar('\\');
|
||||
|
||||
putchar(*s);
|
||||
if (*s == '\n')
|
||||
putchar(' ');
|
||||
else
|
||||
putchar(*s);
|
||||
|
||||
s ++;
|
||||
}
|
||||
|
||||
+4
-4
@@ -270,7 +270,7 @@ cupsResolveConflicts(
|
||||
* Resolver loop!
|
||||
*/
|
||||
|
||||
DEBUG_printf(("1ppdResolveConflicts: Resolver loop with %s!",
|
||||
DEBUG_printf(("1cupsResolveConflicts: Resolver loop with %s!",
|
||||
consts->resolver));
|
||||
goto error;
|
||||
}
|
||||
@@ -278,14 +278,14 @@ cupsResolveConflicts(
|
||||
if ((resolver = ppdFindAttr(ppd, "cupsUIResolver",
|
||||
consts->resolver)) == NULL)
|
||||
{
|
||||
DEBUG_printf(("1ppdResolveConflicts: Resolver %s not found!",
|
||||
DEBUG_printf(("1cupsResolveConflicts: Resolver %s not found!",
|
||||
consts->resolver));
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (!resolver->value)
|
||||
{
|
||||
DEBUG_printf(("1ppdResolveConflicts: Resolver %s has no value!",
|
||||
DEBUG_printf(("1cupsResolveConflicts: Resolver %s has no value!",
|
||||
consts->resolver));
|
||||
goto error;
|
||||
}
|
||||
@@ -507,7 +507,7 @@ cupsResolveConflicts(
|
||||
|
||||
if (!changed)
|
||||
{
|
||||
DEBUG_puts("1ppdResolveConflicts: Unable to automatically resolve "
|
||||
DEBUG_puts("1cupsResolveConflicts: Unable to automatically resolve "
|
||||
"constraint!");
|
||||
goto error;
|
||||
}
|
||||
|
||||
+2
-2
@@ -60,10 +60,10 @@ extern "C" {
|
||||
* Constants...
|
||||
*/
|
||||
|
||||
# define CUPS_VERSION 1.0499
|
||||
# define CUPS_VERSION 1.0502
|
||||
# define CUPS_VERSION_MAJOR 1
|
||||
# define CUPS_VERSION_MINOR 5
|
||||
# define CUPS_VERSION_PATCH -1
|
||||
# define CUPS_VERSION_PATCH 2
|
||||
|
||||
# define CUPS_BC_FD 3 /* Back-channel file descriptor for select/poll */
|
||||
# define CUPS_DATE_ANY (time_t)-1
|
||||
|
||||
+1
-1
@@ -286,7 +286,7 @@ ppdEmitAfterOrder(
|
||||
* Get the string...
|
||||
*/
|
||||
|
||||
buffer = ppdEmitString(ppd, section, limit ? min_order : 0.0);
|
||||
buffer = ppdEmitString(ppd, section, limit ? min_order : 0.0f);
|
||||
|
||||
/*
|
||||
* Write it as needed and return...
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
* cupsFilePeekChar() - Peek at the next character from a file.
|
||||
* cupsFilePrintf() - Write a formatted string.
|
||||
* cupsFilePutChar() - Write a character.
|
||||
* cupsFilePutConf() - Write a configuration line.
|
||||
* cupsFilePuts() - Write a string.
|
||||
* cupsFileRead() - Read from a file.
|
||||
* cupsFileRewind() - Set the current file position to the beginning of
|
||||
@@ -52,6 +53,7 @@
|
||||
* cupsFileWrite() - Write to a file.
|
||||
* cups_compress() - Compress a buffer of data.
|
||||
* cups_fill() - Fill the input buffer.
|
||||
* cups_open() - Safely open a file for writing.
|
||||
* cups_read() - Read from a file descriptor.
|
||||
* cups_write() - Write to a file descriptor.
|
||||
*/
|
||||
@@ -78,6 +80,7 @@ static ssize_t cups_read(cups_file_t *fp, char *buf, size_t bytes);
|
||||
static ssize_t cups_write(cups_file_t *fp, const char *buf, size_t bytes);
|
||||
|
||||
|
||||
#ifndef WIN32
|
||||
/*
|
||||
* '_cupsFileCheck()' - Check the permissions of the given filename.
|
||||
*/
|
||||
@@ -355,6 +358,7 @@ _cupsFileCheckFilter(
|
||||
|
||||
fprintf(stderr, "%s: %s\n", prefix, message);
|
||||
}
|
||||
#endif /* !WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
|
||||
+6
-1
@@ -366,7 +366,12 @@ httpAddrString(const http_addr_t *addr, /* I - Address to convert */
|
||||
|
||||
#ifdef AF_LOCAL
|
||||
if (addr->addr.sa_family == AF_LOCAL)
|
||||
strlcpy(s, addr->un.sun_path, slen);
|
||||
{
|
||||
if (addr->un.sun_path[0] == '/')
|
||||
strlcpy(s, addr->un.sun_path, slen);
|
||||
else
|
||||
strlcpy(s, "localhost", slen);
|
||||
}
|
||||
else
|
||||
#endif /* AF_LOCAL */
|
||||
if (addr->addr.sa_family == AF_INET)
|
||||
|
||||
@@ -169,7 +169,7 @@ httpAddrConnect(
|
||||
}
|
||||
|
||||
if (!addrlist)
|
||||
_cupsSetError(IPP_SERVICE_UNAVAILABLE, _("Unable to connect to server"), 1);
|
||||
_cupsSetError(IPP_SERVICE_UNAVAILABLE, strerror(errno), 0);
|
||||
|
||||
return (addrlist);
|
||||
}
|
||||
|
||||
+25
-24
@@ -245,14 +245,14 @@ struct _http_s /**** HTTP connection structure. ****/
|
||||
http_status_t status; /* Status of last request */
|
||||
http_version_t version; /* Protocol version */
|
||||
http_keepalive_t keep_alive; /* Keep-alive supported? */
|
||||
struct sockaddr_in _hostaddr; /* Address of connected host @deprecated@ */
|
||||
struct sockaddr_in _hostaddr; /* Address of connected host (deprecated) */
|
||||
char hostname[HTTP_MAX_HOST],
|
||||
/* Name of connected host */
|
||||
fields[HTTP_FIELD_MAX][HTTP_MAX_VALUE];
|
||||
/* Field values */
|
||||
char *data; /* Pointer to data buffer */
|
||||
http_encoding_t data_encoding; /* Chunked or not */
|
||||
int _data_remaining;/* Number of bytes left @deprecated@ */
|
||||
int _data_remaining;/* Number of bytes left (deprecated) */
|
||||
int used; /* Number of bytes used in buffer */
|
||||
char buffer[HTTP_MAX_BUFFER];
|
||||
/* Buffer for incoming data */
|
||||
@@ -264,40 +264,41 @@ struct _http_s /**** HTTP connection structure. ****/
|
||||
http_tls_t tls; /* TLS state information */
|
||||
http_encryption_t encryption; /* Encryption requirements */
|
||||
/**** New in CUPS 1.1.19 ****/
|
||||
fd_set *input_set; /* select() set for httpWait() @deprecated@ */
|
||||
http_status_t expect; /* Expect: header @since CUPS 1.1.19@ */
|
||||
char *cookie; /* Cookie value(s) @since CUPS 1.1.19@ */
|
||||
fd_set *input_set; /* select() set for httpWait() (deprecated) */
|
||||
http_status_t expect; /* Expect: header */
|
||||
char *cookie; /* Cookie value(s) */
|
||||
/**** New in CUPS 1.1.20 ****/
|
||||
char _authstring[HTTP_MAX_VALUE],
|
||||
/* Current Authentication value. @deprecated@ */
|
||||
/* Current Authentication value (deprecated) */
|
||||
userpass[HTTP_MAX_VALUE];
|
||||
/* Username:password string @since CUPS 1.1.20@ */
|
||||
int digest_tries; /* Number of tries for digest auth @since CUPS 1.1.20@ */
|
||||
/* Username:password string */
|
||||
int digest_tries; /* Number of tries for digest auth */
|
||||
/**** New in CUPS 1.2 ****/
|
||||
off_t data_remaining; /* Number of bytes left @since CUPS 1.2@ */
|
||||
http_addr_t *hostaddr; /* Current host address and port @since CUPS 1.2@ */
|
||||
http_addrlist_t *addrlist; /* List of valid addresses @since CUPS 1.2@ */
|
||||
off_t data_remaining; /* Number of bytes left */
|
||||
http_addr_t *hostaddr; /* Current host address and port */
|
||||
http_addrlist_t *addrlist; /* List of valid addresses */
|
||||
char wbuffer[HTTP_MAX_BUFFER];
|
||||
/* Buffer for outgoing data */
|
||||
int wused; /* Write buffer bytes used @since CUPS 1.2@ */
|
||||
int wused; /* Write buffer bytes used */
|
||||
/**** New in CUPS 1.3 ****/
|
||||
char *field_authorization;
|
||||
/* Authorization field @since CUPS 1.3@ */
|
||||
char *authstring; /* Current authorization field @since CUPS 1.3 */
|
||||
/* Authorization field */
|
||||
char *authstring; /* Current authorization field */
|
||||
# ifdef HAVE_GSSAPI
|
||||
gss_OID gssmech; /* Authentication mechanism @since CUPS 1.3@ */
|
||||
gss_ctx_id_t gssctx; /* Authentication context @since CUPS 1.3@ */
|
||||
gss_name_t gssname; /* Authentication server name @since CUPS 1.3@ */
|
||||
gss_OID gssmech; /* Authentication mechanism */
|
||||
gss_ctx_id_t gssctx; /* Authentication context */
|
||||
gss_name_t gssname; /* Authentication server name */
|
||||
# endif /* HAVE_GSSAPI */
|
||||
# ifdef HAVE_AUTHORIZATION_H
|
||||
AuthorizationRef auth_ref; /* Authorization ref @since CUPS 1.3@ */
|
||||
AuthorizationRef auth_ref; /* Authorization ref */
|
||||
# endif /* HAVE_AUTHORIZATION_H */
|
||||
/**** New in CUPS 1.5 ****/
|
||||
http_tls_credentials_t tls_credentials;
|
||||
/* TLS credentials @since CUPS 1.5/Mac OS X 10.7@ */
|
||||
http_timeout_cb_t timeout_cb; /* Timeout callback @since CUPS 1.5/Mac OS X 10.7@ */
|
||||
void *timeout_data; /* User data pointer @since CUPS 1.5/Mac OS X 10.7@ */
|
||||
struct timeval timeout_value; /* Timeout in seconds */
|
||||
/* TLS credentials */
|
||||
http_timeout_cb_t timeout_cb; /* Timeout callback */
|
||||
void *timeout_data; /* User data pointer */
|
||||
double timeout_value; /* Timeout in seconds */
|
||||
int wait_value; /* httpWait value for timeout */
|
||||
# ifdef HAVE_GSSAPI
|
||||
char gsshost[256]; /* Hostname for Kerberos */
|
||||
# endif /* HAVE_GSSAPI */
|
||||
@@ -371,12 +372,12 @@ extern void _httpAddrSetPort(http_addr_t *addr, int port);
|
||||
extern char *_httpAssembleUUID(const char *server, int port,
|
||||
const char *name, int number,
|
||||
char *buffer, size_t bufsize);
|
||||
extern http_tls_credentials_t
|
||||
_httpConvertCredentials(cups_array_t *credentials);
|
||||
extern http_t *_httpCreate(const char *host, int port,
|
||||
http_addrlist_t *addrlist,
|
||||
http_encryption_t encryption,
|
||||
int family);
|
||||
extern http_tls_credentials_t
|
||||
_httpCreateCredentials(cups_array_t *credentials);
|
||||
extern char *_httpDecodeURI(char *dst, const char *src,
|
||||
size_t dstsize);
|
||||
extern void _httpDisconnect(http_t *http);
|
||||
|
||||
+26
-7
@@ -216,7 +216,7 @@ httpAssembleURI(
|
||||
* Add username@ first...
|
||||
*/
|
||||
|
||||
ptr = http_copy_encode(ptr, username, end, "/?@", NULL,
|
||||
ptr = http_copy_encode(ptr, username, end, "/?#[]@", NULL,
|
||||
encoding & HTTP_URI_CODING_USERNAME);
|
||||
|
||||
if (!ptr)
|
||||
@@ -466,7 +466,7 @@ _httpAssembleUUID(const char *server, /* I - Server name */
|
||||
|
||||
snprintf(data, sizeof(data), "%s:%d:%s:%d:%04x:%04x", server,
|
||||
port, name ? name : server, number,
|
||||
CUPS_RAND() & 0xffff, CUPS_RAND() & 0xffff);
|
||||
(unsigned)CUPS_RAND() & 0xffff, (unsigned)CUPS_RAND() & 0xffff);
|
||||
|
||||
_cupsMD5Init(&md5state);
|
||||
_cupsMD5Append(&md5state, (unsigned char *)data, strlen(data));
|
||||
@@ -1823,17 +1823,36 @@ http_resolve_cb(
|
||||
|
||||
if ((value = TXTRecordGetValuePtr(txtLen, txtRecord, "rp",
|
||||
&valueLen)) != NULL)
|
||||
{
|
||||
if (((char *)value)[0] == '/')
|
||||
{
|
||||
/*
|
||||
* "rp" value (incorrectly) has a leading slash already...
|
||||
*/
|
||||
|
||||
memcpy(rp, value, valueLen);
|
||||
rp[valueLen] = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Convert to resource by concatenating with a leading "/"...
|
||||
*/
|
||||
|
||||
rp[0] = '/';
|
||||
memcpy(rp + 1, value, valueLen);
|
||||
rp[valueLen + 1] = '\0';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Convert to resource by concatenating with a leading "/"...
|
||||
* Default "rp" value is blank, mapping to a path of "/"...
|
||||
*/
|
||||
|
||||
rp[0] = '/';
|
||||
memcpy(rp + 1, value, valueLen);
|
||||
rp[valueLen + 1] = '\0';
|
||||
rp[1] = '\0';
|
||||
}
|
||||
else
|
||||
rp[0] = '\0';
|
||||
|
||||
/*
|
||||
* Lookup the FQDN if needed...
|
||||
|
||||
+402
-224
@@ -34,8 +34,8 @@
|
||||
* httpConnectEncrypt() - Connect to a HTTP server using encryption.
|
||||
* httpCopyCredentials() - Copy the credentials associated with an
|
||||
* encrypted connection.
|
||||
* _httpConvertCredentials() - Convert credentials to the internal format.
|
||||
* _httpCreate() - Create an unconnected HTTP connection.
|
||||
* _httpCreateCredentials() - Create credentials in the internal format.
|
||||
* httpDelete() - Send a DELETE request to the server.
|
||||
* _httpDisconnect() - Disconnect a HTTP connection.
|
||||
* httpEncryption() - Set the required encryption on the link.
|
||||
@@ -107,6 +107,8 @@
|
||||
* http_send() - Send a request with all fields and the trailing
|
||||
* blank line.
|
||||
* http_set_credentials() - Set the SSL/TLS credentials.
|
||||
* http_set_timeout() - Set the socket timeout values.
|
||||
* http_set_wait() - Set the default wait value for reads.
|
||||
* http_setup_ssl() - Set up SSL/TLS support on a connection.
|
||||
* http_shutdown_ssl() - Shut down SSL/TLS on a connection.
|
||||
* http_threadid_cb() - Return the current thread ID.
|
||||
@@ -122,6 +124,7 @@
|
||||
|
||||
#include "cups-private.h"
|
||||
#include <fcntl.h>
|
||||
#include <math.h>
|
||||
#ifdef WIN32
|
||||
# include <tchar.h>
|
||||
#else
|
||||
@@ -164,6 +167,10 @@ static int http_read_ssl(http_t *http, char *buf, int len);
|
||||
# if defined(HAVE_CDSASSL) && defined(HAVE_SECCERTIFICATECOPYDATA)
|
||||
static int http_set_credentials(http_t *http);
|
||||
# endif /* HAVE_CDSASSL ** HAVE_SECCERTIFICATECOPYDATA */
|
||||
#endif /* HAVE_SSL */
|
||||
static void http_set_timeout(int fd, double timeout);
|
||||
static void http_set_wait(http_t *http);
|
||||
#ifdef HAVE_SSL
|
||||
static int http_setup_ssl(http_t *http);
|
||||
static void http_shutdown_ssl(http_t *http);
|
||||
static int http_upgrade(http_t *http);
|
||||
@@ -311,7 +318,10 @@ httpBlocking(http_t *http, /* I - Connection to server */
|
||||
int b) /* I - 1 = blocking, 0 = non-blocking */
|
||||
{
|
||||
if (http)
|
||||
{
|
||||
http->blocking = b;
|
||||
http_set_wait(http);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -556,64 +566,6 @@ httpCopyCredentials(
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* '_httpConvertCredentials()' - Convert credentials to the internal format.
|
||||
*/
|
||||
|
||||
http_tls_credentials_t /* O - Internal credentials */
|
||||
_httpConvertCredentials(
|
||||
cups_array_t *credentials) /* I - Array of credentials */
|
||||
{
|
||||
if (!credentials)
|
||||
return (NULL);
|
||||
|
||||
# ifdef HAVE_LIBSSL
|
||||
return (NULL);
|
||||
|
||||
# elif defined(HAVE_GNUTLS)
|
||||
return (NULL);
|
||||
|
||||
# elif defined(HAVE_CDSASSL) && defined(HAVE_SECCERTIFICATECOPYDATA)
|
||||
CFMutableArrayRef peerCerts; /* Peer credentials reference */
|
||||
SecCertificateRef secCert; /* Certificate reference */
|
||||
CFDataRef data; /* Credential data reference */
|
||||
http_credential_t *credential; /* Credential data */
|
||||
|
||||
|
||||
if ((peerCerts = CFArrayCreateMutable(kCFAllocatorDefault,
|
||||
cupsArrayCount(credentials),
|
||||
&kCFTypeArrayCallBacks)) == NULL)
|
||||
return (NULL);
|
||||
|
||||
for (credential = (http_credential_t *)cupsArrayFirst(credentials);
|
||||
credential;
|
||||
credential = (http_credential_t *)cupsArrayNext(credentials))
|
||||
{
|
||||
if ((data = CFDataCreate(kCFAllocatorDefault, credential->data,
|
||||
credential->datalen)))
|
||||
{
|
||||
if ((secCert = SecCertificateCreateWithData(kCFAllocatorDefault, data))
|
||||
!= NULL)
|
||||
{
|
||||
CFArrayAppendValue(peerCerts, secCert);
|
||||
CFRelease(secCert);
|
||||
}
|
||||
|
||||
CFRelease(data);
|
||||
}
|
||||
}
|
||||
|
||||
return (peerCerts);
|
||||
|
||||
# elif defined(HAVE_SSPISSL)
|
||||
return (NULL);
|
||||
|
||||
# else
|
||||
return (NULL);
|
||||
# endif /* HAVE_LIBSSL */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* '_httpCreate()' - Create an unconnected HTTP connection.
|
||||
*/
|
||||
@@ -679,6 +631,8 @@ _httpCreate(
|
||||
else
|
||||
http->encryption = encryption;
|
||||
|
||||
http_set_wait(http);
|
||||
|
||||
/*
|
||||
* Return the new structure...
|
||||
*/
|
||||
@@ -687,6 +641,64 @@ _httpCreate(
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* '_httpCreateCredentials()' - Create credentials in the internal format.
|
||||
*/
|
||||
|
||||
http_tls_credentials_t /* O - Internal credentials */
|
||||
_httpCreateCredentials(
|
||||
cups_array_t *credentials) /* I - Array of credentials */
|
||||
{
|
||||
if (!credentials)
|
||||
return (NULL);
|
||||
|
||||
# ifdef HAVE_LIBSSL
|
||||
return (NULL);
|
||||
|
||||
# elif defined(HAVE_GNUTLS)
|
||||
return (NULL);
|
||||
|
||||
# elif defined(HAVE_CDSASSL) && defined(HAVE_SECCERTIFICATECOPYDATA)
|
||||
CFMutableArrayRef peerCerts; /* Peer credentials reference */
|
||||
SecCertificateRef secCert; /* Certificate reference */
|
||||
CFDataRef data; /* Credential data reference */
|
||||
http_credential_t *credential; /* Credential data */
|
||||
|
||||
|
||||
if ((peerCerts = CFArrayCreateMutable(kCFAllocatorDefault,
|
||||
cupsArrayCount(credentials),
|
||||
&kCFTypeArrayCallBacks)) == NULL)
|
||||
return (NULL);
|
||||
|
||||
for (credential = (http_credential_t *)cupsArrayFirst(credentials);
|
||||
credential;
|
||||
credential = (http_credential_t *)cupsArrayNext(credentials))
|
||||
{
|
||||
if ((data = CFDataCreate(kCFAllocatorDefault, credential->data,
|
||||
credential->datalen)))
|
||||
{
|
||||
if ((secCert = SecCertificateCreateWithData(kCFAllocatorDefault, data))
|
||||
!= NULL)
|
||||
{
|
||||
CFArrayAppendValue(peerCerts, secCert);
|
||||
CFRelease(secCert);
|
||||
}
|
||||
|
||||
CFRelease(data);
|
||||
}
|
||||
}
|
||||
|
||||
return (peerCerts);
|
||||
|
||||
# elif defined(HAVE_SSPISSL)
|
||||
return (NULL);
|
||||
|
||||
# else
|
||||
return (NULL);
|
||||
# endif /* HAVE_LIBSSL */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'httpDelete()' - Send a DELETE request to the server.
|
||||
*/
|
||||
@@ -1314,7 +1326,7 @@ httpGets(char *line, /* I - Line to read into */
|
||||
* No newline; see if there is more data to be read...
|
||||
*/
|
||||
|
||||
while (!_httpWait(http, http->blocking ? 30000 : 10000, 1))
|
||||
while (!_httpWait(http, http->wait_value, 1))
|
||||
{
|
||||
if (http->timeout_cb && (*http->timeout_cb)(http, http->timeout_data))
|
||||
continue;
|
||||
@@ -1639,7 +1651,7 @@ _httpPeek(http_t *http, /* I - Connection to server */
|
||||
|
||||
if (!http->blocking)
|
||||
{
|
||||
while (!httpWait(http, 10000))
|
||||
while (!httpWait(http, http->wait_value))
|
||||
{
|
||||
if (http->timeout_cb && (*http->timeout_cb)(http, http->timeout_data))
|
||||
continue;
|
||||
@@ -1901,9 +1913,11 @@ httpRead2(http_t *http, /* I - Connection to server */
|
||||
* Buffer small reads for better performance...
|
||||
*/
|
||||
|
||||
ssize_t buflen; /* Length of read for buffer */
|
||||
|
||||
if (!http->blocking)
|
||||
{
|
||||
while (!httpWait(http, 10000))
|
||||
while (!httpWait(http, http->wait_value))
|
||||
{
|
||||
if (http->timeout_cb && (*http->timeout_cb)(http, http->timeout_data))
|
||||
continue;
|
||||
@@ -1913,69 +1927,65 @@ httpRead2(http_t *http, /* I - Connection to server */
|
||||
}
|
||||
|
||||
if (http->data_remaining > sizeof(http->buffer))
|
||||
bytes = sizeof(http->buffer);
|
||||
buflen = sizeof(http->buffer);
|
||||
else
|
||||
bytes = http->data_remaining;
|
||||
buflen = http->data_remaining;
|
||||
|
||||
DEBUG_printf(("2httpRead2: Reading %d bytes into buffer.", (int)buflen));
|
||||
|
||||
do
|
||||
{
|
||||
#ifdef HAVE_SSL
|
||||
if (http->tls)
|
||||
bytes = http_read_ssl(http, http->buffer, bytes);
|
||||
else
|
||||
if (http->tls)
|
||||
bytes = http_read_ssl(http, http->buffer, buflen);
|
||||
else
|
||||
#endif /* HAVE_SSL */
|
||||
{
|
||||
DEBUG_printf(("2httpRead2: reading %d bytes from socket into buffer...",
|
||||
(int)bytes));
|
||||
bytes = recv(http->fd, http->buffer, buflen, 0);
|
||||
|
||||
bytes = recv(http->fd, http->buffer, bytes, 0);
|
||||
|
||||
DEBUG_printf(("2httpRead2: read %d bytes from socket into buffer...",
|
||||
(int)bytes));
|
||||
}
|
||||
|
||||
if (bytes > 0)
|
||||
http->used = bytes;
|
||||
else if (bytes < 0)
|
||||
{
|
||||
if (bytes < 0)
|
||||
{
|
||||
#ifdef WIN32
|
||||
if (WSAGetLastError() != WSAEINTR)
|
||||
{
|
||||
http->error = WSAGetLastError();
|
||||
return (-1);
|
||||
}
|
||||
else if (WSAGetLastError() == WSAEWOULDBLOCK)
|
||||
{
|
||||
if (!http->timeout_cb || !(*http->timeout_cb)(http, http->timeout_data))
|
||||
if (WSAGetLastError() != WSAEINTR)
|
||||
{
|
||||
http->error = WSAEWOULDBLOCK;
|
||||
http->error = WSAGetLastError();
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
else if (WSAGetLastError() == WSAEWOULDBLOCK)
|
||||
{
|
||||
if (!http->timeout_cb ||
|
||||
!(*http->timeout_cb)(http, http->timeout_data))
|
||||
{
|
||||
http->error = WSAEWOULDBLOCK;
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (errno == EWOULDBLOCK || errno == EAGAIN)
|
||||
{
|
||||
if (http->timeout_cb && !(*http->timeout_cb)(http, http->timeout_data))
|
||||
if (errno == EWOULDBLOCK || errno == EAGAIN)
|
||||
{
|
||||
if (http->timeout_cb && !(*http->timeout_cb)(http, http->timeout_data))
|
||||
{
|
||||
http->error = errno;
|
||||
return (-1);
|
||||
}
|
||||
else if (!http->timeout_cb && errno != EAGAIN)
|
||||
{
|
||||
http->error = errno;
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
else if (errno != EINTR)
|
||||
{
|
||||
http->error = errno;
|
||||
return (-1);
|
||||
}
|
||||
else if (!http->timeout_cb && errno != EAGAIN)
|
||||
{
|
||||
http->error = errno;
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
else if (errno != EINTR)
|
||||
{
|
||||
http->error = errno;
|
||||
return (-1);
|
||||
}
|
||||
#endif /* WIN32 */
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
http->error = EPIPE;
|
||||
return (0);
|
||||
}
|
||||
while (bytes < 0);
|
||||
|
||||
DEBUG_printf(("2httpRead2: Read %d bytes into buffer.", (int)bytes));
|
||||
|
||||
http->used = bytes;
|
||||
}
|
||||
|
||||
if (http->used > 0)
|
||||
@@ -1999,7 +2009,7 @@ httpRead2(http_t *http, /* I - Connection to server */
|
||||
{
|
||||
if (!http->blocking)
|
||||
{
|
||||
while (!httpWait(http, 10000))
|
||||
while (!httpWait(http, http->wait_value))
|
||||
{
|
||||
if (http->timeout_cb && (*http->timeout_cb)(http, http->timeout_data))
|
||||
continue;
|
||||
@@ -2008,14 +2018,35 @@ httpRead2(http_t *http, /* I - Connection to server */
|
||||
}
|
||||
}
|
||||
|
||||
bytes = (ssize_t)http_read_ssl(http, buffer, (int)length);
|
||||
while ((bytes = (ssize_t)http_read_ssl(http, buffer, (int)length)) < 0)
|
||||
{
|
||||
#ifdef WIN32
|
||||
if (WSAGetLastError() == WSAEWOULDBLOCK)
|
||||
{
|
||||
if (!http->timeout_cb || !(*http->timeout_cb)(http, http->timeout_data))
|
||||
break;
|
||||
}
|
||||
else if (WSAGetLastError() != WSAEINTR)
|
||||
break;
|
||||
#else
|
||||
if (errno == EWOULDBLOCK || errno == EAGAIN)
|
||||
{
|
||||
if (http->timeout_cb && !(*http->timeout_cb)(http, http->timeout_data))
|
||||
break;
|
||||
else if (!http->timeout_cb && errno != EAGAIN)
|
||||
break;
|
||||
}
|
||||
else if (errno != EINTR)
|
||||
break;
|
||||
#endif /* WIN32 */
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_SSL */
|
||||
else
|
||||
{
|
||||
if (!http->blocking)
|
||||
{
|
||||
while (!httpWait(http, 10000))
|
||||
while (!httpWait(http, http->wait_value))
|
||||
{
|
||||
if (http->timeout_cb && (*http->timeout_cb)(http, http->timeout_data))
|
||||
continue;
|
||||
@@ -2132,7 +2163,7 @@ _httpReadCDSA(
|
||||
* Make sure we have data before we read...
|
||||
*/
|
||||
|
||||
while (!_httpWait(http, 10000, 0))
|
||||
while (!_httpWait(http, http->wait_value, 0))
|
||||
{
|
||||
if (http->timeout_cb && (*http->timeout_cb)(http, http->timeout_data))
|
||||
continue;
|
||||
@@ -2186,8 +2217,11 @@ _httpReadGNUTLS(
|
||||
size_t length) /* I - Number of bytes to read */
|
||||
{
|
||||
http_t *http; /* HTTP connection */
|
||||
ssize_t bytes; /* Bytes read */
|
||||
|
||||
|
||||
DEBUG_printf(("6_httpReadGNUTLS(ptr=%p, data=%p, length=%d)", ptr, data, (int)length));
|
||||
|
||||
http = (http_t *)ptr;
|
||||
|
||||
if (!http->blocking)
|
||||
@@ -2196,7 +2230,7 @@ _httpReadGNUTLS(
|
||||
* Make sure we have data before we read...
|
||||
*/
|
||||
|
||||
while (!_httpWait(http, 10000, 0))
|
||||
while (!_httpWait(http, http->wait_value, 0))
|
||||
{
|
||||
if (http->timeout_cb && (*http->timeout_cb)(http, http->timeout_data))
|
||||
continue;
|
||||
@@ -2206,7 +2240,9 @@ _httpReadGNUTLS(
|
||||
}
|
||||
}
|
||||
|
||||
return (recv(http->fd, data, length, 0));
|
||||
bytes = recv(http->fd, data, length, 0);
|
||||
DEBUG_printf(("6_httpReadGNUTLS: bytes=%d", (int)bytes));
|
||||
return (bytes);
|
||||
}
|
||||
#endif /* HAVE_SSL && HAVE_GNUTLS */
|
||||
|
||||
@@ -2287,28 +2323,13 @@ httpReconnect(http_t *http) /* I - Connection to server */
|
||||
|
||||
DEBUG_printf(("2httpReconnect: New socket=%d", http->fd));
|
||||
|
||||
if (http->timeout_value.tv_sec > 0)
|
||||
{
|
||||
#ifdef WIN32
|
||||
DWORD timeout_value = http->timeout_value.tv_sec * 1000 +
|
||||
http->timeout_value.tv_usec / 1000;
|
||||
/* Timeout in milliseconds */
|
||||
|
||||
setsockopt(http->fd, SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout_value,
|
||||
sizeof(timeout_value));
|
||||
setsockopt(http->fd, SOL_SOCKET, SO_SNDTIMEO, (char *)&timeout_value,
|
||||
sizeof(timeout_value));
|
||||
#else
|
||||
setsockopt(http->fd, SOL_SOCKET, SO_RCVTIMEO, &(http->timeout_value),
|
||||
sizeof(http->timeout_value));
|
||||
setsockopt(http->fd, SOL_SOCKET, SO_SNDTIMEO, &(http->timeout_value),
|
||||
sizeof(http->timeout_value));
|
||||
#endif /* WIN32 */
|
||||
}
|
||||
if (http->timeout_value > 0)
|
||||
http_set_timeout(http->fd, http->timeout_value);
|
||||
|
||||
http->hostaddr = &(addr->addr);
|
||||
http->error = 0;
|
||||
http->status = HTTP_CONTINUE;
|
||||
http->state = HTTP_WAITING;
|
||||
|
||||
#ifdef HAVE_SSL
|
||||
if (http->encryption == HTTP_ENCRYPT_ALWAYS)
|
||||
@@ -2417,7 +2438,7 @@ httpSetCredentials(http_t *http, /* I - Connection to server */
|
||||
|
||||
_httpFreeCredentials(http->tls_credentials);
|
||||
|
||||
http->tls_credentials = _httpConvertCredentials(credentials);
|
||||
http->tls_credentials = _httpCreateCredentials(credentials);
|
||||
|
||||
return (http->tls_credentials ? 0 : -1);
|
||||
}
|
||||
@@ -2580,30 +2601,14 @@ httpSetTimeout(
|
||||
if (!http || timeout <= 0.0)
|
||||
return;
|
||||
|
||||
http->timeout_cb = cb;
|
||||
http->timeout_data = user_data;
|
||||
http->timeout_value.tv_sec = (int)timeout;
|
||||
http->timeout_value.tv_usec = (int)(timeout * 1000000) % 1000000;
|
||||
http->timeout_cb = cb;
|
||||
http->timeout_data = user_data;
|
||||
http->timeout_value = timeout;
|
||||
|
||||
if (http->fd >= 0)
|
||||
{
|
||||
#ifdef WIN32
|
||||
DWORD timeout_value = http->timeout_value.tv_sec * 1000 +
|
||||
http->timeout_value.tv_usec / 1000;
|
||||
/* Timeout in milliseconds */
|
||||
http_set_timeout(http->fd, timeout);
|
||||
|
||||
setsockopt(http->fd, SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout_value,
|
||||
sizeof(timeout_value));
|
||||
setsockopt(http->fd, SOL_SOCKET, SO_SNDTIMEO, (char *)&timeout_value,
|
||||
sizeof(timeout_value));
|
||||
|
||||
#else
|
||||
setsockopt(http->fd, SOL_SOCKET, SO_RCVTIMEO, &(http->timeout_value),
|
||||
sizeof(http->timeout_value));
|
||||
setsockopt(http->fd, SOL_SOCKET, SO_SNDTIMEO, &(http->timeout_value),
|
||||
sizeof(http->timeout_value));
|
||||
#endif /* WIN32 */
|
||||
}
|
||||
http_set_wait(http);
|
||||
}
|
||||
|
||||
|
||||
@@ -3189,7 +3194,19 @@ _httpWriteGNUTLS(
|
||||
const void *data, /* I - Data buffer */
|
||||
size_t length) /* I - Number of bytes to write */
|
||||
{
|
||||
return (send(((http_t *)ptr)->fd, data, length, 0));
|
||||
ssize_t bytes; /* Bytes written */
|
||||
|
||||
|
||||
DEBUG_printf(("6_httpWriteGNUTLS(ptr=%p, data=%p, length=%d)", ptr, data,
|
||||
(int)length));
|
||||
#ifdef DEBUG
|
||||
http_debug_hex("_httpWriteGNUTLS", data, (int)length);
|
||||
#endif /* DEBUG */
|
||||
|
||||
bytes = send(((http_t *)ptr)->fd, data, length, 0);
|
||||
DEBUG_printf(("_httpWriteGNUTLS: bytes=%d", (int)bytes));
|
||||
|
||||
return (bytes);
|
||||
}
|
||||
#endif /* HAVE_SSL && HAVE_GNUTLS */
|
||||
|
||||
@@ -3310,7 +3327,7 @@ http_bio_read(BIO *h, /* I - BIO data */
|
||||
* Make sure we have data before we read...
|
||||
*/
|
||||
|
||||
while (!_httpWait(http, 10000, 0))
|
||||
while (!_httpWait(http, http->wait_value, 0))
|
||||
{
|
||||
if (http->timeout_cb && (*http->timeout_cb)(http, http->timeout_data))
|
||||
continue;
|
||||
@@ -3363,7 +3380,7 @@ http_debug_hex(const char *prefix, /* I - Prefix for line */
|
||||
if (_cups_debug_fd < 0 || _cups_debug_level < 6)
|
||||
return;
|
||||
|
||||
DEBUG_printf(("6%s: %d bytes:\n", prefix, bytes));
|
||||
DEBUG_printf(("6%s: %d bytes:", prefix, bytes));
|
||||
|
||||
snprintf(line, sizeof(line), "6%s: ", prefix);
|
||||
start = line + strlen(line);
|
||||
@@ -3470,7 +3487,8 @@ http_read_ssl(http_t *http, /* I - Connection to server */
|
||||
|
||||
|
||||
error = SSLRead(http->tls, buf, len, &processed);
|
||||
|
||||
DEBUG_printf(("6http_read_ssl: error=%d, processed=%d", (int)error,
|
||||
(int)processed));
|
||||
switch (error)
|
||||
{
|
||||
case 0 :
|
||||
@@ -3483,7 +3501,7 @@ http_read_ssl(http_t *http, /* I - Connection to server */
|
||||
else
|
||||
{
|
||||
result = -1;
|
||||
errno = EINTR;
|
||||
errno = EINTR;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -3494,12 +3512,13 @@ http_read_ssl(http_t *http, /* I - Connection to server */
|
||||
else
|
||||
{
|
||||
result = -1;
|
||||
errno = EPIPE;
|
||||
errno = EPIPE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return (result);
|
||||
|
||||
# elif defined(HAVE_SSPISSL)
|
||||
return _sspiRead((_sspi_struct_t*) http->tls, buf, len);
|
||||
# endif /* HAVE_LIBSSL */
|
||||
@@ -3754,43 +3773,92 @@ http_set_credentials(http_t *http) /* I - Connection to server */
|
||||
return (error);
|
||||
}
|
||||
# endif /* HAVE_CDSASSL && HAVE_SECCERTIFICATECOPYDATA */
|
||||
#endif /* HAVE_SSL */
|
||||
|
||||
|
||||
/*
|
||||
* 'http_set_timeout()' - Set the socket timeout values.
|
||||
*/
|
||||
|
||||
static void
|
||||
http_set_timeout(int fd, /* I - File descriptor */
|
||||
double timeout) /* I - Timeout in seconds */
|
||||
{
|
||||
#ifdef WIN32
|
||||
DWORD tv = (DWORD)(timeout * 1000);
|
||||
/* Timeout in milliseconds */
|
||||
|
||||
setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(tv));
|
||||
setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, (char *)&tv, sizeof(tv));
|
||||
|
||||
#else
|
||||
struct timeval tv; /* Timeout in secs and usecs */
|
||||
|
||||
tv.tv_sec = (int)timeout;
|
||||
tv.tv_usec = (int)(1000000 * fmod(timeout, 1.0));
|
||||
|
||||
setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
|
||||
setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv));
|
||||
#endif /* WIN32 */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'http_set_wait()' - Set the default wait value for reads.
|
||||
*/
|
||||
|
||||
static void
|
||||
http_set_wait(http_t *http) /* I - Connection to server */
|
||||
{
|
||||
if (http->blocking)
|
||||
{
|
||||
http->wait_value = (int)(http->timeout_value * 1000);
|
||||
|
||||
if (http->wait_value <= 0)
|
||||
http->wait_value = 60000;
|
||||
}
|
||||
else
|
||||
http->wait_value = 10000;
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_SSL
|
||||
/*
|
||||
* 'http_setup_ssl()' - Set up SSL/TLS support on a connection.
|
||||
*/
|
||||
|
||||
static int /* O - Status of connection */
|
||||
static int /* O - 0 on success, -1 on failure */
|
||||
http_setup_ssl(http_t *http) /* I - Connection to server */
|
||||
{
|
||||
_cups_globals_t *cg = _cupsGlobals();
|
||||
/* Pointer to library globals */
|
||||
int any_root; /* Allow any root */
|
||||
char *hostname; /* Hostname */
|
||||
|
||||
# ifdef HAVE_LIBSSL
|
||||
SSL_CTX *context; /* Context for encryption */
|
||||
BIO *bio; /* BIO data */
|
||||
SSL_CTX *context; /* Context for encryption */
|
||||
BIO *bio; /* BIO data */
|
||||
const char *message = NULL;/* Error message */
|
||||
# elif defined(HAVE_GNUTLS)
|
||||
int status; /* Status of handshake */
|
||||
gnutls_certificate_client_credentials *credentials;
|
||||
/* TLS credentials */
|
||||
# elif defined(HAVE_CDSASSL)
|
||||
OSStatus error; /* Error code */
|
||||
const char *message = NULL; /* Error message */
|
||||
char *hostname; /* Hostname */
|
||||
OSStatus error; /* Error code */
|
||||
const char *message = NULL;/* Error message */
|
||||
# ifdef HAVE_SECCERTIFICATECOPYDATA
|
||||
cups_array_t *credentials; /* Credentials array */
|
||||
cups_array_t *names; /* CUPS distinguished names */
|
||||
CFArrayRef dn_array; /* CF distinguished names array */
|
||||
CFIndex count; /* Number of credentials */
|
||||
CFDataRef data; /* Certificate data */
|
||||
int i; /* Looping var */
|
||||
http_credential_t
|
||||
*credential; /* Credential data */
|
||||
cups_array_t *credentials; /* Credentials array */
|
||||
cups_array_t *names; /* CUPS distinguished names */
|
||||
CFArrayRef dn_array; /* CF distinguished names array */
|
||||
CFIndex count; /* Number of credentials */
|
||||
CFDataRef data; /* Certificate data */
|
||||
int i; /* Looping var */
|
||||
http_credential_t *credential; /* Credential data */
|
||||
# endif /* HAVE_SECCERTIFICATECOPYDATA */
|
||||
# elif defined(HAVE_SSPISSL)
|
||||
TCHAR username[256]; /* Username returned from GetUserName() */
|
||||
TCHAR commonName[256]; /* Common name for certificate */
|
||||
DWORD dwSize; /* 32 bit size */
|
||||
TCHAR username[256]; /* Username returned from GetUserName() */
|
||||
TCHAR commonName[256];/* Common name for certificate */
|
||||
DWORD dwSize; /* 32 bit size */
|
||||
# endif /* HAVE_LIBSSL */
|
||||
|
||||
|
||||
@@ -3805,7 +3873,11 @@ http_setup_ssl(http_t *http) /* I - Connection to server */
|
||||
else
|
||||
any_root = cg->any_root;
|
||||
|
||||
hostname = httpAddrLocalhost(http->hostaddr) ? "localhost" : http->hostname;
|
||||
|
||||
# ifdef HAVE_LIBSSL
|
||||
(void)any_root;
|
||||
|
||||
context = SSL_CTX_new(SSLv23_client_method());
|
||||
|
||||
SSL_CTX_set_options(context, SSL_OP_NO_SSLv2); /* Only use SSLv3 or TLS */
|
||||
@@ -3814,16 +3886,19 @@ http_setup_ssl(http_t *http) /* I - Connection to server */
|
||||
BIO_ctrl(bio, BIO_C_SET_FILE_PTR, 0, (char *)http);
|
||||
|
||||
http->tls = SSL_new(context);
|
||||
SSL_set_bio(http->tls_credentials, bio, bio);
|
||||
SSL_set_bio(http->tls, bio, bio);
|
||||
|
||||
SSL_set_tlsext_host_name(http->tls, hostname);
|
||||
|
||||
if (SSL_connect(http->tls) != 1)
|
||||
{
|
||||
# ifdef DEBUG
|
||||
unsigned long error; /* Error code */
|
||||
|
||||
while ((error = ERR_get_error()) != 0)
|
||||
DEBUG_printf(("8http_setup_ssl: %s", ERR_error_string(error, NULL)));
|
||||
# endif /* DEBUG */
|
||||
{
|
||||
message = ERR_error_string(error, NULL);
|
||||
DEBUG_printf(("8http_setup_ssl: %s", message));
|
||||
}
|
||||
|
||||
SSL_CTX_free(context);
|
||||
SSL_free(http->tls);
|
||||
@@ -3836,16 +3911,26 @@ http_setup_ssl(http_t *http) /* I - Connection to server */
|
||||
# endif /* WIN32 */
|
||||
http->status = HTTP_ERROR;
|
||||
|
||||
return (HTTP_ERROR);
|
||||
if (!message)
|
||||
message = _("Unable to establish a secure connection to host.");
|
||||
|
||||
_cupsSetError(IPP_PKI_ERROR, message, 1);
|
||||
|
||||
return (-1);
|
||||
}
|
||||
|
||||
# elif defined(HAVE_GNUTLS)
|
||||
(void)any_root;
|
||||
|
||||
credentials = (gnutls_certificate_client_credentials *)
|
||||
malloc(sizeof(gnutls_certificate_client_credentials));
|
||||
if (credentials == NULL)
|
||||
{
|
||||
http->error = errno;
|
||||
DEBUG_printf(("8http_setup_ssl: Unable to allocate credentials: %s",
|
||||
strerror(errno)));
|
||||
http->error = errno;
|
||||
http->status = HTTP_ERROR;
|
||||
_cupsSetHTTPError(HTTP_ERROR);
|
||||
|
||||
return (-1);
|
||||
}
|
||||
@@ -3854,22 +3939,32 @@ http_setup_ssl(http_t *http) /* I - Connection to server */
|
||||
|
||||
gnutls_init(&http->tls, GNUTLS_CLIENT);
|
||||
gnutls_set_default_priority(http->tls);
|
||||
gnutls_server_name_set(http->tls, GNUTLS_NAME_DNS, hostname,
|
||||
strlen(hostname));
|
||||
gnutls_credentials_set(http->tls, GNUTLS_CRD_CERTIFICATE, *credentials);
|
||||
gnutls_transport_set_ptr(http->tls, (gnutls_transport_ptr)http);
|
||||
gnutls_transport_set_pull_function(http->tls, _httpReadGNUTLS);
|
||||
gnutls_transport_set_push_function(http->tls, _httpWriteGNUTLS);
|
||||
|
||||
if ((gnutls_handshake(http->tls)) != GNUTLS_E_SUCCESS)
|
||||
while ((status = gnutls_handshake(http->tls)) != GNUTLS_E_SUCCESS)
|
||||
{
|
||||
http->error = errno;
|
||||
http->status = HTTP_ERROR;
|
||||
DEBUG_printf(("8http_setup_ssl: gnutls_handshake returned %d (%s)",
|
||||
status, gnutls_strerror(status)));
|
||||
|
||||
gnutls_deinit(http->tls);
|
||||
gnutls_certificate_free_credentials(*credentials);
|
||||
free(credentials);
|
||||
http->tls = NULL;
|
||||
if (gnutls_error_is_fatal(status))
|
||||
{
|
||||
http->error = EIO;
|
||||
http->status = HTTP_ERROR;
|
||||
|
||||
return (-1);
|
||||
_cupsSetError(IPP_PKI_ERROR, gnutls_strerror(status), 0);
|
||||
|
||||
gnutls_deinit(http->tls);
|
||||
gnutls_certificate_free_credentials(*credentials);
|
||||
free(credentials);
|
||||
http->tls = NULL;
|
||||
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
|
||||
http->tls_credentials = credentials;
|
||||
@@ -3877,8 +3972,9 @@ http_setup_ssl(http_t *http) /* I - Connection to server */
|
||||
# elif defined(HAVE_CDSASSL)
|
||||
if ((error = SSLNewContext(false, &http->tls)))
|
||||
{
|
||||
http->error = error;
|
||||
http->error = errno;
|
||||
http->status = HTTP_ERROR;
|
||||
_cupsSetHTTPError(HTTP_ERROR);
|
||||
|
||||
return (-1);
|
||||
}
|
||||
@@ -3892,13 +3988,6 @@ http_setup_ssl(http_t *http) /* I - Connection to server */
|
||||
DEBUG_printf(("4http_setup_ssl: SSLSetIOFuncs, error=%d", (int)error));
|
||||
}
|
||||
|
||||
if (!error)
|
||||
{
|
||||
error = SSLSetProtocolVersionEnabled(http->tls, kSSLProtocol2, false);
|
||||
DEBUG_printf(("4http_setup_ssl: SSLSetProtocolVersionEnabled, error=%d",
|
||||
(int)error));
|
||||
}
|
||||
|
||||
if (!error)
|
||||
{
|
||||
error = SSLSetAllowsAnyRoot(http->tls, any_root);
|
||||
@@ -3920,6 +4009,27 @@ http_setup_ssl(http_t *http) /* I - Connection to server */
|
||||
cg->expired_root, (int)error));
|
||||
}
|
||||
|
||||
# ifdef HAVE_SSLSETPROTOCOLVERSIONMAX
|
||||
if (!error)
|
||||
{
|
||||
error = SSLSetProtocolVersionMax(http->tls, kTLSProtocol1);
|
||||
DEBUG_printf(("4http_setup_ssl: SSLSetProtocolVersionMax(kTLSProtocol1), "
|
||||
"error=%d", (int)error));
|
||||
}
|
||||
# endif /* HAVE_SSLSETPROTOCOLVERSIONMAX */
|
||||
|
||||
/*
|
||||
* In general, don't verify certificates since things like the common name
|
||||
* often do not match...
|
||||
*/
|
||||
|
||||
if (!error)
|
||||
{
|
||||
error = SSLSetEnableCertVerify(http->tls, false);
|
||||
DEBUG_printf(("4http_setup_ssl: SSLSetEnableCertVerify, error=%d",
|
||||
(int)error));
|
||||
}
|
||||
|
||||
# ifdef HAVE_SECCERTIFICATECOPYDATA
|
||||
if (!error)
|
||||
{
|
||||
@@ -3945,24 +4055,21 @@ http_setup_ssl(http_t *http) /* I - Connection to server */
|
||||
|
||||
if (!error && cg->server_cert_cb != NULL)
|
||||
{
|
||||
error = SSLSetEnableCertVerify(http->tls, false);
|
||||
DEBUG_printf(("4http_setup_ssl: SSLSetEnableCertVerify, error=%d",
|
||||
(int)error));
|
||||
|
||||
if (!error)
|
||||
{
|
||||
error = SSLSetSessionOption(http->tls,
|
||||
kSSLSessionOptionBreakOnServerAuth, true);
|
||||
DEBUG_printf(("4http_setup_ssl: kSSLSessionOptionBreakOnServerAuth, "
|
||||
"error=%d", (int)error));
|
||||
}
|
||||
error = SSLSetSessionOption(http->tls,
|
||||
kSSLSessionOptionBreakOnServerAuth, true);
|
||||
DEBUG_printf(("4http_setup_ssl: kSSLSessionOptionBreakOnServerAuth, "
|
||||
"error=%d", (int)error));
|
||||
}
|
||||
# endif /* HAVE_SECCERTIFICATECOPYDATA */
|
||||
|
||||
/*
|
||||
* Let the server know which hostname/domain we are trying to connect to
|
||||
* in case it wants to serve up a certificate with a matching common name.
|
||||
*/
|
||||
|
||||
if (!error)
|
||||
{
|
||||
hostname = httpAddrLocalhost(http->hostaddr) ? "localhost" : http->hostname;
|
||||
error = SSLSetPeerDomainName(http->tls, hostname, strlen(hostname));
|
||||
error = SSLSetPeerDomainName(http->tls, hostname, strlen(hostname));
|
||||
|
||||
DEBUG_printf(("4http_setup_ssl: SSLSetPeerDomainName, error=%d",
|
||||
(int)error));
|
||||
@@ -3976,7 +4083,7 @@ http_setup_ssl(http_t *http) /* I - Connection to server */
|
||||
{
|
||||
error = SSLHandshake(http->tls);
|
||||
|
||||
DEBUG_printf(("4_httpWait: SSLHandshake returned %d.", (int)error));
|
||||
DEBUG_printf(("4http_setup_ssl: SSLHandshake returned %d.", (int)error));
|
||||
|
||||
switch (error)
|
||||
{
|
||||
@@ -4001,8 +4108,8 @@ http_setup_ssl(http_t *http) /* I - Connection to server */
|
||||
httpFreeCredentials(credentials);
|
||||
}
|
||||
|
||||
DEBUG_printf(("4_httpWait: Server certificate callback returned "
|
||||
"%d.", (int)error));
|
||||
DEBUG_printf(("4http_setup_ssl: Server certificate callback "
|
||||
"returned %d.", (int)error));
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -4042,7 +4149,7 @@ http_setup_ssl(http_t *http) /* I - Connection to server */
|
||||
error = (cg->client_cert_cb)(http, http->tls, names,
|
||||
cg->client_cert_data);
|
||||
|
||||
DEBUG_printf(("4_httpWait: Client certificate callback "
|
||||
DEBUG_printf(("4http_setup_ssl: Client certificate callback "
|
||||
"returned %d.", (int)error));
|
||||
}
|
||||
|
||||
@@ -4121,7 +4228,10 @@ http_setup_ssl(http_t *http) /* I - Connection to server */
|
||||
http->tls = _sspiAlloc();
|
||||
|
||||
if (!http->tls)
|
||||
{
|
||||
_cupsSetHTTPError(HTTP_ERROR);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
http->tls->sock = http->fd;
|
||||
dwSize = sizeof(username) / sizeof(TCHAR);
|
||||
@@ -4134,26 +4244,38 @@ http_setup_ssl(http_t *http) /* I - Connection to server */
|
||||
{
|
||||
_sspiFree(http->tls_credentials);
|
||||
http->tls_credentials = NULL;
|
||||
|
||||
http->error = EIO;
|
||||
http->status = HTTP_ERROR;
|
||||
|
||||
_cupsSetError(IPP_PKI_ERROR,
|
||||
_("Unable to establish a secure connection to host."), 1);
|
||||
|
||||
return (-1);
|
||||
}
|
||||
|
||||
_sspiSetAllowsAnyRoot(http->tls_credentials, TRUE);
|
||||
_sspiSetAllowsAnyRoot(http->tls_credentials, any_root);
|
||||
_sspiSetAllowsExpiredCerts(http->tls_credentials, TRUE);
|
||||
|
||||
if (!_sspiConnect(http->tls_credentials, http->hostname))
|
||||
if (!_sspiConnect(http->tls_credentials, hostname))
|
||||
{
|
||||
_sspiFree(http->tls_credentials);
|
||||
http->tls_credentials = NULL;
|
||||
|
||||
http->error = EIO;
|
||||
http->status = HTTP_ERROR;
|
||||
|
||||
_cupsSetError(IPP_PKI_ERROR,
|
||||
_("Unable to establish a secure connection to host."), 1);
|
||||
|
||||
return (-1);
|
||||
}
|
||||
# endif /* HAVE_CDSASSL */
|
||||
|
||||
return (0);
|
||||
}
|
||||
#endif /* HAVE_SSL */
|
||||
|
||||
|
||||
#ifdef HAVE_SSL
|
||||
/*
|
||||
* 'http_shutdown_ssl()' - Shut down SSL/TLS on a connection.
|
||||
*/
|
||||
@@ -4164,11 +4286,11 @@ http_shutdown_ssl(http_t *http) /* I - Connection to server */
|
||||
# ifdef HAVE_LIBSSL
|
||||
SSL_CTX *context; /* Context for encryption */
|
||||
|
||||
context = SSL_get_SSL_CTX(http->tls_credentials);
|
||||
context = SSL_get_SSL_CTX(http->tls);
|
||||
|
||||
SSL_shutdown(http->tls_credentials);
|
||||
SSL_shutdown(http->tls);
|
||||
SSL_CTX_free(context);
|
||||
SSL_free(http->tls_credentials);
|
||||
SSL_free(http->tls);
|
||||
|
||||
# elif defined(HAVE_GNUTLS)
|
||||
gnutls_certificate_client_credentials *credentials;
|
||||
@@ -4308,6 +4430,62 @@ http_write(http_t *http, /* I - Connection to server */
|
||||
|
||||
while (length > 0)
|
||||
{
|
||||
if (http->timeout_cb)
|
||||
{
|
||||
#ifdef HAVE_POLL
|
||||
struct pollfd pfd; /* Polled file descriptor */
|
||||
#else
|
||||
fd_set output_set; /* Output ready for write? */
|
||||
struct timeval timeout; /* Timeout value */
|
||||
#endif /* HAVE_POLL */
|
||||
int nfds; /* Result from select()/poll() */
|
||||
|
||||
do
|
||||
{
|
||||
#ifdef HAVE_POLL
|
||||
pfd.fd = http->fd;
|
||||
pfd.events = POLLOUT;
|
||||
|
||||
while ((nfds = poll(&pfd, 1, http->wait_value)) < 0 &&
|
||||
(errno == EINTR || errno == EAGAIN));
|
||||
|
||||
#else
|
||||
do
|
||||
{
|
||||
FD_ZERO(&output_set);
|
||||
FD_SET(http->fd, &output_set);
|
||||
|
||||
timeout.tv_sec = http->wait_value / 1000;
|
||||
timeout.tv_usec = 1000 * (http->wait_value % 1000);
|
||||
|
||||
nfds = select(http->fd + 1, NULL, &output_set, NULL, &timeout);
|
||||
}
|
||||
# ifdef WIN32
|
||||
while (nfds < 0 && (WSAGetLastError() == WSAEINTR ||
|
||||
WSAGetLastError() == WSAEWOULDBLOCK));
|
||||
# else
|
||||
while (nfds < 0 && (errno == EINTR || errno == EAGAIN));
|
||||
# endif /* WIN32 */
|
||||
#endif /* HAVE_POLL */
|
||||
|
||||
if (nfds < 0)
|
||||
{
|
||||
http->error = errno;
|
||||
return (-1);
|
||||
}
|
||||
else if (nfds == 0 && !(*http->timeout_cb)(http, http->timeout_data))
|
||||
{
|
||||
#ifdef WIN32
|
||||
http->error = WSAEWOULDBLOCK;
|
||||
#else
|
||||
http->error = EWOULDBLOCK;
|
||||
#endif /* WIN32 */
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
while (nfds <= 0);
|
||||
}
|
||||
|
||||
#ifdef HAVE_SSL
|
||||
if (http->tls)
|
||||
bytes = http_write_ssl(http, buffer, length);
|
||||
|
||||
+71
-53
@@ -89,7 +89,9 @@ static const char * const ipp_status_oks[] = /* "OK" status codes */
|
||||
"server-error-busy",
|
||||
"server-error-job-canceled",
|
||||
"server-error-multiple-document-jobs-not-supported",
|
||||
"server-error-printer-is-deactivated"
|
||||
"server-error-printer-is-deactivated",
|
||||
"server-error-too-many-jobs",
|
||||
"server-error-too-many-documents"
|
||||
},
|
||||
* const ipp_status_1000s[] = /* CUPS internal */
|
||||
{
|
||||
@@ -100,8 +102,8 @@ static const char * const ipp_status_oks[] = /* "OK" status codes */
|
||||
static char * const ipp_std_ops[] =
|
||||
{
|
||||
/* 0x0000 - 0x000f */
|
||||
"unknown-00",
|
||||
"unknown-01",
|
||||
"0x00",
|
||||
"0x01",
|
||||
"Print-Job",
|
||||
"Print-URI",
|
||||
"Validate-Job",
|
||||
@@ -115,7 +117,7 @@ static char * const ipp_std_ops[] =
|
||||
"Hold-Job",
|
||||
"Release-Job",
|
||||
"Restart-Job",
|
||||
"unknown-0f",
|
||||
"0x0f",
|
||||
|
||||
/* 0x0010 - 0x001f */
|
||||
"Pause-Printer",
|
||||
@@ -132,11 +134,11 @@ static char * const ipp_std_ops[] =
|
||||
"Cancel-Subscription",
|
||||
"Get-Notifications",
|
||||
"Send-Notifications",
|
||||
"unknown-1e",
|
||||
"unknown-1f",
|
||||
"0x1e",
|
||||
"0x1f",
|
||||
|
||||
/* 0x0020 - 0x002f */
|
||||
"unknown-20",
|
||||
"0x20",
|
||||
"Get-Printer-Support-Files",
|
||||
"Enable-Printer",
|
||||
"Disable-Printer",
|
||||
@@ -156,7 +158,7 @@ static char * const ipp_std_ops[] =
|
||||
/* 0x0030 - 0x003b */
|
||||
"Promote-Job",
|
||||
"Schedule-Job-After",
|
||||
"unknown-32",
|
||||
"0x32",
|
||||
"Cancel-Document",
|
||||
"Get-Document-Attributes",
|
||||
"Get-Documents",
|
||||
@@ -165,7 +167,8 @@ static char * const ipp_std_ops[] =
|
||||
"Cancel-Jobs",
|
||||
"Cancel-My-Jobs",
|
||||
"Resubmit-Job",
|
||||
"Close-Job"
|
||||
"Close-Job",
|
||||
"Identify-Printer"
|
||||
},
|
||||
* const ipp_cups_ops[] =
|
||||
{
|
||||
@@ -205,46 +208,47 @@ static char * const ipp_std_ops[] =
|
||||
/* 0x06 */
|
||||
"event-notification-attributes-tag",
|
||||
/* 0x07 */
|
||||
"unknown-08", /* 0x08 */
|
||||
"unknown-09", /* 0x09 */
|
||||
"unknown-0a", /* 0x0a */
|
||||
"unknown-0b", /* 0x0b */
|
||||
"unknown-0c", /* 0x0c */
|
||||
"unknown-0d", /* 0x0d */
|
||||
"unknown-0e", /* 0x0e */
|
||||
"unknown-0f", /* 0x0f */
|
||||
"0x08", /* 0x08 */
|
||||
"document-attributes-tag",
|
||||
/* 0x09 */
|
||||
"0x0a", /* 0x0a */
|
||||
"0x0b", /* 0x0b */
|
||||
"0x0c", /* 0x0c */
|
||||
"0x0d", /* 0x0d */
|
||||
"0x0e", /* 0x0e */
|
||||
"0x0f", /* 0x0f */
|
||||
"unsupported", /* 0x10 */
|
||||
"default", /* 0x11 */
|
||||
"unknown", /* 0x12 */
|
||||
"no-value", /* 0x13 */
|
||||
"unknown-14", /* 0x14 */
|
||||
"0x14", /* 0x14 */
|
||||
"not-settable", /* 0x15 */
|
||||
"delete-attribute", /* 0x16 */
|
||||
"admin-define", /* 0x17 */
|
||||
"unknown-18", /* 0x18 */
|
||||
"unknown-19", /* 0x19 */
|
||||
"unknown-1a", /* 0x1a */
|
||||
"unknown-1b", /* 0x1b */
|
||||
"unknown-1c", /* 0x1c */
|
||||
"unknown-1d", /* 0x1d */
|
||||
"unknown-1e", /* 0x1e */
|
||||
"unknown-1f", /* 0x1f */
|
||||
"unknown-20", /* 0x20 */
|
||||
"0x18", /* 0x18 */
|
||||
"0x19", /* 0x19 */
|
||||
"0x1a", /* 0x1a */
|
||||
"0x1b", /* 0x1b */
|
||||
"0x1c", /* 0x1c */
|
||||
"0x1d", /* 0x1d */
|
||||
"0x1e", /* 0x1e */
|
||||
"0x1f", /* 0x1f */
|
||||
"0x20", /* 0x20 */
|
||||
"integer", /* 0x21 */
|
||||
"boolean", /* 0x22 */
|
||||
"enum", /* 0x23 */
|
||||
"unknown-24", /* 0x24 */
|
||||
"unknown-25", /* 0x25 */
|
||||
"unknown-26", /* 0x26 */
|
||||
"unknown-27", /* 0x27 */
|
||||
"unknown-28", /* 0x28 */
|
||||
"unknown-29", /* 0x29 */
|
||||
"unknown-2a", /* 0x2a */
|
||||
"unknown-2b", /* 0x2b */
|
||||
"unknown-2c", /* 0x2c */
|
||||
"unknown-2d", /* 0x2d */
|
||||
"unknown-2e", /* 0x2e */
|
||||
"unknown-2f", /* 0x2f */
|
||||
"0x24", /* 0x24 */
|
||||
"0x25", /* 0x25 */
|
||||
"0x26", /* 0x26 */
|
||||
"0x27", /* 0x27 */
|
||||
"0x28", /* 0x28 */
|
||||
"0x29", /* 0x29 */
|
||||
"0x2a", /* 0x2a */
|
||||
"0x2b", /* 0x2b */
|
||||
"0x2c", /* 0x2c */
|
||||
"0x2d", /* 0x2d */
|
||||
"0x2e", /* 0x2e */
|
||||
"0x2f", /* 0x2f */
|
||||
"octetString", /* 0x30 */
|
||||
"dateTime", /* 0x31 */
|
||||
"resolution", /* 0x32 */
|
||||
@@ -253,18 +257,18 @@ static char * const ipp_std_ops[] =
|
||||
"textWithLanguage", /* 0x35 */
|
||||
"nameWithLanguage", /* 0x36 */
|
||||
"endCollection", /* 0x37 */
|
||||
"unknown-38", /* 0x38 */
|
||||
"unknown-39", /* 0x39 */
|
||||
"unknown-3a", /* 0x3a */
|
||||
"unknown-3b", /* 0x3b */
|
||||
"unknown-3c", /* 0x3c */
|
||||
"unknown-3d", /* 0x3d */
|
||||
"unknown-3e", /* 0x3e */
|
||||
"unknown-3f", /* 0x3f */
|
||||
"unknown-40", /* 0x40 */
|
||||
"0x38", /* 0x38 */
|
||||
"0x39", /* 0x39 */
|
||||
"0x3a", /* 0x3a */
|
||||
"0x3b", /* 0x3b */
|
||||
"0x3c", /* 0x3c */
|
||||
"0x3d", /* 0x3d */
|
||||
"0x3e", /* 0x3e */
|
||||
"0x3f", /* 0x3f */
|
||||
"0x40", /* 0x40 */
|
||||
"textWithoutLanguage",/* 0x41 */
|
||||
"nameWithoutLanguage",/* 0x42 */
|
||||
"unknown-43", /* 0x43 */
|
||||
"0x43", /* 0x43 */
|
||||
"keyword", /* 0x44 */
|
||||
"uri", /* 0x45 */
|
||||
"uriScheme", /* 0x46 */
|
||||
@@ -370,6 +374,16 @@ _ippAttrString(ipp_attribute_t *attr, /* I - Attribute */
|
||||
bufptr += strlen(ptr);
|
||||
break;
|
||||
}
|
||||
else if (!strcmp(attr->name, "operations-supported"))
|
||||
{
|
||||
ptr = ippOpString(val->integer);
|
||||
|
||||
if (buffer && bufptr < bufend)
|
||||
strlcpy(bufptr, ptr, bufend - bufptr + 1);
|
||||
|
||||
bufptr += strlen(ptr);
|
||||
break;
|
||||
}
|
||||
|
||||
case IPP_TAG_INTEGER :
|
||||
if (buffer && bufptr < bufend)
|
||||
@@ -437,6 +451,7 @@ _ippAttrString(ipp_attribute_t *attr, /* I - Attribute */
|
||||
case IPP_TAG_KEYWORD :
|
||||
case IPP_TAG_CHARSET :
|
||||
case IPP_TAG_URI :
|
||||
case IPP_TAG_URISCHEME :
|
||||
case IPP_TAG_MIMETYPE :
|
||||
case IPP_TAG_LANGUAGE :
|
||||
case IPP_TAG_TEXTLANG :
|
||||
@@ -544,10 +559,10 @@ ippErrorString(ipp_status_t error) /* I - Error status */
|
||||
return (ipp_status_1000s[error - IPP_AUTHENTICATION_CANCELED]);
|
||||
|
||||
/*
|
||||
* No, build an "unknown-xxxx" error string...
|
||||
* No, build an "0xxxxx" error string...
|
||||
*/
|
||||
|
||||
sprintf(cg->ipp_unknown, "unknown-%04x", error);
|
||||
sprintf(cg->ipp_unknown, "0x%04x", error);
|
||||
|
||||
return (cg->ipp_unknown);
|
||||
}
|
||||
@@ -617,10 +632,10 @@ ippOpString(ipp_op_t op) /* I - Operation ID */
|
||||
return (ipp_cups_ops2[0]);
|
||||
|
||||
/*
|
||||
* No, build an "unknown-xxxx" operation string...
|
||||
* No, build an "0xxxxx" operation string...
|
||||
*/
|
||||
|
||||
sprintf(cg->ipp_unknown, "unknown-%04x", op);
|
||||
sprintf(cg->ipp_unknown, "0x%04x", op);
|
||||
|
||||
return (cg->ipp_unknown);
|
||||
}
|
||||
@@ -638,6 +653,9 @@ ippOpValue(const char *name) /* I - Textual name */
|
||||
int i;
|
||||
|
||||
|
||||
if (!strncmp(name, "0x", 2))
|
||||
return ((ipp_op_t)strtol(name + 2, NULL, 16));
|
||||
|
||||
for (i = 0; i < (sizeof(ipp_std_ops) / sizeof(ipp_std_ops[0])); i ++)
|
||||
if (!_cups_strcasecmp(name, ipp_std_ops[i]))
|
||||
return ((ipp_op_t)i);
|
||||
|
||||
+134
-64
@@ -1116,7 +1116,7 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
if ((buffer = ipp_buffer_get()) == NULL)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: Unable to get read buffer!");
|
||||
DEBUG_puts("1ippReadIO: Unable to get read buffer.");
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
@@ -1134,7 +1134,7 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
if ((*cb)(src, buffer, 8) < 8)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: Unable to read header!");
|
||||
DEBUG_puts("1ippReadIO: Unable to read header.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1193,7 +1193,7 @@ ippReadIO(void *src, /* I - Data source */
|
||||
* No more attributes left...
|
||||
*/
|
||||
|
||||
DEBUG_puts("2ippReadIO: IPP_TAG_END!");
|
||||
DEBUG_puts("2ippReadIO: IPP_TAG_END.");
|
||||
|
||||
ipp->state = IPP_DATA;
|
||||
break;
|
||||
@@ -1225,7 +1225,7 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
if ((*cb)(src, buffer, 2) < 2)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: unable to read name length!");
|
||||
DEBUG_puts("1ippReadIO: unable to read name length.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1234,7 +1234,8 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
if (n >= IPP_BUF_SIZE)
|
||||
{
|
||||
DEBUG_printf(("1ippReadIO: bad name length %d!", n));
|
||||
_cupsSetError(IPP_ERROR, _("IPP name larger than 32767 bytes."), 1);
|
||||
DEBUG_printf(("1ippReadIO: bad name length %d.", n));
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1250,7 +1251,8 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
if (ipp->current == NULL)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: Attribute without name and no current");
|
||||
_cupsSetError(IPP_ERROR, _("IPP attribute has no name."), 1);
|
||||
DEBUG_puts("1ippReadIO: Attribute without name and no current.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1285,6 +1287,9 @@ ippReadIO(void *src, /* I - Data source */
|
||||
(tag < IPP_TAG_TEXT || tag > IPP_TAG_MIMETYPE) &&
|
||||
tag != IPP_TAG_NOVALUE)
|
||||
{
|
||||
_cupsSetError(IPP_ERROR,
|
||||
_("IPP 1setOf attribute with incompatible value "
|
||||
"tags."), 1);
|
||||
DEBUG_printf(("1ippReadIO: 1setOf value tag %x(%s) != %x(%s)",
|
||||
value_tag, ippTagString(value_tag), tag,
|
||||
ippTagString(tag)));
|
||||
@@ -1292,8 +1297,53 @@ ippReadIO(void *src, /* I - Data source */
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
}
|
||||
else if (value_tag == IPP_TAG_INTEGER ||
|
||||
value_tag == IPP_TAG_RANGE)
|
||||
{
|
||||
/*
|
||||
* Integer and rangeOfInteger values can sometimes be mixed; accept
|
||||
* sets of differing values...
|
||||
*/
|
||||
|
||||
if (tag != IPP_TAG_INTEGER && tag != IPP_TAG_RANGE)
|
||||
{
|
||||
_cupsSetError(IPP_ERROR,
|
||||
_("IPP 1setOf attribute with incompatible value "
|
||||
"tags."), 1);
|
||||
DEBUG_printf(("1ippReadIO: 1setOf value tag %x(%s) != %x(%s)",
|
||||
value_tag, ippTagString(value_tag), tag,
|
||||
ippTagString(tag)));
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
if (value_tag == IPP_TAG_INTEGER && tag == IPP_TAG_RANGE)
|
||||
{
|
||||
/*
|
||||
* Convert integer values to rangeOfInteger values...
|
||||
*/
|
||||
|
||||
int i; /* Looping var */
|
||||
|
||||
DEBUG_printf(("1ippReadIO: Converting %s attribute to "
|
||||
"rangeOfInteger.", attr->name));
|
||||
|
||||
attr->value_tag = IPP_TAG_RANGE;
|
||||
|
||||
for (i = attr->num_values, value = attr->values;
|
||||
i > 0;
|
||||
i --, value ++)
|
||||
{
|
||||
n = value->integer;
|
||||
value->range.lower = value->range.upper = n;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (value_tag != tag)
|
||||
{
|
||||
_cupsSetError(IPP_ERROR,
|
||||
_("IPP 1setOf attribute with incompatible value "
|
||||
"tags."), 1);
|
||||
DEBUG_printf(("1ippReadIO: value tag %x(%s) != %x(%s)",
|
||||
value_tag, ippTagString(value_tag), tag,
|
||||
ippTagString(tag)));
|
||||
@@ -1311,7 +1361,6 @@ ippReadIO(void *src, /* I - Data source */
|
||||
{
|
||||
ipp_attribute_t *temp; /* Pointer to new buffer */
|
||||
|
||||
|
||||
DEBUG_printf(("2ippReadIO: reallocating for up to %d values...",
|
||||
attr->num_values + IPP_MAX_VALUES));
|
||||
|
||||
@@ -1323,6 +1372,7 @@ ippReadIO(void *src, /* I - Data source */
|
||||
(attr->num_values + IPP_MAX_VALUES - 1) *
|
||||
sizeof(ipp_value_t))) == NULL)
|
||||
{
|
||||
_cupsSetHTTPError(HTTP_ERROR);
|
||||
DEBUG_puts("1ippReadIO: Unable to resize attribute");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
@@ -1351,7 +1401,8 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
if (n)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: member name not empty!");
|
||||
_cupsSetError(IPP_ERROR, _("IPP member name is not empty."), 1);
|
||||
DEBUG_puts("1ippReadIO: member name not empty.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1376,7 +1427,7 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
if ((*cb)(src, buffer, n) < n)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: unable to read name!");
|
||||
DEBUG_puts("1ippReadIO: unable to read name.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1388,7 +1439,8 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
if ((attr = ipp->current = _ippAddAttr(ipp, 1)) == NULL)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: unable to allocate attribute!");
|
||||
_cupsSetHTTPError(HTTP_ERROR);
|
||||
DEBUG_puts("1ippReadIO: unable to allocate attribute.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1411,7 +1463,7 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
if ((*cb)(src, buffer, 2) < 2)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: unable to read value length!");
|
||||
DEBUG_puts("1ippReadIO: unable to read value length.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1419,20 +1471,35 @@ ippReadIO(void *src, /* I - Data source */
|
||||
n = (buffer[0] << 8) | buffer[1];
|
||||
DEBUG_printf(("2ippReadIO: value length=%d", n));
|
||||
|
||||
if (n >= IPP_BUF_SIZE)
|
||||
{
|
||||
_cupsSetError(IPP_ERROR,
|
||||
_("IPP value larger than 32767 bytes."), 1);
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d.", n));
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
switch (tag)
|
||||
{
|
||||
case IPP_TAG_INTEGER :
|
||||
case IPP_TAG_ENUM :
|
||||
if (n != 4)
|
||||
{
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d!", n));
|
||||
if (tag == IPP_TAG_INTEGER)
|
||||
_cupsSetError(IPP_ERROR,
|
||||
_("IPP integer value not 4 bytes."), 1);
|
||||
else
|
||||
_cupsSetError(IPP_ERROR,
|
||||
_("IPP enum value not 4 bytes."), 1);
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d.", n));
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
if ((*cb)(src, buffer, 4) < 4)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: Unable to read integer value!");
|
||||
DEBUG_puts("1ippReadIO: Unable to read integer value.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1440,20 +1507,25 @@ ippReadIO(void *src, /* I - Data source */
|
||||
n = (((((buffer[0] << 8) | buffer[1]) << 8) | buffer[2]) << 8) |
|
||||
buffer[3];
|
||||
|
||||
value->integer = n;
|
||||
if (attr->value_tag == IPP_TAG_RANGE)
|
||||
value->range.lower = value->range.upper = n;
|
||||
else
|
||||
value->integer = n;
|
||||
break;
|
||||
|
||||
case IPP_TAG_BOOLEAN :
|
||||
if (n != 1)
|
||||
{
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d!", n));
|
||||
_cupsSetError(IPP_ERROR, _("IPP boolean value not 1 byte."),
|
||||
1);
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d.", n));
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
if ((*cb)(src, buffer, 1) < 1)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: Unable to read boolean value!");
|
||||
DEBUG_puts("1ippReadIO: Unable to read boolean value.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1487,16 +1559,9 @@ ippReadIO(void *src, /* I - Data source */
|
||||
case IPP_TAG_CHARSET :
|
||||
case IPP_TAG_LANGUAGE :
|
||||
case IPP_TAG_MIMETYPE :
|
||||
if (n >= IPP_BUF_SIZE)
|
||||
{
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d!", n));
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
if ((*cb)(src, buffer, n) < n)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: unable to read name!");
|
||||
DEBUG_puts("1ippReadIO: unable to read string value.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1509,14 +1574,16 @@ ippReadIO(void *src, /* I - Data source */
|
||||
case IPP_TAG_DATE :
|
||||
if (n != 11)
|
||||
{
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d!", n));
|
||||
_cupsSetError(IPP_ERROR, _("IPP date value not 11 bytes."),
|
||||
1);
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d.", n));
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
if ((*cb)(src, value->date, 11) < 11)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: Unable to read date value!");
|
||||
DEBUG_puts("1ippReadIO: Unable to read date value.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1525,14 +1592,16 @@ ippReadIO(void *src, /* I - Data source */
|
||||
case IPP_TAG_RESOLUTION :
|
||||
if (n != 9)
|
||||
{
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d!", n));
|
||||
_cupsSetError(IPP_ERROR,
|
||||
_("IPP resolution value not 9 bytes."), 1);
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d.", n));
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
if ((*cb)(src, buffer, 9) < 9)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: Unable to read resolution value!");
|
||||
DEBUG_puts("1ippReadIO: Unable to read resolution value.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1550,14 +1619,16 @@ ippReadIO(void *src, /* I - Data source */
|
||||
case IPP_TAG_RANGE :
|
||||
if (n != 8)
|
||||
{
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d!", n));
|
||||
_cupsSetError(IPP_ERROR,
|
||||
_("IPP rangeOfInteger value not 8 bytes."), 1);
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d.", n));
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
if ((*cb)(src, buffer, 8) < 8)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: Unable to read range value!");
|
||||
DEBUG_puts("1ippReadIO: Unable to read range value.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1572,9 +1643,17 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
case IPP_TAG_TEXTLANG :
|
||||
case IPP_TAG_NAMELANG :
|
||||
if (n >= IPP_BUF_SIZE || n < 4)
|
||||
if (n < 4)
|
||||
{
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d!", n));
|
||||
if (tag == IPP_TAG_TEXTLANG)
|
||||
_cupsSetError(IPP_ERROR,
|
||||
_("IPP textWithLanguage value less than "
|
||||
"minimum 4 bytes."), 1);
|
||||
else
|
||||
_cupsSetError(IPP_ERROR,
|
||||
_("IPP nameWithLanguage value less than "
|
||||
"minimum 4 bytes."), 1);
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d.", n));
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1582,7 +1661,7 @@ ippReadIO(void *src, /* I - Data source */
|
||||
if ((*cb)(src, buffer, n) < n)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: Unable to read string w/language "
|
||||
"value!");
|
||||
"value.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1593,10 +1672,13 @@ ippReadIO(void *src, /* I - Data source */
|
||||
* text-with-language and name-with-language are composite
|
||||
* values:
|
||||
*
|
||||
* charset-length
|
||||
* charset
|
||||
* language-length
|
||||
* language
|
||||
* text-length
|
||||
* text
|
||||
*
|
||||
* The "charset" field name is an unfortunate typo from
|
||||
* CUPS 1.0...
|
||||
*/
|
||||
|
||||
n = (bufptr[0] << 8) | bufptr[1];
|
||||
@@ -1604,7 +1686,9 @@ ippReadIO(void *src, /* I - Data source */
|
||||
if ((bufptr + 2 + n) >= (buffer + IPP_BUF_SIZE) ||
|
||||
n >= sizeof(string))
|
||||
{
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d!", n));
|
||||
_cupsSetError(IPP_ERROR,
|
||||
_("IPP language length overflows value."), 1);
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d.", n));
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1619,7 +1703,9 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
if ((bufptr + 2 + n) >= (buffer + IPP_BUF_SIZE))
|
||||
{
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d!", n));
|
||||
_cupsSetError(IPP_ERROR,
|
||||
_("IPP string length overflows value."), 1);
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d.", n));
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1637,15 +1723,17 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
if (n > 0)
|
||||
{
|
||||
_cupsSetError(IPP_ERROR,
|
||||
_("IPP begCollection value not 0 bytes."), 1);
|
||||
DEBUG_puts("1ippReadIO: begCollection tag with value length "
|
||||
"> 0!");
|
||||
"> 0.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
if (ippReadIO(src, cb, 1, ipp, value->collection) == IPP_ERROR)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: Unable to read collection value!");
|
||||
DEBUG_puts("1ippReadIO: Unable to read collection value.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1656,8 +1744,10 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
if (n > 0)
|
||||
{
|
||||
_cupsSetError(IPP_ERROR,
|
||||
_("IPP endCollection value not 0 bytes."), 1);
|
||||
DEBUG_puts("1ippReadIO: endCollection tag with value length "
|
||||
"> 0!");
|
||||
"> 0.");
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
@@ -1670,16 +1760,9 @@ ippReadIO(void *src, /* I - Data source */
|
||||
* we need to carry over...
|
||||
*/
|
||||
|
||||
if (n >= IPP_BUF_SIZE)
|
||||
{
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d!", n));
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
if ((*cb)(src, buffer, n) < n)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: Unable to read member name value!");
|
||||
DEBUG_puts("1ippReadIO: Unable to read member name value.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1699,25 +1782,12 @@ ippReadIO(void *src, /* I - Data source */
|
||||
break;
|
||||
|
||||
default : /* Other unsupported values */
|
||||
if (n > IPP_MAX_LENGTH)
|
||||
{
|
||||
DEBUG_printf(("1ippReadIO: bad value length %d!", n));
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
if (!value)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: NULL value!");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
|
||||
value->unknown.length = n;
|
||||
if (n > 0)
|
||||
{
|
||||
if ((value->unknown.data = malloc(n)) == NULL)
|
||||
{
|
||||
_cupsSetHTTPError(HTTP_ERROR);
|
||||
DEBUG_puts("1ippReadIO: Unable to allocate value");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
@@ -1725,7 +1795,7 @@ ippReadIO(void *src, /* I - Data source */
|
||||
|
||||
if ((*cb)(src, value->unknown.data, n) < n)
|
||||
{
|
||||
DEBUG_puts("1ippReadIO: Unable to read unsupported value!");
|
||||
DEBUG_puts("1ippReadIO: Unable to read unsupported value.");
|
||||
ipp_buffer_release(buffer);
|
||||
return (IPP_ERROR);
|
||||
}
|
||||
@@ -1753,7 +1823,7 @@ ippReadIO(void *src, /* I - Data source */
|
||||
break; /* anti-compiler-warning-code */
|
||||
}
|
||||
|
||||
DEBUG_printf(("1ippReadIO: returning ipp->state=%d!", ipp->state));
|
||||
DEBUG_printf(("1ippReadIO: returning ipp->state=%d.", ipp->state));
|
||||
ipp_buffer_release(buffer);
|
||||
|
||||
return (ipp->state);
|
||||
|
||||
@@ -73,6 +73,7 @@ typedef enum ipp_tag_e /**** Format tags for attributes ****/
|
||||
IPP_TAG_UNSUPPORTED_GROUP, /* Unsupported attributes group */
|
||||
IPP_TAG_SUBSCRIPTION, /* Subscription group */
|
||||
IPP_TAG_EVENT_NOTIFICATION, /* Event group */
|
||||
IPP_TAG_DOCUMENT = 0x09, /* Document group */
|
||||
IPP_TAG_UNSUPPORTED_VALUE = 0x10, /* Unsupported value */
|
||||
IPP_TAG_DEFAULT, /* Default value */
|
||||
IPP_TAG_UNKNOWN, /* Unknown value */
|
||||
@@ -241,6 +242,7 @@ typedef enum ipp_op_e /**** IPP operations ****/
|
||||
IPP_CANCEL_MY_JOBS, /* Cancel-My-Jobs */
|
||||
IPP_RESUBMIT_JOB, /* Resubmit-Job */
|
||||
IPP_CLOSE_JOB, /* Close-Job */
|
||||
IPP_IDENTIFY_PRINTER, /* Identify-Printer (proposed IPP JPS3) */
|
||||
IPP_PRIVATE = 0x4000, /* Reserved @private@ */
|
||||
CUPS_GET_DEFAULT, /* Get the default printer */
|
||||
CUPS_GET_PRINTERS, /* Get a list of printers and/or classes */
|
||||
@@ -312,6 +314,8 @@ typedef enum ipp_status_e /**** IPP status codes ****/
|
||||
IPP_ERROR_JOB_CANCELED, /* server-error-job-canceled */
|
||||
IPP_MULTIPLE_JOBS_NOT_SUPPORTED, /* server-error-multiple-document-jobs-not-supported */
|
||||
IPP_PRINTER_IS_DEACTIVATED, /* server-error-printer-is-deactivated */
|
||||
IPP_TOO_MANY_JOBS, /* server-error-too-many-jobs */
|
||||
IPP_TOO_MANY_DOCUMENTS, /* server-error-too-many-documents */
|
||||
|
||||
IPP_AUTHENTICATION_CANCELED = 0x1000, /* Authentication canceled by user @since CUPS 1.5/Mac OS X 10.7@ */
|
||||
IPP_PKI_ERROR, /* Error negotiating a secure connection @since CUPS 1.5/Mac OS X 10.7@ */
|
||||
|
||||
+1
-1
@@ -80,7 +80,7 @@ static const char * const lang_encodings[] =
|
||||
"cp1256", "cp1257",
|
||||
"cp1258", "koi8-r",
|
||||
"koi8-u", "iso-8859-11",
|
||||
"iso-8859-16", "mac-roman",
|
||||
"iso-8859-16", "mac",
|
||||
"unknown", "unknown",
|
||||
"unknown", "unknown",
|
||||
"unknown", "unknown",
|
||||
|
||||
+15
-14
@@ -25,6 +25,8 @@ _cupsStrFree
|
||||
_cupsStrRetain
|
||||
_cupsStrScand
|
||||
_cupsStrStatistics
|
||||
_cups_strcasecmp
|
||||
_cups_strncasecmp
|
||||
_cups_strcpy
|
||||
_cups_strlcat
|
||||
_cups_strlcpy
|
||||
@@ -35,12 +37,23 @@ _httpCreate
|
||||
_httpEncodeURI
|
||||
_httpPeek
|
||||
_httpResolveURI
|
||||
_httpSetTimeout
|
||||
_httpWait
|
||||
_ippAddAttr
|
||||
_ippAttrString
|
||||
_ippFindOption
|
||||
_ippFreeAttr
|
||||
_ppdCacheCreateWithFile
|
||||
_ppdCacheCreateWithPPD
|
||||
_ppdCacheDestroy
|
||||
_ppdCacheGetBin
|
||||
_ppdCacheGetInputSlot
|
||||
_ppdCacheGetMediaType
|
||||
_ppdCacheGetOutputBin
|
||||
_ppdCacheGetPageSize
|
||||
_ppdCacheGetSize
|
||||
_ppdCacheGetSource
|
||||
_ppdCacheGetType
|
||||
_ppdCacheWriteFile
|
||||
_ppdFreeLanguages
|
||||
_ppdGetEncoding
|
||||
_ppdGetLanguages
|
||||
@@ -48,25 +61,12 @@ _ppdHashName
|
||||
_ppdLocalizedAttr
|
||||
_ppdNormalizeMakeAndModel
|
||||
_ppdParseOptions
|
||||
_pwgCreateWithFile
|
||||
_pwgDestroy
|
||||
_pwgWriteFile
|
||||
_pwgGenerateSize
|
||||
_pwgInitSize
|
||||
_pwgMediaForLegacy
|
||||
_pwgMediaForPPD
|
||||
_pwgMediaForPWG
|
||||
_pwgMediaForSize
|
||||
_pwgCreateWithPPD
|
||||
_pwgGetBin
|
||||
_pwgGetInputSlot
|
||||
_pwgGetMediaType
|
||||
_pwgGetOutputBin
|
||||
_pwgGetPageSize
|
||||
_pwgGetSize
|
||||
_pwgGetSource
|
||||
_pwgGetType
|
||||
_pwgInputSlotForSource
|
||||
_pwgMediaTypeForType
|
||||
_pwgPageSizeForMedia
|
||||
cupsAddDest
|
||||
@@ -257,6 +257,7 @@ httpSetCredentials
|
||||
httpSetExpect
|
||||
httpSetField
|
||||
httpSetLength
|
||||
httpSetTimeout
|
||||
httpStatus
|
||||
httpTrace
|
||||
httpUpdate
|
||||
|
||||
+5
-3
@@ -257,11 +257,13 @@ cupsMarkOptions(
|
||||
* Map sides to duplex option...
|
||||
*/
|
||||
|
||||
if (!strcmp(sides, "one-sided"))
|
||||
if (!strcmp(sides, "one-sided") && cache->sides_1sided)
|
||||
ppd_mark_option(ppd, cache->sides_option, cache->sides_1sided);
|
||||
else if (!strcmp(sides, "two-sided-long-edge"))
|
||||
else if (!strcmp(sides, "two-sided-long-edge") &&
|
||||
cache->sides_2sided_long)
|
||||
ppd_mark_option(ppd, cache->sides_option, cache->sides_2sided_long);
|
||||
else if (!strcmp(sides, "two-sided-short-edge"))
|
||||
else if (!strcmp(sides, "two-sided-short-edge") &&
|
||||
cache->sides_2sided_short)
|
||||
ppd_mark_option(ppd, cache->sides_option, cache->sides_2sided_short);
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -873,11 +873,8 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
|
||||
pwg_name = "top";
|
||||
else if (!_cups_strncasecmp(choice->choice, "Side", 4))
|
||||
pwg_name = "side";
|
||||
else if (!_cups_strcasecmp(choice->choice, "Roll") ||
|
||||
!_cups_strcasecmp(choice->choice, "Roll1"))
|
||||
else if (!_cups_strcasecmp(choice->choice, "Roll"))
|
||||
pwg_name = "main-roll";
|
||||
else if (!_cups_strcasecmp(choice->choice, "Roll2"))
|
||||
pwg_name = "alternate-roll";
|
||||
else
|
||||
{
|
||||
/*
|
||||
@@ -938,6 +935,8 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
|
||||
pwg_name = "stationery-letterhead";
|
||||
else if (!_cups_strncasecmp(choice->choice, "Preprint", 8))
|
||||
pwg_name = "stationery-preprinted";
|
||||
else if (!_cups_strcasecmp(choice->choice, "Recycled"))
|
||||
pwg_name = "stationery-recycled";
|
||||
else if (!_cups_strncasecmp(choice->choice, "Transparen", 10))
|
||||
pwg_name = "transparency";
|
||||
else
|
||||
@@ -1272,7 +1271,8 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
|
||||
|
||||
if (filter)
|
||||
cupsArrayAdd(pc->filters,
|
||||
"application/vnd.cups-command application/postscript 0 -");
|
||||
"application/vnd.cups-command application/postscript 100 "
|
||||
"commandtops");
|
||||
}
|
||||
|
||||
if ((ppd_attr = ppdFindAttr(ppd, "cupsPreFilter", NULL)) != NULL)
|
||||
|
||||
+163
-11
@@ -43,6 +43,7 @@
|
||||
* ppd_compare_coptions() - Compare two custom options.
|
||||
* ppd_compare_options() - Compare two options.
|
||||
* ppd_decode() - Decode a string value...
|
||||
* ppd_free_filters() - Free the filters array.
|
||||
* ppd_free_group() - Free a single UI group.
|
||||
* ppd_free_option() - Free a single option.
|
||||
* ppd_get_coption() - Get a custom option record.
|
||||
@@ -52,6 +53,7 @@
|
||||
* ppd_hash_option() - Generate a hash of the option name...
|
||||
* ppd_read() - Read a line from a PPD file, skipping comment
|
||||
* lines as necessary.
|
||||
* ppd_update_filters() - Update the filters array as needed.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -110,6 +112,7 @@ static int ppd_compare_coptions(ppd_coption_t *a,
|
||||
ppd_coption_t *b);
|
||||
static int ppd_compare_options(ppd_option_t *a, ppd_option_t *b);
|
||||
static int ppd_decode(char *string);
|
||||
static void ppd_free_filters(ppd_file_t *ppd);
|
||||
static void ppd_free_group(ppd_group_t *group);
|
||||
static void ppd_free_option(ppd_option_t *option);
|
||||
static ppd_coption_t *ppd_get_coption(ppd_file_t *ppd, const char *name);
|
||||
@@ -125,6 +128,8 @@ static int ppd_read(cups_file_t *fp, _ppd_line_t *line,
|
||||
char *keyword, char *option, char *text,
|
||||
char **string, int ignoreblank,
|
||||
_cups_globals_t *cg);
|
||||
static int ppd_update_filters(ppd_file_t *ppd,
|
||||
_cups_globals_t *cg);
|
||||
|
||||
|
||||
/*
|
||||
@@ -138,7 +143,6 @@ ppdClose(ppd_file_t *ppd) /* I - PPD file record */
|
||||
ppd_emul_t *emul; /* Current emulation */
|
||||
ppd_group_t *group; /* Current group */
|
||||
char **font; /* Current font */
|
||||
char **filter; /* Current filter */
|
||||
ppd_attr_t **attr; /* Current attribute */
|
||||
ppd_coption_t *coption; /* Current custom option */
|
||||
ppd_cparam_t *cparam; /* Current custom parameter */
|
||||
@@ -211,13 +215,7 @@ ppdClose(ppd_file_t *ppd) /* I - PPD file record */
|
||||
* Free any filters...
|
||||
*/
|
||||
|
||||
if (ppd->num_filters > 0)
|
||||
{
|
||||
for (i = ppd->num_filters, filter = ppd->filters; i > 0; i --, filter ++)
|
||||
_cupsStrFree(*filter);
|
||||
|
||||
ppd_free(ppd->filters);
|
||||
}
|
||||
ppd_free_filters(ppd);
|
||||
|
||||
/*
|
||||
* Free any fonts...
|
||||
@@ -880,11 +878,10 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
|
||||
ppd->num_filters ++;
|
||||
|
||||
/*
|
||||
* Copy filter string and prevent it from being freed below...
|
||||
* Retain a copy of the filter string...
|
||||
*/
|
||||
|
||||
*filter = string;
|
||||
string = NULL;
|
||||
*filter = _cupsStrRetain(string);
|
||||
}
|
||||
else if (!strcmp(keyword, "Throughput"))
|
||||
ppd->throughput = atoi(string);
|
||||
@@ -1961,6 +1958,17 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Update the filters array as needed...
|
||||
*/
|
||||
|
||||
if (!ppd_update_filters(ppd, cg))
|
||||
{
|
||||
ppdClose(ppd);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Create the sorted options array and set the option back-pointer for
|
||||
* each choice and custom option...
|
||||
@@ -2376,6 +2384,30 @@ ppd_decode(char *string) /* I - String to decode */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ppd_free_filters()' - Free the filters array.
|
||||
*/
|
||||
|
||||
static void
|
||||
ppd_free_filters(ppd_file_t *ppd) /* I - PPD file */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
char **filter; /* Current filter */
|
||||
|
||||
|
||||
if (ppd->num_filters > 0)
|
||||
{
|
||||
for (i = ppd->num_filters, filter = ppd->filters; i > 0; i --, filter ++)
|
||||
_cupsStrFree(*filter);
|
||||
|
||||
ppd_free(ppd->filters);
|
||||
|
||||
ppd->num_filters = 0;
|
||||
ppd->filters = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ppd_free_group()' - Free a single UI group.
|
||||
*/
|
||||
@@ -3139,6 +3171,126 @@ ppd_read(cups_file_t *fp, /* I - File to read from */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ppd_update_filters()' - Update the filters array as needed.
|
||||
*
|
||||
* This function re-populates the filters array with cupsFilter2 entries that
|
||||
* have been stripped of the destination MIME media types and any maxsize hints.
|
||||
*
|
||||
* (All for backwards-compatibility)
|
||||
*/
|
||||
|
||||
static int /* O - 1 on success, 0 on failure */
|
||||
ppd_update_filters(ppd_file_t *ppd,/* I - PPD file */
|
||||
_cups_globals_t *cg) /* I - Global data */
|
||||
{
|
||||
ppd_attr_t *attr; /* Current cupsFilter2 value */
|
||||
char srcsuper[16], /* Source MIME media type */
|
||||
srctype[256],
|
||||
dstsuper[16], /* Destination MIME media type */
|
||||
dsttype[256],
|
||||
program[1024], /* Command to run */
|
||||
*ptr, /* Pointer into command to run */
|
||||
buffer[1024], /* Re-written cupsFilter value */
|
||||
**filter; /* Current filter */
|
||||
int cost; /* Cost of filter */
|
||||
|
||||
|
||||
DEBUG_printf(("4ppd_update_filters(ppd=%p, cg=%p)", ppd, cg));
|
||||
|
||||
/*
|
||||
* See if we have any cupsFilter2 lines...
|
||||
*/
|
||||
|
||||
if ((attr = ppdFindAttr(ppd, "cupsFilter2", NULL)) == NULL)
|
||||
{
|
||||
DEBUG_puts("5ppd_update_filters: No cupsFilter2 keywords present.");
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Yes, free the cupsFilter-defined filters and re-build...
|
||||
*/
|
||||
|
||||
ppd_free_filters(ppd);
|
||||
|
||||
do
|
||||
{
|
||||
/*
|
||||
* Parse the cupsFilter2 string:
|
||||
*
|
||||
* src/type dst/type cost program
|
||||
* src/type dst/type cost maxsize(n) program
|
||||
*/
|
||||
|
||||
DEBUG_printf(("5ppd_update_filters: cupsFilter2=\"%s\"", attr->value));
|
||||
|
||||
if (sscanf(attr->value, "%15[^/]/%255s%*[ \t]%15[^/]/%255s%d%*[ \t]%1023[^\n]",
|
||||
srcsuper, srctype, dstsuper, dsttype, &cost, program) != 6)
|
||||
{
|
||||
DEBUG_puts("5ppd_update_filters: Bad cupsFilter2 line.");
|
||||
cg->ppd_status = PPD_BAD_VALUE;
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
DEBUG_printf(("5ppd_update_filters: srcsuper=\"%s\", srctype=\"%s\", "
|
||||
"dstsuper=\"%s\", dsttype=\"%s\", cost=%d, program=\"%s\"",
|
||||
srcsuper, srctype, dstsuper, dsttype, cost, program));
|
||||
|
||||
if (!strncmp(program, "maxsize(", 8) &&
|
||||
(ptr = strchr(program + 8, ')')) != NULL)
|
||||
{
|
||||
DEBUG_puts("5ppd_update_filters: Found maxsize(nnn).");
|
||||
|
||||
ptr ++;
|
||||
while (_cups_isspace(*ptr))
|
||||
ptr ++;
|
||||
|
||||
_cups_strcpy(program, ptr);
|
||||
DEBUG_printf(("5ppd_update_filters: New program=\"%s\"", program));
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert to cupsFilter format:
|
||||
*
|
||||
* src/type cost program
|
||||
*/
|
||||
|
||||
snprintf(buffer, sizeof(buffer), "%s/%s %d %s", srcsuper, srctype, cost,
|
||||
program);
|
||||
DEBUG_printf(("5ppd_update_filters: Adding \"%s\".", buffer));
|
||||
|
||||
/*
|
||||
* Add a cupsFilter-compatible string to the filters array.
|
||||
*/
|
||||
|
||||
if (ppd->num_filters == 0)
|
||||
filter = malloc(sizeof(char *));
|
||||
else
|
||||
filter = realloc(ppd->filters, sizeof(char *) * (ppd->num_filters + 1));
|
||||
|
||||
if (filter == NULL)
|
||||
{
|
||||
DEBUG_puts("5ppd_update_filters: Out of memory.");
|
||||
cg->ppd_status = PPD_ALLOC_ERROR;
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
ppd->filters = filter;
|
||||
filter += ppd->num_filters;
|
||||
ppd->num_filters ++;
|
||||
|
||||
*filter = _cupsStrAlloc(buffer);
|
||||
}
|
||||
while ((attr = ppdFindNextAttr(ppd, "cupsFilter2", NULL)) != NULL);
|
||||
|
||||
DEBUG_puts("5ppd_update_filters: Completed OK.");
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
|
||||
+2
-2
@@ -103,8 +103,8 @@ static _pwg_media_t const cups_pwg_media[] =
|
||||
_PWG_MEDIA_IN("na_eur-edp_12x14in", NULL, NULL, 12, 14),
|
||||
_PWG_MEDIA_IN("na_arch-b_12x18in", "arch-b", "ARCHB", 12, 18),
|
||||
_PWG_MEDIA_IN("na_12x19_12x19in", NULL, "12x19", 12, 19),
|
||||
_PWG_MEDIA_IN("na_b-plus_12x19.17in", NULL, NULL, 12, 19.17),
|
||||
_PWG_MEDIA_IN("na_super-b_13x19in", "super-b", "SuperB", 13, 19),
|
||||
_PWG_MEDIA_IN("na_b-plus_12x19.17in", NULL, "SuperB", 12, 19.17),
|
||||
_PWG_MEDIA_IN("na_super-b_13x19in", "super-b", "13x19", 13, 19),
|
||||
_PWG_MEDIA_IN("na_c_17x22in", "c", "AnsiC", 17, 22),
|
||||
_PWG_MEDIA_IN("na_arch-c_18x24in", "arch-c", "ARCHC", 18, 24),
|
||||
_PWG_MEDIA_IN("na_d_22x34in", "d", "AnsiD", 22, 34),
|
||||
|
||||
+91
-41
@@ -248,16 +248,9 @@ cupsDoIORequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
|
||||
while ((bytes = (int)read(infile, buffer, sizeof(buffer))) > 0)
|
||||
{
|
||||
if (httpCheck(http))
|
||||
{
|
||||
_httpUpdate(http, &status);
|
||||
|
||||
if (status >= HTTP_MULTIPLE_CHOICES)
|
||||
break;
|
||||
}
|
||||
|
||||
if (httpWrite2(http, buffer, bytes) < bytes)
|
||||
break;
|
||||
if ((status = cupsWriteRequestData(http, buffer, bytes))
|
||||
!= HTTP_CONTINUE)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -265,13 +258,11 @@ cupsDoIORequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
* Get the server's response...
|
||||
*/
|
||||
|
||||
if (status == HTTP_CONTINUE || status == HTTP_OK)
|
||||
if (status != HTTP_ERROR)
|
||||
{
|
||||
response = cupsGetResponse(http, resource);
|
||||
status = http->status;
|
||||
status = httpGetStatus(http);
|
||||
}
|
||||
else
|
||||
httpFlush(http);
|
||||
|
||||
DEBUG_printf(("2cupsDoIORequest: status=%d", status));
|
||||
|
||||
@@ -283,26 +274,24 @@ cupsDoIORequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
break;
|
||||
}
|
||||
|
||||
if (response)
|
||||
if (response && outfile >= 0)
|
||||
{
|
||||
if (outfile >= 0)
|
||||
{
|
||||
/*
|
||||
* Write trailing data to file...
|
||||
*/
|
||||
/*
|
||||
* Write trailing data to file...
|
||||
*/
|
||||
|
||||
while ((bytes = (int)httpRead2(http, buffer, sizeof(buffer))) > 0)
|
||||
if (write(outfile, buffer, bytes) < bytes)
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Flush any remaining data...
|
||||
*/
|
||||
while ((bytes = (int)httpRead2(http, buffer, sizeof(buffer))) > 0)
|
||||
if (write(outfile, buffer, bytes) < bytes)
|
||||
break;
|
||||
}
|
||||
|
||||
httpFlush(http);
|
||||
}
|
||||
if (http->state != HTTP_WAITING)
|
||||
{
|
||||
/*
|
||||
* Flush any remaining data...
|
||||
*/
|
||||
|
||||
httpFlush(http);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,7 +332,8 @@ cupsDoRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP_
|
||||
*
|
||||
* Use this function to get the response for an IPP request sent using
|
||||
* cupsSendDocument() or cupsSendRequest(). For requests that return
|
||||
* additional data, use httpRead() after getting a successful response.
|
||||
* additional data, use httpRead() after getting a successful response,
|
||||
* otherwise call httpFlush() to complete the response processing.
|
||||
*
|
||||
* @since CUPS 1.4/Mac OS X 10.6@
|
||||
*/
|
||||
@@ -426,6 +416,8 @@ cupsGetResponse(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
response = NULL;
|
||||
|
||||
_cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
|
||||
http->status = status = HTTP_ERROR;
|
||||
http->error = EIO;
|
||||
}
|
||||
}
|
||||
else if (status != HTTP_ERROR)
|
||||
@@ -451,7 +443,7 @@ cupsGetResponse(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
if (!cupsDoAuthentication(http, "POST", resource))
|
||||
httpReconnect(http);
|
||||
else
|
||||
status = HTTP_AUTHORIZATION_CANCELED;
|
||||
http->status = status = HTTP_AUTHORIZATION_CANCELED;
|
||||
}
|
||||
|
||||
#ifdef HAVE_SSL
|
||||
@@ -484,6 +476,8 @@ cupsGetResponse(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
attr ? attr->values[0].string.text :
|
||||
ippErrorString(response->request.status.status_code), 0);
|
||||
}
|
||||
else if (status == HTTP_ERROR)
|
||||
_cupsSetError(IPP_INTERNAL_ERROR, strerror(http->error), 0);
|
||||
else if (status != HTTP_OK)
|
||||
_cupsSetHTTPError(status);
|
||||
|
||||
@@ -637,6 +631,25 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
if ((http = _cupsConnect()) == NULL)
|
||||
return (HTTP_SERVICE_UNAVAILABLE);
|
||||
|
||||
/*
|
||||
* If the prior request was not flushed out, do so now...
|
||||
*/
|
||||
|
||||
if (http->state == HTTP_GET_SEND ||
|
||||
http->state == HTTP_POST_SEND)
|
||||
{
|
||||
DEBUG_puts("2cupsSendRequest: Flush prior response.");
|
||||
httpFlush(http);
|
||||
}
|
||||
else if (http->state != HTTP_WAITING)
|
||||
{
|
||||
DEBUG_printf(("1cupsSendRequest: Unknown HTTP state (%d), bailing.",
|
||||
http->state));
|
||||
_cupsSetError(IPP_INTERNAL_ERROR, strerror(EINVAL), 0);
|
||||
|
||||
return (HTTP_ERROR);
|
||||
}
|
||||
|
||||
#ifdef HAVE_SSL
|
||||
/*
|
||||
* See if we have an auth-info attribute and are communicating over
|
||||
@@ -648,7 +661,7 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
!httpAddrLocalhost(http->hostaddr) && !http->tls &&
|
||||
httpEncryption(http, HTTP_ENCRYPT_REQUIRED))
|
||||
{
|
||||
_cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
|
||||
DEBUG_puts("1cupsSendRequest: Unable to encrypt connection.");
|
||||
return (HTTP_SERVICE_UNAVAILABLE);
|
||||
}
|
||||
#endif /* HAVE_SSL */
|
||||
@@ -658,11 +671,15 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
*/
|
||||
|
||||
if (!_cups_strcasecmp(http->fields[HTTP_FIELD_CONNECTION], "close"))
|
||||
{
|
||||
DEBUG_puts("2cupsSendRequest: Connection: close");
|
||||
httpClearFields(http);
|
||||
if (httpReconnect(http))
|
||||
{
|
||||
_cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
|
||||
DEBUG_puts("1cupsSendRequest: Unable to reconnect.");
|
||||
return (HTTP_SERVICE_UNAVAILABLE);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Loop until we can send the request without authorization problems.
|
||||
@@ -707,9 +724,10 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
|
||||
if (httpPost(http, resource))
|
||||
{
|
||||
DEBUG_puts("2cupsSendRequest: POST failed, reconnecting.");
|
||||
if (httpReconnect(http))
|
||||
{
|
||||
_cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
|
||||
DEBUG_puts("1cupsSendRequest: Unable to reconnect.");
|
||||
return (HTTP_SERVICE_UNAVAILABLE);
|
||||
}
|
||||
else
|
||||
@@ -740,6 +758,8 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
|
||||
if (state == IPP_ERROR)
|
||||
{
|
||||
DEBUG_puts("1cupsSendRequest: Unable to send IPP request.");
|
||||
|
||||
http->status = HTTP_ERROR;
|
||||
http->state = HTTP_WAITING;
|
||||
|
||||
@@ -770,22 +790,38 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
*/
|
||||
|
||||
if (status >= HTTP_MULTIPLE_CHOICES)
|
||||
{
|
||||
_cupsSetHTTPError(status);
|
||||
|
||||
do
|
||||
{
|
||||
status = httpUpdate(http);
|
||||
}
|
||||
while (status != HTTP_ERROR && http->state == HTTP_POST_RECV);
|
||||
|
||||
httpFlush(http);
|
||||
}
|
||||
|
||||
switch (status)
|
||||
{
|
||||
case HTTP_ERROR :
|
||||
case HTTP_CONTINUE :
|
||||
case HTTP_OK :
|
||||
DEBUG_printf(("1cupsSendRequest: Returning %d.", status));
|
||||
return (status);
|
||||
|
||||
case HTTP_UNAUTHORIZED :
|
||||
if (cupsDoAuthentication(http, "POST", resource))
|
||||
{
|
||||
DEBUG_puts("1cupsSendRequest: Returning HTTP_AUTHORIZATION_CANCELED.");
|
||||
return (HTTP_AUTHORIZATION_CANCELED);
|
||||
}
|
||||
|
||||
DEBUG_puts("2cupsSendRequest: Reconnecting after HTTP_UNAUTHORIZED.");
|
||||
|
||||
if (httpReconnect(http))
|
||||
{
|
||||
_cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
|
||||
DEBUG_puts("1cupsSendRequest: Unable to reconnect.");
|
||||
return (HTTP_SERVICE_UNAVAILABLE);
|
||||
}
|
||||
break;
|
||||
@@ -797,15 +833,19 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
* encryption...
|
||||
*/
|
||||
|
||||
DEBUG_puts("2cupsSendRequest: Reconnecting after "
|
||||
"HTTP_UPGRADE_REQUIRED.");
|
||||
|
||||
if (httpReconnect(http))
|
||||
{
|
||||
_cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
|
||||
DEBUG_puts("1cupsSendRequest: Unable to reconnect.");
|
||||
return (HTTP_SERVICE_UNAVAILABLE);
|
||||
}
|
||||
|
||||
DEBUG_puts("2cupsSendRequest: Upgrading to TLS.");
|
||||
if (httpEncryption(http, HTTP_ENCRYPT_REQUIRED))
|
||||
{
|
||||
_cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
|
||||
DEBUG_puts("1cupsSendRequest: Unable to encrypt connection.");
|
||||
return (HTTP_SERVICE_UNAVAILABLE);
|
||||
}
|
||||
break;
|
||||
@@ -818,9 +858,12 @@ cupsSendRequest(http_t *http, /* I - Connection to server or @code CUPS_HTTP
|
||||
|
||||
expect = (http_status_t)0;
|
||||
|
||||
DEBUG_puts("2cupsSendRequest: Reconnecting after "
|
||||
"HTTP_EXPECTATION_FAILED.");
|
||||
|
||||
if (httpReconnect(http))
|
||||
{
|
||||
_cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
|
||||
DEBUG_puts("1cupsSendRequest: Unable to reconnect.");
|
||||
return (HTTP_SERVICE_UNAVAILABLE);
|
||||
}
|
||||
break;
|
||||
@@ -907,6 +950,13 @@ cupsWriteRequestData(
|
||||
if (status >= HTTP_MULTIPLE_CHOICES)
|
||||
{
|
||||
_cupsSetHTTPError(status);
|
||||
|
||||
do
|
||||
{
|
||||
status = httpUpdate(http);
|
||||
}
|
||||
while (status != HTTP_ERROR && http->state == HTTP_POST_RECV);
|
||||
|
||||
httpFlush(http);
|
||||
}
|
||||
|
||||
@@ -1082,7 +1132,7 @@ _cupsSetHTTPError(http_status_t status) /* I - HTTP status code */
|
||||
break;
|
||||
|
||||
case HTTP_ERROR :
|
||||
_cupsSetError(IPP_INTERNAL_ERROR, httpStatus(status), 0);
|
||||
_cupsSetError(IPP_INTERNAL_ERROR, strerror(errno), 0);
|
||||
break;
|
||||
|
||||
default :
|
||||
|
||||
+1
-1
@@ -117,7 +117,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
cupsFileClose(fp);
|
||||
|
||||
if (cupsFinishDocument(CUPS_HTTP_DEFAULT, argv[1]) != HTTP_OK)
|
||||
if (cupsFinishDocument(CUPS_HTTP_DEFAULT, argv[1]) > IPP_OK_SUBST)
|
||||
{
|
||||
puts("Unable to finish document!");
|
||||
return (1);
|
||||
|
||||
+8
-2
@@ -167,6 +167,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
{
|
||||
int i, j, k; /* Looping vars */
|
||||
http_t *http; /* HTTP connection */
|
||||
http_encryption_t encryption; /* Encryption type */
|
||||
http_status_t status; /* Status of GET command */
|
||||
int failures; /* Number of test failures */
|
||||
char buffer[8192]; /* Input buffer */
|
||||
@@ -541,7 +542,13 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
hostname, sizeof(hostname), &port,
|
||||
resource, sizeof(resource));
|
||||
|
||||
http = httpConnectEncrypt(hostname, port, HTTP_ENCRYPT_IF_REQUESTED);
|
||||
if (!_cups_strcasecmp(scheme, "https") || !_cups_strcasecmp(scheme, "ipps") ||
|
||||
port == 443)
|
||||
encryption = HTTP_ENCRYPT_ALWAYS;
|
||||
else
|
||||
encryption = HTTP_ENCRYPT_IF_REQUESTED;
|
||||
|
||||
http = httpConnectEncrypt(hostname, port, encryption);
|
||||
if (http == NULL)
|
||||
{
|
||||
perror(hostname);
|
||||
@@ -558,7 +565,6 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
else
|
||||
printf("GET failed with status %d...\n", status);
|
||||
|
||||
|
||||
start = time(NULL);
|
||||
length = httpGetLength2(http);
|
||||
total = 0;
|
||||
|
||||
+259
-121
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* IPP test program for CUPS.
|
||||
*
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1997-2005 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -38,148 +38,197 @@
|
||||
#endif /* WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
* Local types...
|
||||
*/
|
||||
|
||||
typedef struct _ippdata_t
|
||||
{
|
||||
size_t rpos, /* Read position */
|
||||
wused, /* Bytes used */
|
||||
wsize; /* Max size of buffer */
|
||||
ipp_uchar_t *wbuffer; /* Buffer */
|
||||
} _ippdata_t;
|
||||
|
||||
|
||||
/*
|
||||
* Local globals...
|
||||
*/
|
||||
|
||||
int rpos; /* Current position in buffer */
|
||||
ipp_uchar_t wbuffer[8192]; /* Write buffer */
|
||||
int wused; /* Number of bytes in buffer */
|
||||
ipp_uchar_t collection[] = /* Collection buffer */
|
||||
ipp_uchar_t collection[] = /* Collection buffer */
|
||||
{
|
||||
0x01, 0x01, /* IPP version */
|
||||
0x00, 0x02, /* Print-Job operation */
|
||||
0x00, 0x00, 0x00, 0x01, /* Request ID */
|
||||
0x01, 0x01, /* IPP version */
|
||||
0x00, 0x02, /* Print-Job operation */
|
||||
0x00, 0x00, 0x00, 0x01,
|
||||
/* Request ID */
|
||||
|
||||
IPP_TAG_OPERATION,
|
||||
|
||||
IPP_TAG_CHARSET,
|
||||
0x00, 0x12, /* Name length + name */
|
||||
0x00, 0x12, /* Name length + name */
|
||||
'a','t','t','r','i','b','u','t','e','s','-',
|
||||
'c','h','a','r','s','e','t',
|
||||
0x00, 0x05, /* Value length + value */
|
||||
0x00, 0x05, /* Value length + value */
|
||||
'u','t','f','-','8',
|
||||
|
||||
IPP_TAG_LANGUAGE,
|
||||
0x00, 0x1b, /* Name length + name */
|
||||
0x00, 0x1b, /* Name length + name */
|
||||
'a','t','t','r','i','b','u','t','e','s','-',
|
||||
'n','a','t','u','r','a','l','-','l','a','n',
|
||||
'g','u','a','g','e',
|
||||
0x00, 0x02, /* Value length + value */
|
||||
0x00, 0x02, /* Value length + value */
|
||||
'e','n',
|
||||
|
||||
IPP_TAG_URI,
|
||||
0x00, 0x0b, /* Name length + name */
|
||||
0x00, 0x0b, /* Name length + name */
|
||||
'p','r','i','n','t','e','r','-','u','r','i',
|
||||
0x00, 0x1c, /* Value length + value */
|
||||
'i','p','p',':','/','/','l','o','c','a','l',
|
||||
'h','o','s','t','/','p','r','i','n','t','e',
|
||||
'r','s','/','f','o','o',
|
||||
|
||||
IPP_TAG_JOB, /* job group tag */
|
||||
IPP_TAG_JOB, /* job group tag */
|
||||
|
||||
IPP_TAG_BEGIN_COLLECTION, /* begCollection tag */
|
||||
0x00, 0x09, /* Name length + name */
|
||||
IPP_TAG_BEGIN_COLLECTION,
|
||||
/* begCollection tag */
|
||||
0x00, 0x09, /* Name length + name */
|
||||
'm', 'e', 'd', 'i', 'a', '-', 'c', 'o', 'l',
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0a, /* Value length + value */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0a, /* Value length + value */
|
||||
'm', 'e', 'd', 'i', 'a', '-', 's', 'i', 'z', 'e',
|
||||
IPP_TAG_BEGIN_COLLECTION, /* begCollection tag */
|
||||
0x00, 0x00, /* Name length + name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0b, /* Value length + value */
|
||||
IPP_TAG_BEGIN_COLLECTION,
|
||||
/* begCollection tag */
|
||||
0x00, 0x00, /* Name length + name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME,
|
||||
/* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0b, /* Value length + value */
|
||||
'x', '-', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n',
|
||||
IPP_TAG_INTEGER, /* integer tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x04, /* Value length + value */
|
||||
IPP_TAG_INTEGER, /* integer tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x04, /* Value length + value */
|
||||
0x00, 0x00, 0x54, 0x56,
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0b, /* Value length + value */
|
||||
IPP_TAG_MEMBERNAME,
|
||||
/* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0b, /* Value length + value */
|
||||
'y', '-', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n',
|
||||
IPP_TAG_INTEGER, /* integer tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x04, /* Value length + value */
|
||||
IPP_TAG_INTEGER, /* integer tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x04, /* Value length + value */
|
||||
0x00, 0x00, 0x6d, 0x24,
|
||||
IPP_TAG_END_COLLECTION, /* endCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0b, /* Value length + value */
|
||||
IPP_TAG_END_COLLECTION,
|
||||
/* endCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0b, /* Value length + value */
|
||||
'm', 'e', 'd', 'i', 'a', '-', 'c', 'o', 'l', 'o', 'r',
|
||||
IPP_TAG_KEYWORD, /* keyword tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x04, /* Value length + value */
|
||||
IPP_TAG_KEYWORD, /* keyword tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x04, /* Value length + value */
|
||||
'b', 'l', 'u', 'e',
|
||||
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0a, /* Value length + value */
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0a, /* Value length + value */
|
||||
'm', 'e', 'd', 'i', 'a', '-', 't', 'y', 'p', 'e',
|
||||
IPP_TAG_KEYWORD, /* keyword tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x05, /* Value length + value */
|
||||
IPP_TAG_KEYWORD, /* keyword tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x05, /* Value length + value */
|
||||
'p', 'l', 'a', 'i', 'n',
|
||||
IPP_TAG_END_COLLECTION, /* endCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_END_COLLECTION,
|
||||
/* endCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
|
||||
IPP_TAG_BEGIN_COLLECTION, /* begCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0a, /* Value length + value */
|
||||
IPP_TAG_BEGIN_COLLECTION,
|
||||
/* begCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0a, /* Value length + value */
|
||||
'm', 'e', 'd', 'i', 'a', '-', 's', 'i', 'z', 'e',
|
||||
IPP_TAG_BEGIN_COLLECTION, /* begCollection tag */
|
||||
0x00, 0x00, /* Name length + name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0b, /* Value length + value */
|
||||
IPP_TAG_BEGIN_COLLECTION,
|
||||
/* begCollection tag */
|
||||
0x00, 0x00, /* Name length + name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME,
|
||||
/* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0b, /* Value length + value */
|
||||
'x', '-', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n',
|
||||
IPP_TAG_INTEGER, /* integer tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x04, /* Value length + value */
|
||||
IPP_TAG_INTEGER, /* integer tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x04, /* Value length + value */
|
||||
0x00, 0x00, 0x52, 0x08,
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0b, /* Value length + value */
|
||||
IPP_TAG_MEMBERNAME,
|
||||
/* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0b, /* Value length + value */
|
||||
'y', '-', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o', 'n',
|
||||
IPP_TAG_INTEGER, /* integer tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x04, /* Value length + value */
|
||||
IPP_TAG_INTEGER, /* integer tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x04, /* Value length + value */
|
||||
0x00, 0x00, 0x74, 0x04,
|
||||
IPP_TAG_END_COLLECTION, /* endCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0b, /* Value length + value */
|
||||
IPP_TAG_END_COLLECTION,
|
||||
/* endCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0b, /* Value length + value */
|
||||
'm', 'e', 'd', 'i', 'a', '-', 'c', 'o', 'l', 'o', 'r',
|
||||
IPP_TAG_KEYWORD, /* keyword tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x05, /* Value length + value */
|
||||
IPP_TAG_KEYWORD, /* keyword tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x05, /* Value length + value */
|
||||
'p', 'l', 'a', 'i', 'd',
|
||||
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0a, /* Value length + value */
|
||||
IPP_TAG_MEMBERNAME, /* memberAttrName tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x0a, /* Value length + value */
|
||||
'm', 'e', 'd', 'i', 'a', '-', 't', 'y', 'p', 'e',
|
||||
IPP_TAG_KEYWORD, /* keyword tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x06, /* Value length + value */
|
||||
IPP_TAG_KEYWORD, /* keyword tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x06, /* Value length + value */
|
||||
'g', 'l', 'o', 's', 's', 'y',
|
||||
IPP_TAG_END_COLLECTION, /* endCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
IPP_TAG_END_COLLECTION,
|
||||
/* endCollection tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x00, /* No value */
|
||||
|
||||
IPP_TAG_END /* end tag */
|
||||
IPP_TAG_END /* end tag */
|
||||
};
|
||||
|
||||
ipp_uchar_t mixed[] = /* Mixed value buffer */
|
||||
{
|
||||
0x01, 0x01, /* IPP version */
|
||||
0x00, 0x02, /* Print-Job operation */
|
||||
0x00, 0x00, 0x00, 0x01,
|
||||
/* Request ID */
|
||||
|
||||
IPP_TAG_OPERATION,
|
||||
|
||||
IPP_TAG_INTEGER, /* integer tag */
|
||||
0x00, 0x1f, /* Name length + name */
|
||||
'n', 'o', 't', 'i', 'f', 'y', '-', 'l', 'e', 'a', 's', 'e',
|
||||
'-', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '-', 's', 'u',
|
||||
'p', 'p', 'o', 'r', 't', 'e', 'd',
|
||||
0x00, 0x04, /* Value length + value */
|
||||
0x00, 0x00, 0x00, 0x01,
|
||||
|
||||
IPP_TAG_RANGE, /* rangeOfInteger tag */
|
||||
0x00, 0x00, /* No name */
|
||||
0x00, 0x08, /* Value length + value */
|
||||
0x00, 0x00, 0x00, 0x10,
|
||||
0x00, 0x00, 0x00, 0x20,
|
||||
|
||||
IPP_TAG_END /* end tag */
|
||||
};
|
||||
|
||||
|
||||
@@ -189,8 +238,8 @@ ipp_uchar_t collection[] = /* Collection buffer */
|
||||
|
||||
void hex_dump(const char *title, ipp_uchar_t *buffer, int bytes);
|
||||
void print_attributes(ipp_t *ipp, int indent);
|
||||
ssize_t read_cb(void *data, ipp_uchar_t *buffer, size_t bytes);
|
||||
ssize_t write_cb(void *data, ipp_uchar_t *buffer, size_t bytes);
|
||||
ssize_t read_cb(_ippdata_t *data, ipp_uchar_t *buffer, size_t bytes);
|
||||
ssize_t write_cb(_ippdata_t *data, ipp_uchar_t *buffer, size_t bytes);
|
||||
|
||||
|
||||
/*
|
||||
@@ -201,6 +250,8 @@ int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
_ippdata_t data; /* IPP buffer */
|
||||
ipp_uchar_t buffer[8192]; /* Write buffer data */
|
||||
ipp_t *cols[2], /* Collections */
|
||||
*size; /* media-size collection */
|
||||
ipp_t *request; /* Request */
|
||||
@@ -280,33 +331,36 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
printf("Write Sample to Memory: ");
|
||||
|
||||
wused = 0;
|
||||
while ((state = ippWriteIO(wbuffer, write_cb, 1, NULL,
|
||||
data.wused = 0;
|
||||
data.wsize = sizeof(buffer);
|
||||
data.wbuffer = buffer;
|
||||
|
||||
while ((state = ippWriteIO(&data, (ipp_iocb_t)write_cb, 1, NULL,
|
||||
request)) != IPP_DATA)
|
||||
if (state == IPP_ERROR)
|
||||
break;
|
||||
|
||||
if (state != IPP_DATA)
|
||||
{
|
||||
printf("FAIL - %d bytes written.\n", wused);
|
||||
printf("FAIL - %d bytes written.\n", (int)data.wused);
|
||||
status = 1;
|
||||
}
|
||||
else if (wused != sizeof(collection))
|
||||
else if (data.wused != sizeof(collection))
|
||||
{
|
||||
printf("FAIL - wrote %d bytes, expected %d bytes!\n", wused,
|
||||
printf("FAIL - wrote %d bytes, expected %d bytes!\n", (int)data.wused,
|
||||
(int)sizeof(collection));
|
||||
hex_dump("Bytes Written", wbuffer, wused);
|
||||
hex_dump("Bytes Written", data.wbuffer, data.wused);
|
||||
hex_dump("Baseline", collection, sizeof(collection));
|
||||
status = 1;
|
||||
}
|
||||
else if (memcmp(wbuffer, collection, wused))
|
||||
else if (memcmp(data.wbuffer, collection, data.wused))
|
||||
{
|
||||
for (i = 0; i < wused; i ++)
|
||||
if (wbuffer[i] != collection[i])
|
||||
for (i = 0; i < data.wused; i ++)
|
||||
if (data.wbuffer[i] != collection[i])
|
||||
break;
|
||||
|
||||
printf("FAIL - output does not match baseline at 0x%04x!\n", i);
|
||||
hex_dump("Bytes Written", wbuffer, wused);
|
||||
hex_dump("Bytes Written", data.wbuffer, data.wused);
|
||||
hex_dump("Baseline", collection, sizeof(collection));
|
||||
status = 1;
|
||||
}
|
||||
@@ -321,10 +375,11 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
printf("Read Sample from Memory: ");
|
||||
|
||||
request = ippNew();
|
||||
rpos = 0;
|
||||
request = ippNew();
|
||||
data.rpos = 0;
|
||||
|
||||
while ((state = ippReadIO(wbuffer, read_cb, 1, NULL, request)) != IPP_DATA)
|
||||
while ((state = ippReadIO(&data, (ipp_iocb_t)read_cb, 1, NULL,
|
||||
request)) != IPP_DATA)
|
||||
if (state == IPP_ERROR)
|
||||
break;
|
||||
|
||||
@@ -332,12 +387,13 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
if (state != IPP_DATA)
|
||||
{
|
||||
printf("FAIL - %d bytes read.\n", rpos);
|
||||
printf("FAIL - %d bytes read.\n", (int)data.rpos);
|
||||
status = 1;
|
||||
}
|
||||
else if (rpos != wused)
|
||||
else if (data.rpos != data.wused)
|
||||
{
|
||||
printf("FAIL - read %d bytes, expected %d bytes!\n", rpos, wused);
|
||||
printf("FAIL - read %d bytes, expected %d bytes!\n", (int)data.rpos,
|
||||
(int)data.wused);
|
||||
print_attributes(request, 8);
|
||||
status = 1;
|
||||
}
|
||||
@@ -493,6 +549,82 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
ippDelete(request);
|
||||
|
||||
/*
|
||||
* Read the mixed data and confirm we converted everything to rangeOfInteger
|
||||
* values...
|
||||
*/
|
||||
|
||||
printf("Read Mixed integer/rangeOfInteger from Memory: ");
|
||||
|
||||
request = ippNew();
|
||||
data.rpos = 0;
|
||||
data.wused = sizeof(mixed);
|
||||
data.wsize = sizeof(mixed);
|
||||
data.wbuffer = mixed;
|
||||
|
||||
while ((state = ippReadIO(&data, (ipp_iocb_t)read_cb, 1, NULL,
|
||||
request)) != IPP_DATA)
|
||||
if (state == IPP_ERROR)
|
||||
break;
|
||||
|
||||
length = ippLength(request);
|
||||
|
||||
if (state != IPP_DATA)
|
||||
{
|
||||
printf("FAIL - %d bytes read.\n", (int)data.rpos);
|
||||
status = 1;
|
||||
}
|
||||
else if (data.rpos != sizeof(mixed))
|
||||
{
|
||||
printf("FAIL - read %d bytes, expected %d bytes!\n", (int)data.rpos,
|
||||
(int)sizeof(mixed));
|
||||
print_attributes(request, 8);
|
||||
status = 1;
|
||||
}
|
||||
else if (length != (sizeof(mixed) + 4))
|
||||
{
|
||||
printf("FAIL - wrong ippLength(), %d instead of %d bytes!\n",
|
||||
length, (int)sizeof(mixed) + 4);
|
||||
print_attributes(request, 8);
|
||||
status = 1;
|
||||
}
|
||||
else
|
||||
puts("PASS");
|
||||
|
||||
fputs("ippFindAttribute(notify-lease-duration-supported): ", stdout);
|
||||
if ((attr = ippFindAttribute(request, "notify-lease-duration-supported",
|
||||
IPP_TAG_ZERO)) == NULL)
|
||||
{
|
||||
puts("FAIL (not found)");
|
||||
status = 1;
|
||||
}
|
||||
else if (attr->value_tag != IPP_TAG_RANGE)
|
||||
{
|
||||
printf("FAIL (wrong type - %s)\n", ippTagString(attr->value_tag));
|
||||
status = 1;
|
||||
}
|
||||
else if (attr->num_values != 2)
|
||||
{
|
||||
printf("FAIL (wrong count - %d)\n", attr->num_values);
|
||||
status = 1;
|
||||
}
|
||||
else if (attr->values[0].range.lower != 1 ||
|
||||
attr->values[0].range.upper != 1 ||
|
||||
attr->values[1].range.lower != 16 ||
|
||||
attr->values[1].range.upper != 32)
|
||||
{
|
||||
printf("FAIL (wrong values - %d,%d and %d,%d)\n",
|
||||
attr->values[0].range.lower,
|
||||
attr->values[0].range.upper,
|
||||
attr->values[1].range.lower,
|
||||
attr->values[1].range.upper);
|
||||
status = 1;
|
||||
}
|
||||
else
|
||||
puts("PASS");
|
||||
|
||||
ippDelete(request);
|
||||
|
||||
/*
|
||||
* Test _ippFindOption() private API...
|
||||
*/
|
||||
@@ -813,25 +945,28 @@ print_attributes(ipp_t *ipp, /* I - IPP request */
|
||||
*/
|
||||
|
||||
ssize_t /* O - Number of bytes read */
|
||||
read_cb(void *data, /* I - Data */
|
||||
read_cb(_ippdata_t *data, /* I - Data */
|
||||
ipp_uchar_t *buffer, /* O - Buffer to read */
|
||||
size_t bytes) /* I - Number of bytes to read */
|
||||
{
|
||||
int count; /* Number of bytes */
|
||||
size_t count; /* Number of bytes */
|
||||
|
||||
|
||||
/*
|
||||
* Copy bytes from the data buffer to the read buffer...
|
||||
*/
|
||||
|
||||
for (count = bytes; count > 0 && rpos < wused; count --, rpos ++)
|
||||
*buffer++ = wbuffer[rpos];
|
||||
if ((count = data->wsize - data->rpos) > bytes)
|
||||
count = bytes;
|
||||
|
||||
memcpy(buffer, data->wbuffer + data->rpos, count);
|
||||
data->rpos += count;
|
||||
|
||||
/*
|
||||
* Return the number of bytes read...
|
||||
*/
|
||||
|
||||
return (bytes - count);
|
||||
return (count);
|
||||
}
|
||||
|
||||
|
||||
@@ -840,25 +975,28 @@ read_cb(void *data, /* I - Data */
|
||||
*/
|
||||
|
||||
ssize_t /* O - Number of bytes written */
|
||||
write_cb(void *data, /* I - Data */
|
||||
write_cb(_ippdata_t *data, /* I - Data */
|
||||
ipp_uchar_t *buffer, /* I - Buffer to write */
|
||||
size_t bytes) /* I - Number of bytes to write */
|
||||
{
|
||||
int count; /* Number of bytes */
|
||||
size_t count; /* Number of bytes */
|
||||
|
||||
|
||||
/*
|
||||
* Loop until all bytes are written...
|
||||
*/
|
||||
|
||||
for (count = bytes; count > 0 && wused < sizeof(wbuffer); count --, wused ++)
|
||||
wbuffer[wused] = *buffer++;
|
||||
if ((count = data->wsize - data->wused) > bytes)
|
||||
count = bytes;
|
||||
|
||||
memcpy(data->wbuffer + data->wused, buffer, count);
|
||||
data->wused += count;
|
||||
|
||||
/*
|
||||
* Return the number of bytes written...
|
||||
*/
|
||||
|
||||
return (bytes - count);
|
||||
return (count);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+8
-5
@@ -171,16 +171,17 @@ cupsCharsetToUTF8(
|
||||
|
||||
if (map_to_utf8 != (iconv_t)-1)
|
||||
{
|
||||
char *altdestptr = (char *)dest; /* Silence bogus GCC type-punned */
|
||||
|
||||
srclen = strlen(src);
|
||||
outBytesLeft = maxout - 1;
|
||||
|
||||
iconv(map_to_utf8, (char **)&src, &srclen, (char **)&destptr,
|
||||
&outBytesLeft);
|
||||
*destptr = '\0';
|
||||
iconv(map_to_utf8, (char **)&src, &srclen, &altdestptr, &outBytesLeft);
|
||||
*altdestptr = '\0';
|
||||
|
||||
_cupsMutexUnlock(&map_mutex);
|
||||
|
||||
return ((int)(destptr - dest));
|
||||
return ((int)(altdestptr - (char *)dest));
|
||||
}
|
||||
|
||||
_cupsMutexUnlock(&map_mutex);
|
||||
@@ -295,10 +296,12 @@ cupsUTF8ToCharset(
|
||||
|
||||
if (map_from_utf8 != (iconv_t)-1)
|
||||
{
|
||||
char *altsrc = (char *)src; /* Silence bogus GCC type-punned */
|
||||
|
||||
srclen = strlen((char *)src);
|
||||
outBytesLeft = maxout - 1;
|
||||
|
||||
iconv(map_from_utf8, (char **)&src, &srclen, &destptr, &outBytesLeft);
|
||||
iconv(map_from_utf8, &altsrc, &srclen, &destptr, &outBytesLeft);
|
||||
*destptr = '\0';
|
||||
|
||||
_cupsMutexUnlock(&map_mutex);
|
||||
|
||||
+9
-1
@@ -223,7 +223,7 @@ cupsSetCredentials(
|
||||
return (-1);
|
||||
|
||||
_httpFreeCredentials(cg->tls_credentials);
|
||||
cg->tls_credentials = _httpConvertCredentials(credentials);
|
||||
cg->tls_credentials = _httpCreateCredentials(credentials);
|
||||
|
||||
return (cg->tls_credentials ? 0 : -1);
|
||||
}
|
||||
@@ -636,7 +636,9 @@ cups_read_client_conf(
|
||||
char line[1024], /* Line from file */
|
||||
*value, /* Pointer into line */
|
||||
encryption[1024], /* Encryption value */
|
||||
#ifndef __APPLE__
|
||||
server_name[1024], /* ServerName value */
|
||||
#endif /* !__APPLE__ */
|
||||
any_root[1024], /* AllowAnyRoot value */
|
||||
expired_root[1024], /* AllowExpiredRoot value */
|
||||
expired_certs[1024]; /* AllowExpiredCerts value */
|
||||
@@ -658,12 +660,18 @@ cups_read_client_conf(
|
||||
strlcpy(encryption, value, sizeof(encryption));
|
||||
cups_encryption = encryption;
|
||||
}
|
||||
#ifndef __APPLE__
|
||||
/*
|
||||
* The Server directive is not supported on Mac OS X due to app sandboxing
|
||||
* restrictions, i.e. not all apps request network access.
|
||||
*/
|
||||
else if (!cups_server && (!cg->server[0] || !cg->ipp_port) &&
|
||||
!_cups_strcasecmp(line, "ServerName") && value)
|
||||
{
|
||||
strlcpy(server_name, value, sizeof(server_name));
|
||||
cups_server = server_name;
|
||||
}
|
||||
#endif /* !__APPLE__ */
|
||||
else if (!cups_anyroot && !_cups_strcasecmp(line, "AllowAnyRoot") && value)
|
||||
{
|
||||
strlcpy(any_root, value, sizeof(any_root));
|
||||
|
||||
@@ -21,6 +21,8 @@ Name[fr]=Gestionnaire d'impression
|
||||
Comment[fr]=Interface Web de CUPS
|
||||
Name[he]=נהל הדפסות
|
||||
Comment[he]=ממשק דפדפן של CUPS
|
||||
Name[hu]=Nyomtatás kezelése
|
||||
Comment[hu]=A CUPS webes felülete
|
||||
Name[id]=Manajemen Pencetakan
|
||||
Comment[id]=Antarmuka Web CUPS
|
||||
Name[it]=Gestione stampa
|
||||
|
||||
@@ -50,7 +50,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
|
||||
<P><A HREF="help/options.html">Kommandozeilendruck und Einstellungen</A></P>
|
||||
|
||||
<P><A HREF="help/whatsnew.html">Neues in CUPS 1.4</A></P>
|
||||
<P><A HREF="help/whatsnew.html">Neues in CUPS 1.5</A></P>
|
||||
|
||||
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.general">Benutzerforum</A></P>
|
||||
|
||||
@@ -101,7 +101,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
<TR><TD> </TD></TR>
|
||||
<TR><TD CLASS="trailer">CUPS und das CUPS Logo sind
|
||||
eingetragene Warenzeichen der <A HREF="http://www.apple.com">Apple Inc.</A>
|
||||
CUPS ist urheberrechtlich geschützt 2007-2011 von Apple Inc, alle Rechte vorbehalten.</TD></TR>
|
||||
CUPS ist urheberrechtlich geschützt 2007-2012 von Apple Inc, alle Rechte vorbehalten.</TD></TR>
|
||||
</TABLE>
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
@@ -50,7 +50,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
|
||||
<P><A HREF="help/options.html">Impresión desde la línea de comandos y opciones</A></P>
|
||||
|
||||
<P><A HREF="help/whatsnew.html">Qué hay de nuevo en CUPS 1.4</A></P>
|
||||
<P><A HREF="help/whatsnew.html">Qué hay de nuevo en CUPS 1.5</A></P>
|
||||
|
||||
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.general">Foro de usuarios</A></P>
|
||||
|
||||
@@ -101,7 +101,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
<TR><TD> </TD></TR>
|
||||
<TR><TD CLASS="trailer">CUPS y el logo de CUPS son
|
||||
marcas registradas de <A HREF="http://www.apple.com">Apple Inc.</A> Los derechos
|
||||
de copia de CUPS 2007-2011 son de Apple Inc. Todos los derechos reservados.</TD></TR>
|
||||
de copia de CUPS 2007-2012 son de Apple Inc. Todos los derechos reservados.</TD></TR>
|
||||
</TABLE>
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
@@ -32,7 +32,7 @@ AUTOSAVE="org.cups.help" RESULTS="20"></FORM></TD>
|
||||
<H1>CUPS @CUPS_VERSION@</H1>
|
||||
|
||||
<P><A HREF="http://www.apple.com/">Apple Inc.</A>-ek Mac OS<SUP>®</SUP> X eta
|
||||
beste UNIX<SUP>®</SUP> bezalako sistema eragileentzako iturburu irekiko
|
||||
beste UNIX<SUP>®</SUP> bezalako sistema eragileentzako iturburu irekiko
|
||||
inprimatzeko sisteman oinarrituta dago.</P>
|
||||
|
||||
</TD>
|
||||
@@ -50,7 +50,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
|
||||
<P><A HREF="help/options.html">Komando-lerroaren bidez inprimatzea eta aukerak</A></P>
|
||||
|
||||
<P><A HREF="help/whatsnew.html">CUPS 1.4 bertsioak dakartzan berrikuntza.</A></P>
|
||||
<P><A HREF="help/whatsnew.html">CUPS 1.5 bertsioak dakartzan berrikuntza.</A></P>
|
||||
|
||||
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.general">Erabiltzaileen foroa</A></P>
|
||||
|
||||
@@ -100,7 +100,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
</TD></TR>
|
||||
<TR><TD> </TD></TR>
|
||||
<TR><TD CLASS="trailer">CUPS eta CUPSen logotipoa <A HREF="http://www.apple.com">Apple Inc.</A> en marka erregistratuak dira.
|
||||
CUPSen copyright-a 2007-2011 Apple Inc. Eskubide guztiak gordeta.</TD></TR>
|
||||
CUPSen copyright-a 2007-2012 Apple Inc. Eskubide guztiak gordeta.</TD></TR>
|
||||
</TABLE>
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
|
||||
<TITLE>Accueil - CUPS @CUPS_VERSION@@CUPS_REVISION@</TITLE>
|
||||
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/cups.css">
|
||||
<LINK REL="SHORTCUT ICON" HREF="/images/cups-icon.png" TYPE="image/png">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<TABLE CLASS="page" SUMMARY="{title}">
|
||||
<TR><TD CLASS="body">
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
|
||||
<TR HEIGHT="36">
|
||||
<TD><A HREF="http://www.cups.org/" TARGET="_blank"><IMG
|
||||
SRC="/images/left.gif" WIDTH="64" HEIGHT="36" BORDER="0" ALT=""></A></TD>
|
||||
<TD CLASS="sel"><A HREF="/"> Accueil </A></TD>
|
||||
<TD CLASS="unsel"><A HREF="/admin"> Administration </A></TD>
|
||||
<TD CLASS="unsel"><A HREF="/classes/"> Classes </A></TD>
|
||||
<TD CLASS="unsel"><A HREF="/help/"> Aide En Ligne </A></TD>
|
||||
<TD CLASS="unsel"><A HREF="/jobs/"> Tâches </A></TD>
|
||||
<TD CLASS="unsel"><A HREF="/printers/"> Imprimantes </A></TD>
|
||||
<TD CLASS="unsel" WIDTH="100%"><FORM ACTION="/help/" METHOD="GET"><INPUT
|
||||
TYPE="SEARCH" NAME="QUERY" SIZE="20" PLACEHOLDER="Search Help"
|
||||
AUTOSAVE="org.cups.help" RESULTS="20"></FORM></TD>
|
||||
<TD><IMG SRC="/images/right.gif" WIDTH="4" HEIGHT="36" ALT=""></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<TABLE CLASS="indent" SUMMARY="">
|
||||
<TR><TD STYLE="padding-right: 20px;">
|
||||
|
||||
<H1>CUPS @CUPS_VERSION@</H1>
|
||||
|
||||
<P>CUPS est le système d'impression Open Source, basé sur des standards, développé par
|
||||
<A HREF="http://www.apple.com/">Apple Inc.</A> pour Mac OS<SUP>®</SUP> X et
|
||||
les autres OS UNIX<SUP>®</SUP>-like.</P>
|
||||
|
||||
</TD>
|
||||
<TD><A HREF="http://www.cups.org/"><IMG SRC="images/cups-icon.png" WIDTH="128"
|
||||
HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<TABLE CLASS="indent" SUMMARY="">
|
||||
<TR><TD VALIGN="top" STYLE="border-right: dotted thin #cccccc; padding-right: 20px;">
|
||||
|
||||
<H2>CUPS pour les utilisateurs</H2>
|
||||
|
||||
<P><A HREF="help/overview.html">Présentation de CUPS</A></P>
|
||||
|
||||
<P><A HREF="help/options.html">Impression en ligne de commande et options</A></P>
|
||||
|
||||
<P><A HREF="help/whatsnew.html">Quoi de neuf dans CUPS 1.5</A></P>
|
||||
|
||||
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.general">Forum utilisateur</A></P>
|
||||
|
||||
</TD><TD VALIGN="top" STYLE="border-right: dotted thin #cccccc; padding-left: 20px; padding-right: 20px;">
|
||||
|
||||
<H2>CUPS pour les administrateurs</H2>
|
||||
|
||||
<P><A HREF="admin">Ajout d'imprimantes et de classes</A></P>
|
||||
|
||||
<P><A HREF="help/policies.html">Gérer les politiques</A></P>
|
||||
|
||||
<P><A HREF="help/accounting.html">Printer Accounting Basics</A></P>
|
||||
|
||||
<P><A HREF="help/security.html">Sécurité du serveur</A></P>
|
||||
|
||||
<P><A HREF="help/kerberos.html">Utiliser l'authentification Kerberos</A></P>
|
||||
|
||||
<P><A HREF="help/network.html">Utiliser des imprimantes réseaux</A></P>
|
||||
|
||||
<P><A HREF="help/ref-cupsd-conf.html">Références sur cupsd.conf</A></P>
|
||||
|
||||
<P><A HREF="http://www.cups.org/ppd.php">Trouver des pilotes d'imprimantes</A></P>
|
||||
|
||||
</TD><TD VALIGN="top" STYLE="padding-left: 20px;">
|
||||
|
||||
<H2>CUPS pour les développeurs</H2>
|
||||
|
||||
<P><A HREF="help/api-overview.html">Introduction à la programmation CUPS</A></P>
|
||||
|
||||
<P><A HREF="help/api-cups.html">L'API CUPS</A></P>
|
||||
|
||||
<P><A HREF="help/api-filter.html">Programmation de filtres et de backends</A></P>
|
||||
|
||||
<P><A HREF="help/api-httpipp.html">Les API HTTP et IPP</A></P>
|
||||
|
||||
<P><A HREF="help/api-ppd.html">L'API PPD</A></P>
|
||||
|
||||
<P><A HREF="help/api-raster.html">L'API Raster</A></P>
|
||||
|
||||
<P><A HREF="help/ref-ppdcfile.html">PPD Compiler Driver Information File Reference</A></P>
|
||||
|
||||
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.development">Forum développeurs</A></P>
|
||||
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
</TD></TR>
|
||||
<TR><TD> </TD></TR>
|
||||
<TR><TD CLASS="trailer">CUPS et le logo CUPS sont des marques déposées de
|
||||
<A HREF="http://www.apple.com">Apple Inc.</A> CUPS est sous copyright 2007-2012 Apple
|
||||
Inc. Tous droits réservés.</TD></TR>
|
||||
</TABLE>
|
||||
</BODY>
|
||||
</HTML>
|
||||
+18
-51
@@ -8,11 +8,7 @@
|
||||
|
||||
<H1 CLASS="title">Using Kerberos Authentication</H1>
|
||||
|
||||
<P>CUPS allows you to use a Key Distribution Center (KDC) for authentication
|
||||
on your local CUPS server and when printing to a remote authenticated queue.
|
||||
This document describes how to configure CUPS to use Kerberos authentication
|
||||
and provides links to the MIT help pages for configuring Kerberos on your
|
||||
systems and network.</P>
|
||||
<P>CUPS allows you to use a Key Distribution Center (KDC) for authentication on your local CUPS server and when printing to a remote authenticated queue. This document describes how to configure CUPS to use Kerberos authentication and provides links to the MIT help pages for configuring Kerberos on your systems and network.</P>
|
||||
|
||||
|
||||
<H2 CLASS="title"><A NAME="REQUIREMENTS">System Requirements</A></H2>
|
||||
@@ -23,42 +19,31 @@ systems and network.</P>
|
||||
|
||||
<li>Heimdal Kerberos (any version) or MIT Kerberos (1.6.3 or newer)</li>
|
||||
|
||||
<li>Properly configured Domain Name System (DNS)
|
||||
infrastructure:<ol type='a'>
|
||||
<li>DNS server(s) with static IP addresses for all CUPS clients
|
||||
and servers or configured to allow DHCP updates to the host
|
||||
addresses</li>
|
||||
<li>Properly configured Domain Name System (DNS) infrastructure (for your servers):<ol type='a'>
|
||||
<li>DNS server(s) with static IP addresses for all CUPS servers or configured to allow DHCP updates to the host addresses and</li>
|
||||
<li>All CUPS clients and servers configured to use the same
|
||||
DNS server(s)</li>
|
||||
DNS server(s).</li>
|
||||
</ol></li>
|
||||
|
||||
<li>Properly configured Kerberos infrastructure:<ol type='a'>
|
||||
<li>KDC configured to allow CUPS clients and servers to obtain
|
||||
Service Granting Tickets (SGTs) for the "ipp" service</li>
|
||||
<li>LDAP-based user accounts - both OpenDirectory and
|
||||
ActiveDirectory provide this with the KDC</li>
|
||||
<li>CUPS clients and servers bound to the KDC and LDAP
|
||||
server(s)</li>
|
||||
<li>KDC configured to allow CUPS servers to obtain Service Granting Tickets (SGTs) for the "host" service,</li>
|
||||
<li>LDAP-based user accounts - both OpenDirectory and ActiveDirectory provide this with the KDC, and</li>
|
||||
<li>CUPS clients and servers bound to the same KDC and LDAP
|
||||
server(s).</li>
|
||||
</ol></li>
|
||||
|
||||
<li>An "ipp" Service Granting Ticket (SGT) for every CUPS client and
|
||||
server</li>
|
||||
<li>A "host" Service Granting Ticket (SGT) for every CUPS server</li>
|
||||
|
||||
</ol>
|
||||
|
||||
|
||||
<H2 CLASS="title"><A NAME="KRB5">Configuring Kerberos on Your System</A></H2>
|
||||
|
||||
<P>Before you can use Kerberos with CUPS, you will need to configure
|
||||
Kerberos on your system and setup a system as a KDC. Because this
|
||||
configuration is highly system and site-specific, please consult
|
||||
the following on-line resources provided by the creators of Kerberos
|
||||
at the Massachusetts Institute of Technology (MIT):</P>
|
||||
<P>Before you can use Kerberos with CUPS, you will need to configure Kerberos on your system and setup a system as a KDC. Because this configuration is highly system and site-specific, please consult the following on-line resources provided by the creators of Kerberos at the Massachusetts Institute of Technology (MIT):</P>
|
||||
|
||||
<UL>
|
||||
|
||||
<LI><A HREF="http://web.mit.edu/kerberos/">Kerberos: The Network
|
||||
Authentication Protocol</A></LI>
|
||||
<LI><A HREF="http://web.mit.edu/kerberos/">Kerberos: The Network Authentication Protocol</A></LI>
|
||||
|
||||
<LI><A HREF="http://web.mit.edu/macdev/KfM/Common/Documentation/faq-osx.html">Kerberos
|
||||
on Mac OS X Frequently Asked Questions</A></LI>
|
||||
@@ -77,46 +62,28 @@ at the Massachusetts Institute of Technology (MIT):</P>
|
||||
|
||||
<H2 CLASS="title"><A NAME="CUPS">Configuring CUPS to Use Kerberos</A></H2>
|
||||
|
||||
<P>Once you have configured Kerberos on your system(s), you can then
|
||||
enable Kerberos authentication by selecting the <tt>Negotiate</tt>
|
||||
authentication type. The simplest way to do this is using the
|
||||
<tt>cupsctl(8)</tt> command:</P>
|
||||
<P>Once youhave configured Kerberos on your system(s), you can then enable Kerberos authentication by selecting the <tt>Negotiate</tt> authentication type. The simplest way to do this is using the <tt>cupsctl(8)</tt> command on your server(s):</P>
|
||||
|
||||
<PRE CLASS="command">
|
||||
<KBD>cupsctl DefaultAuthType=Negotiate</KBD>
|
||||
</PRE>
|
||||
|
||||
<P>You can also enable Kerberos from the web interface by checking the
|
||||
<VAR>Use Kerberos Authentication</VAR> box and clicking <VAR>Change
|
||||
Settings</VAR>:</P>
|
||||
<P>You can also enable Kerberos from the web interface by checking the <VAR>Use Kerberos Authentication</VAR> box and clicking <VAR>Change Settings</VAR>:</P>
|
||||
|
||||
<PRE CLASS="command">
|
||||
http://localhost:631/admin
|
||||
http://server.example.com:631/admin
|
||||
</PRE>
|
||||
|
||||
<P>After you have enabled Kerberos authentication, use the built-in
|
||||
"authenticated" policy or your own custom policies with the printers you
|
||||
will be sharing. See <a href="policies.html">Managing Operation Policies</a>
|
||||
for more information.</P>
|
||||
<P>After you have enabled Kerberos authentication, use the built-in "authenticated" policy or your own custom policies with the printers you will be sharing. See <a href="policies.html">Managing Operation Policies</a> for more information.</P>
|
||||
|
||||
|
||||
<H2 CLASS="title"><A NAME="IMPLEMENT">Implementation Information</A></H2>
|
||||
|
||||
<P>CUPS implements Kerberos over HTTP using GSSAPI and the service name
|
||||
"host". Because of limitations in the HTTP GSSAPI protocol extension, only
|
||||
a single domain/KDC is supported for authentication.</P>
|
||||
<P>CUPS implements Kerberos over HTTP using GSSAPI and the service name "host". Because of limitations in the HTTP GSSAPI protocol extension, only a single domain/KDC is supported for authentication. The HTTP extension is described in <a href="http://tools.ietf.org/html/rfc4559">RFC 4559</a>.</P>
|
||||
|
||||
<P>When doing printing tasks that require authentication, CUPS requests a
|
||||
single-use "ticket" from your login session to authenticate who you are.
|
||||
This ticket gives CUPS a username of the form "user@REALM", which is then
|
||||
converted to just "user" for purposes of user and group checks.</P>
|
||||
<P>When doing printing tasks that require authentication, CUPS requests single-use "tickets" from your login session to authenticate who you are. These tickets give CUPS a username of the form "user@REALM", which is then converted to just "user" for purposes of user and group checks.</P>
|
||||
|
||||
<P>In order to support printing to a shared printer, CUPS has to ask the KDC
|
||||
for a copy of your credentials (this is called delegation) that can be sent to
|
||||
the remote server for authentication. Delegation only works when the system
|
||||
has a stable hostname which maps to the current address of the system, which
|
||||
is why you need a static IP address or DHCP that updates the DNS entry for your
|
||||
system.</P>
|
||||
<P>In order to support printing to a shared printer, CUPS runs the IPP backend as the owner of the print job so it can obtain the necessary credentials.</P>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
@@ -909,9 +909,13 @@ ConfigFilePerm 0640
|
||||
|
||||
<H3>Description</H3>
|
||||
|
||||
<P>The <CODE>ConfigFilePerm</CODE> directive specifies the
|
||||
permissions to use when writing configuration files. The default
|
||||
is @CUPS_CONFIG_FILE_PERM@.</P>
|
||||
<P>The <CODE>ConfigFilePerm</CODE> directive specifies the permissions to use when the scheduler writes configuration and cache files, typically in response to IPP or HTTP requests. The default is @CUPS_CONFIG_FILE_PERM@.</P>
|
||||
|
||||
<BLOCKQUOTE><B>Note:</B>
|
||||
|
||||
<P>The permissions for the <VAR>printers.conf</VAR> file are always masked to only allow access from the scheduler user (typically root). This is done because printer device URIs sometimes contain sensitive authentication information that should not be generally known on the system. There is no way to disable this security feature.</P>
|
||||
|
||||
</BLOCKQUOTE>
|
||||
|
||||
|
||||
<H2 CLASS="title"><A NAME="DataDir">DataDir</A></H2>
|
||||
@@ -2038,7 +2042,7 @@ LogFilePerm 0600
|
||||
<H3>Description</H3>
|
||||
|
||||
<P>The <CODE>LogFilePerm</CODE> directive specifies the
|
||||
permissions to use when writing configuration files. The default
|
||||
permissions to use when writing log files. The default
|
||||
is @CUPS_LOG_FILE_PERM@.</P>
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ DeskJet root 2 [20/May/1999:19:21:05 +0000] 2 1 acme-123 localhost myjob letter
|
||||
|
||||
</P>
|
||||
|
||||
<p>The <a href="ref-cupsd_conf.html#PageLogFormat"><code>PageLogFormat</code></a>
|
||||
<p>The <a href="ref-cupsd-conf.html#PageLogFormat"><code>PageLogFormat</code></a>
|
||||
directive can be used to change this information.</p>
|
||||
|
||||
<P>The <I>printer</I> field contains the name of the printer that
|
||||
|
||||
@@ -341,7 +341,7 @@ div.contents ul.subcontents li {
|
||||
<body>
|
||||
<div class='body'>
|
||||
<!--
|
||||
"$Id: spec-ppd.html 9803 2011-05-26 02:11:20Z mike $"
|
||||
"$Id: spec-ppd.html 9813 2011-06-01 17:00:27Z mike $"
|
||||
|
||||
PPD extension documentation for CUPS.
|
||||
|
||||
@@ -604,9 +604,10 @@ f(x) = density * x <sup style='font-size: 100%'>gamma</sup>
|
||||
|
||||
<h4>Customizing the Profile Selection Keywords</h4>
|
||||
|
||||
<p>The <tt>MediaType</tt> and <tt>Resolution</tt> main keywords can be reassigned to different main keywords, allowing drivers to do color profile selection based on different parameters. The <tt>cupsICCQualifier2</tt> and <tt>cupsICCQualifier3</tt> keywords define the mapping from selector to main keyword:</p>
|
||||
<p>The <tt>ColorModel</tt>, <tt>MediaType</tt>, and <tt>Resolution</tt> main keywords can be reassigned to different main keywords, allowing drivers to do color profile selection based on different parameters. The <tt>cupsICCQualifier1</tt>, <tt>cupsICCQualifier2</tt>, and <tt>cupsICCQualifier3</tt> keywords define the mapping from selector to main keyword:</p>
|
||||
|
||||
<pre class='command'>
|
||||
*cupsICCQualifier1: MainKeyword1
|
||||
*cupsICCQualifier2: MainKeyword2
|
||||
*cupsICCQualifier3: MainKeyword3
|
||||
</pre>
|
||||
@@ -614,6 +615,7 @@ f(x) = density * x <sup style='font-size: 100%'>gamma</sup>
|
||||
<p>The default mapping is as follows:</p>
|
||||
|
||||
<pre class='command'>
|
||||
*cupsICCQualifier1: ColorModel
|
||||
*cupsICCQualifier2: MediaType
|
||||
*cupsICCQualifier3: Resolution
|
||||
</pre>
|
||||
|
||||
Arquivo executável
+113
@@ -0,0 +1,113 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
|
||||
<TITLE>Kezdőlap - CUPS @CUPS_VERSION@@CUPS_REVISION@</TITLE>
|
||||
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/cups.css">
|
||||
<LINK REL="SHORTCUT ICON" HREF="/images/cups-icon.png" TYPE="image/png">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<TABLE CLASS="page" SUMMARY="{title}">
|
||||
<TR><TD CLASS="body">
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
|
||||
<TR HEIGHT="36">
|
||||
<TD><A HREF="http://www.cups.org/" TARGET="_blank"><IMG
|
||||
SRC="/images/left.gif" WIDTH="64" HEIGHT="36" BORDER="0" ALT=""></A></TD>
|
||||
<TD CLASS="sel"><A HREF="/"> Kezdőoldal </A></TD>
|
||||
<TD CLASS="unsel"><A
|
||||
HREF="/admin"> Adminisztráció </A></TD>
|
||||
<TD CLASS="unsel"><A HREF="/classes/"> Osztályok </A></TD>
|
||||
<TD CLASS="unsel"><A
|
||||
HREF="/help/"> Online súgó </A></TD>
|
||||
<TD CLASS="unsel"><A HREF="/jobs/"> Feladatok </A></TD>
|
||||
<TD CLASS="unsel"><A
|
||||
HREF="/printers/"> Nyomtatók </A></TD>
|
||||
<TD CLASS="unsel" WIDTH="100%"><FORM ACTION="/help/" METHOD="GET"><INPUT
|
||||
TYPE="SEARCH" NAME="QUERY" SIZE="20" PLACEHOLDER="Keresés a súgóban"
|
||||
AUTOSAVE="org.cups.help" RESULTS="20"></FORM></TD>
|
||||
<TD><IMG SRC="/images/right.gif" WIDTH="4" HEIGHT="36" ALT=""></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<TABLE CLASS="indent" SUMMARY="">
|
||||
<TR><TD STYLE="padding-right: 20px;">
|
||||
|
||||
<H1>CUPS @CUPS_VERSION@</H1>
|
||||
|
||||
<P>A CUPS az <A HREF="http://www.apple.com/">Apple Inc.</A> által a Mac
|
||||
OS<SUP>®</SUP> X és más UNIX<SUP>®</SUP>-szerű operációs
|
||||
rendszerekhez kifejlesztett, szabványokra épülő, nyílt forrású
|
||||
nyomtatórendszer.</P>
|
||||
|
||||
</TD>
|
||||
<TD><A HREF="http://www.cups.org/"><IMG SRC="images/cups-icon.png" WIDTH="128"
|
||||
HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<TABLE CLASS="indent" SUMMARY="">
|
||||
<TR><TD VALIGN="top" STYLE="border-right: dotted thin #cccccc; padding-right: 20px;">
|
||||
|
||||
<H2>CUPS felhasználóknak</H2>
|
||||
|
||||
<P><A HREF="help/overview.html">A CUPS bemutatása</A></P>
|
||||
|
||||
<P><A HREF="help/options.html">Parancssori nyomtatás és kapcsolók</A></P>
|
||||
|
||||
<P><A HREF="help/whatsnew.html">A CUPS 1.5 újdonságai</A></P>
|
||||
|
||||
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.general">Felhasználói fórum</A></P>
|
||||
|
||||
</TD><TD VALIGN="top" STYLE="border-right: dotted thin #cccccc; padding-left: 20px; padding-right: 20px;">
|
||||
|
||||
<H2>CUPS rendszergazdáknak</H2>
|
||||
|
||||
<P><A HREF="admin">Nyomtatók és osztályok hozzáadása</A></P>
|
||||
|
||||
<P><A HREF="help/policies.html">Műveletházirendek kezelése</A></P>
|
||||
|
||||
<P><A HREF="help/accounting.html">Nyomtatási számlázás alapjai</A></P>
|
||||
|
||||
<P><A HREF="help/security.html">Kiszolgáló biztonsága</A></P>
|
||||
|
||||
<P><A HREF="help/kerberos.html">Kerberos hitelesítés használata</A></P>
|
||||
|
||||
<P><A HREF="help/network.html">Hálózati nyomtatók használata</A></P>
|
||||
|
||||
<P><A HREF="help/ref-cupsd-conf.html">cupsd.conf referencia</A></P>
|
||||
|
||||
<P><A HREF="http://www.cups.org/ppd.php">Nyomtató-illesztőprogramok
|
||||
keresése</A></P>
|
||||
|
||||
</TD><TD VALIGN="top" STYLE="padding-left: 20px;">
|
||||
|
||||
<H2>A CUPS fejlesztőknek</H2>
|
||||
|
||||
<P><A HREF="help/api-overview.html">A CUPS programozásának bemutatása</A></P>
|
||||
|
||||
<P><A HREF="help/api-cups.html">CUPS API</A></P>
|
||||
|
||||
<P><A HREF="help/api-filter.html">Szűrők és háttérprogramok
|
||||
programozása</A></P>
|
||||
|
||||
<P><A HREF="help/api-httpipp.html">HTTP és IPP API-k</A></P>
|
||||
|
||||
<P><A HREF="help/api-ppd.html">PPD API</A></P>
|
||||
|
||||
<P><A HREF="help/api-raster.html">Raszter API</A></P>
|
||||
|
||||
<P><A HREF="help/ref-ppdcfile.html">PPD fordító illesztőprogram-információs fájljának referenciája</A></P>
|
||||
|
||||
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.development">Fejlesztői fórum</A></P>
|
||||
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
</TD></TR>
|
||||
<TR><TD> </TD></TR>
|
||||
<TR><TD CLASS="trailer">A CUPS és a CUPS logó az <A
|
||||
HREF="http://www.apple.com">Apple Inc.</A> védjegyei. CUPS copyright
|
||||
2007-2012 Apple Inc. Minden jog fenntartva.</TD></TR>
|
||||
</TABLE>
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -50,7 +50,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
|
||||
<P><A HREF="help/options.html">Opsi dan Pencetakan dari Baris Perintah</A></P>
|
||||
|
||||
<P><A HREF="help/whatsnew.html">Apa yang Baru di CUPS 1.4</A></P>
|
||||
<P><A HREF="help/whatsnew.html">Apa yang Baru di CUPS 1.5</A></P>
|
||||
|
||||
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.general">Forum Pengguna</A></P>
|
||||
|
||||
@@ -100,7 +100,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
</TD></TR>
|
||||
<TR><TD> </TD></TR>
|
||||
<TR><TD CLASS="trailer">CUPS dan logo CUPS logo adalah merek dagang dari
|
||||
<A HREF="http://www.apple.com">Apple Inc.</A> Hak cipta CUPS pada 2007-2011 Apple
|
||||
<A HREF="http://www.apple.com">Apple Inc.</A> Hak cipta CUPS pada 2007-2012 Apple
|
||||
Inc. Semua hak terpelihara.</TD></TR>
|
||||
</TABLE>
|
||||
</BODY>
|
||||
|
||||
+2
-2
@@ -50,7 +50,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
|
||||
<P><A HREF="help/options.html">Command-Line Printing and Options</A></P>
|
||||
|
||||
<P><A HREF="help/whatsnew.html">What's New in CUPS 1.4</A></P>
|
||||
<P><A HREF="help/whatsnew.html">What's New in CUPS 1.5</A></P>
|
||||
|
||||
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.general">User Forum</A></P>
|
||||
|
||||
@@ -100,7 +100,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
</TD></TR>
|
||||
<TR><TD> </TD></TR>
|
||||
<TR><TD CLASS="trailer">CUPS and the CUPS logo are trademarks of
|
||||
<A HREF="http://www.apple.com">Apple Inc.</A> CUPS is copyright 2007-2011 Apple
|
||||
<A HREF="http://www.apple.com">Apple Inc.</A> CUPS is copyright 2007-2012 Apple
|
||||
Inc. All rights reserved.</TD></TR>
|
||||
</TABLE>
|
||||
</BODY>
|
||||
|
||||
@@ -50,7 +50,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
|
||||
<P><A HREF="help/options.html">Stampa e opzioni da riga di comando</A></P>
|
||||
|
||||
<P><A HREF="help/whatsnew.html">Cosa c'è di nuovo in CUPS 1.4</A></P>
|
||||
<P><A HREF="help/whatsnew.html">Cosa c'è di nuovo in CUPS 1.5</A></P>
|
||||
|
||||
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.general">Forum degli utenti</A></P>
|
||||
|
||||
@@ -100,7 +100,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
</TD></TR>
|
||||
<TR><TD> </TD></TR>
|
||||
<TR><TD CLASS="trailer">CUPS e il logo CUPS sono marchi di
|
||||
<A HREF="http://www.apple.com">Apple Inc.</A> CUPS è un copyright 2007-2011 di Apple
|
||||
<A HREF="http://www.apple.com">Apple Inc.</A> CUPS è un copyright 2007-2012 di Apple
|
||||
Inc. Tutti i diritti sono riservati.</TD></TR>
|
||||
</TABLE>
|
||||
</BODY>
|
||||
|
||||
@@ -50,7 +50,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
|
||||
<P><A HREF="help/options.html">コマンドラインからの印刷とオプション</A></P>
|
||||
|
||||
<P><A HREF="help/whatsnew.html">CUPS 1.4 の新機能</A></P>
|
||||
<P><A HREF="help/whatsnew.html">CUPS 1.5 の新機能</A></P>
|
||||
|
||||
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.general">ユーザーフォーラム</A></P>
|
||||
|
||||
@@ -100,7 +100,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
</TD></TR>
|
||||
<TR><TD> </TD></TR>
|
||||
<TR><TD CLASS="trailer">CUPS and the CUPS logo are trademarks of
|
||||
<A HREF="http://www.apple.com">Apple Inc.</A> CUPS is copyright 2007-2011 Apple
|
||||
<A HREF="http://www.apple.com">Apple Inc.</A> CUPS is copyright 2007-2012 Apple
|
||||
Inc. All rights reserved.</TD></TR>
|
||||
</TABLE>
|
||||
</BODY>
|
||||
|
||||
@@ -50,7 +50,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
|
||||
<P><A HREF="help/options.html">Drukowanie i opcje w wierszu poleceń</A></P>
|
||||
|
||||
<P><A HREF="help/whatsnew.html">Co nowego w CUPS 1.4</A></P>
|
||||
<P><A HREF="help/whatsnew.html">Co nowego w CUPS 1.5</A></P>
|
||||
|
||||
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.general">Forum użytkowników</A></P>
|
||||
|
||||
@@ -101,7 +101,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
<TR><TD> </TD></TR>
|
||||
<TR><TD CLASS="trailer">CUPS i logo CUPS
|
||||
są znakami handlowymi <A HREF="http://www.apple.com">Apple Inc.</A> CUPS
|
||||
copyright 2007-2011 Apple Inc. Wszystkie prawa zastrzeżone.</TD></TR>
|
||||
copyright 2007-2012 Apple Inc. Wszystkie prawa zastrzeżone.</TD></TR>
|
||||
</TABLE>
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
@@ -48,7 +48,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
|
||||
<P><A HREF="help/options.html">Печать из командной строки</A></P>
|
||||
|
||||
<P><A HREF="help/whatsnew.html">Что нового в CUPS 1.4</A></P>
|
||||
<P><A HREF="help/whatsnew.html">Что нового в CUPS 1.5</A></P>
|
||||
|
||||
<P><A HREF="http://www.cups.org/newsgroups.php?gcups.general">Форум пользователей</A></P>
|
||||
|
||||
@@ -97,7 +97,7 @@ HEIGHT="128" ALT="CUPS"></A></TD>
|
||||
|
||||
</TD></TR>
|
||||
<TR><TD> </TD></TR>
|
||||
<TR><TD CLASS="trailer">CUPS а также логотип CUPS являются зарегистрированными торговыми марками <A HREF="http://www.apple.com">Apple Inc.</A> Авторские права на CUPS принадлежат (2007-2011) компании Apple Inc. Все права защищены.</TD></TR>
|
||||
<TR><TD CLASS="trailer">CUPS а также логотип CUPS являются зарегистрированными торговыми марками <A HREF="http://www.apple.com">Apple Inc.</A> Авторские права на CUPS принадлежат (2007-2012) компании Apple Inc. Все права защищены.</TD></TR>
|
||||
</TABLE>
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
+9
-9
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Test the CMYK color separation code for CUPS.
|
||||
*
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1993-2006 by Easy Software Products, All Rights Reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -28,8 +28,8 @@
|
||||
#include <sys/stat.h>
|
||||
|
||||
|
||||
void test_gray(int num_comps, const char *basename);
|
||||
void test_rgb(int num_comps, const char *basename);
|
||||
void test_gray(int num_comps, const char *base);
|
||||
void test_rgb(int num_comps, const char *base);
|
||||
|
||||
|
||||
/*
|
||||
@@ -78,7 +78,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
void
|
||||
test_gray(int num_comps, /* I - Number of components */
|
||||
const char *basename) /* I - Base filename of output */
|
||||
const char *base) /* I - Base filename of output */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
char filename[255]; /* Output filename */
|
||||
@@ -147,13 +147,13 @@ test_gray(int num_comps, /* I - Number of components */
|
||||
|
||||
for (i = 0; i < num_comps; i ++)
|
||||
{
|
||||
sprintf(filename, "%s%d.pgm", basename, i);
|
||||
sprintf(filename, "%s%d.pgm", base, i);
|
||||
out[i] = fopen(filename, "wb");
|
||||
|
||||
fprintf(out[i], "P5\n%d %d 255\n", width, height);
|
||||
}
|
||||
|
||||
sprintf(filename, "%s.ppm", basename);
|
||||
sprintf(filename, "%s.ppm", base);
|
||||
comp = fopen(filename, "wb");
|
||||
|
||||
fprintf(comp, "P6\n%d %d 255\n", width, height);
|
||||
@@ -260,7 +260,7 @@ test_gray(int num_comps, /* I - Number of components */
|
||||
|
||||
void
|
||||
test_rgb(int num_comps, /* I - Number of components */
|
||||
const char *basename) /* I - Base filename of output */
|
||||
const char *base) /* I - Base filename of output */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
char filename[255]; /* Output filename */
|
||||
@@ -325,13 +325,13 @@ test_rgb(int num_comps, /* I - Number of components */
|
||||
|
||||
for (i = 0; i < num_comps; i ++)
|
||||
{
|
||||
sprintf(filename, "%s%d.pgm", basename, i);
|
||||
sprintf(filename, "%s%d.pgm", base, i);
|
||||
out[i] = fopen(filename, "wb");
|
||||
|
||||
fprintf(out[i], "P5\n%d %d 255\n", width, height);
|
||||
}
|
||||
|
||||
sprintf(filename, "%s.ppm", basename);
|
||||
sprintf(filename, "%s.ppm", base);
|
||||
comp = fopen(filename, "wb");
|
||||
|
||||
fprintf(comp, "P6\n%d %d 255\n", width, height);
|
||||
|
||||
+9
-10
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Test the new RGB color separation code for CUPS.
|
||||
*
|
||||
* Copyright 2007-2010 by Apple Inc.
|
||||
* Copyright 2007-2011 by Apple Inc.
|
||||
* Copyright 1993-2006 by Easy Software Products, All Rights Reserved.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
@@ -33,10 +33,9 @@
|
||||
|
||||
|
||||
void test_gray(cups_sample_t *samples, int num_samples,
|
||||
int cube_size, int num_comps, const char *basename);
|
||||
int cube_size, int num_comps, const char *base);
|
||||
void test_rgb(cups_sample_t *samples, int num_samples,
|
||||
int cube_size, int num_comps,
|
||||
const char *basename);
|
||||
int cube_size, int num_comps, const char *base);
|
||||
|
||||
|
||||
/*
|
||||
@@ -92,7 +91,7 @@ test_gray(cups_sample_t *samples, /* I - Sample values */
|
||||
int num_samples, /* I - Number of samples */
|
||||
int cube_size, /* I - Cube size */
|
||||
int num_comps, /* I - Number of components */
|
||||
const char *basename) /* I - Base filename of output */
|
||||
const char *base) /* I - Base filename of output */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
char filename[255]; /* Output filename */
|
||||
@@ -135,13 +134,13 @@ test_gray(cups_sample_t *samples, /* I - Sample values */
|
||||
|
||||
for (i = 0; i < num_comps; i ++)
|
||||
{
|
||||
sprintf(filename, "%s%d.pgm", basename, i);
|
||||
sprintf(filename, "%s%d.pgm", base, i);
|
||||
out[i] = fopen(filename, "wb");
|
||||
|
||||
fprintf(out[i], "P5\n%d %d 255\n", width, height);
|
||||
}
|
||||
|
||||
sprintf(filename, "%s.ppm", basename);
|
||||
sprintf(filename, "%s.ppm", base);
|
||||
comp = fopen(filename, "wb");
|
||||
|
||||
fprintf(comp, "P6\n%d %d 255\n", width, height);
|
||||
@@ -222,7 +221,7 @@ test_rgb(cups_sample_t *samples, /* I - Sample values */
|
||||
int num_samples, /* I - Number of samples */
|
||||
int cube_size, /* I - Cube size */
|
||||
int num_comps, /* I - Number of components */
|
||||
const char *basename) /* I - Base filename of output */
|
||||
const char *base) /* I - Base filename of output */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
char filename[255]; /* Output filename */
|
||||
@@ -265,13 +264,13 @@ test_rgb(cups_sample_t *samples, /* I - Sample values */
|
||||
|
||||
for (i = 0; i < num_comps; i ++)
|
||||
{
|
||||
sprintf(filename, "%s%d.pgm", basename, i);
|
||||
sprintf(filename, "%s%d.pgm", base, i);
|
||||
out[i] = fopen(filename, "wb");
|
||||
|
||||
fprintf(out[i], "P5\n%d %d 255\n", width, height);
|
||||
}
|
||||
|
||||
sprintf(filename, "%s.ppm", basename);
|
||||
sprintf(filename, "%s.ppm", base);
|
||||
comp = fopen(filename, "wb");
|
||||
|
||||
fprintf(comp, "P6\n%d %d 255\n", width, height);
|
||||
|
||||
+6
-6
@@ -321,7 +321,7 @@ gziptoany: gziptoany.o ../Makedefs ../cups/$(LIBCUPS)
|
||||
libcupsimage.so.2 libcupsimage.sl.2: $(IMAGEOBJS)
|
||||
echo Linking $@...
|
||||
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS) $(DSOLIBS) \
|
||||
-L../cups $(LINKCUPS) -lm
|
||||
-L../cups $(LINKCUPS)
|
||||
$(RM) `basename $@ .2`
|
||||
$(LN) $@ `basename $@ .2`
|
||||
|
||||
@@ -334,7 +334,7 @@ libcupsimage.so.2 libcupsimage.sl.2: $(IMAGEOBJS)
|
||||
echo Linking 32-bit $@...
|
||||
-mkdir 32bit
|
||||
$(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(IMAGE32OBJS) $(DSOLIBS) \
|
||||
-L../cups/32bit $(LINKCUPS) -lm
|
||||
-L../cups/32bit $(LINKCUPS)
|
||||
|
||||
|
||||
#
|
||||
@@ -345,7 +345,7 @@ libcupsimage.so.2 libcupsimage.sl.2: $(IMAGEOBJS)
|
||||
echo Linking 64-bit $@...
|
||||
-mkdir 64bit
|
||||
$(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(IMAGE64OBJS) $(DSOLIBS) \
|
||||
-L../cups/64bit $(LINKCUPS) -lm
|
||||
-L../cups/64bit $(LINKCUPS)
|
||||
|
||||
|
||||
#
|
||||
@@ -358,7 +358,7 @@ libcupsimage.2.dylib: $(IMAGEOBJS) $(LIBCUPSIMAGEORDER)
|
||||
-install_name $(libdir)/$@ \
|
||||
-current_version 2.3.0 \
|
||||
-compatibility_version 2.0.0 \
|
||||
$(IMAGEOBJS) $(DSOLIBS) -L../cups $(LINKCUPS) -lm
|
||||
$(IMAGEOBJS) $(DSOLIBS) -L../cups $(LINKCUPS)
|
||||
$(RM) libcupsimage.dylib
|
||||
$(LN) $@ libcupsimage.dylib
|
||||
|
||||
@@ -370,7 +370,7 @@ libcupsimage.2.dylib: $(IMAGEOBJS) $(LIBCUPSIMAGEORDER)
|
||||
libcupsimage_s.a: $(IMAGEOBJS) libcupsimage_s.exp
|
||||
echo Linking $@...
|
||||
$(DSO) $(DSOFLAGS) -Wl,-berok,-bexport:libcupsimage_s.exp \
|
||||
-o libcupsimage_s.o $(IMAGEOBJS) $(DSOLIBS) -lm
|
||||
-o libcupsimage_s.o $(IMAGEOBJS) $(DSOLIBS)
|
||||
$(RM) $@
|
||||
$(AR) $(ARFLAGS) $@ libcupsimage_s.o
|
||||
|
||||
@@ -435,7 +435,7 @@ imagetoraster: imagetoraster.o common.o $(LIBCUPSIMAGE) \
|
||||
|
||||
pstops: pstops.o common.o ../cups/$(LIBCUPS)
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ pstops.o common.o $(LIBS) -lm
|
||||
$(CC) $(LDFLAGS) -o $@ pstops.o common.o $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
|
||||
+29
-31
@@ -353,7 +353,7 @@ gif_get_code(FILE *fp, /* I - File to read from */
|
||||
* Read in another buffer...
|
||||
*/
|
||||
|
||||
if ((count = gif_get_block (fp, buf + last_byte)) <= 0)
|
||||
if ((count = gif_get_block(fp, buf + last_byte)) <= 0)
|
||||
{
|
||||
/*
|
||||
* Whoops, no more data!
|
||||
@@ -582,19 +582,13 @@ gif_read_lzw(FILE *fp, /* I - File to read from */
|
||||
gif_get_code(fp, 0, 1);
|
||||
|
||||
/*
|
||||
* Wipe the decompressor table...
|
||||
* Wipe the decompressor table (already mostly 0 due to the calloc above...)
|
||||
*/
|
||||
|
||||
fresh = 1;
|
||||
|
||||
for (i = 0; i < clear_code; i ++)
|
||||
{
|
||||
table[0][i] = 0;
|
||||
for (i = 1; i < clear_code; i ++)
|
||||
table[1][i] = i;
|
||||
}
|
||||
|
||||
for (; i < 4096; i ++)
|
||||
table[0][i] = table[1][0] = 0;
|
||||
|
||||
sp = stack;
|
||||
|
||||
@@ -605,29 +599,30 @@ gif_read_lzw(FILE *fp, /* I - File to read from */
|
||||
fresh = 0;
|
||||
|
||||
do
|
||||
{
|
||||
firstcode = oldcode = gif_get_code(fp, code_size, 0);
|
||||
}
|
||||
while (firstcode == clear_code);
|
||||
|
||||
return (firstcode);
|
||||
return (firstcode & 255);
|
||||
}
|
||||
else if (!table)
|
||||
return (0);
|
||||
|
||||
if (sp > stack)
|
||||
return (*--sp);
|
||||
return ((*--sp) & 255);
|
||||
|
||||
while ((code = gif_get_code (fp, code_size, 0)) >= 0)
|
||||
while ((code = gif_get_code(fp, code_size, 0)) >= 0)
|
||||
{
|
||||
if (code == clear_code)
|
||||
{
|
||||
for (i = 0; i < clear_code; i ++)
|
||||
{
|
||||
table[0][i] = 0;
|
||||
table[1][i] = i;
|
||||
}
|
||||
/*
|
||||
* Clear/reset the compression table...
|
||||
*/
|
||||
|
||||
for (; i < 4096; i ++)
|
||||
table[0][i] = table[1][i] = 0;
|
||||
memset(table, 0, 2 * sizeof(gif_table_t));
|
||||
for (i = 1; i < clear_code; i ++)
|
||||
table[1][i] = i;
|
||||
|
||||
code_size = set_code_size + 1;
|
||||
max_code_size = 2 * clear_code;
|
||||
@@ -637,12 +632,11 @@ gif_read_lzw(FILE *fp, /* I - File to read from */
|
||||
|
||||
firstcode = oldcode = gif_get_code(fp, code_size, 0);
|
||||
|
||||
return (firstcode);
|
||||
return (firstcode & 255);
|
||||
}
|
||||
else if (code == end_code)
|
||||
else if (code == end_code || code > max_code)
|
||||
{
|
||||
unsigned char buf[260];
|
||||
|
||||
unsigned char buf[260]; /* Block buffer */
|
||||
|
||||
if (!gif_eof)
|
||||
while (gif_get_block(fp, buf) > 0);
|
||||
@@ -652,13 +646,15 @@ gif_read_lzw(FILE *fp, /* I - File to read from */
|
||||
|
||||
incode = code;
|
||||
|
||||
if (code >= max_code)
|
||||
if (code == max_code)
|
||||
{
|
||||
*sp++ = firstcode;
|
||||
code = oldcode;
|
||||
if (sp < (stack + 8192))
|
||||
*sp++ = firstcode;
|
||||
|
||||
code = oldcode;
|
||||
}
|
||||
|
||||
while (code >= clear_code)
|
||||
while (code >= clear_code && sp < (stack + 8192))
|
||||
{
|
||||
*sp++ = table[1][code];
|
||||
if (code == table[0][code])
|
||||
@@ -667,8 +663,10 @@ gif_read_lzw(FILE *fp, /* I - File to read from */
|
||||
code = table[0][code];
|
||||
}
|
||||
|
||||
*sp++ = firstcode = table[1][code];
|
||||
code = max_code;
|
||||
if (sp < (stack + 8192))
|
||||
*sp++ = firstcode = table[1][code];
|
||||
|
||||
code = max_code;
|
||||
|
||||
if (code < 4096)
|
||||
{
|
||||
@@ -686,10 +684,10 @@ gif_read_lzw(FILE *fp, /* I - File to read from */
|
||||
oldcode = incode;
|
||||
|
||||
if (sp > stack)
|
||||
return (*--sp);
|
||||
return ((*--sp) & 255);
|
||||
}
|
||||
|
||||
return (code);
|
||||
return (code & 255);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+4
-3
@@ -349,9 +349,10 @@ cupsImageOpen(
|
||||
* Load the image as appropriate...
|
||||
*/
|
||||
|
||||
img->max_ics = CUPS_TILE_MINIMUM;
|
||||
img->xppi = 128;
|
||||
img->yppi = 128;
|
||||
img->cachefile = -1;
|
||||
img->max_ics = CUPS_TILE_MINIMUM;
|
||||
img->xppi = 128;
|
||||
img->yppi = 128;
|
||||
|
||||
if (!memcmp(header, "GIF87a", 6) || !memcmp(header, "GIF89a", 6))
|
||||
status = _cupsImageReadGIF(img, fp, primary, secondary, saturation, hue,
|
||||
|
||||
@@ -820,7 +820,7 @@ error_stack(_cups_ps_stack_t *st, /* I - Stack */
|
||||
_cups_ps_obj_t *obj; /* Current object on stack */
|
||||
|
||||
|
||||
_cupsRasterAddError(title);
|
||||
_cupsRasterAddError("%s", title);
|
||||
|
||||
for (obj = st->objs, c = st->num_objs; c > 0; c --, obj ++)
|
||||
error_object(obj);
|
||||
|
||||
+12
-11
@@ -1594,10 +1594,7 @@ copy_page(cups_file_t *fp, /* I - File to read from */
|
||||
*/
|
||||
|
||||
if (linelen > 0 && !strncmp(line, "%%EndPageSetup", 14))
|
||||
{
|
||||
linelen = cupsFileGetLine(fp, line, linesize);
|
||||
has_page_setup = 0;
|
||||
}
|
||||
linelen = cupsFileGetLine(fp, line, linesize);
|
||||
}
|
||||
|
||||
if (first_page)
|
||||
@@ -2880,6 +2877,17 @@ start_nup(pstops_doc_t *doc, /* I - Document information */
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Mirror the page as needed...
|
||||
*/
|
||||
|
||||
if (doc->mirror)
|
||||
doc_printf(doc, "%.1f 0.0 translate -1 1 scale\n", PageWidth);
|
||||
|
||||
/*
|
||||
* Offset and scale as necessary for fitplot/fit-to-page/number-up...
|
||||
*/
|
||||
|
||||
if (Duplex && doc->number_up > 1 && ((number / doc->number_up) & 1))
|
||||
doc_printf(doc, "%.1f %.1f translate\n", PageWidth - PageRight, PageBottom);
|
||||
else if (doc->number_up > 1 || doc->fitplot)
|
||||
@@ -3234,13 +3242,6 @@ start_nup(pstops_doc_t *doc, /* I - Document information */
|
||||
bboxx + margin, bboxy + margin,
|
||||
bboxw - 2 * margin, bboxl - 2 * margin);
|
||||
}
|
||||
|
||||
/*
|
||||
* Mirror the page as needed...
|
||||
*/
|
||||
|
||||
if (doc->mirror)
|
||||
doc_printf(doc, "%.1f 0.0 translate -1 1 scale\n", PageWidth);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+120
-24
@@ -347,7 +347,8 @@ cupsRasterReadPixels(cups_raster_t *r, /* I - Raster stream */
|
||||
int count; /* Repetition count */
|
||||
|
||||
|
||||
if (r == NULL || r->mode != CUPS_RASTER_READ || r->remaining == 0)
|
||||
if (r == NULL || r->mode != CUPS_RASTER_READ || r->remaining == 0 ||
|
||||
r->header.cupsBytesPerLine == 0)
|
||||
return (0);
|
||||
|
||||
if (!r->compressed)
|
||||
@@ -565,22 +566,79 @@ cupsRasterWriteHeader(
|
||||
if (r->mode == CUPS_RASTER_WRITE_PWG)
|
||||
{
|
||||
/*
|
||||
* PWG raster data is always network byte order with most of the page header
|
||||
* PWG raster data is always network byte order with much of the page header
|
||||
* zeroed.
|
||||
*/
|
||||
|
||||
cups_page_header2_t fh; /* File page header */
|
||||
|
||||
memset(&fh, 0, sizeof(fh));
|
||||
fh.HWResolution[0] = htonl(r->header.HWResolution[0]);
|
||||
fh.HWResolution[1] = htonl(r->header.HWResolution[1]);
|
||||
fh.cupsWidth = htonl(r->header.cupsWidth);
|
||||
fh.cupsHeight = htonl(r->header.cupsHeight);
|
||||
fh.cupsBitsPerColor = htonl(r->header.cupsBitsPerColor);
|
||||
fh.cupsBitsPerPixel = htonl(r->header.cupsBitsPerPixel);
|
||||
fh.cupsBytesPerLine = htonl(r->header.cupsBytesPerLine);
|
||||
fh.cupsColorOrder = htonl(r->header.cupsColorOrder);
|
||||
fh.cupsColorSpace = htonl(r->header.cupsColorSpace);
|
||||
|
||||
strlcpy(fh.MediaClass, "PwgRaster", sizeof(fh.MediaClass));
|
||||
/* PwgRaster */
|
||||
strlcpy(fh.MediaColor, r->header.MediaColor, sizeof(fh.MediaColor));
|
||||
strlcpy(fh.MediaType, r->header.MediaType, sizeof(fh.MediaType));
|
||||
strlcpy(fh.OutputType, r->header.OutputType, sizeof(fh.OutputType));
|
||||
/* PrintContentType */
|
||||
|
||||
fh.CutMedia = htonl(r->header.CutMedia);
|
||||
fh.Duplex = htonl(r->header.Duplex);
|
||||
fh.HWResolution[0] = htonl(r->header.HWResolution[0]);
|
||||
fh.HWResolution[1] = htonl(r->header.HWResolution[1]);
|
||||
fh.ImagingBoundingBox[0] = htonl(r->header.ImagingBoundingBox[0]);
|
||||
fh.ImagingBoundingBox[1] = htonl(r->header.ImagingBoundingBox[1]);
|
||||
fh.ImagingBoundingBox[2] = htonl(r->header.ImagingBoundingBox[2]);
|
||||
fh.ImagingBoundingBox[3] = htonl(r->header.ImagingBoundingBox[3]);
|
||||
fh.InsertSheet = htonl(r->header.InsertSheet);
|
||||
fh.Jog = htonl(r->header.Jog);
|
||||
fh.LeadingEdge = htonl(r->header.LeadingEdge);
|
||||
fh.ManualFeed = htonl(r->header.ManualFeed);
|
||||
fh.MediaPosition = htonl(r->header.MediaPosition);
|
||||
fh.MediaWeight = htonl(r->header.MediaWeight);
|
||||
fh.NumCopies = htonl(r->header.NumCopies);
|
||||
fh.Orientation = htonl(r->header.Orientation);
|
||||
fh.PageSize[0] = htonl(r->header.PageSize[0]);
|
||||
fh.PageSize[1] = htonl(r->header.PageSize[1]);
|
||||
fh.Tumble = htonl(r->header.Tumble);
|
||||
fh.cupsWidth = htonl(r->header.cupsWidth);
|
||||
fh.cupsHeight = htonl(r->header.cupsHeight);
|
||||
fh.cupsBitsPerColor = htonl(r->header.cupsBitsPerColor);
|
||||
fh.cupsBitsPerPixel = htonl(r->header.cupsBitsPerPixel);
|
||||
fh.cupsBytesPerLine = htonl(r->header.cupsBytesPerLine);
|
||||
fh.cupsColorOrder = htonl(r->header.cupsColorOrder);
|
||||
fh.cupsColorSpace = htonl(r->header.cupsColorSpace);
|
||||
fh.cupsNumColors = htonl(r->header.cupsNumColors);
|
||||
fh.cupsInteger[0] = htonl(r->header.cupsInteger[0]);
|
||||
/* TotalPageCount */
|
||||
fh.cupsInteger[1] = htonl(r->header.cupsInteger[1]);
|
||||
/* CrossFeedTransform */
|
||||
fh.cupsInteger[2] = htonl(r->header.cupsInteger[2]);
|
||||
/* FeedTransform */
|
||||
fh.cupsInteger[3] = htonl(r->header.cupsInteger[3]);
|
||||
/* ImageBoxLeft */
|
||||
fh.cupsInteger[4] = htonl(r->header.cupsInteger[4]);
|
||||
/* ImageBoxTop */
|
||||
fh.cupsInteger[5] = htonl(r->header.cupsInteger[5]);
|
||||
/* ImageBoxRight */
|
||||
fh.cupsInteger[6] = htonl(r->header.cupsInteger[6]);
|
||||
/* ImageBoxBottom */
|
||||
fh.cupsInteger[7] = htonl(r->header.cupsInteger[7]);
|
||||
/* BlackPrimary */
|
||||
fh.cupsInteger[8] = htonl(r->header.cupsInteger[8]);
|
||||
/* PrintQuality */
|
||||
fh.cupsInteger[14] = htonl(r->header.cupsInteger[14]);
|
||||
/* VendorIdentifier */
|
||||
fh.cupsInteger[15] = htonl(r->header.cupsInteger[15]);
|
||||
/* VendorLength */
|
||||
|
||||
memcpy(fh.cupsReal, r->header.cupsReal,
|
||||
sizeof(fh.cupsReal) + sizeof(fh.cupsString));
|
||||
/* VendorData */
|
||||
|
||||
strlcpy(fh.cupsRenderingIntent, r->header.cupsRenderingIntent,
|
||||
sizeof(fh.cupsRenderingIntent));
|
||||
strlcpy(fh.cupsPageSizeName, r->header.cupsPageSizeName,
|
||||
sizeof(fh.cupsPageSizeName));
|
||||
|
||||
return (cups_raster_io(r, (unsigned char *)&fh, sizeof(fh)) == sizeof(fh));
|
||||
}
|
||||
@@ -630,16 +688,54 @@ cupsRasterWriteHeader2(
|
||||
cups_page_header2_t fh; /* File page header */
|
||||
|
||||
memset(&fh, 0, sizeof(fh));
|
||||
fh.HWResolution[0] = htonl(r->header.HWResolution[0]);
|
||||
fh.HWResolution[1] = htonl(r->header.HWResolution[1]);
|
||||
fh.cupsWidth = htonl(r->header.cupsWidth);
|
||||
fh.cupsHeight = htonl(r->header.cupsHeight);
|
||||
fh.cupsBitsPerColor = htonl(r->header.cupsBitsPerColor);
|
||||
fh.cupsBitsPerPixel = htonl(r->header.cupsBitsPerPixel);
|
||||
fh.cupsBytesPerLine = htonl(r->header.cupsBytesPerLine);
|
||||
fh.cupsColorOrder = htonl(r->header.cupsColorOrder);
|
||||
fh.cupsColorSpace = htonl(r->header.cupsColorSpace);
|
||||
fh.cupsNumColors = htonl(r->header.cupsNumColors);
|
||||
strlcpy(fh.MediaClass, "PwgRaster", sizeof(fh.MediaClass));
|
||||
strlcpy(fh.MediaColor, r->header.MediaColor, sizeof(fh.MediaColor));
|
||||
strlcpy(fh.MediaType, r->header.MediaType, sizeof(fh.MediaType));
|
||||
strlcpy(fh.OutputType, r->header.OutputType, sizeof(fh.OutputType));
|
||||
strlcpy(fh.cupsRenderingIntent, r->header.cupsRenderingIntent,
|
||||
sizeof(fh.cupsRenderingIntent));
|
||||
strlcpy(fh.cupsPageSizeName, r->header.cupsPageSizeName,
|
||||
sizeof(fh.cupsPageSizeName));
|
||||
|
||||
fh.CutMedia = htonl(r->header.CutMedia);
|
||||
fh.Duplex = htonl(r->header.Duplex);
|
||||
fh.HWResolution[0] = htonl(r->header.HWResolution[0]);
|
||||
fh.HWResolution[1] = htonl(r->header.HWResolution[1]);
|
||||
fh.ImagingBoundingBox[0] = htonl(r->header.ImagingBoundingBox[0]);
|
||||
fh.ImagingBoundingBox[1] = htonl(r->header.ImagingBoundingBox[1]);
|
||||
fh.ImagingBoundingBox[2] = htonl(r->header.ImagingBoundingBox[2]);
|
||||
fh.ImagingBoundingBox[3] = htonl(r->header.ImagingBoundingBox[3]);
|
||||
fh.InsertSheet = htonl(r->header.InsertSheet);
|
||||
fh.Jog = htonl(r->header.Jog);
|
||||
fh.LeadingEdge = htonl(r->header.LeadingEdge);
|
||||
fh.ManualFeed = htonl(r->header.ManualFeed);
|
||||
fh.MediaPosition = htonl(r->header.MediaPosition);
|
||||
fh.MediaWeight = htonl(r->header.MediaWeight);
|
||||
fh.NumCopies = htonl(r->header.NumCopies);
|
||||
fh.Orientation = htonl(r->header.Orientation);
|
||||
fh.PageSize[0] = htonl(r->header.PageSize[0]);
|
||||
fh.PageSize[1] = htonl(r->header.PageSize[1]);
|
||||
fh.Tumble = htonl(r->header.Tumble);
|
||||
fh.cupsWidth = htonl(r->header.cupsWidth);
|
||||
fh.cupsHeight = htonl(r->header.cupsHeight);
|
||||
fh.cupsBitsPerColor = htonl(r->header.cupsBitsPerColor);
|
||||
fh.cupsBitsPerPixel = htonl(r->header.cupsBitsPerPixel);
|
||||
fh.cupsBytesPerLine = htonl(r->header.cupsBytesPerLine);
|
||||
fh.cupsColorOrder = htonl(r->header.cupsColorOrder);
|
||||
fh.cupsColorSpace = htonl(r->header.cupsColorSpace);
|
||||
fh.cupsNumColors = htonl(r->header.cupsNumColors);
|
||||
fh.cupsInteger[0] = htonl(r->header.cupsInteger[0]);
|
||||
fh.cupsInteger[1] = htonl(r->header.cupsInteger[1]);
|
||||
fh.cupsInteger[2] = htonl(r->header.cupsInteger[2]);
|
||||
fh.cupsInteger[3] = htonl((unsigned)(r->header.cupsImagingBBox[0] *
|
||||
r->header.HWResolution[0]));
|
||||
fh.cupsInteger[4] = htonl((unsigned)(r->header.cupsImagingBBox[1] *
|
||||
r->header.HWResolution[1]));
|
||||
fh.cupsInteger[5] = htonl((unsigned)(r->header.cupsImagingBBox[2] *
|
||||
r->header.HWResolution[0]));
|
||||
fh.cupsInteger[6] = htonl((unsigned)(r->header.cupsImagingBBox[3] *
|
||||
r->header.HWResolution[1]));
|
||||
fh.cupsInteger[7] = htonl(0xffffff);
|
||||
|
||||
return (cups_raster_io(r, (unsigned char *)&fh, sizeof(fh)) == sizeof(fh));
|
||||
}
|
||||
@@ -895,7 +991,7 @@ cups_raster_read_header(
|
||||
|
||||
cups_raster_update(r);
|
||||
|
||||
return (1);
|
||||
return (r->header.cupsBytesPerLine != 0 && r->header.cupsHeight != 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -904,7 +1000,7 @@ cups_raster_read_header(
|
||||
*/
|
||||
|
||||
static int /* O - Bytes read or -1 */
|
||||
cups_raster_io(cups_raster_t *r, /* I - Raster stream */
|
||||
cups_raster_io(cups_raster_t *r, /* I - Raster stream */
|
||||
unsigned char *buf, /* I - Buffer for read/write */
|
||||
int bytes) /* I - Number of bytes to read/write */
|
||||
{
|
||||
@@ -914,7 +1010,7 @@ cups_raster_io(cups_raster_t *r, /* I - Raster stream */
|
||||
|
||||
DEBUG_printf(("4cups_raster_io(r=%p, buf=%p, bytes=%d)", r, buf, bytes));
|
||||
|
||||
for (total = 0; total < bytes; total += count, buf += count)
|
||||
for (total = 0; total < (size_t)bytes; total += count, buf += count)
|
||||
{
|
||||
count = (*r->iocb)(r->ctx, buf, bytes - total);
|
||||
|
||||
|
||||
+248
-5
@@ -22,10 +22,8 @@
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include <cups/cups.h>
|
||||
#include <cups/language-private.h>
|
||||
#include <cups/cups-private.h>
|
||||
#include <cups/raster.h>
|
||||
#include <cups/string-private.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
@@ -54,6 +52,14 @@ main(int argc, /* I - Number of command-line args */
|
||||
linesize, /* Bytes per line */
|
||||
lineoffset; /* Offset into line */
|
||||
unsigned char white; /* White pixel */
|
||||
ppd_file_t *ppd; /* PPD file */
|
||||
ppd_attr_t *back; /* cupsBackSize attribute */
|
||||
_ppd_cache_t *cache; /* PPD cache */
|
||||
_pwg_size_t *pwg_size; /* PWG media size */
|
||||
_pwg_media_t *pwg_media; /* PWG media name */
|
||||
int num_options; /* Number of options */
|
||||
cups_option_t *options = NULL;/* Options */
|
||||
const char *val; /* Option value */
|
||||
|
||||
|
||||
if (argc < 6 || argc > 7)
|
||||
@@ -75,6 +81,16 @@ main(int argc, /* I - Number of command-line args */
|
||||
inras = cupsRasterOpen(fd, CUPS_RASTER_READ);
|
||||
outras = cupsRasterOpen(1, CUPS_RASTER_WRITE_PWG);
|
||||
|
||||
ppd = ppdOpenFile(getenv("PPD"));
|
||||
back = ppdFindAttr(ppd, "cupsBackSide", NULL);
|
||||
|
||||
num_options = cupsParseOptions(argv[5], 0, &options);
|
||||
|
||||
ppdMarkDefaults(ppd);
|
||||
cupsMarkOptions(ppd, num_options, options);
|
||||
|
||||
cache = ppd ? ppd->cache : NULL;
|
||||
|
||||
while (cupsRasterReadHeader2(inras, &inheader))
|
||||
{
|
||||
/*
|
||||
@@ -126,6 +142,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
case CUPS_CSPACE_DEVICEF :
|
||||
white = 0;
|
||||
break;
|
||||
|
||||
default :
|
||||
_cupsLangPrintFilter(stderr, "ERROR", _("Unsupported raster data."));
|
||||
fprintf(stderr, "DEBUG: Unsupported cupsColorSpace %d on page %d.\n",
|
||||
@@ -151,10 +168,236 @@ main(int argc, /* I - Number of command-line args */
|
||||
}
|
||||
|
||||
memcpy(&outheader, &inheader, sizeof(outheader));
|
||||
outheader.cupsWidth = page_width;
|
||||
outheader.cupsWidth = page_width;
|
||||
outheader.cupsHeight = page_height;
|
||||
outheader.cupsBytesPerLine = linesize;
|
||||
|
||||
outheader.cupsInteger[14] = 0; /* VendorIdentifier */
|
||||
outheader.cupsInteger[15] = 0; /* VendorLength */
|
||||
|
||||
if ((val = cupsGetOption("print-content-optimize", num_options,
|
||||
options)) != NULL)
|
||||
{
|
||||
if (!strcmp(val, "automatic"))
|
||||
strlcpy(outheader.OutputType, "Automatic",
|
||||
sizeof(outheader.OutputType));
|
||||
else if (!strcmp(val, "graphics"))
|
||||
strlcpy(outheader.OutputType, "Graphics", sizeof(outheader.OutputType));
|
||||
else if (!strcmp(val, "photo"))
|
||||
strlcpy(outheader.OutputType, "Photo", sizeof(outheader.OutputType));
|
||||
else if (!strcmp(val, "text"))
|
||||
strlcpy(outheader.OutputType, "Text", sizeof(outheader.OutputType));
|
||||
else if (!strcmp(val, "text-and-graphics"))
|
||||
strlcpy(outheader.OutputType, "TextAndGraphics",
|
||||
sizeof(outheader.OutputType));
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "DEBUG: Unsupported print-content-type \"%s\".\n", val);
|
||||
outheader.OutputType[0] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
if ((val = cupsGetOption("print-quality", num_options, options)) != NULL)
|
||||
{
|
||||
int quality = atoi(val); /* print-quality value */
|
||||
|
||||
if (quality >= IPP_QUALITY_DRAFT && quality <= IPP_QUALITY_HIGH)
|
||||
outheader.cupsInteger[8] = quality;
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "DEBUG: Unsupported print-quality %d.\n", quality);
|
||||
outheader.cupsInteger[8] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ((val = cupsGetOption("print-rendering-intent", num_options,
|
||||
options)) != NULL)
|
||||
{
|
||||
if (!strcmp(val, "absolute"))
|
||||
strlcpy(outheader.cupsRenderingIntent, "Absolute",
|
||||
sizeof(outheader.cupsRenderingIntent));
|
||||
else if (!strcmp(val, "automatic"))
|
||||
strlcpy(outheader.cupsRenderingIntent, "Automatic",
|
||||
sizeof(outheader.cupsRenderingIntent));
|
||||
else if (!strcmp(val, "perceptual"))
|
||||
strlcpy(outheader.cupsRenderingIntent, "Perceptual",
|
||||
sizeof(outheader.cupsRenderingIntent));
|
||||
else if (!strcmp(val, "relative"))
|
||||
strlcpy(outheader.cupsRenderingIntent, "Relative",
|
||||
sizeof(outheader.cupsRenderingIntent));
|
||||
else if (!strcmp(val, "relative-bpc"))
|
||||
strlcpy(outheader.cupsRenderingIntent, "RelativeBpc",
|
||||
sizeof(outheader.cupsRenderingIntent));
|
||||
else if (!strcmp(val, "saturation"))
|
||||
strlcpy(outheader.cupsRenderingIntent, "Saturation",
|
||||
sizeof(outheader.cupsRenderingIntent));
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "DEBUG: Unsupported print-rendering-intent \"%s\".\n",
|
||||
val);
|
||||
outheader.cupsRenderingIntent[0] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
if (inheader.cupsPageSizeName[0] &&
|
||||
(pwg_size = _ppdCacheGetSize(cache, inheader.cupsPageSizeName)) != NULL)
|
||||
{
|
||||
strlcpy(outheader.cupsPageSizeName, pwg_size->map.pwg,
|
||||
sizeof(outheader.cupsPageSizeName));
|
||||
}
|
||||
else
|
||||
{
|
||||
pwg_media = _pwgMediaForSize((int)(2540.0 * inheader.cupsPageSize[0] /
|
||||
72.0),
|
||||
(int)(2540.0 * inheader.cupsPageSize[1] /
|
||||
72.0));
|
||||
|
||||
if (pwg_media)
|
||||
strlcpy(outheader.cupsPageSizeName, pwg_media->pwg,
|
||||
sizeof(outheader.cupsPageSizeName));
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "DEBUG: Unsupported PageSize %.2fx%.2f.\n",
|
||||
inheader.cupsPageSize[0], inheader.cupsPageSize[1]);
|
||||
outheader.cupsPageSizeName[0] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
if (inheader.Duplex && !(page & 1) &&
|
||||
back && _cups_strcasecmp(back->value, "Normal"))
|
||||
{
|
||||
if (_cups_strcasecmp(back->value, "Flipped"))
|
||||
{
|
||||
if (inheader.Tumble)
|
||||
{
|
||||
outheader.cupsInteger[1] = -1;/* CrossFeedTransform */
|
||||
outheader.cupsInteger[2] = 1; /* FeedTransform */
|
||||
|
||||
outheader.cupsInteger[3] = page_width - page_left -
|
||||
inheader.cupsWidth;
|
||||
/* ImageBoxLeft */
|
||||
outheader.cupsInteger[4] = page_top;
|
||||
/* ImageBoxTop */
|
||||
outheader.cupsInteger[5] = page_width - page_left;
|
||||
/* ImageBoxRight */
|
||||
outheader.cupsInteger[6] = page_height - page_bottom;
|
||||
/* ImageBoxBottom */
|
||||
}
|
||||
else
|
||||
{
|
||||
outheader.cupsInteger[1] = 1; /* CrossFeedTransform */
|
||||
outheader.cupsInteger[2] = -1;/* FeedTransform */
|
||||
|
||||
outheader.cupsInteger[3] = page_left;
|
||||
/* ImageBoxLeft */
|
||||
outheader.cupsInteger[4] = page_bottom;
|
||||
/* ImageBoxTop */
|
||||
outheader.cupsInteger[5] = page_left + inheader.cupsWidth;
|
||||
/* ImageBoxRight */
|
||||
outheader.cupsInteger[6] = page_height - page_top;
|
||||
/* ImageBoxBottom */
|
||||
}
|
||||
}
|
||||
else if (_cups_strcasecmp(back->value, "ManualTumble"))
|
||||
{
|
||||
if (inheader.Tumble)
|
||||
{
|
||||
outheader.cupsInteger[1] = -1;/* CrossFeedTransform */
|
||||
outheader.cupsInteger[2] = -1;/* FeedTransform */
|
||||
|
||||
outheader.cupsInteger[3] = page_width - page_left -
|
||||
inheader.cupsWidth;
|
||||
/* ImageBoxLeft */
|
||||
outheader.cupsInteger[4] = page_bottom;
|
||||
/* ImageBoxTop */
|
||||
outheader.cupsInteger[5] = page_width - page_left;
|
||||
/* ImageBoxRight */
|
||||
outheader.cupsInteger[6] = page_height - page_top;
|
||||
/* ImageBoxBottom */
|
||||
}
|
||||
else
|
||||
{
|
||||
outheader.cupsInteger[1] = 1; /* CrossFeedTransform */
|
||||
outheader.cupsInteger[2] = 1; /* FeedTransform */
|
||||
|
||||
outheader.cupsInteger[3] = page_left;
|
||||
/* ImageBoxLeft */
|
||||
outheader.cupsInteger[4] = page_top;
|
||||
/* ImageBoxTop */
|
||||
outheader.cupsInteger[5] = page_left + inheader.cupsWidth;
|
||||
/* ImageBoxRight */
|
||||
outheader.cupsInteger[6] = page_height - page_bottom;
|
||||
/* ImageBoxBottom */
|
||||
}
|
||||
}
|
||||
else if (_cups_strcasecmp(back->value, "Rotated"))
|
||||
{
|
||||
if (inheader.Tumble)
|
||||
{
|
||||
outheader.cupsInteger[1] = -1;/* CrossFeedTransform */
|
||||
outheader.cupsInteger[2] = -1;/* FeedTransform */
|
||||
|
||||
outheader.cupsInteger[3] = page_width - page_left -
|
||||
inheader.cupsWidth;
|
||||
/* ImageBoxLeft */
|
||||
outheader.cupsInteger[4] = page_bottom;
|
||||
/* ImageBoxTop */
|
||||
outheader.cupsInteger[5] = page_width - page_left;
|
||||
/* ImageBoxRight */
|
||||
outheader.cupsInteger[6] = page_height - page_top;
|
||||
/* ImageBoxBottom */
|
||||
}
|
||||
else
|
||||
{
|
||||
outheader.cupsInteger[1] = 1; /* CrossFeedTransform */
|
||||
outheader.cupsInteger[2] = 1; /* FeedTransform */
|
||||
|
||||
outheader.cupsInteger[3] = page_left;
|
||||
/* ImageBoxLeft */
|
||||
outheader.cupsInteger[4] = page_top;
|
||||
/* ImageBoxTop */
|
||||
outheader.cupsInteger[5] = page_left + inheader.cupsWidth;
|
||||
/* ImageBoxRight */
|
||||
outheader.cupsInteger[6] = page_height - page_bottom;
|
||||
/* ImageBoxBottom */
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Unsupported value...
|
||||
*/
|
||||
|
||||
fprintf(stderr, "DEBUG: Unsupported cupsBackSide \"%s\".\n", back->value);
|
||||
|
||||
outheader.cupsInteger[1] = 1; /* CrossFeedTransform */
|
||||
outheader.cupsInteger[2] = 1; /* FeedTransform */
|
||||
|
||||
outheader.cupsInteger[3] = page_left;
|
||||
/* ImageBoxLeft */
|
||||
outheader.cupsInteger[4] = page_top;
|
||||
/* ImageBoxTop */
|
||||
outheader.cupsInteger[5] = page_left + inheader.cupsWidth;
|
||||
/* ImageBoxRight */
|
||||
outheader.cupsInteger[6] = page_height - page_bottom;
|
||||
/* ImageBoxBottom */
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
outheader.cupsInteger[1] = 1; /* CrossFeedTransform */
|
||||
outheader.cupsInteger[2] = 1; /* FeedTransform */
|
||||
|
||||
outheader.cupsInteger[3] = page_left;
|
||||
/* ImageBoxLeft */
|
||||
outheader.cupsInteger[4] = page_top;
|
||||
/* ImageBoxTop */
|
||||
outheader.cupsInteger[5] = page_left + inheader.cupsWidth;
|
||||
/* ImageBoxRight */
|
||||
outheader.cupsInteger[6] = page_height - page_bottom;
|
||||
/* ImageBoxBottom */
|
||||
}
|
||||
|
||||
if (!cupsRasterWriteHeader2(outras, &outheader))
|
||||
{
|
||||
_cupsLangPrintFilter(stderr, "ERROR", _("Error sending raster data."));
|
||||
@@ -191,7 +434,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
}
|
||||
|
||||
memset(line, white, linesize);
|
||||
for (y = page_top; y > 0; y --)
|
||||
for (y = page_bottom; y > 0; y --)
|
||||
if (!cupsRasterWritePixels(outras, line, outheader.cupsBytesPerLine))
|
||||
{
|
||||
_cupsLangPrintFilter(stderr, "ERROR", _("Error sending raster data."));
|
||||
|
||||
@@ -165,9 +165,10 @@ f(x) = density * x <sup style='font-size: 100%'>gamma</sup>
|
||||
|
||||
<h4>Customizing the Profile Selection Keywords</h4>
|
||||
|
||||
<p>The <tt>MediaType</tt> and <tt>Resolution</tt> main keywords can be reassigned to different main keywords, allowing drivers to do color profile selection based on different parameters. The <tt>cupsICCQualifier2</tt> and <tt>cupsICCQualifier3</tt> keywords define the mapping from selector to main keyword:</p>
|
||||
<p>The <tt>ColorModel</tt>, <tt>MediaType</tt>, and <tt>Resolution</tt> main keywords can be reassigned to different main keywords, allowing drivers to do color profile selection based on different parameters. The <tt>cupsICCQualifier1</tt>, <tt>cupsICCQualifier2</tt>, and <tt>cupsICCQualifier3</tt> keywords define the mapping from selector to main keyword:</p>
|
||||
|
||||
<pre class='command'>
|
||||
*cupsICCQualifier1: MainKeyword1
|
||||
*cupsICCQualifier2: MainKeyword2
|
||||
*cupsICCQualifier3: MainKeyword3
|
||||
</pre>
|
||||
@@ -175,6 +176,7 @@ f(x) = density * x <sup style='font-size: 100%'>gamma</sup>
|
||||
<p>The default mapping is as follows:</p>
|
||||
|
||||
<pre class='command'>
|
||||
*cupsICCQualifier1: ColorModel
|
||||
*cupsICCQualifier2: MediaType
|
||||
*cupsICCQualifier3: Resolution
|
||||
</pre>
|
||||
|
||||
@@ -692,6 +692,12 @@ do_raster_tests(cups_mode_t mode) /* O - Write mode */
|
||||
expected.cupsHeight = 256;
|
||||
expected.cupsBytesPerLine = 256;
|
||||
|
||||
if (mode == CUPS_RASTER_WRITE_PWG)
|
||||
{
|
||||
strlcpy(expected.MediaClass, "PwgRaster", sizeof(expected.MediaClass));
|
||||
expected.cupsInteger[7] = 0xffffff;
|
||||
}
|
||||
|
||||
if (page & 1)
|
||||
{
|
||||
expected.cupsBytesPerLine *= 2;
|
||||
|
||||
+2
-2
@@ -140,9 +140,9 @@ pot: checkpo po2strings
|
||||
mv cups.pot.N cups.pot
|
||||
echo Checking cups.pot...
|
||||
./checkpo cups.pot
|
||||
for loc in $(LANGUAGES) ; do \
|
||||
for loc in *.po; do \
|
||||
echo Merging changes into cups_$$loc.po... ; \
|
||||
msgmerge -o cups_$$loc.po -s -N --no-location cups_$$loc.po cups.pot ; \
|
||||
msgmerge -o $$loc -s -N --no-location $$loc cups.pot ; \
|
||||
done
|
||||
echo Updating cups.strings...
|
||||
./po2strings cups.pot cups.strings
|
||||
|
||||
+599
-521
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+19
-1
@@ -88,6 +88,7 @@
|
||||
" %s Bad UTF-8 \"%s\" translation string for option %s, choice %s." = " %s Bad UTF-8 \"%s\" translation string for option %s, choice %s.";
|
||||
" %s Bad UTF-8 \"%s\" translation string for option %s." = " %s Bad UTF-8 \"%s\" translation string for option %s.";
|
||||
" %s Bad cupsFilter value \"%s\"." = " %s Bad cupsFilter value \"%s\".";
|
||||
" %s Bad cupsFilter2 value \"%s\"." = " %s Bad cupsFilter2 value \"%s\".";
|
||||
" %s Bad cupsICCProfile %s." = " %s Bad cupsICCProfile %s.";
|
||||
" %s Bad cupsPreFilter value \"%s\"." = " %s Bad cupsPreFilter value \"%s\".";
|
||||
" %s Bad cupsUIConstraints %s: \"%s\"" = " %s Bad cupsUIConstraints %s: \"%s\"";
|
||||
@@ -804,6 +805,23 @@
|
||||
"HP" = "HP";
|
||||
"Hanging Folder" = "Hanging Folder";
|
||||
"Hanging Folder - 9/16 x 2\"" = "Hanging Folder - 9/16 x 2\"";
|
||||
"IPP 1setOf attribute with incompatible value tags." = "IPP 1setOf attribute with incompatible value tags.";
|
||||
"IPP attribute has no name." = "IPP attribute has no name.";
|
||||
"IPP begCollection value not 0 bytes." = "IPP begCollection value not 0 bytes.";
|
||||
"IPP boolean value not 1 byte." = "IPP boolean value not 1 byte.";
|
||||
"IPP date value not 11 bytes." = "IPP date value not 11 bytes.";
|
||||
"IPP endCollection value not 0 bytes." = "IPP endCollection value not 0 bytes.";
|
||||
"IPP enum value not 4 bytes." = "IPP enum value not 4 bytes.";
|
||||
"IPP integer value not 4 bytes." = "IPP integer value not 4 bytes.";
|
||||
"IPP language length overflows value." = "IPP language length overflows value.";
|
||||
"IPP member name is not empty." = "IPP member name is not empty.";
|
||||
"IPP name larger than 32767 bytes." = "IPP name larger than 32767 bytes.";
|
||||
"IPP nameWithLanguage value less than minimum 4 bytes." = "IPP nameWithLanguage value less than minimum 4 bytes.";
|
||||
"IPP rangeOfInteger value not 8 bytes." = "IPP rangeOfInteger value not 8 bytes.";
|
||||
"IPP resolution value not 9 bytes." = "IPP resolution value not 9 bytes.";
|
||||
"IPP string length overflows value." = "IPP string length overflows value.";
|
||||
"IPP textWithLanguage value less than minimum 4 bytes." = "IPP textWithLanguage value less than minimum 4 bytes.";
|
||||
"IPP value larger than 32767 bytes." = "IPP value larger than 32767 bytes.";
|
||||
"ISOLatin1" = "ISOLatin1";
|
||||
"Illegal control character" = "Illegal control character";
|
||||
"Illegal main keyword string" = "Illegal main keyword string";
|
||||
@@ -889,6 +907,7 @@
|
||||
"Missing document-number attribute." = "Missing document-number attribute.";
|
||||
"Missing double quote on line %d." = "Missing double quote on line %d.";
|
||||
"Missing form variable" = "Missing form variable";
|
||||
"Missing last-document attribute in request." = "Missing last-document attribute in request.";
|
||||
"Missing media or media-col." = "Missing media or media-col.";
|
||||
"Missing media-size in media-col." = "Missing media-size in media-col.";
|
||||
"Missing notify-subscription-ids attribute." = "Missing notify-subscription-ids attribute.";
|
||||
@@ -1179,7 +1198,6 @@
|
||||
"Unable to change printer:" = "Unable to change printer:";
|
||||
"Unable to change server settings:" = "Unable to change server settings:";
|
||||
"Unable to connect to host." = "Unable to connect to host.";
|
||||
"Unable to connect to server" = "Unable to connect to server";
|
||||
"Unable to contact printer, queuing on next printer in class." = "Unable to contact printer, queuing on next printer in class.";
|
||||
"Unable to copy 64-bit CUPS printer driver files (%d)." = "Unable to copy 64-bit CUPS printer driver files (%d).";
|
||||
"Unable to copy 64-bit Windows printer driver files (%d)." = "Unable to copy 64-bit Windows printer driver files (%d).";
|
||||
|
||||
+3820
-2248
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+3844
-2267
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+2804
-4267
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+3984
-2327
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+3831
-2258
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+3890
-2309
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+5814
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+3836
-2269
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+3950
-2304
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+3946
-2294
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+3820
-2245
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+3856
-2280
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+3826
-2256
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+3840
-2273
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+3844
-2269
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+3849
-2270
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+3822
-2253
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+3824
-2256
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+3807
-2242
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais
Referência em uma Nova Issue
Bloquear um usuário