From 7cf5915ead7c80b3011a37eaade214568d938f5b Mon Sep 17 00:00:00 2001 From: msweet Date: Wed, 22 Sep 2010 22:13:21 +0000 Subject: [PATCH] Merge changes from CUPS 1.5svn-r9313. git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@2683 a1ca3aef-8c08-0410-bb20-df032aa958be --- CHANGES-1.4.txt | 38 +- backend/Dependencies | 32 +- backend/Makefile | 13 +- backend/ipp.c | 424 ++++- backend/pap.c | 1696 ------------------ backend/runloop.c | 6 +- backend/serial.c | 2 +- backend/usb-darwin.c | 125 +- backend/usb-libusb.c | 9 +- berkeley/Dependencies | 16 +- cgi-bin/Dependencies | 70 +- cgi-bin/admin.c | 17 +- config-scripts/cups-common.m4 | 7 + config-scripts/cups-pap.m4 | 31 - config-scripts/cups-ssl.m4 | 6 +- config.h.in | 26 + configure.in | 1 - cups/Dependencies | 318 ++-- cups/adminutil.c | 101 +- cups/api-filter.header | 2 +- cups/attr.c | 4 +- cups/auth.c | 8 +- cups/conflicts.c | 14 +- cups/cups-private.h | 11 + cups/cups.h | 17 + cups/debug-private.h | 23 +- cups/debug.c | 154 +- cups/dest.c | 14 +- cups/dir.c | 2 +- cups/emit.c | 3 +- cups/encode.c | 1 + cups/file.c | 10 +- cups/globals.c | 11 +- cups/http-addrlist.c | 13 + cups/http-private.h | 65 +- cups/http-support.c | 11 +- cups/http.c | 894 +++++++-- cups/http.h | 29 +- cups/ipp-support.c | 51 +- cups/ipp.h | 6 +- cups/language.c | 6 +- cups/libcups2.def | 7 +- cups/localize.c | 16 +- cups/mark.c | 17 +- cups/options.c | 24 +- cups/page.c | 4 +- cups/ppd-private.h | 1 - cups/ppd.c | 30 +- cups/pwg-media.c | 215 ++- cups/pwg-ppd.c | 175 +- cups/pwg-private.h | 1 + cups/request.c | 15 +- cups/string-private.h | 56 + cups/string.c | 3 +- cups/testfile.c | 2 +- cups/testhttp.c | 2 + cups/testpwg.c | 95 + cups/transcode.c | 4 + cups/usersys.c | 159 +- cups/versioning.h | 9 +- doc/Makefile | 1 + driver/Dependencies | 42 +- filter/Dependencies | 228 ++- filter/pstops.c | 37 +- locale/Dependencies | 18 +- man/ipptoolfile.man | 4 +- man/lp.man | 7 +- man/lpadmin.man | 49 +- monitor/Dependencies | 8 +- notifier/Dependencies | 8 +- ppdc/Dependencies | 95 +- scheduler/Dependencies | 325 ++-- scheduler/auth.c | 18 + scheduler/classes.c | 9 +- scheduler/client.c | 213 ++- scheduler/cupsd.h | 4 +- scheduler/dirsvc.c | 4 +- scheduler/ipp.c | 23 +- scheduler/job.c | 20 +- scheduler/main.c | 6 + scheduler/printers.c | 267 ++- scheduler/process.c | 7 + scripting/php/Dependencies | 4 +- systemv/Dependencies | 113 +- systemv/cupsaddsmb.c | 3 +- systemv/lpadmin.c | 751 +------- systemv/lpstat.c | 3 +- templates/de/add-class.tmpl | 2 +- templates/de/add-rss-subscription.tmpl | 2 +- templates/de/search.tmpl | 2 +- templates/ja/option-pickone.tmpl | 2 +- templates/pl/set-printer-options-header.tmpl | 2 +- test/Dependencies | 16 +- test/ipp-1.1.test | 4 + test/ipp-2.0.test | 14 +- test/ipp-2.1.test | 2 +- test/ipptool.c | 166 +- test/print-job-media-col.test | 6 + test/print-uri.test | 27 + test/run-stp-tests.sh | 2 +- vcnet/config.h | 4 +- vcnet/regex/engine.c | 2 +- vcnet/regex/regcomp.c | 8 +- 103 files changed, 3779 insertions(+), 3871 deletions(-) delete mode 100644 backend/pap.c create mode 100644 test/print-uri.test diff --git a/CHANGES-1.4.txt b/CHANGES-1.4.txt index 330778b10..2888b12a9 100644 --- a/CHANGES-1.4.txt +++ b/CHANGES-1.4.txt @@ -1,9 +1,45 @@ CHANGES-1.4.txt --------------- +CHANGES IN CUPS V1.4.6 + + + CHANGES IN CUPS V1.4.5 - - Documentation fixes (STR #3542) + - Documentation fixes (STR #3542, STR #3650) + - Localization fixes (STR #3635, STR #3636, STR #3647, STR #3666) + - The scheduler would restart jobs while shutting down (STR #3679) + - Fixed a PPD loader bug that could cause a crash in cupsd (STR #3680) + - Improved the mapping of non-standard PPD and PWG names (STR #3671) + - The scheduler did not initialize Kerberos in all cases (STR #3662) + - cupsAdminSetServerSettings duplicated Listen and Order lines + (STR #3645) + - Added DeviceN colorspace support to the CUPS Raster format (STR #3419) + - ppdMarkDefaults() did not clear the marked field of the previous + choices (STR #3642) + - The serial backend would not allow a raw job to be canceled + (STR #3649) + - The socket backend could go into an infinite loop with certain + printers (STR #3622) + - Setting the PRINTER or LPDEST environment variables to "name/instance" + did not work (STR #3485) + - The scheduler did not handle the JobRetryLimit setting properly + (STR #3466) + - The lpstat command always showed a remote job ID of 0 for shared + printers (STR #3627) + - Increased the write timeout for the libusb-based USB backend to 5 + minutes (STR #3595) + - The libusb-base USB backend did not check whether the printer has a + serial number (STR #3590) + - The lpadmin command did not support setting of custom option values + (STR #3631) + - The lpadmin command did not support setting of the location or + description of a class (STR #3613) + - The cupsaddsmb command did not give up after too many failed attempts + (STR #3615) + - The CUPS library no longer uses certain problematic ctype macros that + change based on the locale's character set. - PJL value substitution of more than 9 values was broken (STR #3621) - Custom options with missing string values caused ppdEmit* to segfault (STR #3620) diff --git a/backend/Dependencies b/backend/Dependencies index 0f3718ed3..f6c512e4a 100644 --- a/backend/Dependencies +++ b/backend/Dependencies @@ -1,8 +1,8 @@ # DO NOT DELETE THIS LINE -- make depend depends on it. ipp.o: backend-private.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h -ipp.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h -ipp.o: ../cups/array.h ../cups/string-private.h ../config.h +ipp.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +ipp.o: ../cups/language.h ../cups/string-private.h ../config.h ipp.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h ipp.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h ipp.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h @@ -12,8 +12,8 @@ ipp.o: ../cups/sidechannel.h lpd.o: ../cups/http-private.h ../config.h ../cups/http.h lpd.o: ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h lpd.o: backend-private.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h -lpd.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h -lpd.o: ../cups/array.h ../cups/string-private.h ../cups/debug-private.h +lpd.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +lpd.o: ../cups/language.h ../cups/string-private.h ../cups/debug-private.h lpd.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h lpd.o: ../cups/pwg-private.h ../cups/http-private.h lpd.o: ../cups/language-private.h ../cups/transcode.h @@ -21,7 +21,7 @@ lpd.o: ../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h lpd.o: ../cups/sidechannel.h dnssd.o: backend-private.h ../cups/cups-private.h ../cups/cups.h dnssd.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -dnssd.o: ../cups/language.h ../cups/array.h ../cups/string-private.h +dnssd.o: ../cups/array.h ../cups/language.h ../cups/string-private.h dnssd.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h dnssd.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h dnssd.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h @@ -29,12 +29,12 @@ dnssd.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h dnssd.o: ../cups/transcode.h ../cups/thread-private.h ../cups/snmp-private.h dnssd.o: ../cups/backend.h ../cups/sidechannel.h ../cups/array.h pap.o: ../config.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -pap.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +pap.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h pap.o: ../cups/backend.h ../cups/sidechannel.h ../cups/language-private.h pap.o: ../cups/transcode.h parallel.o: backend-private.h ../cups/cups-private.h ../cups/cups.h parallel.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -parallel.o: ../cups/language.h ../cups/array.h ../cups/string-private.h +parallel.o: ../cups/array.h ../cups/language.h ../cups/string-private.h parallel.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h parallel.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h parallel.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h @@ -43,7 +43,7 @@ parallel.o: ../cups/transcode.h ../cups/thread-private.h parallel.o: ../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h serial.o: backend-private.h ../cups/cups-private.h ../cups/cups.h serial.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -serial.o: ../cups/language.h ../cups/array.h ../cups/string-private.h +serial.o: ../cups/array.h ../cups/language.h ../cups/string-private.h serial.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h serial.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h serial.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h @@ -52,7 +52,7 @@ serial.o: ../cups/transcode.h ../cups/thread-private.h ../cups/snmp-private.h serial.o: ../cups/backend.h ../cups/sidechannel.h snmp.o: backend-private.h ../cups/cups-private.h ../cups/cups.h snmp.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -snmp.o: ../cups/language.h ../cups/array.h ../cups/string-private.h +snmp.o: ../cups/array.h ../cups/language.h ../cups/string-private.h snmp.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h snmp.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h snmp.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h @@ -64,7 +64,7 @@ socket.o: ../cups/http-private.h ../config.h ../cups/http.h socket.o: ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h socket.o: backend-private.h ../cups/cups-private.h ../cups/cups.h socket.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -socket.o: ../cups/language.h ../cups/array.h ../cups/string-private.h +socket.o: ../cups/array.h ../cups/language.h ../cups/string-private.h socket.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h socket.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h socket.o: ../cups/language-private.h ../cups/transcode.h @@ -72,8 +72,8 @@ socket.o: ../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h socket.o: ../cups/sidechannel.h test1284.o: ../cups/string-private.h ../config.h ieee1284.c backend-private.h test1284.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -test1284.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -test1284.o: ../cups/language.h ../cups/array.h ../cups/string-private.h +test1284.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +test1284.o: ../cups/language.h ../cups/string-private.h test1284.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h test1284.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h test1284.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h @@ -82,11 +82,11 @@ test1284.o: ../cups/thread-private.h ../cups/snmp-private.h ../cups/backend.h test1284.o: ../cups/sidechannel.h testbackend.o: ../cups/string-private.h ../config.h ../cups/cups.h testbackend.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h -testbackend.o: ../cups/http.h ../cups/language.h ../cups/array.h +testbackend.o: ../cups/http.h ../cups/array.h ../cups/language.h testbackend.o: ../cups/sidechannel.h testsupplies.o: backend-private.h ../cups/cups-private.h ../cups/cups.h testsupplies.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h -testsupplies.o: ../cups/http.h ../cups/language.h ../cups/array.h +testsupplies.o: ../cups/http.h ../cups/array.h ../cups/language.h testsupplies.o: ../cups/string-private.h ../config.h ../cups/debug-private.h testsupplies.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h testsupplies.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h @@ -95,8 +95,8 @@ testsupplies.o: ../cups/language-private.h ../cups/transcode.h testsupplies.o: ../cups/thread-private.h ../cups/snmp-private.h testsupplies.o: ../cups/backend.h ../cups/sidechannel.h usb.o: backend-private.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h -usb.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h -usb.o: ../cups/array.h ../cups/string-private.h ../config.h +usb.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +usb.o: ../cups/language.h ../cups/string-private.h ../config.h usb.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h usb.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h usb.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h diff --git a/backend/Makefile b/backend/Makefile index 6b217462f..1cca9836d 100644 --- a/backend/Makefile +++ b/backend/Makefile @@ -22,11 +22,11 @@ include ../Makedefs # RBACKENDS = ipp lpd $(DNSSD_BACKEND) -UBACKENDS = $(PAP) $(LEGACY_BACKENDS) serial snmp socket usb +UBACKENDS = $(LEGACY_BACKENDS) serial snmp socket usb UNITTESTS = test1284 testbackend testsupplies TARGETS = libbackend.a $(RBACKENDS) $(UBACKENDS) LIBOBJS = ieee1284.o network.o runloop.o snmp-supplies.o -OBJS = ipp.o lpd.o dnssd.o pap.o parallel.o serial.o snmp.o \ +OBJS = ipp.o lpd.o dnssd.o parallel.o serial.o snmp.o \ socket.o test1284.o testbackend.o testsupplies.o usb.o @@ -207,15 +207,6 @@ lpd: lpd.o ../cups/$(LIBCUPS) libbackend.a $(CC) $(LDFLAGS) -o lpd lpd.o libbackend.a $(LIBS) -# -# pap -# - -pap: pap.o ../cups/$(LIBCUPS) - echo Linking $@... - $(CC) $(LDFLAGS) -o pap pap.o $(BACKLIBS) $(LIBS) -framework AppleTalk - - # # parallel # diff --git a/backend/ipp.c b/backend/ipp.c index 5d2a82963..5701ce5d4 100644 --- a/backend/ipp.c +++ b/backend/ipp.c @@ -18,8 +18,9 @@ * * main() - Send a file to the printer or server. * cancel_job() - Cancel a print job. - * check_printer_state() - Check the printer state... + * check_printer_state() - Check the printer state. * compress_files() - Compress print files... + * monitor_printer() - Monitor the printer state... * password_cb() - Disable the password prompt for * cupsDoFileRequest(). * report_attr() - Report an IPP attribute value. @@ -36,33 +37,82 @@ #include #include + +/* + * Types... + */ + +typedef struct _cups_monitor_s /**** Monitoring data ****/ +{ + const char *uri, /* Printer URI */ + *hostname, /* Hostname */ + *user, /* Username */ + *resource; /* Resource path */ + int port, /* Port number */ + version, /* IPP version */ + job_id; /* Job ID for submitted job */ + http_encryption_t encryption; /* Use encryption? */ + ipp_jstate_t job_state; /* Current job state */ + ipp_pstate_t printer_state; /* Current printer state */ +} _cups_monitor_t; + + /* * Globals... */ -static char *password = NULL; /* Password for device URI */ -static int password_tries = 0; /* Password tries */ static const char *auth_info_required = "none"; /* New auth-info-required value */ +static const char * const jattrs[] = /* Job attributes we want */ +{ + "job-media-sheets-completed", + "job-state", + "job-state-reasons" +}; static int job_canceled = 0; /* Job cancelled? */ +static char *password = NULL; /* Password for device URI */ +static int password_tries = 0; /* Password tries */ +static const char * const pattrs[] = /* Printer attributes we want */ +{ + "copies-supported", + "cups-version", + "document-format-supported", + "marker-colors", + "marker-high-levels", + "marker-levels", + "marker-low-levels", + "marker-message", + "marker-names", + "marker-types", + "media-col-supported", + "printer-alert", + "printer-alert-description", + "printer-is-accepting-jobs", + "printer-state", + "printer-state-message", + "printer-state-reasons", +}; /* * Local functions... */ -static void cancel_job(http_t *http, const char *uri, int id, - const char *resource, const char *user, int version); -static void check_printer_state(http_t *http, const char *uri, - const char *resource, const char *user, - int version, int job_id); +static void cancel_job(http_t *http, const char *uri, int id, + const char *resource, const char *user, + int version); +static ipp_pstate_t check_printer_state(http_t *http, const char *uri, + const char *resource, + const char *user, int version, + int job_id); #ifdef HAVE_LIBZ -static void compress_files(int num_files, char **files); +static void compress_files(int num_files, char **files); #endif /* HAVE_LIBZ */ -static const char *password_cb(const char *); -static void report_attr(ipp_attribute_t *attr); -static int report_printer_state(ipp_t *ipp, int job_id); -static void sigterm_handler(int sig); +static void *monitor_printer(_cups_monitor_t *monitor); +static const char *password_cb(const char *); +static void report_attr(ipp_attribute_t *attr); +static int report_printer_state(ipp_t *ipp, int job_id); +static void sigterm_handler(int sig); /* @@ -111,6 +161,7 @@ main(int argc, /* I - Number of command-line args */ int compression, /* Do compression of the job data? */ waitjob, /* Wait for job complete? */ waitprinter; /* Wait for printer ready? */ + _cups_monitor_t monitor; /* Monitoring data */ ipp_attribute_t *job_id_attr; /* job-id attribute */ int job_id; /* job-id value */ ipp_attribute_t *job_sheets; /* job-media-sheets-completed */ @@ -132,28 +183,6 @@ main(int argc, /* I - Number of command-line args */ struct sigaction action; /* Actions for POSIX signals */ #endif /* HAVE_SIGACTION && !HAVE_SIGSET */ int version; /* IPP version */ - static const char * const pattrs[] = - { /* Printer attributes we want */ - "copies-supported", - "document-format-supported", - "marker-colors", - "marker-high-levels", - "marker-levels", - "marker-low-levels", - "marker-message", - "marker-names", - "marker-types", - "media-col-supported", - "printer-is-accepting-jobs", - "printer-state", - "printer-state-message", - "printer-state-reasons", - }; - static const char * const jattrs[] = - { /* Job attributes we want */ - "job-media-sheets-completed", - "job-state" - }; /* @@ -402,8 +431,7 @@ main(int argc, /* I - Number of command-line args */ send_options = !strcasecmp(final_content_type, "application/pdf") || !strcasecmp(final_content_type, "application/vnd.cups-pdf") || !strcasecmp(final_content_type, "image/jpeg") || - !strcasecmp(final_content_type, "image/png") || - !strcasecmp(final_content_type, "image/urf"); + !strcasecmp(final_content_type, "image/png"); fputs("DEBUG: Sending stdin for job...\n", stderr); } @@ -472,6 +500,11 @@ main(int argc, /* I - Number of command-line args */ if ((http = httpConnectEncrypt(hostname, port, cupsEncryption())) == NULL) { +#if 0 /* These need to go in here someplace when we see HTTP_PKI_ERROR or IPP_PKI_ERROR */ + fputs("STATE: +cups-certificate-error\n", stderr); + fputs("STATE: -cups-certificate-error\n", stderr); +#endif /* 0 */ + int error = errno; /* Connection error */ if (job_canceled) @@ -647,13 +680,14 @@ main(int argc, /* I - Number of command-line args */ exit(CUPS_BACKEND_STOP); } - if ((supported = cupsDoRequest(http, request, resource)) == NULL) - ipp_status = cupsLastError(); - else - ipp_status = supported->request.status.status_code; + supported = cupsDoRequest(http, request, resource); + ipp_status = cupsLastError(); if (ipp_status > IPP_OK_CONFLICT) { + fprintf(stderr, "DEBUG: Get-Printer-Attributes returned %s.\n", + ippErrorString(ipp_status)); + if (ipp_status == IPP_PRINTER_BUSY || ipp_status == IPP_SERVICE_UNAVAILABLE) { @@ -700,7 +734,9 @@ main(int argc, /* I - Number of command-line args */ } else if (ipp_status == IPP_NOT_FOUND) { - _cupsLangPuts(stderr, _("ERROR: The printer URI is incorrect or no longer exists.\n")); + _cupsLangPuts(stderr, + _("ERROR: The printer URI is incorrect or no longer " + "exists.\n")); if (supported) ippDelete(supported); @@ -834,6 +870,23 @@ main(int argc, /* I - Number of command-line args */ else copies_remaining = copies; + /* + * Start monitoring the printer in the background... + */ + + monitor.uri = uri; + monitor.hostname = hostname; + monitor.user = argv[2]; + monitor.resource = resource; + monitor.port = port; + monitor.version = version; + monitor.job_id = 0; + monitor.encryption = cupsEncryption(); + monitor.job_state = IPP_JOB_PENDING; + monitor.printer_state = IPP_PRINTER_IDLE; + + _cupsThreadCreate((_cups_thread_func_t)monitor_printer, &monitor); + /* * Then issue the print-job request... */ @@ -1005,9 +1058,9 @@ main(int argc, /* I - Number of command-line args */ _pwg_media_t *found; /* PWG media */ - if ((found = _pwgMediaForPPD(keyword)) == NULL) + if ((found = _pwgMediaForPPD(keyword)) != NULL) keyword = found->pwg; - else if ((found = _pwgMediaForLegacy(keyword)) == NULL) + else if ((found = _pwgMediaForLegacy(keyword)) != NULL) keyword = found->pwg; ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "media", @@ -1027,11 +1080,52 @@ main(int argc, /* I - Number of command-line args */ options)) != NULL) ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "output-mode", NULL, keyword); + else if ((keyword = cupsGetOption("ColorModel", num_options, + options)) != NULL) + { + if (!strcasecmp(keyword, "Gray")) + ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "output-mode", + NULL, "monochrome"); + else if (!strcasecmp(keyword, "Color")) + ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "output-mode", + NULL, "color"); + } + + if ((keyword = cupsGetOption("print-quality", num_options, + options)) != NULL) + ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_ENUM, "print-quality", + atoi(keyword)); + else if ((keyword = cupsGetOption("cupsPrintQuality", num_options, + options)) != NULL) + { + if (!strcasecmp(keyword, "draft")) + ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_ENUM, "print-quality", + IPP_QUALITY_DRAFT); + else if (!strcasecmp(keyword, "normal")) + ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_ENUM, "print-quality", + IPP_QUALITY_NORMAL); + else if (!strcasecmp(keyword, "high")) + ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_ENUM, "print-quality", + IPP_QUALITY_HIGH); + } if ((keyword = cupsGetOption("sides", num_options, options)) != NULL) ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides", - NULL, keyword); - + NULL, keyword); + else if ((keyword = cupsGetOption("Duplex", num_options, + options)) != NULL) + { + if (!strcasecmp(keyword, "None")) + ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides", + NULL, "one-sided"); + else if (!strcasecmp(keyword, "DuplexNoTumble")) + ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides", + NULL, "two-sided-long-edge"); + if (!strcasecmp(keyword, "DuplexTumble")) + ippAddString(request, IPP_TAG_JOB, IPP_TAG_KEYWORD, "sides", + NULL, "two-sided-short-edge"); + } + _pwgDestroy(pwg); } @@ -1134,7 +1228,7 @@ main(int argc, /* I - Number of command-line args */ } else { - job_id = job_id_attr->values[0].integer; + monitor.job_id = job_id = job_id_attr->values[0].integer; _cupsLangPrintf(stderr, _("NOTICE: Print file accepted - job ID %d.\n"), job_id); } @@ -1336,11 +1430,13 @@ main(int argc, /* I - Number of command-line args */ ippDelete(response); +#if 0 /* * Check the printer state and report it if necessary... */ check_printer_state(http, uri, resource, argv[2], version, job_id); +#endif /* 0 */ /* * Wait 1-10 seconds before polling again... @@ -1467,34 +1563,27 @@ cancel_job(http_t *http, /* I - HTTP connection */ /* - * 'check_printer_state()' - Check the printer state... + * 'check_printer_state()' - Check the printer state. */ -static void +static ipp_pstate_t /* O - Current printer-state */ check_printer_state( http_t *http, /* I - HTTP connection */ const char *uri, /* I - Printer URI */ const char *resource, /* I - Resource path */ const char *user, /* I - Username, if any */ int version, /* I - IPP version */ - int job_id) /* I - Current job ID */ + int job_id) { - ipp_t *request, /* IPP request */ - *response; /* IPP response */ - static const char * const attrs[] = /* Attributes we want */ - { - "marker-colors", - "marker-levels", - "marker-message", - "marker-names", - "marker-types", - "printer-state-message", - "printer-state-reasons" - }; + ipp_t *request, /* IPP request */ + *response; /* IPP response */ + ipp_attribute_t *attr; /* Attribute in response */ + ipp_pstate_t printer_state = IPP_PRINTER_STOPPED; + /* Current printer-state */ /* - * Check on the printer state... + * Send a Get-Printer-Attributes request and log the results... */ request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES); @@ -1502,25 +1591,32 @@ check_printer_state( request->request.op.version[1] = version % 10; ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", - NULL, uri); + NULL, uri); if (user && user[0]) ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, - "requesting-user-name", NULL, user); + "requesting-user-name", NULL, user); ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, - "requested-attributes", - (int)(sizeof(attrs) / sizeof(attrs[0])), NULL, attrs); - - /* - * Do the request... - */ + "requested-attributes", + (int)(sizeof(pattrs) / sizeof(pattrs[0])), NULL, pattrs); if ((response = cupsDoRequest(http, request, resource)) != NULL) { report_printer_state(response, job_id); + + if ((attr = ippFindAttribute(response, "printer-state", + IPP_TAG_ENUM)) != NULL) + printer_state = (ipp_pstate_t)attr->values[0].integer; + ippDelete(response); } + + /* + * Return the printer-state value... + */ + + return (printer_state); } @@ -1602,6 +1698,122 @@ compress_files(int num_files, /* I - Number of files */ #endif /* HAVE_LIBZ */ +/* + * 'monitor_printer()' - Monitor the printer state... + */ + +static void * /* O - Thread exit code */ +monitor_printer( + _cups_monitor_t *monitor) /* I - Monitoring data */ +{ + http_t *http; /* Connection to printer */ + ipp_t *request, /* IPP request */ + *response; /* IPP response */ + ipp_attribute_t *attr; /* Attribute in response */ + int delay, /* Current delay */ + prev_delay, /* Previous delay */ + temp_delay; /* Temporary delay value */ + + + /* + * Make a copy of the printer connection... + */ + + http = _httpCreate(monitor->hostname, monitor->port, monitor->encryption); + cupsSetPasswordCB(password_cb); + + /* + * Loop until the job is canceled, aborted, or completed. + */ + + delay = 1; + prev_delay = 0; + + while (monitor->job_state < IPP_JOB_CANCELED && !job_canceled) + { + /* + * Reconnect to the printer... + */ + + if (!httpReconnect(http)) + { + /* + * Connected, so check on the printer state... + */ + + monitor->printer_state = check_printer_state(http, monitor->uri, + monitor->resource, + monitor->user, + monitor->version, + monitor->job_id); + + if (monitor->job_id > 0) + { + /* + * Check the status of the job itself... + */ + + request = ippNewRequest(IPP_GET_JOB_ATTRIBUTES); + request->request.op.version[0] = monitor->version / 10; + request->request.op.version[1] = monitor->version % 10; + + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", + NULL, monitor->uri); + ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_INTEGER, "job-id", + monitor->job_id); + + if (monitor->user && monitor->user[0]) + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, + "requesting-user-name", NULL, monitor->user); + + ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, + "requested-attributes", + (int)(sizeof(jattrs) / sizeof(jattrs[0])), NULL, jattrs); + + /* + * Do the request... + */ + + response = cupsDoRequest(http, request, monitor->resource); + + if ((attr = ippFindAttribute(response, "job-state", + IPP_TAG_ENUM)) != NULL) + monitor->job_state = (ipp_jstate_t)attr->values[0].integer; + else + monitor->job_state = IPP_JOB_COMPLETED; + + ippDelete(response); + } + + /* + * Disconnect from the printer - we'll reconnect on the next poll... + */ + + _httpDisconnect(http); + } + + /* + * Sleep for N seconds, and then update the next sleep time using a + * Fibonacci series (1 1 2 3 5 8)... + */ + + sleep(delay); + + temp_delay = delay; + delay = (delay + prev_delay) % 12; + prev_delay = delay < temp_delay ? 0 : temp_delay; + } + + /* + * Cleanup and return... + */ + + httpClose(http); + + return (NULL); +} + + /* * 'password_cb()' - Disable the password prompt for cupsDoFileRequest(). */ @@ -1712,41 +1924,93 @@ report_printer_state(ipp_t *ipp, /* I - IPP response */ { int i; /* Looping var */ int count; /* Count of reasons shown... */ - ipp_attribute_t *psm, /* printer-state-message */ + ipp_attribute_t *pa, /* printer-alert */ + *pam, /* printer-alert-message */ + *psm, /* printer-state-message */ *reasons, /* printer-state-reasons */ *marker; /* marker-* attributes */ const char *reason; /* Current reason */ const char *prefix; /* Prefix for STATE: line */ - char state[1024]; /* State string */ + char value[1024], /* State/message string */ + *valptr; /* Pointer into string */ + /* + * Report alerts and messages... + */ + + if ((pa = ippFindAttribute(ipp, "printer-alert", IPP_TAG_TEXT)) != NULL) + report_attr(pa); + + if ((pam = ippFindAttribute(ipp, "printer-alert-message", + IPP_TAG_TEXT)) != NULL) + report_attr(pam); + if ((psm = ippFindAttribute(ipp, "printer-state-message", IPP_TAG_TEXT)) != NULL) - fprintf(stderr, "INFO: %s\n", psm->values[0].string.text); + { + char *ptr; /* Pointer into message */ + + + strlcpy(value, "INFO: ", sizeof(value)); + for (ptr = psm->values[0].string.text, valptr = value + 6; + *ptr && valptr < (value + sizeof(value) - 6); + ptr ++) + { + if (*ptr < ' ' && *ptr > 0 && *ptr != '\t') + { + /* + * Substitute "" for the control character; sprintf is safe because + * we always leave 6 chars free at the end... + */ + + sprintf(valptr, "<%02X>", *ptr); + valptr += 4; + } + else + *valptr++ = *ptr; + } + + *valptr++ = '\n'; + *valptr++ = '\0'; + + fputs(value, stderr); + } + + /* + * Now report printer-state-reasons, filtering out some of the reasons we never + * want to set... + */ if ((reasons = ippFindAttribute(ipp, "printer-state-reasons", IPP_TAG_KEYWORD)) == NULL) return (0); - state[0] = '\0'; + value[0] = '\0'; prefix = "STATE: "; - for (i = 0, count = 0; i < reasons->num_values; i ++) + for (i = 0, count = 0, valptr = value; i < reasons->num_values; i ++) { reason = reasons->values[i].string.text; if (strcmp(reason, "paused") && strcmp(reason, "com.apple.print.recoverable-warning")) { - strlcat(state, prefix, sizeof(state)); - strlcat(state, reason, sizeof(state)); + strlcpy(valptr, prefix, sizeof(value) - (valptr - value) - 1); + valptr += strlen(valptr); + strlcpy(valptr, reason, sizeof(value) - (valptr - value) - 1); + valptr += strlen(valptr); prefix = ","; } } - if (state[0]) - fprintf(stderr, "%s\n", state); + if (value[0]) + { + *valptr++ = '\n'; + *valptr++ = '\0'; + fputs(value, stderr); + } /* * Relay the current marker-* attribute values... diff --git a/backend/pap.c b/backend/pap.c deleted file mode 100644 index b57698fd2..000000000 --- a/backend/pap.c +++ /dev/null @@ -1,1696 +0,0 @@ -/* -* "$Id: pap.c 7720 2008-07-11 22:46:21Z mike $" -* -* Copyright 2004-2010 Apple Inc. All rights reserved. -* -* IMPORTANT: This Apple software is supplied to you by Apple Computer, -* Inc. ("Apple") in consideration of your agreement to the following -* terms, and your use, installation, modification or redistribution of -* this Apple software constitutes acceptance of these terms. If you do -* not agree with these terms, please do not use, install, modify or -* redistribute this Apple software. -* -* In consideration of your agreement to abide by the following terms, and -* subject to these terms, Apple grants you a personal, non-exclusive -* license, under AppleÕs copyrights in this original Apple software (the -* "Apple Software"), to use, reproduce, modify and redistribute the Apple -* Software, with or without modifications, in source and/or binary forms; -* provided that if you redistribute the Apple Software in its entirety and -* without modifications, you must retain this notice and the following -* text and disclaimers in all such redistributions of the Apple Software. -* Neither the name, trademarks, service marks or logos of Apple Computer, -* Inc. may be used to endorse or promote products derived from the Apple -* Software without specific prior written permission from Apple. Except -* as expressly stated in this notice, no other rights or licenses, express -* or implied, are granted by Apple herein, including but not limited to -* any patent rights that may be infringed by your derivative works or by -* other works in which the Apple Software may be incorporated. -* -* The Apple Software is provided by Apple on an "AS IS" basis. APPLE -* MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION -* THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS -* FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND -* OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. -* -* IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL -* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -* INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, -* MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED -* AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), -* STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -* -* -* This program implements the Printer Access Protocol (PAP) on top of AppleTalk -* Transaction Protocol (ATP). If it were to use the blocking pap functions of -* the AppleTalk library it would need seperate threads for reading, writing -* and status. -* -* Contents: -* -* main() - Send a file to the specified Appletalk printer. -* listDevices() - List all LaserWriter printers in the local zone. -* printFile() - Print file. -* papOpen() - Open a pap session to a printer. -* papClose() - Close a pap session. -* papWrite() - Write bytes to a printer. -* papCloseResp() - Send a pap close response. -* papSendRequest() - Fomrat and send a pap packet. -* papCancelRequest() - Cancel a pending pap request. -* sidechannel_request() - Handle side-channel requests. -* statusUpdate() - Print printer status to stderr. -* parseUri() - Extract the print name and zone from a uri. -* addPercentEscapes() - Encode a string with percent escapes. -* removePercentEscapes - Remove percent escape sequences from a string. -* nbptuple_compare() - Compare routine for qsort. -* okayToUseAppleTalk() - Returns true if AppleTalk is available and enabled. -* packet_name() - Returns packet name string. -* connectTimeout() - Returns the connect timeout preference value. -* signalHandler() - handle SIGINT to close the session before quiting. -*/ - -/* - * This backend uses deprecated APIs for AppleTalk; we know this, so - * silence any warnings about it... - */ - -#ifdef MAC_OS_X_VERSION_MIN_REQUIRED -# undef MAC_OS_X_VERSION_MIN_REQUIRED -#endif /* MAX_OS_X_VERSION_MIN_REQUIRED */ -#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_0 - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -#ifdef HAVE_APPLETALK_AT_PROTO_H -# include -#else -/* These definitions come from at_proto.h... */ -# define ZIP_DEF_INTERFACE NULL -enum { RUNNING, NOTLOADED, LOADED, OTHERERROR }; - -extern int atp_abort(int fd, at_inet_t *dest, u_short tid); -extern int atp_close(int fd); -extern int atp_getreq(int fd, at_inet_t *src, char *buf, int *len, int *userdata, - int *xo, u_short *tid, u_char *bitmap, int nowait); -extern int atp_getresp(int fd, u_short *tid, at_resp_t *resp); -extern int atp_look(int fd); -extern int atp_open(at_socket *sock); -extern int atp_sendreq(int fd, at_inet_t *dest, char *buf, int len, - int userdata, int xo, int xo_relt, u_short *tid, - at_resp_t *resp, at_retry_t *retry, int nowait); -extern int atp_sendrsp(int fd, at_inet_t *dest, int xo, u_short tid, - at_resp_t *resp); -extern int checkATStack(); -extern int nbp_lookup(at_entity_t *entity, at_nbptuple_t *buf, int max, - at_retry_t *retry); -extern int nbp_make_entity(at_entity_t *entity, char *obj, char *type, - char *zone); -extern int zip_getmyzone(char *ifName, at_nvestr_t *zone); -#endif /* HAVE_APPLETALK_AT_PROTO_H */ - -#include -#include -#include - -/* Defines */ -#define MAX_PRINTERS 500 /* Max number of printers we can lookup */ -#define PAP_CONNID 0 -#define PAP_TYPE 1 -#define PAP_EOF 2 - -#define CONNID_OF(p) (((u_char *)&p)[0]) -#define TYPE_OF(p) (((u_char *)&p)[1]) -#define SEQUENCE_NUM(p) (((u_char *)&p)[2]) -#define IS_PAP_EOF(p) (((u_char *)&p)[2]) - -#ifndef true -#define true 1 -#define false 0 -#endif - -/* Globals */ -int gSockfd = 0; /* Socket descriptor */ -at_inet_t gSessionAddr = { 0 }; /* Address of the session responding socket */ -u_char gConnID = 0; /* PAP session connection id */ -u_short gSendDataID = 0; /* Transaction id of pending send-data request */ -u_short gTickleID = 0; /* Transaction id of outstanding tickle request*/ -int gWaitEOF = false; /* Option: wait for a remote's EOF */ -int gStatusInterval= 5; /* Option: 0=off else seconds between status requests*/ -int gErrorlogged = false; /* If an error was logged don't send any more INFO messages */ -int gDebug = 0; /* Option: emit debugging info */ - -/* Local functions */ -static int listDevices(void); -static int printFile(char* name, char* type, char* zone, int fdin, int fdout, - int fderr, int copies, int argc); -static int papOpen(at_nbptuple_t* tuple, u_char* connID, int* fd, - at_inet_t* pap_to, u_char* flowQuantum); -static int papClose(); -static int papWrite(int sockfd, at_inet_t* dest, u_short tid, u_char connID, - u_char flowQuantum, char* data, int len, int eof); -static int papCloseResp(int sockfd, at_inet_t* dest, int xo, u_short tid, - u_char connID); -static int papSendRequest(int sockfd, at_inet_t* dest, u_char connID, - int function, u_char bitmap, int xo, int seqno); -static int papCancelRequest(int sockfd, u_short tid); -static void sidechannel_request(); -static void statusUpdate(char* status, u_char statusLen); -static int parseUri(const char* argv0, char* name, char* type, char* zone); -static int addPercentEscapes(const char* src, char* dst, int dstMax); -static int removePercentEscapes(const char* src, char* dst, int dstMax); -static int nbptuple_compare(const void *p1, const void *p2); -static int okayToUseAppleTalk(void); -static const char *packet_name(u_char x); -static int connectTimeout(void); -static void signalHandler(int sigraised); - - -/*! - * @function main - * @abstract Send a file to the specified AppleTalk PAP address. - * - * Usage: printer-uri job-id user title copies options [file] - * - * @param argc # of arguments - * @param argv array of arguments - * - * @result A non-zero return value for errors - */ -int main (int argc, const char * argv[]) -{ - int err = 0; - FILE *fp; /* Print file */ - int copies; /* Number of copies to print */ - char name[NBP_NVE_STR_SIZE + 1]; /* +1 for a nul */ - char type[NBP_NVE_STR_SIZE + 1]; /* +1 for a nul */ - char zone[NBP_NVE_STR_SIZE + 1]; /* +1 for a nul */ - - /* Make sure status messages are not buffered... */ - setbuf(stderr, NULL); - - if (argc == 1 || (argc == 2 && strcmp(argv[1], "-discover") == 0)) - { - listDevices(); - - return 0; - } - - if (argc < 6 || argc > 7) - { - _cupsLangPrintf(stderr, - _("Usage: %s job-id user title copies options [file]\n"), - argv[0]); - return (CUPS_BACKEND_FAILED); - } - - /* If we have 7 arguments, print the file named on the command-line. - * Otherwise, send stdin instead... - */ - if (argc == 6) - { - fp = stdin; - copies = 1; - } - else - { - fprintf(stderr, "DEBUG: opening print file \"%s\"\n", argv[6]); - - /* Try to open the print file... */ - if ((fp = fopen(argv[6], "rb")) == NULL) - { - _cupsLangPrintf(stderr, - _("ERROR: Unable to open print file \"%s\": %s\n"), - argv[6], strerror(errno)); - return (CUPS_BACKEND_FAILED); - } - - copies = atoi(argv[4]); - } - - /* Extract the device name and options from the URI... */ - parseUri(cupsBackendDeviceURI((char **)argv), name, type, zone); - - err = printFile(name, type, zone, fileno(fp), STDOUT_FILENO, STDERR_FILENO, copies, argc); - - if (fp != stdin) - fclose(fp); - - /* Only clear the last status if there wasn't an error */ - if (err == noErr && !gErrorlogged) - fprintf(stderr, "INFO:\n"); - - return err; -} - - -/*! - * @function listDevices - * @abstract Print a list of all LaserWriter type devices registered in the default zone. - * - * @result A non-zero return value for errors - */ -static int listDevices(void) -{ - int i; - int numberFound; - - at_nvestr_t at_zone; - at_entity_t entity; - at_nbptuple_t buf[MAX_PRINTERS]; - at_retry_t retry; - char name[NBP_NVE_STR_SIZE+1]; - char encodedName[(3 * NBP_NVE_STR_SIZE) + 1]; - char zone[NBP_NVE_STR_SIZE+1]; - char encodedZone[(3 * NBP_NVE_STR_SIZE) + 1]; - - /* Make sure it's okay to use appletalk */ - if (!okayToUseAppleTalk()) - { - _cupsLangPuts(stderr, _("INFO: AppleTalk disabled in System Preferences\n")); - return -1; /* Network is down */ - } - - if (zip_getmyzone(ZIP_DEF_INTERFACE, &at_zone)) - { - perror("DEBUG: Unable to get default AppleTalk zone."); - return -2; - } - - memcpy(zone, at_zone.str, MIN(at_zone.len, sizeof(zone)-1)); - zone[MIN(at_zone.len, sizeof(zone)-1)] = '\0'; - - _cupsLangPrintf(stderr, _("INFO: Using default AppleTalk zone \"%s\"\n"), - zone); - - addPercentEscapes(zone, encodedZone, sizeof(encodedZone)); - - /* Look up all the printers in our zone */ - nbp_make_entity(&entity, "=", "LaserWriter", zone); - retry.retries = 1; - retry.interval = 1; - retry.backoff = 1; - - if ((numberFound = nbp_lookup(&entity, buf, MAX_PRINTERS, &retry)) < 0) - { - perror("DEBUG: Unable to lookup AppleTalk printers."); - return numberFound; - } - - if (numberFound >= MAX_PRINTERS) - _cupsLangPrintf(stderr, - _("WARNING: Adding only the first %d printers found"), - MAX_PRINTERS); - - /* Not required but sort them so they look nice */ - qsort(buf, numberFound, sizeof(at_nbptuple_t), nbptuple_compare); - - for (i = 0; i < numberFound; i++) - { - memcpy(name, buf[i].enu_entity.object.str, MIN(buf[i].enu_entity.object.len, sizeof(name)-1)); - name[MIN(buf[i].enu_entity.object.len, sizeof(name)-1)] = '\0'; - - if (addPercentEscapes(name, encodedName, sizeof(encodedName)) == 0) - { - /* Each line is of the form: "class URI "make model" "info" */ - char make_model[128], /* Make and model */ - *ptr; - - - if ((ptr = strchr(name, ' ')) != NULL) - { - /* - * If the printer name contains spaces, it is probably a make and - * model... - */ - - if (!strncmp(name, "ET00", 4)) - { - /* - * Drop leading ethernet address info... - */ - - strlcpy(make_model, ptr + 1, sizeof(make_model)); - } - else - strlcpy(make_model, name, sizeof(make_model)); - } - else - strcpy(make_model, "Unknown"); - - printf("network pap://%s/%s/LaserWriter \"%s\" \"%s AppleTalk\"\n", - encodedZone, encodedName, make_model, name); - } - } - return numberFound; -} - - -/*! - * @function printFile - * @abstract Open a PAP session and send the data from the input socket to the printer. - * - * @param name NBP name - * @param zone NBP zone - * @param type NBP type - * @param fdin File descriptor to read data from - * @param fdout File descriptor to write printer responses to - * @param fderr File descriptor to write printer status to - * @param copies # of copies to send (in case in the converter couldn't handle this for us). - * @param argc # of command line arguments. - * - * @result A non-zero return value for errors - */ -static int printFile(char* name, char* type, char* zone, int fdin, int fdout, int fderr, int copies, int argc) -{ - int err; - int rc; - int val; - int len, i; - - char fileBuffer[4096]; /* File buffer */ - int fileBufferNbytes; - off_t fileTbytes; - int fileEOFRead; - int fileEOFSent; - - char sockBuffer[4096 + 1]; /* Socket buffer with room for nul */ - char atpReqBuf[AT_PAP_DATA_SIZE]; - fd_set readSet; - int use_sidechannel; /* Use side channel? */ - - at_nbptuple_t tuple; - at_inet_t sendDataAddr; - at_inet_t src; - at_resp_t resp; - int userdata, xo = 0, reqlen; - u_short tid; - u_char bitmap; - int maxfdp1, - nbp_failures = 0; - struct timeval timeout, *timeoutPtr; - u_char flowQuantum = 1; - time_t now, - start_time, - elasped_time, - sleep_time, - connect_timeout = -1, - nextStatusTime = 0; - at_entity_t entity; - at_retry_t retry; - -#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET) - struct sigaction action; /* Actions for POSIX signals */ -#endif /* HAVE_SIGACTION && !HAVE_SIGSET */ - - /* - * Test the side channel descriptor before calling papOpen() since it may open - * an unused fd 4 (a.k.a. CUPS_SC_FD)... - */ - - FD_ZERO(&readSet); - FD_SET(CUPS_SC_FD, &readSet); - - timeout.tv_sec = 0; - timeout.tv_usec = 0; - - if ((select(CUPS_SC_FD+1, &readSet, NULL, NULL, &timeout)) >= 0) - use_sidechannel = 1; - else - use_sidechannel = 0; - - /* try to find our printer */ - if ((err = nbp_make_entity(&entity, name, type, zone)) != noErr) - { - perror("DEBUG: Unable to make AppleTalk address."); - goto Exit; - } - - /* - * Remember when we started looking for the printer. - */ - - start_time = time(NULL); - - retry.interval = 1; - retry.retries = 5; - retry.backoff = 0; - - fprintf(stderr, "STATE: +connecting-to-device\n"); - - /* Loop forever trying to get an open session with the printer. */ - for (;;) - { - /* Make sure it's okay to use appletalk */ - if (okayToUseAppleTalk()) - { - /* Clear this printer-state-reason in case we've set it */ - fprintf(stderr, "STATE: -apple-appletalk-disabled-warning\n"); - - /* Resolve the name into an address. Returns the number found or an error */ - if ((err = nbp_lookup(&entity, &tuple, 1, &retry)) > 0) - { - if (err > 1) - fprintf(stderr, "DEBUG: Found more than one printer with the name \"%s\"\n", name); - - if (nbp_failures) - { - fprintf(stderr, "STATE: -apple-nbp-lookup-warning\n"); - nbp_failures = 0; - } - - /* Open a connection to the device */ - if ((err = papOpen(&tuple, &gConnID, &gSockfd, &gSessionAddr, &flowQuantum)) == 0) - break; - - _cupsLangPrintf(stderr, _("WARNING: Unable to open \"%s:%s\": %s\n"), - name, zone, strerror(err)); - } - else - { - /* It's not unusual to have to call nbp_lookup() twice before it's sucessful... */ - if (++nbp_failures > 2) - { - retry.interval = 2; - retry.retries = 3; - fprintf(stderr, "STATE: +apple-nbp-lookup-warning\n"); - _cupsLangPuts(stderr, _("WARNING: Printer not responding\n")); - } - } - } - else - { - fprintf(stderr, "STATE: +apple-appletalk-disabled-warning\n"); - _cupsLangPuts(stderr, - _("INFO: AppleTalk disabled in System Preferences.\n")); - } - - elasped_time = time(NULL) - start_time; - - if (connect_timeout == -1) - connect_timeout = connectTimeout(); - - if (connect_timeout && elasped_time > connect_timeout) - { - _cupsLangPuts(stderr, _("ERROR: Printer not responding\n")); - err = ETIMEDOUT; - goto Exit; /* Waiting too long... */ - } - else if (elasped_time < (30 * 60)) - sleep_time = 10; /* Waiting < 30 minutes */ - else if (elasped_time < (24 * 60 * 60)) - sleep_time = 30; /* Waiting < 24 hours */ - else - sleep_time = 60; /* Waiting > 24 hours */ - - fprintf(stderr, "DEBUG: sleeping %d seconds...\n", (int)sleep_time); - sleep(sleep_time); - } - - fprintf(stderr, "STATE: -connecting-to-device\n"); - - /* - * Now that we are connected to the printer ignore SIGTERM so that we - * can finish out any page data the driver sends (e.g. to eject the - * current page... if we are printing data from a file then catch the - * signal so we can send a PAP Close packet (otherwise you can't cancel - * raw jobs...) - */ - -#ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */ - sigset(SIGTERM, (argc < 7) ? SIG_IGN : signalHandler); -#elif defined(HAVE_SIGACTION) - memset(&action, 0, sizeof(action)); - - sigemptyset(&action.sa_mask); - action.sa_handler = (argc < 7) ? SIG_IGN : signalHandler; - sigaction(SIGTERM, &action, NULL); -#else - signal(SIGTERM, (argc < 7) ? SIG_IGN : signalHandler); - -#ifdef DEBUG - /* Makes debugging easier; otherwise printer will be busy for several minutes */ - signal(SIGINT, signalHandler); -#endif /* DEBUG */ - -#endif /* HAVE_SIGSET */ - - _cupsLangPuts(stderr, _("INFO: Sending data\n")); - - sendDataAddr = tuple.enu_addr; - - /* Start the tickle packets and set a timeout alarm */ - if ((err = papSendRequest(gSockfd, &gSessionAddr, gConnID, AT_PAP_TYPE_TICKLE, 0, false, false)) < 0) - { - perror("DEBUG: Unable to send PAP tickle request."); - goto Exit; - } - signal(SIGALRM, signalHandler); - alarm(PAP_TIMEOUT); - - /* Prime the pump with an initial send-data packet */ - if ((err = papSendRequest(gSockfd, &gSessionAddr, gConnID, AT_PAP_TYPE_SEND_DATA, 0xFF, true, true)) < 0) - { - perror("DEBUG: Unable to send initial PAP send data request."); - goto Exit; - } - - /* Set non-blocking mode on our data source descriptor */ - val = fcntl(fdin, F_GETFL, 0); - fcntl(fdin, F_SETFL, val | O_NONBLOCK); - - fileBufferNbytes = 0; - fileTbytes = 0; - fileEOFRead = fileEOFSent = false; - - maxfdp1 = MAX(fdin, gSockfd) + 1; - - if (use_sidechannel && CUPS_SC_FD >= maxfdp1) - maxfdp1 = CUPS_SC_FD + 1; - - if (gStatusInterval != 0) - { - timeout.tv_usec = 0; - nextStatusTime = time(NULL) + gStatusInterval; - timeoutPtr = &timeout; - } - else - timeoutPtr = NULL; - - - for (;;) - { - /* Set up our descriptors for the select */ - FD_ZERO(&readSet); - FD_SET(gSockfd, &readSet); - - if (fileBufferNbytes == 0 && fileEOFRead == false) - FD_SET(fdin, &readSet); - - if (use_sidechannel) - FD_SET(CUPS_SC_FD, &readSet); - - /* Set the select timeout value based on the next status interval */ - if (gStatusInterval != 0) - { - now = time(NULL); - timeout.tv_sec = (nextStatusTime > now) ? nextStatusTime - now : 1; - } - - /* Wait here for something interesting to happen */ - if ((err = select(maxfdp1, &readSet, 0, 0, timeoutPtr)) < 0) - { - perror("DEBUG: select() failed."); - break; - } - - if (err == 0 || (gStatusInterval != 0 && time(NULL) >= nextStatusTime)) - { - /* Time to send a status request */ - if ((err = papSendRequest(gSockfd, &tuple.enu_addr, 0, AT_PAP_TYPE_SEND_STATUS, 0x01, false, false)) < 0) - _cupsLangPrintError(_("WARNING: Unable to send PAP status request")); - - if (gStatusInterval) - nextStatusTime = time(NULL) + gStatusInterval; - } - - /* - * Check if we have a side-channel request ready... - */ - - if (use_sidechannel && FD_ISSET(CUPS_SC_FD, &readSet)) - sidechannel_request(); - - /* Was there an event on the input stream? */ - if (FD_ISSET(fdin, &readSet)) - { - FD_CLR(fdin, &readSet); - - assert(fileBufferNbytes == 0); - fileBufferNbytes = read(fdin, fileBuffer, MIN(sizeof(fileBuffer), AT_PAP_DATA_SIZE * flowQuantum)); - if (fileBufferNbytes == 0) - fileEOFRead = true; - - if (fileEOFSent == false && fileBufferNbytes >= 0 && gSendDataID != 0) - { - fprintf(stderr, "DEBUG: -> PAP_DATA %d bytes %s\n", fileBufferNbytes, fileEOFRead ? "with EOF" : ""); - papWrite(gSockfd, &sendDataAddr, gSendDataID, gConnID, flowQuantum, fileBuffer, fileBufferNbytes, fileEOFRead); - - fileTbytes += fileBufferNbytes; - if (argc > 6 && !gErrorlogged) - fprintf(stderr, "DEBUG: Sending print file, %qd bytes\n", (off_t)fileTbytes); - - fileBufferNbytes = 0; - gSendDataID = 0; - if (fileEOFRead) - { - fileEOFSent = true; - if (gWaitEOF == false || fileTbytes == 0) - { - err = 0; - goto Exit; - } - } - } - } - - /* Was there an event on the output stream? */ - if (FD_ISSET(gSockfd, &readSet)) - { - if ((rc = atp_look(gSockfd)) < 0) - { - perror("DEBUG: Unable to look for PAP response."); - break; - } - - if (rc > 0) - { - /* It's an ATP response */ - resp.resp[0].iov_base = sockBuffer; - resp.resp[0].iov_len = sizeof(sockBuffer) - 1; - resp.bitmap = 0x01; - - if ((err = atp_getresp(gSockfd, &tid, &resp)) < 0) - { - perror("DEBUG: Unable to get PAP response."); - break; - } - userdata = resp.userdata[0]; - } - else - { - /* It's an ATP request */ - reqlen = sizeof(atpReqBuf); - if ((err = atp_getreq(gSockfd, &src, atpReqBuf, &reqlen, &userdata, &xo, &tid, &bitmap, 0)) < 0) - { - perror("DEBUG: Unable to get PAP response."); - break; - } - } - - fprintf(stderr, "DEBUG: <- %s\n", packet_name(TYPE_OF(userdata))); - - switch (TYPE_OF(userdata)) - { - case AT_PAP_TYPE_SEND_STS_REPLY: /* Send-Status-Reply packet */ - if (resp.bitmap & 1) - { - char *iov_base = (char *)resp.resp[0].iov_base; - statusUpdate(&iov_base[5], iov_base[4]); - } - break; - - case AT_PAP_TYPE_SEND_DATA: /* Send-Data packet */ - sendDataAddr.socket = src.socket; - gSendDataID = tid; - OSReadBigInt16(&SEQUENCE_NUM(userdata), 0); - - if ((fileBufferNbytes > 0 || fileEOFRead) && fileEOFSent == false) - { - fprintf(stderr, "DEBUG: -> PAP_DATA %d bytes %s\n", fileBufferNbytes, fileEOFRead ? "with EOF" : ""); - papWrite(gSockfd, &sendDataAddr, gSendDataID, gConnID, flowQuantum, fileBuffer, fileBufferNbytes, fileEOFRead); - - fileTbytes += fileBufferNbytes; - if (argc > 6 && !gErrorlogged) - fprintf(stderr, "DEBUG: Sending print file, %qd bytes\n", (off_t)fileTbytes); - - fileBufferNbytes = 0; - gSendDataID = 0; - if (fileEOFRead) - { - fileEOFSent = true; - if (gWaitEOF == false) - { - err = 0; - goto Exit; - } - } - } - break; - - case AT_PAP_TYPE_DATA: /* Data packet */ - for (len=0, i=0; i < ATP_TRESP_MAX; i++) - { - if (resp.bitmap & (1 << i)) - len += resp.resp[i].iov_len; - } - - fprintf(stderr, "DEBUG: <- PAP_DATA %d bytes %s\n", len, IS_PAP_EOF(userdata) ? "with EOF" : ""); - - if (len > 0) - { - char *pLineBegin, *pCommentEnd, *pChar; - char *logLevel; - char logstr[512]; - int logstrlen; - - cupsBackChannelWrite(sockBuffer, len, 1.0); - - sockBuffer[len] = '\0'; /* We always reserve room for the nul so we can use strstr() below*/ - pLineBegin = sockBuffer; - - /* If there are PostScript status comments in the buffer log them. - * - * This logic shouldn't be in the backend but until we get backchannel - * data in CUPS 1.2 it has to live here. - */ - while (pLineBegin < sockBuffer + len && - (pLineBegin = strstr(pLineBegin, "%%[")) != NULL && - (pCommentEnd = strstr(pLineBegin, "]%%")) != NULL) - { - pCommentEnd += 3; /* Skip past "]%%" */ - *pCommentEnd = '\0'; /* There's always room for the nul */ - - /* Strip the CRs & LFs before writing it to stderr */ - for (pChar = pLineBegin; pChar < pCommentEnd; pChar++) - if (*pChar == '\r' || *pChar == '\n') - *pChar = ' '; - - if (strncasecmp(pLineBegin, "%%[ Error:", 10) == 0) - { - /* logLevel should be "ERROR" here but this causes PrintCenter - * to pause the queue which in turn clears this error, which - * restarts the job. So the job ends up in an infinite loop with - * the queue being held/un-held. Just make it DEBUG for now until - * we fix notifications later. - */ - logLevel = "DEBUG"; - gErrorlogged = true; - } - else if (strncasecmp(pLineBegin, "%%[ Flushing", 12) == 0) - logLevel = "DEBUG"; - else - logLevel = "INFO"; - - if ((logstrlen = snprintf(logstr, sizeof(logstr), "%s: %s\n", logLevel, pLineBegin)) >= sizeof(logstr)) - { - /* If the string was trucnated make sure it has a linefeed before the nul */ - logstrlen = sizeof(logstr) - 1; - logstr[logstrlen - 1] = '\n'; - } - - write(fderr, logstr, logstrlen); - - pLineBegin = pCommentEnd + 1; - } - } - - if (IS_PAP_EOF(userdata) != 0) - { - /* If this is EOF then were we expecting it? */ - if (fileEOFSent == true) - goto Exit; - else - { - _cupsLangPuts(stderr, _("WARNING: Printer sent unexpected EOF\n")); - } - } - - if ((err = papSendRequest(gSockfd, &gSessionAddr, gConnID, AT_PAP_TYPE_SEND_DATA, 0xFF, true, true)) < 0) - { - _cupsLangPrintf(stderr, - _("ERROR: Error %d sending PAPSendData request: %s\n"), - err, strerror(errno)); - goto Exit; - } - break; - - case AT_PAP_TYPE_TICKLE: /* Tickle packet */ - break; - - case AT_PAP_TYPE_CLOSE_CONN: /* Close-Connection packet */ - /* We shouldn't normally see this. */ - papCloseResp(gSockfd, &gSessionAddr, xo, tid, gConnID); - - /* If this is EOF then were we expecting it? */ - if (fileEOFSent == true) - { - _cupsLangPuts(stderr, _("WARNING: Printer sent unexpected EOF\n")); - } - else - { - _cupsLangPuts(stderr, _("ERROR: Printer sent unexpected EOF\n")); - } - goto Exit; - break; - - case AT_PAP_TYPE_OPEN_CONN: /* Open-Connection packet */ - case AT_PAP_TYPE_OPEN_CONN_REPLY: /* Open-Connection-Reply packet */ - case AT_PAP_TYPE_SEND_STATUS: /* Send-Status packet */ - case AT_PAP_TYPE_CLOSE_CONN_REPLY: /* Close-Connection-Reply packet */ - _cupsLangPrintf(stderr, _("WARNING: Unexpected PAP packet of type %d\n"), - TYPE_OF(userdata)); - break; - - default: - _cupsLangPrintf(stderr, _("WARNING: Unknown PAP packet of type %d\n"), - TYPE_OF(userdata)); - break; - } - - if (CONNID_OF(userdata) == gConnID) - { - /* Reset tickle timer */ - alarm(0); - alarm(PAP_TIMEOUT); - } - } - } - -Exit: - /* - * Close the socket and return... - */ - papClose(); - - return err; -} - - -#pragma mark - -/*! - * @function papOpen - * @abstract Open a pap session to a printer. - * - * @param tuple nbp address of printer - * @param connID returned pap connection id - * @param fd returned socket descriptor - * @param sessionAddr returned session address - * @param flowQuantum returned flow quantum (usually 8) - * - * @result A non-zero return value for errors - */ -static int papOpen(at_nbptuple_t* tuple, u_char* connID, int* fd, - at_inet_t* sessionAddr, u_char* flowQuantum) -{ - int result, - open_result, - userdata; - time_t tm, - waitTime; - char data[10], - rdata[ATP_DATA_SIZE]; - u_char *puserdata; - at_socket socketfd; - at_resp_t resp; - at_retry_t retry; - - result = 0; - socketfd = 0; - puserdata = (u_char *)&userdata; - - _cupsLangPuts(stderr, _("INFO: Opening connection\n")); - - if ((*fd = atp_open(&socketfd)) < 0) - return -1; - - /* - * Build the open connection request packet. - */ - - tm = time(NULL); - srand(tm); - - *connID = (rand()&0xff) | 0x01; - puserdata[0] = *connID; - puserdata[1] = AT_PAP_TYPE_OPEN_CONN; - puserdata[2] = 0; - puserdata[3] = 0; - - retry.interval = 2; - retry.retries = 5; - - resp.bitmap = 0x01; - resp.resp[0].iov_base = rdata; - resp.resp[0].iov_len = sizeof(rdata); - - data[0] = socketfd; - data[1] = 8; - - for (;;) - { - waitTime = time(NULL) - tm; - OSWriteBigInt16(&data[2], 0, (u_short)waitTime); - - fprintf(stderr, "DEBUG: -> %s\n", packet_name(AT_PAP_TYPE_OPEN_CONN)); - - if (atp_sendreq(*fd, &tuple->enu_addr, data, 4, userdata, 1, 0, - 0, &resp, &retry, 0) < 0) - { - statusUpdate("Destination unreachable", 23); - result = EHOSTUNREACH; - break; - } - - puserdata = (u_char *)&resp.userdata[0]; - open_result = OSReadBigInt16(&rdata[2], 0); - - fprintf(stderr, "DEBUG: <- %s, status %d\n", packet_name(puserdata[1]), - open_result); - - /* - * Just for the sake of our sanity check the other fields in the packet - */ - - if (puserdata[1] != AT_PAP_TYPE_OPEN_CONN_REPLY || - (open_result == 0 && (puserdata[0] & 0xff) != *connID)) - { - result = EINVAL; - break; - } - - statusUpdate(&rdata[5], rdata[4] & 0xff); - - /* - * if the connection established okay exit from the loop - */ - - if (open_result == 0) - break; - - sleep(1); - } - - if (result == 0) - { - /* Update the session address - */ - sessionAddr->net = tuple->enu_addr.net; - sessionAddr->node = tuple->enu_addr.node; - sessionAddr->socket = rdata[0]; - *flowQuantum = rdata[1]; - } - else - { - atp_close(*fd); - *fd = 0; - sleep(1); - } - - return result; -} - - -/*! - * @function papClose - * @abstract End a PAP session by canceling outstanding send-data & tickle - * transactions and sending a PAP close request. - * - * @result A non-zero return value for errors - */ -static int papClose() -{ - int fd; - u_short tmpID; - unsigned char rdata[ATP_DATA_SIZE]; - int userdata; - u_char *puserdata = (u_char *)&userdata; - at_resp_t resp; - at_retry_t retry; - - if (gSockfd != 0) - { - fd = gSockfd; - gSockfd = 0; - - alarm(0); - - /* Cancel the pending send-data and tickle trnsactions - */ - if (gSendDataID) - { - tmpID = gSendDataID; - gSendDataID = 0; - papCancelRequest(fd, tmpID); - } - - if (gTickleID) - { - tmpID = gTickleID; - gTickleID = 0; - papCancelRequest(fd, tmpID); - } - - /* This is a workaround for bug #2735145. The problem is papWrite() - * returns before the ATP TRel arrives for it. If we send the pap close packet - * before this release then the printer can drop the last data packets. - * The effect on an Epson printer is the last page doesn't print, on HP it - * doesn't close the pap session. - */ - if (gWaitEOF == false) - sleep(2); - - fprintf(stderr, "DEBUG: -> %s\n", packet_name(AT_PAP_TYPE_CLOSE_CONN)); - - puserdata[0] = gConnID; - puserdata[1] = AT_PAP_TYPE_CLOSE_CONN; - puserdata[2] = 0; - puserdata[3] = 0; - - retry.interval = 2; - retry.retries = 5; - - resp.bitmap = 0x01; - resp.resp[0].iov_base = rdata; - resp.resp[0].iov_len = sizeof(rdata); - - atp_sendreq(fd, &gSessionAddr, 0, 0, userdata, 1, 0, 0, &resp, &retry, 0); - - close(fd); - } - return noErr; -} - - -/*! - * @function papWrite - * @abstract Write bytes to a printer. - * - * @param sockfd socket descriptor - * @param dest destination address - * @param tid transaction id - * @param connID connection id - * @param flowQuantum returned flow quantum (usually 8) - * @param data pointer to the data - * @param len number of bytes to send - * @param eof pap eof flag - * - * @result A non-zero return value for errors - */ -static int papWrite(int sockfd, at_inet_t* dest, u_short tid, u_char connID, u_char flowQuantum, char* data, int len, int eof) -{ - int result; - int i; - u_char* puserdata; - at_resp_t resp; - - /* fprintf(stderr, "DEBUG: papWrite(%d%s) to %d,%d,%d; %d\n", len, eof ? " EOF":"", dest->net, dest->node, dest->socket, connID); */ - - if (len > AT_PAP_DATA_SIZE * flowQuantum) - { - fprintf(stderr, "DEBUG: papWrite() len of %d is too big!\n", len); - errno = E2BIG; - return -1; - } - - /* - * Break up the outgoing data into a set of - * response packets to reply to an incoming - * PAP 'SENDDATA' request - */ - for (i = 0; i < flowQuantum; i++) - { - resp.userdata[i] = 0; - puserdata = (u_char *)&resp.userdata[i]; - - puserdata[PAP_CONNID] = connID; - puserdata[PAP_TYPE] = AT_PAP_TYPE_DATA; - puserdata[PAP_EOF] = eof ? 1 : 0; - - resp.resp[i].iov_base = (caddr_t)data; - - if (data) - data += AT_PAP_DATA_SIZE; - - resp.resp[i].iov_len = MIN((int)len, (int)AT_PAP_DATA_SIZE); - len -= resp.resp[i].iov_len; - if (len == 0) - break; - } - resp.bitmap = (1 << (i + 1)) - 1; - - /* - * Write out the data as a PAP 'DATA' response - */ - errno = 0; - if ((result = atp_sendrsp(sockfd, dest, true, tid, &resp)) < 0) - { - fprintf(stderr, "DEBUG: atp_sendrsp() returns %d, errno %d \"%s\"\n", result, errno, strerror(errno)); - return -1; - } - return(0); -} - - -/*! - * @function papCloseResp - * @abstract Send a pap close response in the rare case we receive a close connection request. - * - * @param sockfd socket descriptor - * @param dest destination address - * @param tid transaction id - * @param connID connection id - * - * @result A non-zero return value for errors - */ -static int papCloseResp(int sockfd, at_inet_t* dest, int xo, u_short tid, u_char connID) -{ - int result; - at_resp_t resp; - - resp.bitmap = 1; - resp.userdata[0] = 0; - - ((u_char*)&resp.userdata[0])[PAP_CONNID] = connID; - ((u_char*)&resp.userdata[0])[PAP_TYPE] = AT_PAP_TYPE_CLOSE_CONN_REPLY; - - resp.resp[0].iov_base = NULL; - resp.resp[0].iov_len = 0; - - if ((result = atp_sendrsp(sockfd, dest, xo, tid, &resp)) < 0) - { - fprintf(stderr, "DEBUG: atp_sendrsp() returns %d, errno %d \"%s\"\n", result, errno, strerror(errno)); - return -1; - } - return 0; -} - - -/*! - * @function papSendRequest - * @abstract Send a pap close response in the rare case we receive a close connection request. - * - * @param sockfd socket descriptor - * @param dest destination address - * @param function pap function - * @param bitmap bitmap - * @param xo exactly once - * @param seqno sequence number - * - * @result A non-zero return value for errors - */ -static int papSendRequest(int sockfd, at_inet_t* dest, u_char connID, int function, u_char bitmap, int xo, int seqno) -{ - u_short tid; - int err; - sigset_t sv, osv; - int userdata; - u_char *puserdata = (u_char *)&userdata; - at_retry_t retry; - at_resp_t resp; - static u_short pap_send_count = 0; - - fprintf(stderr, "DEBUG: -> %s\n", packet_name(function)); - - puserdata[0] = connID; - puserdata[1] = function; - resp.bitmap = bitmap; - retry.interval = 10; - retry.retries = -1; /* was ATP_INFINITE_RETRIES */ - if (seqno) - { - pap_send_count++; - if (pap_send_count == 0) - pap_send_count = 1; - - OSWriteBigInt16(&puserdata[2], 0, pap_send_count); - } - else - OSWriteBigInt16(&puserdata[2], 0, 0); - - sigemptyset(&sv); - sigaddset(&sv, SIGIO); - sigprocmask(SIG_SETMASK, &sv, &osv); - - err = atp_sendreq(sockfd, dest, 0, 0, userdata, xo, 0, &tid, &resp, &retry, 1); - - sigprocmask(SIG_SETMASK, &osv, NULL); - - return err; -} - - -/*! - * @function papCancelRequest - * @abstract Cancel a pending pap request. - * - * @param sockfd socket descriptor - * @param tid transaction ID - * - * @result A non-zero return value for errors - */ -int papCancelRequest(int sockfd, u_short tid) -{ - sigset_t sv, osv; - - sigemptyset(&sv); - sigaddset(&sv, SIGIO); - sigprocmask(SIG_SETMASK, &sv, &osv); - - if (atp_abort(sockfd, NULL, tid) < 0) - { - sigprocmask(SIG_SETMASK, &osv, NULL); - return -1; - } - sigprocmask(SIG_SETMASK, &osv, NULL); - - return 0; -} - - -/* - * 'sidechannel_request()' - Handle side-channel requests. - */ - -static int -sidechannel_request() -{ - cups_sc_command_t command; /* Request command */ - cups_sc_status_t status; /* Request/response status */ - char data[2048]; /* Request/response data */ - int datalen; /* Request/response data size */ - - datalen = sizeof(data); - - if (cupsSideChannelRead(&command, &status, data, &datalen, 1.0)) - return (-1); - - switch (command) - { - case CUPS_SC_CMD_GET_BIDI: /* Is the connection bidirectional? */ - data[0] = 1; - return (cupsSideChannelWrite(command, CUPS_SC_STATUS_OK, data, 1, 1.0)); - break; - - case CUPS_SC_CMD_GET_STATE: /* Return device state */ - data[0] = CUPS_SC_STATE_ONLINE; - return (cupsSideChannelWrite(command, CUPS_SC_STATUS_OK, data, 1, 1.0)); - break; - - case CUPS_SC_CMD_DRAIN_OUTPUT: /* Drain all pending output */ - case CUPS_SC_CMD_SOFT_RESET: /* Do a soft reset */ - case CUPS_SC_CMD_GET_DEVICE_ID: /* Return IEEE-1284 device ID */ - default: - return (cupsSideChannelWrite(command, CUPS_SC_STATUS_NOT_IMPLEMENTED, - NULL, 0, 1.0)); - break; - } - return (0); -} - - -#pragma mark - -/*! - * @function statusUpdate - * @abstract Format and print a PAP status response to stderr. - * - * @param status The status response string - * @param statusLen The length of the status response string - */ -void statusUpdate(char* status, u_char statusLen) -{ - static char status_str[255]; - static u_char last_statusLen = 0xFF; - - /* Only send this if the status has changed */ - if (statusLen != last_statusLen || memcmp(status, status_str, statusLen) != 0) - { - if (statusLen > sizeof(status_str)-1) - statusLen = sizeof(status_str)-1; - last_statusLen = statusLen; - memcpy(status_str, status, statusLen); - status_str[(int)statusLen] = '\0'; - - /* - * Make sure the status string is in the form of a PostScript comment. - */ - - if (statusLen > 3 && memcmp(status, "%%[", 3) == 0) - fprintf(stderr, "INFO: %s\n", status_str); - else - fprintf(stderr, "INFO: %%%%[ %s ]%%%%\n", status_str); - } - return; -} - - -/*! - * @function parseUri - * @abstract Parse a PAP URI into it's NBP components. - * - * @param argv0 The PAP URI to parse - * @param name NBP name - * @param zone NBP zone - * @param type NBP type - * - * @result A non-zero return value for errors - */ -static int parseUri(const char* argv0, char* name, char* type, char* zone) -{ - char method[255], /* Method in URI */ - hostname[1024], /* Hostname */ - username[255], /* Username info (not used) */ - resource[1024], /* Resource info (device and options) */ - *resourcePtr, - *typePtr, - *options, /* Pointer to options */ - *optionName, /* Name of option */ - *value, /* Value of option */ - sep; /* Separator character */ - int port; /* Port number (not used) */ - int statusInterval; /* */ - - /* - * Extract the device name and options from the URI... - */ - method[0] = username[0] = hostname[0] = resource[0] = '\0'; - port = 0; - - httpSeparateURI(HTTP_URI_CODING_NONE, argv0, method, sizeof(method), - username, sizeof(username), - hostname, sizeof(hostname), &port, - resource, sizeof(resource)); - - /* - * See if there are any options... - */ - if ((options = strchr(resource, '?')) != NULL) - { - /* - * Yup, terminate the device name string and move to the first - * character of the options... - */ - *options++ = '\0'; - - while (*options != '\0') - { - /* - * Get the name... - */ - - optionName = options; - - while (*options && *options != '=' && *options != '+' && *options != '&') - options ++; - - if ((sep = *options) != '\0') - *options++ = '\0'; - - if (sep == '=') - { - /* - * Get the value... - */ - - value = options; - - while (*options && *options != '+' && *options != '&') - options ++; - - if (*options) - *options++ = '\0'; - } - else - value = (char *)""; - - /* - * Process the option... - */ - - if (!strcasecmp(optionName, "waiteof")) - { - /* - * Wait for the end of the print file? - */ - - if (!strcasecmp(value, "on") || - !strcasecmp(value, "yes") || - !strcasecmp(value, "true")) - { - gWaitEOF = true; - } - else if (!strcasecmp(value, "off") || - !strcasecmp(value, "no") || - !strcasecmp(value, "false")) - { - gWaitEOF = false; - } - else - { - _cupsLangPrintf(stderr, - _("WARNING: Boolean expected for waiteof option \"%s\"\n"), - value); - } - } - else if (!strcasecmp(optionName, "status")) - { - /* - * Set status reporting interval... - */ - - statusInterval = atoi(value); - if (value[0] < '0' || value[0] > '9' || statusInterval < 0) - { - _cupsLangPrintf(stderr, - _("WARNING: number expected for status option \"%s\"\n"), - value); - } - else - { - gStatusInterval = statusInterval; - } - } - } - } - - resourcePtr = resource; - - if (*resourcePtr == '/') - resourcePtr++; - - /* If the resource has a slash we assume the slash seperates the AppleTalk object - * name from the AppleTalk type. If the slash is not present we assume the AppleTalk - * type is LaserWriter. - */ - - typePtr = strchr(resourcePtr, '/'); - if (typePtr != NULL) - { - *typePtr++ = '\0'; - } - else - { - typePtr = "LaserWriter"; - } - - removePercentEscapes(hostname, zone, NBP_NVE_STR_SIZE + 1); - removePercentEscapes(resourcePtr, name, NBP_NVE_STR_SIZE + 1); - removePercentEscapes(typePtr, type, NBP_NVE_STR_SIZE + 1); - - return 0; -} - - -/*! - * @function addPercentEscapes - * @abstract Encode a string with percent escapes - * - * @param src The source C string - * @param dst Desination buffer - * @param dstMax Size of desination buffer - * - * @result A non-zero return value for errors - */ -static int addPercentEscapes(const char* src, char* dst, int dstMax) -{ - char c; - char *dstEnd = dst + dstMax - 1; /* -1 to leave room for the NUL */ - - while (*src) - { - c = *src++; - - if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || - (c >= '0' && c <= '9') || (c == '.' || c == '-' || c == '*' || c == '_')) - { - if (dst >= dstEnd) - return -1; - - *dst++ = c; - } - else - { - if (dst >= dstEnd - 2) - return -1; - - snprintf(dst, dstEnd - dst, "%%%02x", c); - dst += 3; - } - } - - *dst = '\0'; - return 0; -} - - -/*! - * @function removePercentEscapes - * @abstract Returns a string with any percent escape sequences replaced with their equivalent character - * - * @param src Source buffer - * @param srclen Number of bytes in source buffer - * @param dst Desination buffer - * @param dstMax Size of desination buffer - * - * @result A non-zero return value for errors - */ -static int removePercentEscapes(const char* src, char* dst, int dstMax) -{ - int c; - const char *dstEnd = dst + dstMax; - - while (*src && dst < dstEnd) - { - c = *src++; - - if (c == '%') - { - sscanf(src, "%02x", &c); - src += 2; - } - *dst++ = (char)c; - } - - if (dst >= dstEnd) - return -1; - - *dst = '\0'; - return 0; -} - - -/*! - * @function nbptuple_compare - * @abstract An NBP comparator for qsort. - * - * @result p1p2: 1 - */ -int nbptuple_compare(const void *p1, const void *p2) -{ - int result; - int len = MIN(((at_nbptuple_t*)p1)->enu_entity.object.len, - ((at_nbptuple_t*)p2)->enu_entity.object.len); - - if ((result = memcmp(((at_nbptuple_t*)p1)->enu_entity.object.str, ((at_nbptuple_t*)p2)->enu_entity.object.str, len)) == 0) - { - if (((at_nbptuple_t*)p1)->enu_entity.object.len < ((at_nbptuple_t*)p2)->enu_entity.object.len) - result = -1; - else if (((at_nbptuple_t*)p1)->enu_entity.object.len > ((at_nbptuple_t*)p2)->enu_entity.object.len) - result = 1; - else - result = 0; - } - return result; -} - - -/*! - * @function okayToUseAppleTalk - * @abstract Returns true if AppleTalk is available and enabled. - * - * @result non-zero if AppleTalk is enabled - */ -static int okayToUseAppleTalk() -{ - int atStatus = checkATStack(); - - /* I think the test should be: - * return atStatus == RUNNING || atStatus == LOADED; - * but when I disable AppleTalk from the network control panel and - * reboot, AppleTalk shows up as loaded. The test empirically becomes - * the following: - */ - return atStatus == RUNNING; -} - - -/*! - * @function packet_name - * @abstract Returns packet name string. - * - * @result A string - */ -static const char *packet_name(u_char x) -{ - switch (x) - { - case AT_PAP_TYPE_OPEN_CONN: return "PAP_OPEN_CONN"; - case AT_PAP_TYPE_OPEN_CONN_REPLY: return "PAP_OPEN_CONN_REPLY"; - case AT_PAP_TYPE_SEND_DATA: return "PAP_SEND_DATA"; - case AT_PAP_TYPE_DATA: return "PAP_DATA"; - case AT_PAP_TYPE_TICKLE: return "PAP_TICKLE"; - case AT_PAP_TYPE_CLOSE_CONN: return "PAP_CLOSE_CONN"; - case AT_PAP_TYPE_CLOSE_CONN_REPLY: return "PAP_CLOSE_CONN_REPLY"; - case AT_PAP_TYPE_SEND_STATUS: return "PAP_SEND_STATUS"; - case AT_PAP_TYPE_SEND_STS_REPLY: return "PAP_SEND_STS_REPLY"; - case AT_PAP_TYPE_READ_LW: return "PAP_READ_LW"; - } - return ""; -} - - -/*! - * @function connectTimeout - * @abstract Returns the connect timeout preference value. - */ -static int connectTimeout() -{ - CFPropertyListRef value; - SInt32 connect_timeout = (7 * 24 * 60 * 60); /* Default timeout is one week... */ - - value = CFPreferencesCopyValue(CFSTR("timeout"), CFSTR("com.apple.print.backends"), - kCFPreferencesAnyUser, kCFPreferencesCurrentHost); - if (value != NULL) - { - if (CFGetTypeID(value) == CFNumberGetTypeID()) - CFNumberGetValue(value, kCFNumberSInt32Type, &connect_timeout); - - CFRelease(value); - } - - return connect_timeout; -} - - -/*! - * @function signalHandler - * @abstract A signal handler so we can clean up the pap session before exiting. - * - * @param sigraised The signal raised - * - * @result Never returns - */ -static void signalHandler(int sigraised) -{ - _cupsLangPuts(stderr, _("ERROR: There was a timeout error while sending data to the printer\n")); - - papClose(); - - _exit(1); -} diff --git a/backend/runloop.c b/backend/runloop.c index 13f9c23da..d225529da 100644 --- a/backend/runloop.c +++ b/backend/runloop.c @@ -1,9 +1,9 @@ /* * "$Id: runloop.c 7895 2008-09-02 19:19:43Z mike $" * - * Common run loop APIs for the Common UNIX Printing System (CUPS). + * Common run loop APIs for CUPS. * - * Copyright 2007-2009 by Apple Inc. + * Copyright 2007-2010 by Apple Inc. * Copyright 2006-2007 by Easy Software Products, all rights reserved. * * These coded instructions, statements, and computer programs are the @@ -299,6 +299,8 @@ backendRunLoop( strerror(errno)); use_bc = 0; } + else if (bc_bytes == 0) + use_bc = 0; } /* diff --git a/backend/serial.c b/backend/serial.c index 4eb3700ff..7a0c36c61 100644 --- a/backend/serial.c +++ b/backend/serial.c @@ -503,7 +503,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ * stdin (otherwise you can't cancel raw jobs...) */ - if (print_fd != 0) + if (!print_fd) { #ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */ sigset(SIGTERM, SIG_IGN); diff --git a/backend/usb-darwin.c b/backend/usb-darwin.c index f94059984..7bc883e5e 100644 --- a/backend/usb-darwin.c +++ b/backend/usb-darwin.c @@ -112,6 +112,12 @@ extern char **environ; #define DEBUG_WRITES 0 +/* + * WAIT_EOF_DELAY is number of seconds we'll wait for responses from + * the printer after we've finished sending all the data + */ +#define WAIT_EOF_DELAY 7 +#define WAIT_SIDE_DELAY 3 #define DEFAULT_TIMEOUT 5000L #define USB_INTERFACE_KIND CFUUIDGetUUIDBytes(kIOUSBInterfaceInterfaceID190) @@ -241,6 +247,11 @@ typedef struct globals_s Boolean wait_eof; int drain_output; /* Drain all pending output */ int bidi_flag; /* 0=unidirectional, 1=bidirectional */ + + pthread_mutex_t sidechannel_thread_mutex; + pthread_cond_t sidechannel_thread_cond; + int sidechannel_thread_stop; + int sidechannel_thread_done; } globals_t; @@ -333,6 +344,7 @@ print_device(const char *uri, /* I - Device URI */ UInt32 bytes; /* Bytes written */ struct timeval *timeout, /* Timeout pointer */ stimeout; /* Timeout for select() */ + struct timespec cond_timeout; /* pthread condition timeout */ /* @@ -477,6 +489,12 @@ print_device(const char *uri, /* I - Device URI */ if (have_sidechannel) { + g.sidechannel_thread_stop = 0; + g.sidechannel_thread_done = 0; + + pthread_cond_init(&g.sidechannel_thread_cond, NULL); + pthread_mutex_init(&g.sidechannel_thread_mutex, NULL); + if (pthread_create(&sidechannel_thread_id, NULL, sidechannel_thread, NULL)) { fprintf(stderr, "DEBUG: Fatal USB error.\n"); @@ -734,6 +752,101 @@ 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); + action.sa_handler = SIG_DFL; + sigaction(SIGTERM, &action, NULL); + } + + /* + * Wait for the side channel thread to exit... + */ + + if (have_sidechannel) + { + close(CUPS_SC_FD); + pthread_mutex_lock(&g.readwrite_lock_mutex); + g.readwrite_lock = 0; + pthread_cond_signal(&g.readwrite_lock_cond); + pthread_mutex_unlock(&g.readwrite_lock_mutex); + + g.sidechannel_thread_stop = 1; + pthread_mutex_lock(&g.sidechannel_thread_mutex); + if (!g.sidechannel_thread_done) + { + /* + * Wait for the side-channel thread to exit... + */ + + cond_timeout.tv_sec = time(NULL) + WAIT_SIDE_DELAY; + cond_timeout.tv_nsec = 0; + if (pthread_cond_timedwait(&g.sidechannel_thread_cond, + &g.sidechannel_thread_mutex, + &cond_timeout) != 0) + { + /* + * Force the side-channel thread to exit... + */ + + 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... + */ + + 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) + { + cond_timeout.tv_sec = time(NULL) + WAIT_EOF_DELAY; + cond_timeout.tv_nsec = 0; + + if (pthread_cond_timedwait(&g.read_thread_cond, &g.read_thread_mutex, + &cond_timeout) != 0) + { + /* + * Force the read thread to exit... + */ + + g.wait_eof = 0; + pthread_kill(read_thread_id, SIGTERM); + } + } + 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... */ @@ -942,7 +1055,12 @@ sidechannel_thread(void *reference) break; } } - while (1); + while (!g.sidechannel_thread_stop); + + pthread_mutex_lock(&g.sidechannel_thread_mutex); + g.sidechannel_thread_done = 1; + pthread_cond_signal(&g.sidechannel_thread_cond); + pthread_mutex_unlock(&g.sidechannel_thread_mutex); return NULL; } @@ -1278,7 +1396,10 @@ static kern_return_t load_classdriver(CFStringRef driverPath, { fprintf(stderr, "DEBUG: Unable to load class driver \"%s\": %s\n", bundlestr, strerror(errno)); - return (kr); + if (errno == ENOENT) + return (load_classdriver(NULL, intf, printerDriver)); + else + return (kr); } else if (bundleinfo.st_mode & S_IWOTH) { diff --git a/backend/usb-libusb.c b/backend/usb-libusb.c index 7f4095179..3071e1c40 100644 --- a/backend/usb-libusb.c +++ b/backend/usb-libusb.c @@ -1,9 +1,9 @@ /* * "$Id$" * - * Libusb interface code for the Common UNIX Printing System (CUPS). + * Libusb interface code for CUPS. * - * Copyright 2007-2009 by Apple Inc. + * Copyright 2007-2010 by Apple Inc. * * These coded instructions, statements, and computer programs are the * property of Apple Inc. and are protected by Federal copyright @@ -173,7 +173,7 @@ print_device(const char *uri, /* I - Device URI */ if ((bytes = read(print_fd, buffer, sizeof(buffer))) > 0) { if (usb_bulk_write(printer->handle, printer->write_endp, buffer, - bytes, 45000) < 0) + bytes, 3600000) < 0) { _cupsLangPrintf(stderr, _("ERROR: Unable to write %d bytes to printer\n"), @@ -519,7 +519,8 @@ make_device_uri( if ((sern = cupsGetOption("SERIALNUMBER", num_values, values)) == NULL) if ((sern = cupsGetOption("SERN", num_values, values)) == NULL) - if ((sern = cupsGetOption("SN", num_values, values)) == NULL) + if ((sern = cupsGetOption("SN", num_values, values)) == NULL && + printer->device->descriptor.iSerialNumber) { /* * Try getting the serial number from the device itself... diff --git a/berkeley/Dependencies b/berkeley/Dependencies index 297ddba7f..de9ba9799 100644 --- a/berkeley/Dependencies +++ b/berkeley/Dependencies @@ -1,32 +1,32 @@ # DO NOT DELETE THIS LINE -- make depend depends on it. lpc.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -lpc.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h -lpc.o: ../cups/array.h ../cups/string-private.h ../config.h +lpc.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +lpc.o: ../cups/language.h ../cups/string-private.h ../config.h lpc.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h lpc.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h lpc.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h lpc.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h lpc.o: ../cups/thread-private.h lpq.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -lpq.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h -lpq.o: ../cups/array.h ../cups/string-private.h ../config.h +lpq.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +lpq.o: ../cups/language.h ../cups/string-private.h ../config.h lpq.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h lpq.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h lpq.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h lpq.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h lpq.o: ../cups/thread-private.h lpr.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -lpr.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h -lpr.o: ../cups/array.h ../cups/string-private.h ../config.h +lpr.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +lpr.o: ../cups/language.h ../cups/string-private.h ../config.h lpr.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h lpr.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h lpr.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h lpr.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h lpr.o: ../cups/thread-private.h lprm.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -lprm.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h -lprm.o: ../cups/array.h ../cups/string-private.h ../config.h +lprm.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +lprm.o: ../cups/language.h ../cups/string-private.h ../config.h lprm.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h lprm.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h lprm.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h diff --git a/cgi-bin/Dependencies b/cgi-bin/Dependencies index c8a4e51ba..9a5f11d57 100644 --- a/cgi-bin/Dependencies +++ b/cgi-bin/Dependencies @@ -2,74 +2,74 @@ help-index.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h help-index.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -help-index.o: ../cups/language.h ../cups/array.h ../cups/array.h help-index.h +help-index.o: ../cups/array.h ../cups/language.h ../cups/array.h help-index.h help-index.o: ../cups/debug-private.h ../cups/language-private.h help-index.o: ../cups/transcode.h ../cups/string-private.h ../config.h help-index.o: ../cups/dir.h html.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h -html.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h -html.o: ../cups/array.h ../cups/array.h help-index.h ../cups/debug-private.h -html.o: ../cups/language-private.h ../cups/transcode.h -html.o: ../cups/string-private.h ../config.h +html.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +html.o: ../cups/language.h ../cups/array.h help-index.h +html.o: ../cups/debug-private.h ../cups/language-private.h +html.o: ../cups/transcode.h ../cups/string-private.h ../config.h ipp-var.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h -ipp-var.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -ipp-var.o: ../cups/language.h ../cups/array.h ../cups/array.h help-index.h +ipp-var.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +ipp-var.o: ../cups/language.h ../cups/array.h help-index.h ipp-var.o: ../cups/debug-private.h ../cups/language-private.h ipp-var.o: ../cups/transcode.h ../cups/string-private.h ../config.h search.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h -search.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -search.o: ../cups/language.h ../cups/array.h ../cups/array.h help-index.h +search.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +search.o: ../cups/language.h ../cups/array.h help-index.h search.o: ../cups/debug-private.h ../cups/language-private.h search.o: ../cups/transcode.h ../cups/string-private.h ../config.h template.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h -template.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -template.o: ../cups/language.h ../cups/array.h ../cups/array.h help-index.h +template.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +template.o: ../cups/language.h ../cups/array.h help-index.h template.o: ../cups/debug-private.h ../cups/language-private.h template.o: ../cups/transcode.h ../cups/string-private.h ../config.h var.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -var.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +var.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h var.o: ../cups/array.h help-index.h ../cups/debug-private.h var.o: ../cups/language-private.h ../cups/transcode.h var.o: ../cups/string-private.h ../config.h ../cups/http.h var.o: ../cups/md5-private.h admin.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h -admin.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h -admin.o: ../cups/array.h ../cups/array.h help-index.h ../cups/debug-private.h -admin.o: ../cups/language-private.h ../cups/transcode.h -admin.o: ../cups/string-private.h ../config.h ../cups/adminutil.h -admin.o: ../cups/cups.h ../cups/ppd.h +admin.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +admin.o: ../cups/language.h ../cups/array.h help-index.h +admin.o: ../cups/debug-private.h ../cups/language-private.h +admin.o: ../cups/transcode.h ../cups/string-private.h ../config.h +admin.o: ../cups/adminutil.h ../cups/cups.h ../cups/ppd.h classes.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h -classes.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -classes.o: ../cups/language.h ../cups/array.h ../cups/array.h help-index.h +classes.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +classes.o: ../cups/language.h ../cups/array.h help-index.h classes.o: ../cups/debug-private.h ../cups/language-private.h classes.o: ../cups/transcode.h ../cups/string-private.h ../config.h help.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h -help.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h -help.o: ../cups/array.h ../cups/array.h help-index.h ../cups/debug-private.h -help.o: ../cups/language-private.h ../cups/transcode.h -help.o: ../cups/string-private.h ../config.h +help.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +help.o: ../cups/language.h ../cups/array.h help-index.h +help.o: ../cups/debug-private.h ../cups/language-private.h +help.o: ../cups/transcode.h ../cups/string-private.h ../config.h jobs.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h -jobs.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h -jobs.o: ../cups/array.h ../cups/array.h help-index.h ../cups/debug-private.h -jobs.o: ../cups/language-private.h ../cups/transcode.h -jobs.o: ../cups/string-private.h ../config.h +jobs.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +jobs.o: ../cups/language.h ../cups/array.h help-index.h +jobs.o: ../cups/debug-private.h ../cups/language-private.h +jobs.o: ../cups/transcode.h ../cups/string-private.h ../config.h makedocset.o: cgi.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -makedocset.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +makedocset.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h makedocset.o: ../cups/array.h help-index.h printers.o: cgi-private.h cgi.h ../cups/cups.h ../cups/file.h -printers.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -printers.o: ../cups/language.h ../cups/array.h ../cups/array.h help-index.h +printers.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +printers.o: ../cups/language.h ../cups/array.h help-index.h printers.o: ../cups/debug-private.h ../cups/language-private.h printers.o: ../cups/transcode.h ../cups/string-private.h ../config.h testcgi.o: cgi.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -testcgi.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +testcgi.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h testcgi.o: ../cups/array.h help-index.h testhi.o: cgi.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -testhi.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +testhi.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h testhi.o: ../cups/array.h help-index.h testtemplate.o: cgi.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -testtemplate.o: ../cups/ipp.h ../cups/http.h ../cups/language.h -testtemplate.o: ../cups/array.h ../cups/array.h help-index.h +testtemplate.o: ../cups/ipp.h ../cups/http.h ../cups/array.h +testtemplate.o: ../cups/language.h ../cups/array.h help-index.h websearch.o: cgi.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -websearch.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +websearch.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h websearch.o: ../cups/array.h help-index.h diff --git a/cgi-bin/admin.c b/cgi-bin/admin.c index b890c8b99..a5250dc10 100644 --- a/cgi-bin/admin.c +++ b/cgi-bin/admin.c @@ -3439,6 +3439,20 @@ do_set_options(http_t *http, /* I - HTTP connection */ i > 0; i --, group ++) { + for (j = group->num_options, option = group->options; + j > 0; + j --, option ++) + { + if (!strcmp(option->keyword, "PageRegion")) + continue; + + if (option->num_choices > 1) + break; + } + + if (j == 0) + continue; + cgiSetVariable("GROUP_ID", group->name); if (!strcmp(group->name, "InstallableOptions")) @@ -3452,7 +3466,7 @@ do_set_options(http_t *http, /* I - HTTP connection */ j > 0; j --, option ++) { - if (!strcmp(option->keyword, "PageRegion")) + if (!strcmp(option->keyword, "PageRegion") || option->num_choices < 2) continue; cgiSetVariable("KEYWORD", option->keyword); @@ -3485,7 +3499,6 @@ do_set_options(http_t *http, /* I - HTTP connection */ { const char *units = NULL; /* Units value, if any */ - cgiSetVariable("ISCUSTOM", "1"); for (cparam = ppdFirstCustomParam(coption), m = 0; diff --git a/config-scripts/cups-common.m4 b/config-scripts/cups-common.m4 index db0c6c0c9..d99b86301 100644 --- a/config-scripts/cups-common.m4 +++ b/config-scripts/cups-common.m4 @@ -142,6 +142,13 @@ AC_CHECK_HEADER(iconv.h, SAVELIBS="$SAVELIBS $LIBS") LIBS="$SAVELIBS") +dnl Checks for statfs and its many headers... +AC_CHECK_HEADER(sys/mount.h,AC_DEFINE(HAVE_SYS_MOUNT_H)) +AC_CHECK_HEADER(sys/statfs.h,AC_DEFINE(HAVE_SYS_STATFS_H)) +AC_CHECK_HEADER(sys/statvfs.h,AC_DEFINE(HAVE_SYS_STATVFS_H)) +AC_CHECK_HEADER(sys/vfs.h,AC_DEFINE(HAVE_SYS_VFS_H)) +AC_CHECK_FUNCS(statfs statvfs) + dnl Checks for string functions. AC_CHECK_FUNCS(strdup strcasecmp strncasecmp strlcat strlcpy) if test "$uname" = "HP-UX" -a "$uversion" = "1020"; then diff --git a/config-scripts/cups-pap.m4 b/config-scripts/cups-pap.m4 index b532e0370..e69de29bb 100644 --- a/config-scripts/cups-pap.m4 +++ b/config-scripts/cups-pap.m4 @@ -1,31 +0,0 @@ -dnl -dnl "$Id$" -dnl -dnl PAP (AppleTalk) stuff for the Common UNIX Printing System (CUPS). -dnl -dnl Copyright 2007-2009 by Apple Inc. -dnl Copyright 2006 by Easy Software Products, all rights reserved. -dnl -dnl These coded instructions, statements, and computer programs are the -dnl property of Apple Inc. and are protected by Federal copyright -dnl law. Distribution and use rights are outlined in the file "LICENSE.txt" -dnl which should have been included with this file. If this file is -dnl file is missing or damaged, see the license at "http://www.cups.org/". -dnl - -# Currently the PAP backend is only supported on MacOS X with the AppleTalk -# SDK installed... -AC_ARG_ENABLE(pap, [ --enable-pap build with AppleTalk support]) - -PAP="" -AC_SUBST(PAP) - -if test x$enable_pap = xyes -a $uname = Darwin; then - AC_CHECK_HEADER(netat/appletalk.h,[ - PAP="pap" - AC_CHECK_HEADER(AppleTalk/at_proto.h)]) -fi - -dnl -dnl End of "$Id$". -dnl diff --git a/config-scripts/cups-ssl.m4 b/config-scripts/cups-ssl.m4 index c605121c0..86faf5f9d 100644 --- a/config-scripts/cups-ssl.m4 +++ b/config-scripts/cups-ssl.m4 @@ -38,6 +38,8 @@ if test x$enable_ssl != xno; then AC_DEFINE(HAVE_CDSASSL) dnl Check for the various security headers... + AC_CHECK_HEADER(Security/SecCertificate.h, + AC_DEFINE(HAVE_SECCERTIFICATE_H)) AC_CHECK_HEADER(Security/SecItemPriv.h, AC_DEFINE(HAVE_SECITEMPRIV_H)) AC_CHECK_HEADER(Security/SecPolicy.h, @@ -60,12 +62,14 @@ if test x$enable_ssl != xno; then dnl Check for SecPolicyCreateSSL... AC_MSG_CHECKING(for SecPolicyCreateSSL) - if test $uversion -ge 100; then + if test $uversion -ge 110; then AC_DEFINE(HAVE_SECPOLICYCREATESSL) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi]) + + AC_DEFINE(HAVE_CSSMERRORSTRING) fi fi diff --git a/config.h.in b/config.h.in index af0813dc6..13e2da071 100644 --- a/config.h.in +++ b/config.h.in @@ -289,6 +289,7 @@ */ #undef HAVE_AUTHORIZATION_H +#undef HAVE_SECCERTIFICATE_H #undef HAVE_SECITEMPRIV_H #undef HAVE_SECPOLICY_H #undef HAVE_SECPOLICYPRIV_H @@ -302,6 +303,12 @@ #undef HAVE_SECIDENTITYSEARCHCREATEWITHPOLICY +/* + * Do we have the SecPolicyCreateSSL function? + */ + +#undef HAVE_SECPOLICYCREATESSL + /* * Do we have the SecPolicyCreateSSL function? @@ -310,6 +317,13 @@ #undef HAVE_SECPOLICYCREATESSL +/* + * Do we have the cssmErrorString function? + */ + +#undef HAVE_CSSMERRORSTRING + + /* * Do we have the SLP library? */ @@ -661,6 +675,18 @@ #undef HAVE_ICONV_H +/* + * Do we have statfs or statvfs and one of the corresponding headers? + */ + +#undef HAVE_STATFS +#undef HAVE_STATVFS +#undef HAVE_SYS_MOUNT_H +#undef HAVE_SYS_STATFS_H +#undef HAVE_SYS_STATVFS_H +#undef HAVE_SYS_VFS_H + + #endif /* !_CUPS_CONFIG_H_ */ /* diff --git a/configure.in b/configure.in index 11b3e49cc..cc724bde9 100644 --- a/configure.in +++ b/configure.in @@ -38,7 +38,6 @@ sinclude(config-scripts/cups-largefile.m4) sinclude(config-scripts/cups-dnssd.m4) sinclude(config-scripts/cups-launchd.m4) sinclude(config-scripts/cups-defaults.m4) -sinclude(config-scripts/cups-pap.m4) sinclude(config-scripts/cups-pdf.m4) sinclude(config-scripts/cups-scripting.m4) diff --git a/cups/Dependencies b/cups/Dependencies index 822b97627..4eb80b6c5 100644 --- a/cups/Dependencies +++ b/cups/Dependencies @@ -1,131 +1,131 @@ # DO NOT DELETE adminutil.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -adminutil.o: language.h array.h string-private.h ../config.h debug-private.h +adminutil.o: array.h language.h string-private.h ../config.h debug-private.h adminutil.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h adminutil.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h adminutil.o: language-private.h ../cups/transcode.h thread-private.h adminutil.o: adminutil.h array.o: string-private.h ../config.h debug-private.h array.h versioning.h attr.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -attr.o: language.h array.h string-private.h ../config.h debug-private.h +attr.o: array.h language.h string-private.h ../config.h debug-private.h attr.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h attr.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h attr.o: language-private.h ../cups/transcode.h thread-private.h auth.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -auth.o: language.h array.h string-private.h ../config.h debug-private.h +auth.o: array.h language.h string-private.h ../config.h debug-private.h auth.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h auth.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h auth.o: language-private.h ../cups/transcode.h thread-private.h backchannel.o: cups.h backend.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -backend.o: language.h array.h string-private.h ../config.h debug-private.h +backend.o: array.h language.h string-private.h ../config.h debug-private.h backend.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h backend.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h backend.o: language-private.h ../cups/transcode.h thread-private.h backend.h conflicts.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -conflicts.o: language.h array.h string-private.h ../config.h debug-private.h +conflicts.o: array.h language.h string-private.h ../config.h debug-private.h conflicts.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h conflicts.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h conflicts.o: language-private.h ../cups/transcode.h thread-private.h custom.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -custom.o: language.h array.h string-private.h ../config.h debug-private.h +custom.o: array.h language.h string-private.h ../config.h debug-private.h custom.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h custom.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h custom.o: language-private.h ../cups/transcode.h thread-private.h debug.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -debug.o: language.h array.h string-private.h ../config.h debug-private.h +debug.o: array.h language.h string-private.h ../config.h debug-private.h debug.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h debug.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h debug.o: language-private.h ../cups/transcode.h thread-private.h dest.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -dest.o: language.h array.h string-private.h ../config.h debug-private.h +dest.o: array.h language.h string-private.h ../config.h debug-private.h dest.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h dest.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h dest.o: language-private.h ../cups/transcode.h thread-private.h dir.o: string-private.h ../config.h debug-private.h dir.h versioning.h emit.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -emit.o: language.h array.h string-private.h ../config.h debug-private.h +emit.o: array.h language.h string-private.h ../config.h debug-private.h emit.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h emit.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h emit.o: language-private.h ../cups/transcode.h thread-private.h encode.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -encode.o: language.h array.h string-private.h ../config.h debug-private.h +encode.o: array.h language.h string-private.h ../config.h debug-private.h encode.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h encode.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h encode.o: language-private.h ../cups/transcode.h thread-private.h file.o: file-private.h cups-private.h ../cups/cups.h file.h versioning.h -file.o: ipp.h http.h language.h array.h string-private.h ../config.h +file.o: ipp.h http.h array.h language.h string-private.h ../config.h file.o: debug-private.h ppd-private.h ../cups/ppd.h cups.h pwg-private.h file.o: http-private.h ../cups/http.h md5-private.h ipp-private.h file.o: ../cups/ipp.h language-private.h ../cups/transcode.h thread-private.h getdevices.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -getdevices.o: language.h array.h string-private.h ../config.h debug-private.h +getdevices.o: array.h language.h string-private.h ../config.h debug-private.h getdevices.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h getdevices.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h getdevices.o: language-private.h ../cups/transcode.h thread-private.h getifaddrs.o: http-private.h ../config.h ../cups/http.h md5-private.h getifaddrs.o: ipp-private.h ../cups/ipp.h getputfile.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -getputfile.o: language.h array.h string-private.h ../config.h debug-private.h +getputfile.o: array.h language.h string-private.h ../config.h debug-private.h getputfile.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h getputfile.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h getputfile.o: language-private.h ../cups/transcode.h thread-private.h globals.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -globals.o: language.h array.h string-private.h ../config.h debug-private.h +globals.o: array.h language.h string-private.h ../config.h debug-private.h globals.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h globals.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h globals.o: language-private.h ../cups/transcode.h thread-private.h http.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -http.o: language.h array.h string-private.h ../config.h debug-private.h +http.o: array.h language.h string-private.h ../config.h debug-private.h http.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h http.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h http.o: language-private.h ../cups/transcode.h thread-private.h http-addr.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -http-addr.o: language.h array.h string-private.h ../config.h debug-private.h +http-addr.o: array.h language.h string-private.h ../config.h debug-private.h http-addr.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h http-addr.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h http-addr.o: language-private.h ../cups/transcode.h thread-private.h http-addrlist.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h -http-addrlist.o: http.h language.h array.h string-private.h ../config.h +http-addrlist.o: http.h array.h language.h string-private.h ../config.h http-addrlist.o: debug-private.h ppd-private.h ../cups/ppd.h cups.h http-addrlist.o: pwg-private.h http-private.h ../cups/http.h md5-private.h http-addrlist.o: ipp-private.h ../cups/ipp.h language-private.h http-addrlist.o: ../cups/transcode.h thread-private.h http-support.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h -http-support.o: http.h language.h array.h string-private.h ../config.h +http-support.o: http.h array.h language.h string-private.h ../config.h http-support.o: debug-private.h ppd-private.h ../cups/ppd.h cups.h http-support.o: pwg-private.h http-private.h ../cups/http.h md5-private.h http-support.o: ipp-private.h ../cups/ipp.h language-private.h http-support.o: ../cups/transcode.h thread-private.h -ipp.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -ipp.o: language.h array.h string-private.h ../config.h debug-private.h -ipp.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h -ipp.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h -ipp.o: language-private.h ../cups/transcode.h thread-private.h +ipp.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h array.h +ipp.o: language.h string-private.h ../config.h debug-private.h ppd-private.h +ipp.o: ../cups/ppd.h cups.h pwg-private.h http-private.h ../cups/http.h +ipp.o: md5-private.h ipp-private.h ../cups/ipp.h language-private.h +ipp.o: ../cups/transcode.h thread-private.h ipp-support.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -ipp-support.o: language.h array.h string-private.h ../config.h +ipp-support.o: array.h language.h string-private.h ../config.h ipp-support.o: debug-private.h ppd-private.h ../cups/ppd.h cups.h ipp-support.o: pwg-private.h http-private.h ../cups/http.h md5-private.h ipp-support.o: ipp-private.h ../cups/ipp.h language-private.h ipp-support.o: ../cups/transcode.h thread-private.h langprintf.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -langprintf.o: language.h array.h string-private.h ../config.h debug-private.h +langprintf.o: array.h language.h string-private.h ../config.h debug-private.h langprintf.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h langprintf.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h langprintf.o: language-private.h ../cups/transcode.h thread-private.h language.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -language.o: language.h array.h string-private.h ../config.h debug-private.h +language.o: array.h language.h string-private.h ../config.h debug-private.h language.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h language.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h language.o: language-private.h ../cups/transcode.h thread-private.h localize.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -localize.o: language.h array.h string-private.h ../config.h debug-private.h +localize.o: array.h language.h string-private.h ../config.h debug-private.h localize.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h localize.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h localize.o: language-private.h ../cups/transcode.h thread-private.h mark.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -mark.o: language.h array.h string-private.h ../config.h debug-private.h +mark.o: array.h language.h string-private.h ../config.h debug-private.h mark.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h mark.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h mark.o: language-private.h ../cups/transcode.h thread-private.h @@ -133,42 +133,46 @@ md5.o: md5-private.h string-private.h ../config.h md5passwd.o: http-private.h ../config.h ../cups/http.h md5-private.h md5passwd.o: ipp-private.h ../cups/ipp.h string-private.h notify.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -notify.o: language.h array.h string-private.h ../config.h debug-private.h +notify.o: array.h language.h string-private.h ../config.h debug-private.h notify.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h notify.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h notify.o: language-private.h ../cups/transcode.h thread-private.h -options.o: cups.h string-private.h ../config.h debug-private.h +options.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h +options.o: array.h language.h string-private.h ../config.h debug-private.h +options.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h +options.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h +options.o: language-private.h ../cups/transcode.h thread-private.h page.o: string-private.h ../config.h debug-private.h ppd.h cups.h array.h page.o: versioning.h file.h -ppd.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -ppd.o: language.h array.h string-private.h ../config.h debug-private.h -ppd.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h -ppd.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h -ppd.o: language-private.h ../cups/transcode.h thread-private.h +ppd.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h array.h +ppd.o: language.h string-private.h ../config.h debug-private.h ppd-private.h +ppd.o: ../cups/ppd.h cups.h pwg-private.h http-private.h ../cups/http.h +ppd.o: md5-private.h ipp-private.h ../cups/ipp.h language-private.h +ppd.o: ../cups/transcode.h thread-private.h pwg-file.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -pwg-file.o: language.h array.h string-private.h ../config.h debug-private.h +pwg-file.o: array.h language.h string-private.h ../config.h debug-private.h pwg-file.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h pwg-file.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h pwg-file.o: language-private.h ../cups/transcode.h thread-private.h pwg-media.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -pwg-media.o: language.h array.h string-private.h ../config.h debug-private.h +pwg-media.o: array.h language.h string-private.h ../config.h debug-private.h pwg-media.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h pwg-media.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h pwg-media.o: language-private.h ../cups/transcode.h thread-private.h pwg-ppd.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -pwg-ppd.o: language.h array.h string-private.h ../config.h debug-private.h +pwg-ppd.o: array.h language.h string-private.h ../config.h debug-private.h pwg-ppd.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h pwg-ppd.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h pwg-ppd.o: language-private.h ../cups/transcode.h thread-private.h request.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -request.o: language.h array.h string-private.h ../config.h debug-private.h +request.o: array.h language.h string-private.h ../config.h debug-private.h request.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h request.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h request.o: language-private.h ../cups/transcode.h thread-private.h sidechannel.o: sidechannel.h versioning.h string-private.h ../config.h sidechannel.o: debug-private.h snmp.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -snmp.o: language.h array.h string-private.h ../config.h debug-private.h +snmp.o: array.h language.h string-private.h ../config.h debug-private.h snmp.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h snmp.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h snmp.o: language-private.h ../cups/transcode.h thread-private.h @@ -177,27 +181,27 @@ snprintf.o: string-private.h ../config.h string.o: string-private.h ../config.h debug-private.h thread-private.h string.o: array.h versioning.h tempfile.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -tempfile.o: language.h array.h string-private.h ../config.h debug-private.h +tempfile.o: array.h language.h string-private.h ../config.h debug-private.h tempfile.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h tempfile.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h tempfile.o: language-private.h ../cups/transcode.h thread-private.h thread.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -thread.o: language.h array.h string-private.h ../config.h debug-private.h +thread.o: array.h language.h string-private.h ../config.h debug-private.h thread.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h thread.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h thread.o: language-private.h ../cups/transcode.h thread-private.h transcode.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -transcode.o: language.h array.h string-private.h ../config.h debug-private.h +transcode.o: array.h language.h string-private.h ../config.h debug-private.h transcode.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h transcode.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h transcode.o: language-private.h ../cups/transcode.h thread-private.h usersys.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -usersys.o: language.h array.h string-private.h ../config.h debug-private.h +usersys.o: array.h language.h string-private.h ../config.h debug-private.h usersys.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h usersys.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h usersys.o: language-private.h ../cups/transcode.h thread-private.h util.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -util.o: language.h array.h string-private.h ../config.h debug-private.h +util.o: array.h language.h string-private.h ../config.h debug-private.h util.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h util.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h util.o: language-private.h ../cups/transcode.h thread-private.h @@ -216,25 +220,25 @@ testi18n.o: ../cups/transcode.h language.h array.h versioning.h testipp.o: file.h versioning.h string-private.h ../config.h ipp-private.h testipp.o: ../cups/ipp.h testoptions.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -testoptions.o: language.h array.h string-private.h ../config.h +testoptions.o: array.h language.h string-private.h ../config.h testoptions.o: debug-private.h ppd-private.h ../cups/ppd.h cups.h testoptions.o: pwg-private.h http-private.h ../cups/http.h md5-private.h testoptions.o: ipp-private.h ../cups/ipp.h language-private.h testoptions.o: ../cups/transcode.h thread-private.h testlang.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -testlang.o: language.h array.h string-private.h ../config.h debug-private.h +testlang.o: array.h language.h string-private.h ../config.h debug-private.h testlang.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h testlang.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h testlang.o: language-private.h ../cups/transcode.h thread-private.h testppd.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -testppd.o: language.h array.h string-private.h ../config.h debug-private.h +testppd.o: array.h language.h string-private.h ../config.h debug-private.h testppd.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h testppd.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h testppd.o: language-private.h ../cups/transcode.h thread-private.h -testpwg.o: ppd-private.h ../cups/ppd.h cups.h array.h versioning.h file.h -testpwg.o: pwg-private.h ../cups/cups.h ipp.h http.h language.h +testpwg.o: ppd-private.h ../cups/cups.h file.h versioning.h ipp.h http.h +testpwg.o: array.h language.h ../cups/ppd.h cups.h pwg-private.h testsnmp.o: cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -testsnmp.o: language.h array.h string-private.h ../config.h debug-private.h +testsnmp.o: array.h language.h string-private.h ../config.h debug-private.h testsnmp.o: ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h testsnmp.o: ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h testsnmp.o: language-private.h ../cups/transcode.h thread-private.h @@ -242,131 +246,131 @@ testsnmp.o: snmp-private.h # DO NOT DELETE adminutil.32.o: adminutil.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -adminutil.32.o: adminutil.c language.h array.h string-private.h ../config.h debug-private.h +adminutil.32.o: adminutil.c array.h language.h string-private.h ../config.h debug-private.h adminutil.32.o: adminutil.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h adminutil.32.o: adminutil.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h adminutil.32.o: adminutil.c language-private.h ../cups/transcode.h thread-private.h adminutil.32.o: adminutil.c adminutil.h array.32.o: array.c string-private.h ../config.h debug-private.h array.h versioning.h attr.32.o: attr.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -attr.32.o: attr.c language.h array.h string-private.h ../config.h debug-private.h +attr.32.o: attr.c array.h language.h string-private.h ../config.h debug-private.h attr.32.o: attr.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h attr.32.o: attr.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h attr.32.o: attr.c language-private.h ../cups/transcode.h thread-private.h auth.32.o: auth.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -auth.32.o: auth.c language.h array.h string-private.h ../config.h debug-private.h +auth.32.o: auth.c array.h language.h string-private.h ../config.h debug-private.h auth.32.o: auth.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h auth.32.o: auth.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h auth.32.o: auth.c language-private.h ../cups/transcode.h thread-private.h backchannel.32.o: backchannel.c cups.h backend.32.o: backend.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -backend.32.o: backend.c language.h array.h string-private.h ../config.h debug-private.h +backend.32.o: backend.c array.h language.h string-private.h ../config.h debug-private.h backend.32.o: backend.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h backend.32.o: backend.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h backend.32.o: backend.c language-private.h ../cups/transcode.h thread-private.h backend.h conflicts.32.o: conflicts.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -conflicts.32.o: conflicts.c language.h array.h string-private.h ../config.h debug-private.h +conflicts.32.o: conflicts.c array.h language.h string-private.h ../config.h debug-private.h conflicts.32.o: conflicts.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h conflicts.32.o: conflicts.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h conflicts.32.o: conflicts.c language-private.h ../cups/transcode.h thread-private.h custom.32.o: custom.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -custom.32.o: custom.c language.h array.h string-private.h ../config.h debug-private.h +custom.32.o: custom.c array.h language.h string-private.h ../config.h debug-private.h custom.32.o: custom.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h custom.32.o: custom.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h custom.32.o: custom.c language-private.h ../cups/transcode.h thread-private.h debug.32.o: debug.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -debug.32.o: debug.c language.h array.h string-private.h ../config.h debug-private.h +debug.32.o: debug.c array.h language.h string-private.h ../config.h debug-private.h debug.32.o: debug.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h debug.32.o: debug.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h debug.32.o: debug.c language-private.h ../cups/transcode.h thread-private.h dest.32.o: dest.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -dest.32.o: dest.c language.h array.h string-private.h ../config.h debug-private.h +dest.32.o: dest.c array.h language.h string-private.h ../config.h debug-private.h dest.32.o: dest.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h dest.32.o: dest.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h dest.32.o: dest.c language-private.h ../cups/transcode.h thread-private.h dir.32.o: dir.c string-private.h ../config.h debug-private.h dir.h versioning.h emit.32.o: emit.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -emit.32.o: emit.c language.h array.h string-private.h ../config.h debug-private.h +emit.32.o: emit.c array.h language.h string-private.h ../config.h debug-private.h emit.32.o: emit.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h emit.32.o: emit.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h emit.32.o: emit.c language-private.h ../cups/transcode.h thread-private.h encode.32.o: encode.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -encode.32.o: encode.c language.h array.h string-private.h ../config.h debug-private.h +encode.32.o: encode.c array.h language.h string-private.h ../config.h debug-private.h encode.32.o: encode.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h encode.32.o: encode.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h encode.32.o: encode.c language-private.h ../cups/transcode.h thread-private.h file.32.o: file.c file-private.h cups-private.h ../cups/cups.h file.h versioning.h -file.32.o: file.c ipp.h http.h language.h array.h string-private.h ../config.h +file.32.o: file.c ipp.h http.h array.h language.h string-private.h ../config.h file.32.o: file.c debug-private.h ppd-private.h ../cups/ppd.h cups.h pwg-private.h file.32.o: file.c http-private.h ../cups/http.h md5-private.h ipp-private.h file.32.o: file.c ../cups/ipp.h language-private.h ../cups/transcode.h thread-private.h getdevices.32.o: getdevices.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -getdevices.32.o: getdevices.c language.h array.h string-private.h ../config.h debug-private.h +getdevices.32.o: getdevices.c array.h language.h string-private.h ../config.h debug-private.h getdevices.32.o: getdevices.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h getdevices.32.o: getdevices.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h getdevices.32.o: getdevices.c language-private.h ../cups/transcode.h thread-private.h getifaddrs.32.o: getifaddrs.c http-private.h ../config.h ../cups/http.h md5-private.h getifaddrs.32.o: getifaddrs.c ipp-private.h ../cups/ipp.h getputfile.32.o: getputfile.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -getputfile.32.o: getputfile.c language.h array.h string-private.h ../config.h debug-private.h +getputfile.32.o: getputfile.c array.h language.h string-private.h ../config.h debug-private.h getputfile.32.o: getputfile.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h getputfile.32.o: getputfile.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h getputfile.32.o: getputfile.c language-private.h ../cups/transcode.h thread-private.h globals.32.o: globals.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -globals.32.o: globals.c language.h array.h string-private.h ../config.h debug-private.h +globals.32.o: globals.c array.h language.h string-private.h ../config.h debug-private.h globals.32.o: globals.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h globals.32.o: globals.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h globals.32.o: globals.c language-private.h ../cups/transcode.h thread-private.h http.32.o: http.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -http.32.o: http.c language.h array.h string-private.h ../config.h debug-private.h +http.32.o: http.c array.h language.h string-private.h ../config.h debug-private.h http.32.o: http.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h http.32.o: http.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h http.32.o: http.c language-private.h ../cups/transcode.h thread-private.h http-addr.32.o: http-addr.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -http-addr.32.o: http-addr.c language.h array.h string-private.h ../config.h debug-private.h +http-addr.32.o: http-addr.c array.h language.h string-private.h ../config.h debug-private.h http-addr.32.o: http-addr.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h http-addr.32.o: http-addr.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h http-addr.32.o: http-addr.c language-private.h ../cups/transcode.h thread-private.h http-addrlist.32.o: http-addrlist.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h -http-addrlist.32.o: http-addrlist.c http.h language.h array.h string-private.h ../config.h +http-addrlist.32.o: http-addrlist.c http.h array.h language.h string-private.h ../config.h http-addrlist.32.o: http-addrlist.c debug-private.h ppd-private.h ../cups/ppd.h cups.h http-addrlist.32.o: http-addrlist.c pwg-private.h http-private.h ../cups/http.h md5-private.h http-addrlist.32.o: http-addrlist.c ipp-private.h ../cups/ipp.h language-private.h http-addrlist.32.o: http-addrlist.c ../cups/transcode.h thread-private.h http-support.32.o: http-support.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h -http-support.32.o: http-support.c http.h language.h array.h string-private.h ../config.h +http-support.32.o: http-support.c http.h array.h language.h string-private.h ../config.h http-support.32.o: http-support.c debug-private.h ppd-private.h ../cups/ppd.h cups.h http-support.32.o: http-support.c pwg-private.h http-private.h ../cups/http.h md5-private.h http-support.32.o: http-support.c ipp-private.h ../cups/ipp.h language-private.h http-support.32.o: http-support.c ../cups/transcode.h thread-private.h -ipp.32.o: ipp.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -ipp.32.o: ipp.c language.h array.h string-private.h ../config.h debug-private.h -ipp.32.o: ipp.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h -ipp.32.o: ipp.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h -ipp.32.o: ipp.c language-private.h ../cups/transcode.h thread-private.h +ipp.32.o: ipp.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h array.h +ipp.32.o: ipp.c language.h string-private.h ../config.h debug-private.h ppd-private.h +ipp.32.o: ipp.c ../cups/ppd.h cups.h pwg-private.h http-private.h ../cups/http.h +ipp.32.o: ipp.c md5-private.h ipp-private.h ../cups/ipp.h language-private.h +ipp.32.o: ipp.c ../cups/transcode.h thread-private.h ipp-support.32.o: ipp-support.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -ipp-support.32.o: ipp-support.c language.h array.h string-private.h ../config.h +ipp-support.32.o: ipp-support.c array.h language.h string-private.h ../config.h ipp-support.32.o: ipp-support.c debug-private.h ppd-private.h ../cups/ppd.h cups.h ipp-support.32.o: ipp-support.c pwg-private.h http-private.h ../cups/http.h md5-private.h ipp-support.32.o: ipp-support.c ipp-private.h ../cups/ipp.h language-private.h ipp-support.32.o: ipp-support.c ../cups/transcode.h thread-private.h langprintf.32.o: langprintf.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -langprintf.32.o: langprintf.c language.h array.h string-private.h ../config.h debug-private.h +langprintf.32.o: langprintf.c array.h language.h string-private.h ../config.h debug-private.h langprintf.32.o: langprintf.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h langprintf.32.o: langprintf.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h langprintf.32.o: langprintf.c language-private.h ../cups/transcode.h thread-private.h language.32.o: language.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -language.32.o: language.c language.h array.h string-private.h ../config.h debug-private.h +language.32.o: language.c array.h language.h string-private.h ../config.h debug-private.h language.32.o: language.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h language.32.o: language.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h language.32.o: language.c language-private.h ../cups/transcode.h thread-private.h localize.32.o: localize.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -localize.32.o: localize.c language.h array.h string-private.h ../config.h debug-private.h +localize.32.o: localize.c array.h language.h string-private.h ../config.h debug-private.h localize.32.o: localize.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h localize.32.o: localize.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h localize.32.o: localize.c language-private.h ../cups/transcode.h thread-private.h mark.32.o: mark.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -mark.32.o: mark.c language.h array.h string-private.h ../config.h debug-private.h +mark.32.o: mark.c array.h language.h string-private.h ../config.h debug-private.h mark.32.o: mark.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h mark.32.o: mark.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h mark.32.o: mark.c language-private.h ../cups/transcode.h thread-private.h @@ -374,42 +378,46 @@ md5.32.o: md5.c md5-private.h string-private.h ../config.h md5passwd.32.o: md5passwd.c http-private.h ../config.h ../cups/http.h md5-private.h md5passwd.32.o: md5passwd.c ipp-private.h ../cups/ipp.h string-private.h notify.32.o: notify.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -notify.32.o: notify.c language.h array.h string-private.h ../config.h debug-private.h +notify.32.o: notify.c array.h language.h string-private.h ../config.h debug-private.h notify.32.o: notify.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h notify.32.o: notify.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h notify.32.o: notify.c language-private.h ../cups/transcode.h thread-private.h -options.32.o: options.c cups.h string-private.h ../config.h debug-private.h +options.32.o: options.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h +options.32.o: options.c array.h language.h string-private.h ../config.h debug-private.h +options.32.o: options.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h +options.32.o: options.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h +options.32.o: options.c language-private.h ../cups/transcode.h thread-private.h page.32.o: page.c string-private.h ../config.h debug-private.h ppd.h cups.h array.h page.32.o: page.c versioning.h file.h -ppd.32.o: ppd.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -ppd.32.o: ppd.c language.h array.h string-private.h ../config.h debug-private.h -ppd.32.o: ppd.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h -ppd.32.o: ppd.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h -ppd.32.o: ppd.c language-private.h ../cups/transcode.h thread-private.h +ppd.32.o: ppd.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h array.h +ppd.32.o: ppd.c language.h string-private.h ../config.h debug-private.h ppd-private.h +ppd.32.o: ppd.c ../cups/ppd.h cups.h pwg-private.h http-private.h ../cups/http.h +ppd.32.o: ppd.c md5-private.h ipp-private.h ../cups/ipp.h language-private.h +ppd.32.o: ppd.c ../cups/transcode.h thread-private.h pwg-file.32.o: pwg-file.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -pwg-file.32.o: pwg-file.c language.h array.h string-private.h ../config.h debug-private.h +pwg-file.32.o: pwg-file.c array.h language.h string-private.h ../config.h debug-private.h pwg-file.32.o: pwg-file.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h pwg-file.32.o: pwg-file.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h pwg-file.32.o: pwg-file.c language-private.h ../cups/transcode.h thread-private.h pwg-media.32.o: pwg-media.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -pwg-media.32.o: pwg-media.c language.h array.h string-private.h ../config.h debug-private.h +pwg-media.32.o: pwg-media.c array.h language.h string-private.h ../config.h debug-private.h pwg-media.32.o: pwg-media.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h pwg-media.32.o: pwg-media.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h pwg-media.32.o: pwg-media.c language-private.h ../cups/transcode.h thread-private.h pwg-ppd.32.o: pwg-ppd.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -pwg-ppd.32.o: pwg-ppd.c language.h array.h string-private.h ../config.h debug-private.h +pwg-ppd.32.o: pwg-ppd.c array.h language.h string-private.h ../config.h debug-private.h pwg-ppd.32.o: pwg-ppd.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h pwg-ppd.32.o: pwg-ppd.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h pwg-ppd.32.o: pwg-ppd.c language-private.h ../cups/transcode.h thread-private.h request.32.o: request.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -request.32.o: request.c language.h array.h string-private.h ../config.h debug-private.h +request.32.o: request.c array.h language.h string-private.h ../config.h debug-private.h request.32.o: request.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h request.32.o: request.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h request.32.o: request.c language-private.h ../cups/transcode.h thread-private.h sidechannel.32.o: sidechannel.c sidechannel.h versioning.h string-private.h ../config.h sidechannel.32.o: sidechannel.c debug-private.h snmp.32.o: snmp.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -snmp.32.o: snmp.c language.h array.h string-private.h ../config.h debug-private.h +snmp.32.o: snmp.c array.h language.h string-private.h ../config.h debug-private.h snmp.32.o: snmp.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h snmp.32.o: snmp.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h snmp.32.o: snmp.c language-private.h ../cups/transcode.h thread-private.h @@ -418,27 +426,27 @@ snprintf.32.o: snprintf.c string-private.h ../config.h string.32.o: string.c string-private.h ../config.h debug-private.h thread-private.h string.32.o: string.c array.h versioning.h tempfile.32.o: tempfile.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -tempfile.32.o: tempfile.c language.h array.h string-private.h ../config.h debug-private.h +tempfile.32.o: tempfile.c array.h language.h string-private.h ../config.h debug-private.h tempfile.32.o: tempfile.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h tempfile.32.o: tempfile.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h tempfile.32.o: tempfile.c language-private.h ../cups/transcode.h thread-private.h thread.32.o: thread.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -thread.32.o: thread.c language.h array.h string-private.h ../config.h debug-private.h +thread.32.o: thread.c array.h language.h string-private.h ../config.h debug-private.h thread.32.o: thread.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h thread.32.o: thread.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h thread.32.o: thread.c language-private.h ../cups/transcode.h thread-private.h transcode.32.o: transcode.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -transcode.32.o: transcode.c language.h array.h string-private.h ../config.h debug-private.h +transcode.32.o: transcode.c array.h language.h string-private.h ../config.h debug-private.h transcode.32.o: transcode.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h transcode.32.o: transcode.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h transcode.32.o: transcode.c language-private.h ../cups/transcode.h thread-private.h usersys.32.o: usersys.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -usersys.32.o: usersys.c language.h array.h string-private.h ../config.h debug-private.h +usersys.32.o: usersys.c array.h language.h string-private.h ../config.h debug-private.h usersys.32.o: usersys.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h usersys.32.o: usersys.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h usersys.32.o: usersys.c language-private.h ../cups/transcode.h thread-private.h util.32.o: util.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -util.32.o: util.c language.h array.h string-private.h ../config.h debug-private.h +util.32.o: util.c array.h language.h string-private.h ../config.h debug-private.h util.32.o: util.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h util.32.o: util.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h util.32.o: util.c language-private.h ../cups/transcode.h thread-private.h @@ -457,25 +465,25 @@ testi18n.32.o: testi18n.c ../cups/transcode.h language.h array.h versioning.h testipp.32.o: testipp.c file.h versioning.h string-private.h ../config.h ipp-private.h testipp.32.o: testipp.c ../cups/ipp.h testoptions.32.o: testoptions.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -testoptions.32.o: testoptions.c language.h array.h string-private.h ../config.h +testoptions.32.o: testoptions.c array.h language.h string-private.h ../config.h testoptions.32.o: testoptions.c debug-private.h ppd-private.h ../cups/ppd.h cups.h testoptions.32.o: testoptions.c pwg-private.h http-private.h ../cups/http.h md5-private.h testoptions.32.o: testoptions.c ipp-private.h ../cups/ipp.h language-private.h testoptions.32.o: testoptions.c ../cups/transcode.h thread-private.h testlang.32.o: testlang.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -testlang.32.o: testlang.c language.h array.h string-private.h ../config.h debug-private.h +testlang.32.o: testlang.c array.h language.h string-private.h ../config.h debug-private.h testlang.32.o: testlang.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h testlang.32.o: testlang.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h testlang.32.o: testlang.c language-private.h ../cups/transcode.h thread-private.h testppd.32.o: testppd.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -testppd.32.o: testppd.c language.h array.h string-private.h ../config.h debug-private.h +testppd.32.o: testppd.c array.h language.h string-private.h ../config.h debug-private.h testppd.32.o: testppd.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h testppd.32.o: testppd.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h testppd.32.o: testppd.c language-private.h ../cups/transcode.h thread-private.h -testpwg.32.o: testpwg.c ppd-private.h ../cups/ppd.h cups.h array.h versioning.h file.h -testpwg.32.o: testpwg.c pwg-private.h ../cups/cups.h ipp.h http.h language.h +testpwg.32.o: testpwg.c ppd-private.h ../cups/cups.h file.h versioning.h ipp.h http.h +testpwg.32.o: testpwg.c array.h language.h ../cups/ppd.h cups.h pwg-private.h testsnmp.32.o: testsnmp.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -testsnmp.32.o: testsnmp.c language.h array.h string-private.h ../config.h debug-private.h +testsnmp.32.o: testsnmp.c array.h language.h string-private.h ../config.h debug-private.h testsnmp.32.o: testsnmp.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h testsnmp.32.o: testsnmp.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h testsnmp.32.o: testsnmp.c language-private.h ../cups/transcode.h thread-private.h @@ -483,131 +491,131 @@ testsnmp.32.o: testsnmp.c snmp-private.h # DO NOT DELETE adminutil.64.o: adminutil.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -adminutil.64.o: adminutil.c language.h array.h string-private.h ../config.h debug-private.h +adminutil.64.o: adminutil.c array.h language.h string-private.h ../config.h debug-private.h adminutil.64.o: adminutil.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h adminutil.64.o: adminutil.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h adminutil.64.o: adminutil.c language-private.h ../cups/transcode.h thread-private.h adminutil.64.o: adminutil.c adminutil.h array.64.o: array.c string-private.h ../config.h debug-private.h array.h versioning.h attr.64.o: attr.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -attr.64.o: attr.c language.h array.h string-private.h ../config.h debug-private.h +attr.64.o: attr.c array.h language.h string-private.h ../config.h debug-private.h attr.64.o: attr.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h attr.64.o: attr.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h attr.64.o: attr.c language-private.h ../cups/transcode.h thread-private.h auth.64.o: auth.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -auth.64.o: auth.c language.h array.h string-private.h ../config.h debug-private.h +auth.64.o: auth.c array.h language.h string-private.h ../config.h debug-private.h auth.64.o: auth.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h auth.64.o: auth.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h auth.64.o: auth.c language-private.h ../cups/transcode.h thread-private.h backchannel.64.o: backchannel.c cups.h backend.64.o: backend.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -backend.64.o: backend.c language.h array.h string-private.h ../config.h debug-private.h +backend.64.o: backend.c array.h language.h string-private.h ../config.h debug-private.h backend.64.o: backend.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h backend.64.o: backend.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h backend.64.o: backend.c language-private.h ../cups/transcode.h thread-private.h backend.h conflicts.64.o: conflicts.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -conflicts.64.o: conflicts.c language.h array.h string-private.h ../config.h debug-private.h +conflicts.64.o: conflicts.c array.h language.h string-private.h ../config.h debug-private.h conflicts.64.o: conflicts.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h conflicts.64.o: conflicts.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h conflicts.64.o: conflicts.c language-private.h ../cups/transcode.h thread-private.h custom.64.o: custom.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -custom.64.o: custom.c language.h array.h string-private.h ../config.h debug-private.h +custom.64.o: custom.c array.h language.h string-private.h ../config.h debug-private.h custom.64.o: custom.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h custom.64.o: custom.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h custom.64.o: custom.c language-private.h ../cups/transcode.h thread-private.h debug.64.o: debug.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -debug.64.o: debug.c language.h array.h string-private.h ../config.h debug-private.h +debug.64.o: debug.c array.h language.h string-private.h ../config.h debug-private.h debug.64.o: debug.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h debug.64.o: debug.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h debug.64.o: debug.c language-private.h ../cups/transcode.h thread-private.h dest.64.o: dest.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -dest.64.o: dest.c language.h array.h string-private.h ../config.h debug-private.h +dest.64.o: dest.c array.h language.h string-private.h ../config.h debug-private.h dest.64.o: dest.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h dest.64.o: dest.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h dest.64.o: dest.c language-private.h ../cups/transcode.h thread-private.h dir.64.o: dir.c string-private.h ../config.h debug-private.h dir.h versioning.h emit.64.o: emit.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -emit.64.o: emit.c language.h array.h string-private.h ../config.h debug-private.h +emit.64.o: emit.c array.h language.h string-private.h ../config.h debug-private.h emit.64.o: emit.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h emit.64.o: emit.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h emit.64.o: emit.c language-private.h ../cups/transcode.h thread-private.h encode.64.o: encode.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -encode.64.o: encode.c language.h array.h string-private.h ../config.h debug-private.h +encode.64.o: encode.c array.h language.h string-private.h ../config.h debug-private.h encode.64.o: encode.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h encode.64.o: encode.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h encode.64.o: encode.c language-private.h ../cups/transcode.h thread-private.h file.64.o: file.c file-private.h cups-private.h ../cups/cups.h file.h versioning.h -file.64.o: file.c ipp.h http.h language.h array.h string-private.h ../config.h +file.64.o: file.c ipp.h http.h array.h language.h string-private.h ../config.h file.64.o: file.c debug-private.h ppd-private.h ../cups/ppd.h cups.h pwg-private.h file.64.o: file.c http-private.h ../cups/http.h md5-private.h ipp-private.h file.64.o: file.c ../cups/ipp.h language-private.h ../cups/transcode.h thread-private.h getdevices.64.o: getdevices.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -getdevices.64.o: getdevices.c language.h array.h string-private.h ../config.h debug-private.h +getdevices.64.o: getdevices.c array.h language.h string-private.h ../config.h debug-private.h getdevices.64.o: getdevices.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h getdevices.64.o: getdevices.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h getdevices.64.o: getdevices.c language-private.h ../cups/transcode.h thread-private.h getifaddrs.64.o: getifaddrs.c http-private.h ../config.h ../cups/http.h md5-private.h getifaddrs.64.o: getifaddrs.c ipp-private.h ../cups/ipp.h getputfile.64.o: getputfile.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -getputfile.64.o: getputfile.c language.h array.h string-private.h ../config.h debug-private.h +getputfile.64.o: getputfile.c array.h language.h string-private.h ../config.h debug-private.h getputfile.64.o: getputfile.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h getputfile.64.o: getputfile.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h getputfile.64.o: getputfile.c language-private.h ../cups/transcode.h thread-private.h globals.64.o: globals.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -globals.64.o: globals.c language.h array.h string-private.h ../config.h debug-private.h +globals.64.o: globals.c array.h language.h string-private.h ../config.h debug-private.h globals.64.o: globals.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h globals.64.o: globals.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h globals.64.o: globals.c language-private.h ../cups/transcode.h thread-private.h http.64.o: http.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -http.64.o: http.c language.h array.h string-private.h ../config.h debug-private.h +http.64.o: http.c array.h language.h string-private.h ../config.h debug-private.h http.64.o: http.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h http.64.o: http.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h http.64.o: http.c language-private.h ../cups/transcode.h thread-private.h http-addr.64.o: http-addr.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -http-addr.64.o: http-addr.c language.h array.h string-private.h ../config.h debug-private.h +http-addr.64.o: http-addr.c array.h language.h string-private.h ../config.h debug-private.h http-addr.64.o: http-addr.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h http-addr.64.o: http-addr.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h http-addr.64.o: http-addr.c language-private.h ../cups/transcode.h thread-private.h http-addrlist.64.o: http-addrlist.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h -http-addrlist.64.o: http-addrlist.c http.h language.h array.h string-private.h ../config.h +http-addrlist.64.o: http-addrlist.c http.h array.h language.h string-private.h ../config.h http-addrlist.64.o: http-addrlist.c debug-private.h ppd-private.h ../cups/ppd.h cups.h http-addrlist.64.o: http-addrlist.c pwg-private.h http-private.h ../cups/http.h md5-private.h http-addrlist.64.o: http-addrlist.c ipp-private.h ../cups/ipp.h language-private.h http-addrlist.64.o: http-addrlist.c ../cups/transcode.h thread-private.h http-support.64.o: http-support.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h -http-support.64.o: http-support.c http.h language.h array.h string-private.h ../config.h +http-support.64.o: http-support.c http.h array.h language.h string-private.h ../config.h http-support.64.o: http-support.c debug-private.h ppd-private.h ../cups/ppd.h cups.h http-support.64.o: http-support.c pwg-private.h http-private.h ../cups/http.h md5-private.h http-support.64.o: http-support.c ipp-private.h ../cups/ipp.h language-private.h http-support.64.o: http-support.c ../cups/transcode.h thread-private.h -ipp.64.o: ipp.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -ipp.64.o: ipp.c language.h array.h string-private.h ../config.h debug-private.h -ipp.64.o: ipp.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h -ipp.64.o: ipp.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h -ipp.64.o: ipp.c language-private.h ../cups/transcode.h thread-private.h +ipp.64.o: ipp.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h array.h +ipp.64.o: ipp.c language.h string-private.h ../config.h debug-private.h ppd-private.h +ipp.64.o: ipp.c ../cups/ppd.h cups.h pwg-private.h http-private.h ../cups/http.h +ipp.64.o: ipp.c md5-private.h ipp-private.h ../cups/ipp.h language-private.h +ipp.64.o: ipp.c ../cups/transcode.h thread-private.h ipp-support.64.o: ipp-support.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -ipp-support.64.o: ipp-support.c language.h array.h string-private.h ../config.h +ipp-support.64.o: ipp-support.c array.h language.h string-private.h ../config.h ipp-support.64.o: ipp-support.c debug-private.h ppd-private.h ../cups/ppd.h cups.h ipp-support.64.o: ipp-support.c pwg-private.h http-private.h ../cups/http.h md5-private.h ipp-support.64.o: ipp-support.c ipp-private.h ../cups/ipp.h language-private.h ipp-support.64.o: ipp-support.c ../cups/transcode.h thread-private.h langprintf.64.o: langprintf.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -langprintf.64.o: langprintf.c language.h array.h string-private.h ../config.h debug-private.h +langprintf.64.o: langprintf.c array.h language.h string-private.h ../config.h debug-private.h langprintf.64.o: langprintf.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h langprintf.64.o: langprintf.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h langprintf.64.o: langprintf.c language-private.h ../cups/transcode.h thread-private.h language.64.o: language.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -language.64.o: language.c language.h array.h string-private.h ../config.h debug-private.h +language.64.o: language.c array.h language.h string-private.h ../config.h debug-private.h language.64.o: language.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h language.64.o: language.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h language.64.o: language.c language-private.h ../cups/transcode.h thread-private.h localize.64.o: localize.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -localize.64.o: localize.c language.h array.h string-private.h ../config.h debug-private.h +localize.64.o: localize.c array.h language.h string-private.h ../config.h debug-private.h localize.64.o: localize.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h localize.64.o: localize.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h localize.64.o: localize.c language-private.h ../cups/transcode.h thread-private.h mark.64.o: mark.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -mark.64.o: mark.c language.h array.h string-private.h ../config.h debug-private.h +mark.64.o: mark.c array.h language.h string-private.h ../config.h debug-private.h mark.64.o: mark.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h mark.64.o: mark.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h mark.64.o: mark.c language-private.h ../cups/transcode.h thread-private.h @@ -615,42 +623,46 @@ md5.64.o: md5.c md5-private.h string-private.h ../config.h md5passwd.64.o: md5passwd.c http-private.h ../config.h ../cups/http.h md5-private.h md5passwd.64.o: md5passwd.c ipp-private.h ../cups/ipp.h string-private.h notify.64.o: notify.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -notify.64.o: notify.c language.h array.h string-private.h ../config.h debug-private.h +notify.64.o: notify.c array.h language.h string-private.h ../config.h debug-private.h notify.64.o: notify.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h notify.64.o: notify.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h notify.64.o: notify.c language-private.h ../cups/transcode.h thread-private.h -options.64.o: options.c cups.h string-private.h ../config.h debug-private.h +options.64.o: options.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h +options.64.o: options.c array.h language.h string-private.h ../config.h debug-private.h +options.64.o: options.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h +options.64.o: options.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h +options.64.o: options.c language-private.h ../cups/transcode.h thread-private.h page.64.o: page.c string-private.h ../config.h debug-private.h ppd.h cups.h array.h page.64.o: page.c versioning.h file.h -ppd.64.o: ppd.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -ppd.64.o: ppd.c language.h array.h string-private.h ../config.h debug-private.h -ppd.64.o: ppd.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h -ppd.64.o: ppd.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h -ppd.64.o: ppd.c language-private.h ../cups/transcode.h thread-private.h +ppd.64.o: ppd.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h array.h +ppd.64.o: ppd.c language.h string-private.h ../config.h debug-private.h ppd-private.h +ppd.64.o: ppd.c ../cups/ppd.h cups.h pwg-private.h http-private.h ../cups/http.h +ppd.64.o: ppd.c md5-private.h ipp-private.h ../cups/ipp.h language-private.h +ppd.64.o: ppd.c ../cups/transcode.h thread-private.h pwg-file.64.o: pwg-file.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -pwg-file.64.o: pwg-file.c language.h array.h string-private.h ../config.h debug-private.h +pwg-file.64.o: pwg-file.c array.h language.h string-private.h ../config.h debug-private.h pwg-file.64.o: pwg-file.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h pwg-file.64.o: pwg-file.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h pwg-file.64.o: pwg-file.c language-private.h ../cups/transcode.h thread-private.h pwg-media.64.o: pwg-media.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -pwg-media.64.o: pwg-media.c language.h array.h string-private.h ../config.h debug-private.h +pwg-media.64.o: pwg-media.c array.h language.h string-private.h ../config.h debug-private.h pwg-media.64.o: pwg-media.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h pwg-media.64.o: pwg-media.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h pwg-media.64.o: pwg-media.c language-private.h ../cups/transcode.h thread-private.h pwg-ppd.64.o: pwg-ppd.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -pwg-ppd.64.o: pwg-ppd.c language.h array.h string-private.h ../config.h debug-private.h +pwg-ppd.64.o: pwg-ppd.c array.h language.h string-private.h ../config.h debug-private.h pwg-ppd.64.o: pwg-ppd.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h pwg-ppd.64.o: pwg-ppd.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h pwg-ppd.64.o: pwg-ppd.c language-private.h ../cups/transcode.h thread-private.h request.64.o: request.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -request.64.o: request.c language.h array.h string-private.h ../config.h debug-private.h +request.64.o: request.c array.h language.h string-private.h ../config.h debug-private.h request.64.o: request.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h request.64.o: request.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h request.64.o: request.c language-private.h ../cups/transcode.h thread-private.h sidechannel.64.o: sidechannel.c sidechannel.h versioning.h string-private.h ../config.h sidechannel.64.o: sidechannel.c debug-private.h snmp.64.o: snmp.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -snmp.64.o: snmp.c language.h array.h string-private.h ../config.h debug-private.h +snmp.64.o: snmp.c array.h language.h string-private.h ../config.h debug-private.h snmp.64.o: snmp.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h snmp.64.o: snmp.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h snmp.64.o: snmp.c language-private.h ../cups/transcode.h thread-private.h @@ -659,27 +671,27 @@ snprintf.64.o: snprintf.c string-private.h ../config.h string.64.o: string.c string-private.h ../config.h debug-private.h thread-private.h string.64.o: string.c array.h versioning.h tempfile.64.o: tempfile.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -tempfile.64.o: tempfile.c language.h array.h string-private.h ../config.h debug-private.h +tempfile.64.o: tempfile.c array.h language.h string-private.h ../config.h debug-private.h tempfile.64.o: tempfile.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h tempfile.64.o: tempfile.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h tempfile.64.o: tempfile.c language-private.h ../cups/transcode.h thread-private.h thread.64.o: thread.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -thread.64.o: thread.c language.h array.h string-private.h ../config.h debug-private.h +thread.64.o: thread.c array.h language.h string-private.h ../config.h debug-private.h thread.64.o: thread.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h thread.64.o: thread.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h thread.64.o: thread.c language-private.h ../cups/transcode.h thread-private.h transcode.64.o: transcode.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -transcode.64.o: transcode.c language.h array.h string-private.h ../config.h debug-private.h +transcode.64.o: transcode.c array.h language.h string-private.h ../config.h debug-private.h transcode.64.o: transcode.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h transcode.64.o: transcode.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h transcode.64.o: transcode.c language-private.h ../cups/transcode.h thread-private.h usersys.64.o: usersys.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -usersys.64.o: usersys.c language.h array.h string-private.h ../config.h debug-private.h +usersys.64.o: usersys.c array.h language.h string-private.h ../config.h debug-private.h usersys.64.o: usersys.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h usersys.64.o: usersys.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h usersys.64.o: usersys.c language-private.h ../cups/transcode.h thread-private.h util.64.o: util.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -util.64.o: util.c language.h array.h string-private.h ../config.h debug-private.h +util.64.o: util.c array.h language.h string-private.h ../config.h debug-private.h util.64.o: util.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h util.64.o: util.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h util.64.o: util.c language-private.h ../cups/transcode.h thread-private.h @@ -698,25 +710,25 @@ testi18n.64.o: testi18n.c ../cups/transcode.h language.h array.h versioning.h testipp.64.o: testipp.c file.h versioning.h string-private.h ../config.h ipp-private.h testipp.64.o: testipp.c ../cups/ipp.h testoptions.64.o: testoptions.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -testoptions.64.o: testoptions.c language.h array.h string-private.h ../config.h +testoptions.64.o: testoptions.c array.h language.h string-private.h ../config.h testoptions.64.o: testoptions.c debug-private.h ppd-private.h ../cups/ppd.h cups.h testoptions.64.o: testoptions.c pwg-private.h http-private.h ../cups/http.h md5-private.h testoptions.64.o: testoptions.c ipp-private.h ../cups/ipp.h language-private.h testoptions.64.o: testoptions.c ../cups/transcode.h thread-private.h testlang.64.o: testlang.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -testlang.64.o: testlang.c language.h array.h string-private.h ../config.h debug-private.h +testlang.64.o: testlang.c array.h language.h string-private.h ../config.h debug-private.h testlang.64.o: testlang.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h testlang.64.o: testlang.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h testlang.64.o: testlang.c language-private.h ../cups/transcode.h thread-private.h testppd.64.o: testppd.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -testppd.64.o: testppd.c language.h array.h string-private.h ../config.h debug-private.h +testppd.64.o: testppd.c array.h language.h string-private.h ../config.h debug-private.h testppd.64.o: testppd.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h testppd.64.o: testppd.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h testppd.64.o: testppd.c language-private.h ../cups/transcode.h thread-private.h -testpwg.64.o: testpwg.c ppd-private.h ../cups/ppd.h cups.h array.h versioning.h file.h -testpwg.64.o: testpwg.c pwg-private.h ../cups/cups.h ipp.h http.h language.h +testpwg.64.o: testpwg.c ppd-private.h ../cups/cups.h file.h versioning.h ipp.h http.h +testpwg.64.o: testpwg.c array.h language.h ../cups/ppd.h cups.h pwg-private.h testsnmp.64.o: testsnmp.c cups-private.h ../cups/cups.h file.h versioning.h ipp.h http.h -testsnmp.64.o: testsnmp.c language.h array.h string-private.h ../config.h debug-private.h +testsnmp.64.o: testsnmp.c array.h language.h string-private.h ../config.h debug-private.h testsnmp.64.o: testsnmp.c ppd-private.h ../cups/ppd.h cups.h pwg-private.h http-private.h testsnmp.64.o: testsnmp.c ../cups/http.h md5-private.h ipp-private.h ../cups/ipp.h testsnmp.64.o: testsnmp.c language-private.h ../cups/transcode.h thread-private.h diff --git a/cups/adminutil.c b/cups/adminutil.c index d0121a71e..68efcfd44 100644 --- a/cups/adminutil.c +++ b/cups/adminutil.c @@ -240,7 +240,7 @@ cupsAdminCreateWindowsPPD( } else if (jcloption && !strncmp(line, "*OrderDependency:", 17)) { - for (ptr = line + 17; *ptr && isspace(*ptr & 255); ptr ++); + for (ptr = line + 17; _cups_isspace(*ptr); ptr ++); ptr = strchr(ptr, ' '); @@ -1066,7 +1066,7 @@ cupsAdminGetServerSettings( while (*value) { - for (valptr = value; !isspace(*valptr & 255) && *valptr; valptr ++); + for (valptr = value; *valptr && !_cups_isspace(*valptr); valptr ++); if (*valptr) *valptr++ = '\0'; @@ -1077,7 +1077,7 @@ cupsAdminGetServerSettings( break; } - for (value = valptr; isspace(*value & 255); value ++); + for (value = valptr; _cups_isspace(*value); value ++); } } else if (!strcasecmp(line, "")) @@ -1460,7 +1460,7 @@ cupsAdminSetServerSettings( while (cupsFileGetConf(cupsd, line, sizeof(line), &value, &linenum)) { if ((!strcasecmp(line, "Port") || !strcasecmp(line, "Listen")) && - (remote_admin >= 0 || remote_any > 0 || share_printers >= 0)) + (remote_admin >= 0 || remote_any >= 0 || share_printers >= 0)) { if (!wrote_port_listen) { @@ -1704,83 +1704,86 @@ cupsAdminSetServerSettings( cupsFilePuts(temp, "\n"); } - else if (!strcasecmp(line, "= 0) + if (in_default_policy) { /* - * Don't write anything for this limit section... + * See if the policy limit is for the Cancel-Job operation... */ - - in_cancel_job = 2; - } - else - { - cupsFilePrintf(temp, " %s", line); - - while (*value) + + char *valptr; /* Pointer into value */ + + + if (!strcasecmp(value, "cancel-job") && user_cancel_any >= 0) { - for (valptr = value; !isspace(*valptr & 255) && *valptr; valptr ++); - - if (*valptr) - *valptr++ = '\0'; - - if (!strcasecmp(value, "cancel-job") && user_cancel_any >= 0) + /* + * Don't write anything for this limit section... + */ + + in_cancel_job = 2; + } + else + { + cupsFilePrintf(temp, "%*s%s", indent, "", line); + + while (*value) { - /* - * Write everything except for this definition... - */ - - in_cancel_job = 1; + for (valptr = value; *valptr && !_cups_isspace(*valptr); valptr ++); + + if (*valptr) + *valptr++ = '\0'; + + if (!strcasecmp(value, "cancel-job") && user_cancel_any >= 0) + { + /* + * Write everything except for this definition... + */ + + in_cancel_job = 1; + } + else + cupsFilePrintf(temp, " %s", value); + + for (value = valptr; _cups_isspace(*value); value ++); } - else - cupsFilePrintf(temp, " %s", value); - - for (value = valptr; isspace(*value & 255); value ++); + + cupsFilePuts(temp, ">\n"); } - - cupsFilePuts(temp, ">\n"); } + else + cupsFilePrintf(temp, "%*s%s %s>\n", indent, "", line, value); + + indent += 2; } else if (!strcasecmp(line, "") && in_cancel_job) { indent -= 2; if (in_cancel_job == 1) - cupsFilePuts(temp, " \n"); + cupsFilePuts(temp, " \n"); wrote_policy = 1; if (!user_cancel_any) cupsFilePuts(temp, " # Only the owner or an administrator can cancel " - "a job...\n" - " \n" - " Order deny,allow\n" - " Require user @OWNER " + "a job...\n" + " \n" + " Order deny,allow\n" + " Require user @OWNER " CUPS_DEFAULT_PRINTOPERATOR_AUTH "\n" " \n"); in_cancel_job = 0; } else if ((((in_admin_location || in_conf_location || in_root_location) && - remote_admin >= 0) || + (remote_admin >= 0 || remote_any >= 0)) || (in_root_location && share_printers >= 0)) && (!strcasecmp(line, "Allow") || !strcasecmp(line, "Deny") || !strcasecmp(line, "Order"))) continue; else if (in_cancel_job == 2) continue; - else if (!strcasecmp(line, "\n", line, value); else if (line[0] == '<') { if (value) diff --git a/cups/api-filter.header b/cups/api-filter.header index fb65106f2..60d5918aa 100644 --- a/cups/api-filter.header +++ b/cups/api-filter.header @@ -36,7 +36,7 @@ Programming: Raster API
Programming: Developing PostScript Printer Drivers
Programming: Developing Raster Printer Drivers
- Specifications: CUPS Design Description + Specifications: CUPS Design Description diff --git a/cups/attr.c b/cups/attr.c index d8dff2094..4e6fab68d 100644 --- a/cups/attr.c +++ b/cups/attr.c @@ -166,7 +166,7 @@ _ppdNormalizeMakeAndModel( * Skip leading whitespace... */ - while (isspace(*make_and_model & 255)) + while (_cups_isspace(*make_and_model)) make_and_model ++; /* @@ -321,7 +321,7 @@ _ppdNormalizeMakeAndModel( */ for (bufptr = buffer + strlen(buffer) - 1; - bufptr >= buffer && isspace(*bufptr & 255); + bufptr >= buffer && _cups_isspace(*bufptr); bufptr --); bufptr[1] = '\0'; diff --git a/cups/auth.c b/cups/auth.c index b496ddeff..4d7facf4e 100644 --- a/cups/auth.c +++ b/cups/auth.c @@ -166,12 +166,6 @@ cupsDoAuthentication( return (-1); } - if (!password[0]) - { - http->status = HTTP_AUTHORIZATION_CANCELED; - return (-1); - } - snprintf(http->userpass, sizeof(http->userpass), "%s:%s", cupsUser(), password); } @@ -247,7 +241,7 @@ cupsDoAuthentication( authorization = httpGetField(http, HTTP_FIELD_WWW_AUTHENTICATE); authorization += 9; - while (*authorization && isspace(*authorization & 255)) + while (*authorization && _cups_isspace(*authorization)) authorization ++; if (*authorization) diff --git a/cups/conflicts.c b/cups/conflicts.c index 7e7a72268..95c7b28ac 100644 --- a/cups/conflicts.c +++ b/cups/conflicts.c @@ -289,25 +289,25 @@ cupsResolveConflicts( for (resval = resolver->value; *resval && !changed;) { - while (isspace(*resval & 255)) + while (_cups_isspace(*resval)) resval ++; if (*resval != '*') break; for (resval ++, resptr = resoption; - *resval && !isspace(*resval & 255); + *resval && !_cups_isspace(*resval); resval ++) if (resptr < (resoption + sizeof(resoption) - 1)) *resptr++ = *resval; *resptr = '\0'; - while (isspace(*resval & 255)) + while (_cups_isspace(*resval)) resval ++; for (resptr = reschoice; - *resval && !isspace(*resval & 255); + *resval && !_cups_isspace(*resval); resval ++) if (resptr < (reschoice + sizeof(reschoice) - 1)) *resptr++ = *resval; @@ -886,20 +886,20 @@ ppd_load_constraints(ppd_file_t *ppd) /* I - PPD file */ * Extract "*Option Choice" or just "*Option"... */ - for (vptr ++, ptr = option; *vptr && !isspace(*vptr & 255); vptr ++) + for (vptr ++, ptr = option; *vptr && !_cups_isspace(*vptr); vptr ++) if (ptr < (option + sizeof(option) - 1)) *ptr++ = *vptr; *ptr = '\0'; - while (isspace(*vptr & 255)) + while (_cups_isspace(*vptr)) vptr ++; if (*vptr == '*') choice[0] = '\0'; else { - for (ptr = choice; *vptr && !isspace(*vptr & 255); vptr ++) + for (ptr = choice; *vptr && !_cups_isspace(*vptr); vptr ++) if (ptr < (choice + sizeof(choice) - 1)) *ptr++ = *vptr; diff --git a/cups/cups-private.h b/cups/cups-private.h index 051d3c4a9..87c396d81 100644 --- a/cups/cups-private.h +++ b/cups/cups-private.h @@ -131,6 +131,17 @@ typedef struct _cups_globals_s /**** CUPS global state data ****/ servername[256];/* Server hostname */ cups_password_cb2_t password_cb; /* Password callback */ void *password_data; /* Password user data */ + http_tls_credentials_t tls_credentials; + /* Default client credentials */ + cups_client_cert_cb_t client_cert_cb; /* Client certificate callback */ + void *client_cert_data; + /* Client certificate user data */ + cups_server_cert_cb_t server_cert_cb; /* Server certificate callback */ + void *server_cert_data; + /* Server certificate user data */ + int any_root, /* Allow any root */ + expired_certs, /* Allow expired certs */ + expired_root; /* Allow expired root */ /* util.c */ char def_printer[256]; diff --git a/cups/cups.h b/cups/cups.h index d21f2bd40..f1ad1fb63 100644 --- a/cups/cups.h +++ b/cups/cups.h @@ -169,6 +169,15 @@ typedef struct cups_job_s /**** Job ****/ time_t processing_time; /* Time the job was processed */ } cups_job_t; +typedef int (*cups_client_cert_cb_t)(http_t *http, void *tls, + cups_array_t *distinguished_names, + void *user_data); + /**** Client credentials callback @since CUPS 1.5@ ****/ + +typedef int (*cups_server_cert_cb_t)(http_t *http, void *tls, + cups_array_t *certs, void *user_data); + /**** Server credentials callback @since CUPS 1.5@ ****/ + /* * Functions... @@ -317,6 +326,14 @@ extern http_status_t cupsStartDocument(http_t *http, const char *name, extern http_status_t cupsWriteRequestData(http_t *http, const char *buffer, size_t length) _CUPS_API_1_4; +/**** New in CUPS 1.5 ****/ +extern void cupsSetClientCertCB(cups_client_cert_cb_t cb, + void *user_data) _CUPS_API_1_5; +extern int cupsSetCredentials(cups_array_t *certs) _CUPS_API_1_5; +extern void cupsSetServerCertCB(cups_server_cert_cb_t cb, + void *user_data) _CUPS_API_1_5; + + # ifdef __cplusplus } # endif /* __cplusplus */ diff --git a/cups/debug-private.h b/cups/debug-private.h index 6d56f9b00..c739fa68a 100644 --- a/cups/debug-private.h +++ b/cups/debug-private.h @@ -54,14 +54,30 @@ extern "C" { * 7 = static functions * 8 = return values for static functions * 9 = progress for static functions + * + * The DEBUG_set macro allows an application to programmatically enable (or + * disable) debug logging. The arguments correspond to the CUPS_DEBUG_LOG, + * CUPS_DEBUG_LEVEL, and CUPS_DEBUG_FILTER environment variables. */ # ifdef DEBUG +# ifdef WIN32 +# ifdef LIBCUPS2_EXPORTS +# define DLLExport __declspec(dllexport) +# else +# define DLLExport +# endif /* LIBCUPS2_EXPORTS */ +# else +# define DLLExport +# endif /* WIN32 */ # define DEBUG_puts(x) _cups_debug_puts(x) # define DEBUG_printf(x) _cups_debug_printf x +# define DEBUG_set(logfile,level,filter) _cups_debug_set(logfile,level,filter,1) # else +# define DLLExport # define DEBUG_puts(x) # define DEBUG_printf(x) +# define DEBUG_set(logfile,level,filter) # endif /* DEBUG */ @@ -71,12 +87,15 @@ extern "C" { extern int _cups_debug_fd; extern int _cups_debug_level; -extern void _cups_debug_printf(const char *format, ...) +extern void DLLExport _cups_debug_printf(const char *format, ...) #ifdef __GNUC__ __attribute__ ((__format__ (__printf__, 1, 2))) #endif /* __GNUC__ */ ; -extern void _cups_debug_puts(const char *s); +extern void DLLExport _cups_debug_puts(const char *s); +extern void DLLExport _cups_debug_set(const char *logfile, + const char *level, const char *filter, + int force); # ifdef __cplusplus } diff --git a/cups/debug.c b/cups/debug.c index c119c6741..29d6b4821 100644 --- a/cups/debug.c +++ b/cups/debug.c @@ -18,6 +18,7 @@ * debug_vsnprintf() - Format a string into a fixed size buffer. * _cups_debug_printf() - Write a formatted line to the log. * _cups_debug_puts() - Write a single line to the log. + * _cups_debug_set() - Enable or disable debug logging. */ /* @@ -27,15 +28,26 @@ #include "cups-private.h" #include "thread-private.h" #ifdef WIN32 +# include +# include # include +# define getpid (int)GetCurrentProcessId +static int /* O - 0 on success, -1 on failure */ +gettimeofday(struct timeval *tv, /* I - Timeval struct */ + void *tz) /* I - Timezone */ +{ + struct _timeb timebuffer; /* Time buffer struct */ + _ftime(&timebuffer); + tv->tv_sec = (long)timebuffer.time; + tv->tv_usec = timebuffer.millitm * 1000; + return 0; +} #else # include # include #endif /* WIN32 */ #include -#ifndef WIN32 -# include -#endif /* WIN32 */ +#include /* @@ -53,10 +65,8 @@ int _cups_debug_level = 1; * Local globals... */ -# ifndef WIN32 static regex_t *debug_filter = NULL; /* Filter expression for messages */ -# endif /* !WIN32 */ static int debug_init = 0; /* Did we initialize debugging? */ static _cups_mutex_t debug_mutex = _CUPS_MUTEX_INITIALIZER; /* Mutex to control initialization */ @@ -396,7 +406,7 @@ debug_vsnprintf(char *buffer, /* O - Output buffer */ * '_cups_debug_printf()' - Write a formatted line to the log. */ -void +void DLLExport _cups_debug_printf(const char *format, /* I - Printf-style format string */ ...) /* I - Additional arguments as needed */ { @@ -405,11 +415,6 @@ _cups_debug_printf(const char *format, /* I - Printf-style format string */ char buffer[2048]; /* Output buffer */ size_t bytes; /* Number of bytes in buffer */ int level; /* Log level in message */ - const char *cups_debug_filter, - /* CUPS_DEBUG_FILTER environment variable */ - *cups_debug_level, - /* CUPS_DEBUG_LEVEL environment variable */ - *cups_debug_log;/* CUPS_DEBUG_LOG environment variable */ /* @@ -417,52 +422,8 @@ _cups_debug_printf(const char *format, /* I - Printf-style format string */ */ if (!debug_init) - { - /* - * Get a lock on the debug initializer, then re-check in case another - * thread already did it... - */ - - _cupsMutexLock(&debug_mutex); - - if (!debug_init) - { - if ((cups_debug_log = getenv("CUPS_DEBUG_LOG")) == NULL) - _cups_debug_fd = -1; - else if (!strcmp(cups_debug_log, "-")) - _cups_debug_fd = 2; - else - { - snprintf(buffer, sizeof(buffer), cups_debug_log, getpid()); - - if (buffer[0] == '+') - _cups_debug_fd = open(buffer + 1, O_WRONLY | O_APPEND | O_CREAT, 0644); - else - _cups_debug_fd = open(buffer, O_WRONLY | O_TRUNC | O_CREAT, 0644); - } - - if ((cups_debug_level = getenv("CUPS_DEBUG_LEVEL")) != NULL) - _cups_debug_level = atoi(cups_debug_level); - - if ((cups_debug_filter = getenv("CUPS_DEBUG_FILTER")) != NULL) - { - if ((debug_filter = (regex_t *)calloc(1, sizeof(regex_t))) == NULL) - fputs("Unable to allocate memory for CUPS_DEBUG_FILTER - results not " - "filtered!\n", stderr); - else if (regcomp(debug_filter, cups_debug_filter, REG_EXTENDED)) - { - fputs("Bad regular expression in CUPS_DEBUG_FILTER - results not " - "filtered!\n", stderr); - free(debug_filter); - debug_filter = NULL; - } - } - - debug_init = 1; - } - - _cupsMutexUnlock(&debug_mutex); - } + _cups_debug_set(getenv("CUPS_DEBUG_LOG"), getenv("CUPS_DEBUG_LEVEL"), + getenv("CUPS_DEBUG_FILTER"), 0); if (_cups_debug_fd < 0) return; @@ -525,11 +486,12 @@ _cups_debug_printf(const char *format, /* I - Printf-style format string */ * '_cups_debug_puts()' - Write a single line to the log. */ -void +void DLLExport _cups_debug_puts(const char *s) /* I - String to output */ { char format[4]; /* C%s */ + format[0] = *s++; format[1] = '%'; format[2] = 's'; @@ -537,6 +499,82 @@ _cups_debug_puts(const char *s) /* I - String to output */ _cups_debug_printf(format, s); } + + +/* + * '_cups_debug_set()' - Enable or disable debug logging. + */ + +void DLLExport +_cups_debug_set(const char *logfile, /* I - Log file or NULL */ + const char *level, /* I - Log level or NULL */ + const char *filter, /* I - Filter string or NULL */ + int force) /* I - Force initialization */ +{ + _cupsMutexLock(&debug_mutex); + + if (!debug_init || force) + { + /* + * Restore debug settings to defaults... + */ + + if (_cups_debug_fd != -1) + { + close(_cups_debug_fd); + _cups_debug_fd = -1; + } + + if (debug_filter) + { + regfree((regex_t *)debug_filter); + debug_filter = NULL; + } + + _cups_debug_level = 1; + + /* + * Open logs, set log levels, etc. + */ + + if (!logfile) + _cups_debug_fd = -1; + else if (!strcmp(logfile, "-")) + _cups_debug_fd = 2; + else + { + char buffer[1024]; /* Filename buffer */ + + snprintf(buffer, sizeof(buffer), logfile, getpid()); + + if (buffer[0] == '+') + _cups_debug_fd = open(buffer + 1, O_WRONLY | O_APPEND | O_CREAT, 0644); + else + _cups_debug_fd = open(buffer, O_WRONLY | O_TRUNC | O_CREAT, 0644); + } + + if (level) + _cups_debug_level = atoi(level); + + if (filter) + { + if ((debug_filter = (regex_t *)calloc(1, sizeof(regex_t))) == NULL) + fputs("Unable to allocate memory for CUPS_DEBUG_FILTER - results not " + "filtered!\n", stderr); + else if (regcomp(debug_filter, filter, REG_EXTENDED)) + { + fputs("Bad regular expression in CUPS_DEBUG_FILTER - results not " + "filtered!\n", stderr); + free(debug_filter); + debug_filter = NULL; + } + } + + debug_init = 1; + } + + _cupsMutexUnlock(&debug_mutex); +} #endif /* DEBUG */ diff --git a/cups/dest.c b/cups/dest.c index 98cba04d3..551dc7341 100644 --- a/cups/dest.c +++ b/cups/dest.c @@ -502,7 +502,19 @@ cupsGetNamedDest(http_t *http, /* I - Connection to server or @code CUPS_HTT set_as_default = 1; name = _cupsUserDefault(defname, sizeof(defname)); - if (!name && home) + if (name) + { + char *ptr; /* Temporary pointer... */ + + if ((ptr = strchr(defname, '/')) != NULL) + { + *ptr++ = '\0'; + instance = ptr; + } + else + instance = NULL; + } + else if (home) { /* * No default in the environment, try the user's lpoptions files... diff --git a/cups/dir.c b/cups/dir.c index 67349595b..94a2a9b5b 100644 --- a/cups/dir.c +++ b/cups/dir.c @@ -200,7 +200,7 @@ cupsDirRead(cups_dir_t *dp) /* I - Directory pointer */ dp->entry.fileinfo.st_atime = _cups_dir_time(entry.ftLastAccessTime); dp->entry.fileinfo.st_ctime = _cups_dir_time(entry.ftCreationTime); dp->entry.fileinfo.st_mtime = _cups_dir_time(entry.ftLastWriteTime); - dp->entry.fileinfo.st_size = entry.nFileSizeLow + (entry.nFileSizeHigh << 32); + dp->entry.fileinfo.st_size = entry.nFileSizeLow + ((unsigned long long)entry.nFileSizeHigh << 32); /* * Return the entry... diff --git a/cups/emit.c b/cups/emit.c index 60da1f9a1..438f4cd45 100644 --- a/cups/emit.c +++ b/cups/emit.c @@ -479,7 +479,8 @@ ppdEmitJCL(ppd_file_t *ppd, /* I - PPD file record */ */ for (title += 7; *title && isdigit(*title & 255); title ++); - for (; *title && isspace(*title & 255); title ++); + while (_cups_isspace(*title)) + title ++; if ((ptr = strstr(title, " - ")) != NULL) { diff --git a/cups/encode.c b/cups/encode.c index dfce906aa..392f57295 100644 --- a/cups/encode.c +++ b/cups/encode.c @@ -120,6 +120,7 @@ static const _ipp_option_t ipp_options[] = { 0, "penwidth", IPP_TAG_INTEGER, IPP_TAG_JOB }, { 0, "penwidth-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER }, { 0, "port-monitor", IPP_TAG_NAME, IPP_TAG_PRINTER }, + { 0, "ppd-name", IPP_TAG_NAME, IPP_TAG_PRINTER }, { 0, "ppi", IPP_TAG_INTEGER, IPP_TAG_JOB }, { 0, "ppi-default", IPP_TAG_INTEGER, IPP_TAG_PRINTER }, { 0, "prettyprint", IPP_TAG_BOOLEAN, IPP_TAG_JOB }, diff --git a/cups/file.c b/cups/file.c index 68fb11892..b788b7239 100644 --- a/cups/file.c +++ b/cups/file.c @@ -494,7 +494,7 @@ cupsFileGetConf(cups_file_t *fp, /* I - CUPS file */ // Strip the comment and any trailing whitespace... while (ptr > buf) { - if (!isspace(ptr[-1] & 255)) + if (!_cups_isspace(ptr[-1])) break; ptr --; @@ -508,7 +508,7 @@ cupsFileGetConf(cups_file_t *fp, /* I - CUPS file */ * Strip leading whitespace... */ - for (ptr = buf; isspace(*ptr & 255); ptr ++); + for (ptr = buf; _cups_isspace(*ptr); ptr ++); if (ptr > buf) _cups_strcpy(buf, ptr); @@ -524,7 +524,7 @@ cupsFileGetConf(cups_file_t *fp, /* I - CUPS file */ */ for (ptr = buf; *ptr; ptr ++) - if (isspace(*ptr & 255)) + if (_cups_isspace(*ptr)) break; if (*ptr) @@ -533,7 +533,7 @@ cupsFileGetConf(cups_file_t *fp, /* I - CUPS file */ * Have a value, skip any other spaces... */ - while (isspace(*ptr & 255)) + while (_cups_isspace(*ptr)) *ptr++ = '\0'; if (*ptr) @@ -557,7 +557,7 @@ cupsFileGetConf(cups_file_t *fp, /* I - CUPS file */ return (buf); } - while (ptr > *value && isspace(*ptr & 255)) + while (ptr > *value && _cups_isspace(*ptr)) *ptr-- = '\0'; } diff --git a/cups/globals.c b/cups/globals.c index 3d678d427..00f74c316 100644 --- a/cups/globals.c +++ b/cups/globals.c @@ -202,8 +202,11 @@ cups_globals_alloc(void) */ memset(cg, 0, sizeof(_cups_globals_t)); - cg->encryption = (http_encryption_t)-1; - cg->password_cb = (cups_password_cb2_t)_cupsGetPassword; + cg->encryption = (http_encryption_t)-1; + cg->password_cb = (cups_password_cb2_t)_cupsGetPassword; + cg->any_root = 1; + cg->expired_certs = 1; + cg->expired_root = 1; /* * Then set directories as appropriate... @@ -316,13 +319,13 @@ cups_globals_free(_cups_globals_t *cg) /* I - Pointer to global data */ httpClose(cg->http); + _httpFreeCredentials(cg->tls_credentials); + cupsFileClose(cg->stdio_files[0]); cupsFileClose(cg->stdio_files[1]); cupsFileClose(cg->stdio_files[2]); -# ifndef CUPS_LITE cupsFreeOptions(cg->cupsd_num_settings, cg->cupsd_settings); -# endif /* !CUPS_LITE */ free(cg); } diff --git a/cups/http-addrlist.c b/cups/http-addrlist.c index ddf8079b4..14406427d 100644 --- a/cups/http-addrlist.c +++ b/cups/http-addrlist.c @@ -102,6 +102,16 @@ httpAddrConnect( setsockopt(*sock, SOL_SOCKET, SO_NOSIGPIPE, &val, sizeof(val)); #endif /* SO_NOSIGPIPE */ +#ifdef __APPLE__ + /* + * Use a 30-second read timeout when connecting to limit the amount of time + * we block... + */ + + val = 30; + setsockopt(*sock, SOL_SOCKET, SO_RCVTIMEO, &val, sizeof(val)); +#endif /* __APPLE__ */ + /* * Using TCP_NODELAY improves responsiveness, especially on systems * with a slow loopback interface... @@ -154,6 +164,9 @@ httpAddrConnect( addrlist = addrlist->next; } + if (!addrlist) + _cupsSetError(HTTP_SERVICE_UNAVAILABLE, _("Unable to connect to server"), 1); + return (addrlist); } diff --git a/cups/http-private.h b/cups/http-private.h index 78ebdf930..0700530bd 100644 --- a/cups/http-private.h +++ b/cups/http-private.h @@ -90,7 +90,8 @@ typedef int socklen_t; # include # include -typedef SSL http_tls_t; +typedef SSL *http_tls_t; +typedef void *http_tls_credentials_t; extern BIO_METHOD *_httpBIOMethods(void); @@ -99,13 +100,11 @@ extern BIO_METHOD *_httpBIOMethods(void); * The GNU TLS library is more of a "bare metal" SSL/TLS library... */ # include +# include # include -typedef struct -{ - gnutls_session session; /* GNU TLS session object */ - void *credentials; /* GNU TLS credentials object */ -} http_tls_t; +typedef gnutls_session http_tls_t; +typedef void *http_tls_credentials_t; extern ssize_t _httpReadGNUTLS(gnutls_transport_ptr ptr, void *data, size_t length); @@ -118,13 +117,43 @@ extern ssize_t _httpWriteGNUTLS(gnutls_transport_ptr ptr, const void *data, * for its IO and protocol management... */ +# include +# include # include - -typedef struct /**** CDSA connection information ****/ -{ - SSLContextRef session; /* CDSA session object */ - CFArrayRef certsArray; /* Certificates array */ -} http_tls_t; +# include +# ifdef HAVE_SECBASEPRIV_H +# include +# elif defined(HAVE_CSSMERRORSTRING) /* Declare prototype for function in that header... */ +extern const char *cssmErrorString(int error); +# endif /* HAVE_SECBASEPRIV_H */ +# ifdef HAVE_SECCERTIFICATE_H +# include +# include +# endif /* HAVE_SECCERTIFICATE_H */ +# ifdef HAVE_SECITEMPRIV_H +# include +# else /* Declare constants from that header... */ +extern const CFTypeRef kSecClassCertificate; +extern const CFTypeRef kSecClassIdentity; +# endif /* HAVE_SECITEMPRIV_H */ +# ifdef HAVE_SECIDENTITYSEARCHPRIV_H +# include +# elif defined(HAVE_SECIDENTITYSEARCHCREATEWITHPOLICY) /* Declare prototype for function in that header... */ +extern OSStatus SecIdentitySearchCreateWithPolicy(SecPolicyRef policy, + CFStringRef idString, CSSM_KEYUSE keyUsage, + CFTypeRef keychainOrArray, + Boolean returnOnlyValidIdentities, + SecIdentitySearchRef* searchRef); +# endif /* HAVE_SECIDENTITYSEARCHPRIV_H */ +# ifdef HAVE_SECPOLICYPRIV_H +# include +# elif defined(HAVE_SECIDENTITYSEARCHCREATEWITHPOLICY) /* Declare prototype for function in that header... */ +extern OSStatus SecPolicySetValue(SecPolicyRef policyRef, + const CSSM_DATA *value); +# endif /* HAVE_SECPOLICYPRIV_H */ + +typedef SSLContextRef http_tls_t; +typedef CFArrayRef http_tls_credentials_t; extern OSStatus _httpReadCDSA(SSLConnectionRef connection, void *data, size_t *dataLength); @@ -133,6 +162,10 @@ extern OSStatus _httpWriteCDSA(SSLConnectionRef connection, const void *data, # elif defined(HAVE_SSPISSL) # include "sspi-private.h" +typedef _sspi_struct_t * http_tls_t; +typedef void *http_tls_credentials_t; +# else +typedef void *http_tls_t; # endif /* HAVE_LIBSSL */ @@ -162,7 +195,7 @@ struct _http_s /**** HTTP connection structure. ****/ char nonce[HTTP_MAX_VALUE]; /* Nonce value */ int nonce_count; /* Nonce count */ - void *tls; /* TLS state information */ + 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@ */ @@ -193,6 +226,9 @@ struct _http_s /**** HTTP connection structure. ****/ # ifdef HAVE_AUTHORIZATION_H AuthorizationRef auth_ref; /* Authorization ref */ # endif /* HAVE_AUTHORIZATION_H */ + /**** New in CUPS 1.5 ****/ + http_tls_credentials_t tls_credentials; + /* TLS credentials */ }; @@ -267,11 +303,14 @@ extern void _cups_freeifaddrs(struct ifaddrs *addrs); */ extern int _httpAddrPort(http_addr_t *addr); +extern http_tls_credentials_t + _httpConvertCredentials(cups_array_t *credentials); extern http_t *_httpCreate(const char *host, int port, http_encryption_t encryption); extern void _httpDisconnect(http_t *http); extern char *_httpEncodeURI(char *dst, const char *src, size_t dstsize); +extern void _httpFreeCredentials(http_tls_credentials_t credentials); extern ssize_t _httpPeek(http_t *http, char *buffer, size_t length); extern const char *_httpResolveURI(const char *uri, char *resolved_uri, size_t resolved_size, int log); diff --git a/cups/http-support.c b/cups/http-support.c index 5c1dce5d8..92c66e1fb 100644 --- a/cups/http-support.c +++ b/cups/http-support.c @@ -297,7 +297,7 @@ httpAssembleURI( * Otherwise, just copy the host string... */ - ptr = http_copy_encode(ptr, host, end, ":/?#[]@\\", NULL, + ptr = http_copy_encode(ptr, host, end, ":/?#[]@\\\"", NULL, encoding & HTTP_URI_CODING_HOSTNAME); if (!ptr) @@ -920,7 +920,9 @@ httpSeparateURI( for (ptr = scheme, end = scheme + schemelen - 1; *uri && *uri != ':' && ptr < end;) - if (isalnum(*uri & 255) || *uri == '-' || *uri == '+' || *uri == '.') + if (strchr("ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz" + "0123456789-+.", *uri) != NULL) *ptr++ = *uri++; else break; @@ -944,7 +946,7 @@ httpSeparateURI( *port = 80; else if (!strcmp(scheme, "https")) *port = 443; - else if (!strcmp(scheme, "ipp")) + else if (!strcmp(scheme, "ipp") || !strcmp(scheme, "ipps")) *port = 631; else if (!strcasecmp(scheme, "lpd")) *port = 515; @@ -1247,6 +1249,9 @@ httpStatus(http_status_t status) /* I - HTTP status code */ case HTTP_SERVER_ERROR : s = _("Internal Server Error"); break; + case HTTP_PKI_ERROR : + s = _("SSL/TLS Negotiation Error"); + break; default : s = _("Unknown"); diff --git a/cups/http.c b/cups/http.c index 6df51abc6..defa38859 100644 --- a/cups/http.c +++ b/cups/http.c @@ -19,82 +19,97 @@ * * Contents: * - * _httpBIOMethods() - Get the OpenSSL BIO methods for HTTP connections. - * httpBlocking() - Set blocking/non-blocking behavior on a connection. - * httpCheck() - Check to see if there is a pending response from the - * server. - * httpClearCookie() - Clear the cookie value(s). - * httpClearFields() - Clear HTTP request fields. - * httpClose() - Close an HTTP connection. - * httpConnect() - Connect to a HTTP server. - * httpConnectEncrypt() - Connect to a HTTP server using encryption. - * _httpCreate() - Create an unconnected HTTP connection. - * httpDelete() - Send a DELETE request to the server. - * _httpDisconnect() - Disconnect a HTTP connection. - * httpEncryption() - Set the required encryption on the link. - * httpError() - Get the last error on a connection. - * httpFlush() - Flush data from a HTTP connection. - * httpFlushWrite() - Flush data in write buffer. - * httpGet() - Send a GET request to the server. - * httpGetAuthString() - Get the current authorization string. - * httpGetBlocking() - Get the blocking/non-block state of a connection. - * httpGetCookie() - Get any cookie data from the response. - * httpGetFd() - Get the file descriptor associated with a - * connection. - * httpGetField() - Get a field value from a request/response. - * httpGetLength() - Get the amount of data remaining from the - * content-length or transfer-encoding fields. - * httpGetLength2() - Get the amount of data remaining from the - * content-length or transfer-encoding fields. - * httpGetStatus() - Get the status of the last HTTP request. - * httpGetSubField() - Get a sub-field value. - * httpGetSubField2() - Get a sub-field value. - * httpGets() - Get a line of text from a HTTP connection. - * httpHead() - Send a HEAD request to the server. - * httpInitialize() - Initialize the HTTP interface library and set the - * default HTTP proxy (if any). - * httpOptions() - Send an OPTIONS request to the server. - * _httpPeek() - Peek at data from a HTTP connection. - * httpPost() - Send a POST request to the server. - * httpPrintf() - Print a formatted string to a HTTP connection. - * httpPut() - Send a PUT request to the server. - * httpRead() - Read data from a HTTP connection. - * httpRead2() - Read data from a HTTP connection. - * _httpReadCDSA() - Read function for the CDSA library. - * _httpReadGNUTLS() - Read function for the GNU TLS library. - * httpReconnect() - Reconnect to a HTTP server. - * httpSetAuthString() - Set the current authorization string. - * httpSetCookie() - Set the cookie value(s). - * httpSetExpect() - Set the Expect: header in a request. - * httpSetField() - Set the value of an HTTP header. - * httpSetLength() - Set the content-length and content-encoding. - * httpTrace() - Send an TRACE request to the server. - * httpUpdate() - Update the current HTTP state for incoming data. - * _httpWait() - Wait for data available on a connection (no flush). - * httpWait() - Wait for data available on a connection. - * httpWrite() - Write data to a HTTP connection. - * httpWrite2() - Write data to a HTTP connection. - * _httpWriteCDSA() - Write function for the CDSA library. - * _httpWriteGNUTLS() - Write function for the GNU TLS library. - * http_bio_ctrl() - Control the HTTP connection. - * http_bio_free() - Free OpenSSL data. - * http_bio_new() - Initialize an OpenSSL BIO structure. - * http_bio_puts() - Send a string for OpenSSL. - * http_bio_read() - Read data for OpenSSL. - * http_bio_write() - Write data for OpenSSL. - * http_debug_hex() - Do a hex dump of a buffer. - * http_field() - Return the field index for a field name. - * http_read_ssl() - Read from a SSL/TLS connection. - * http_locking_cb() - Lock/unlock a thread's mutex. - * http_send() - Send a request with all fields and the trailing - * blank line. - * 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. - * http_upgrade() - Force upgrade to TLS encryption. - * http_write() - Write a buffer to a HTTP connection. - * http_write_chunk() - Write a chunked buffer. - * http_write_ssl() - Write to a SSL/TLS connection. + * httpAddCredential() - Allocates and adds a single credential to an + * array. + * _httpBIOMethods() - Get the OpenSSL BIO methods for HTTP + * connections. + * httpBlocking() - Set blocking/non-blocking behavior on a + * connection. + * httpCheck() - Check to see if there is a pending response + * from the server. + * httpClearCookie() - Clear the cookie value(s). + * httpClearFields() - Clear HTTP request fields. + * httpClose() - Close an HTTP connection. + * httpConnect() - Connect to a HTTP server. + * 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. + * httpDelete() - Send a DELETE request to the server. + * _httpDisconnect() - Disconnect a HTTP connection. + * httpEncryption() - Set the required encryption on the link. + * httpError() - Get the last error on a connection. + * httpFlush() - Flush data from a HTTP connection. + * httpFlushWrite() - Flush data in write buffer. + * _httpFreeCredentials() - Free internal credentials. + * httpFreeCredentials() - Free an array of credentials. + * httpGet() - Send a GET request to the server. + * httpGetAuthString() - Get the current authorization string. + * httpGetBlocking() - Get the blocking/non-block state of a + * connection. + * httpGetCookie() - Get any cookie data from the response. + * httpGetFd() - Get the file descriptor associated with a + * connection. + * httpGetField() - Get a field value from a request/response. + * httpGetLength() - Get the amount of data remaining from the + * content-length or transfer-encoding fields. + * httpGetLength2() - Get the amount of data remaining from the + * content-length or transfer-encoding fields. + * httpGetStatus() - Get the status of the last HTTP request. + * httpGetSubField() - Get a sub-field value. + * httpGetSubField2() - Get a sub-field value. + * httpGets() - Get a line of text from a HTTP connection. + * httpHead() - Send a HEAD request to the server. + * httpInitialize() - Initialize the HTTP interface library and set + * the default HTTP proxy (if any). + * httpOptions() - Send an OPTIONS request to the server. + * _httpPeek() - Peek at data from a HTTP connection. + * httpPost() - Send a POST request to the server. + * httpPrintf() - Print a formatted string to a HTTP connection. + * httpPut() - Send a PUT request to the server. + * httpRead() - Read data from a HTTP connection. + * httpRead2() - Read data from a HTTP connection. + * _httpReadCDSA() - Read function for the CDSA library. + * _httpReadGNUTLS() - Read function for the GNU TLS library. + * httpReconnect() - Reconnect to a HTTP server. + * httpSetAuthString() - Set the current authorization string. + * httpSetCredentials() - Set the credentials associated with an + * encrypted connection. + * httpSetCookie() - Set the cookie value(s). + * httpSetExpect() - Set the Expect: header in a request. + * httpSetField() - Set the value of an HTTP header. + * httpSetLength() - Set the content-length and content-encoding. + * httpTrace() - Send an TRACE request to the server. + * httpUpdate() - Update the current HTTP state for incoming + * data. + * _httpWait() - Wait for data available on a connection (no + * flush). + * httpWait() - Wait for data available on a connection. + * httpWrite() - Write data to a HTTP connection. + * httpWrite2() - Write data to a HTTP connection. + * _httpWriteCDSA() - Write function for the CDSA library. + * _httpWriteGNUTLS() - Write function for the GNU TLS library. + * http_bio_ctrl() - Control the HTTP connection. + * http_bio_free() - Free OpenSSL data. + * http_bio_new() - Initialize an OpenSSL BIO structure. + * http_bio_puts() - Send a string for OpenSSL. + * http_bio_read() - Read data for OpenSSL. + * http_bio_write() - Write data for OpenSSL. + * http_debug_hex() - Do a hex dump of a buffer. + * http_field() - Return the field index for a field name. + * http_read_ssl() - Read from a SSL/TLS connection. + * http_locking_cb() - Lock/unlock a thread's mutex. + * http_send() - Send a request with all fields and the trailing + * blank line. + * http_set_credentials() - Set the SSL/TLS credentials. + * 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. + * http_upgrade() - Force upgrade to TLS encryption. + * http_write() - Write a buffer to a HTTP connection. + * http_write_chunk() - Write a chunked buffer. + * http_write_ssl() - Write to a SSL/TLS connection. */ /* @@ -142,6 +157,7 @@ static int http_write_chunk(http_t *http, const char *buffer, int length); #ifdef HAVE_SSL static int http_read_ssl(http_t *http, char *buf, int len); +static int http_set_credentials(http_t *http); static int http_setup_ssl(http_t *http); static void http_shutdown_ssl(http_t *http); static int http_upgrade(http_t *http); @@ -242,8 +258,45 @@ static BIO_METHOD http_bio_methods = http_bio_free, NULL, }; +#endif /* HAVE_SSL && HAVE_LIBSSL */ +/* + * 'httpAddCredential()' - Allocates and adds a single credential to an array. + * + * Use @code cupsArrayNew(NULL, NULL)@ to create a credentials array. + * + * @since CUPS 1.5@ + */ + +int /* O - 0 on success, -1 on error */ +httpAddCredential( + cups_array_t *credentials, /* I - Credentials array */ + const void *data, /* I - PEM-encoded X.509 data */ + size_t datalen) /* I - Length of data */ +{ + http_credential_t *credential; /* Credential data */ + + + if ((credential = malloc(sizeof(http_credential_t))) != NULL) + { + credential->datalen = datalen; + + if ((credential->data = malloc(datalen)) != NULL) + { + memcpy(credential->data, data, datalen); + cupsArrayAdd(credentials, credential); + return (0); + } + + free(credential); + } + + return (-1); +} + + +#if defined(HAVE_SSL) && defined(HAVE_LIBSSL) /* * '_httpBIOMethods()' - Get the OpenSSL BIO methods for HTTP connections. */ @@ -442,6 +495,129 @@ httpConnectEncrypt( } +/* + * 'httpCopyCredentials()' - Copy the credentials associated with an encrypted + * connection. + * + * @since CUPS 1.5@ + */ + +int /* O - Status of call (0 = success) */ +httpCopyCredentials( + http_t *http, /* I - Connection to server */ + cups_array_t **credentials) /* O - Array of credentials */ +{ +# ifdef HAVE_LIBSSL +# elif defined(HAVE_GNUTLS) +# elif defined(HAVE_CDSASSL) + OSStatus error; /* Error code */ + CFIndex count; /* Number of credentials */ + CFArrayRef peerCerts; /* Peer certificates */ + SecCertificateRef secCert; /* Certificate reference */ + CFDataRef data; /* Certificate data */ + int i; /* Looping var */ +# elif defined(HAVE_SSPISSL) +# endif /* HAVE_LIBSSL */ + + + if (credentials) + *credentials = NULL; + + if (!http || !http->tls || !credentials) + return (-1); + +# ifdef HAVE_LIBSSL + return (-1); + +# elif defined(HAVE_GNUTLS) + return (-1); + +# elif defined(HAVE_CDSASSL) + if (!(error = SSLCopyPeerCertificates(http->tls, &peerCerts)) && peerCerts) + { + if ((*credentials = cupsArrayNew(NULL, NULL)) != NULL) + { + for (i = 0, count = CFArrayGetCount(peerCerts); i < count; i++) + { + secCert = (SecCertificateRef)CFArrayGetValueAtIndex(peerCerts, i); + if ((data = SecCertificateCopyData(secCert))) + { + httpAddCredential(*credentials, CFDataGetBytePtr(data), + CFDataGetLength(data)); + CFRelease(data); + } + } + } + + CFRelease(peerCerts); + } + + return (error); + +# elif defined(HAVE_SSPISSL) + return (-1); +# endif /* HAVE_LIBSSL */ +} + + +/* + * '_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) + 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. */ @@ -687,6 +863,57 @@ httpFlushWrite(http_t *http) /* I - Connection to server */ } +/* + * '_httpFreeCredentials()' - Free internal credentials. + */ + +void +_httpFreeCredentials( + http_tls_credentials_t credentials) /* I - Internal credentials */ +{ + if (!credentials) + return; + +#ifdef HAVE_LIBSSL + (void)credentials; + +#elif defined(HAVE_GNUTLS) + (void)credentials; + +#elif defined(HAVE_CDSASSL) + CFRelease(credentials); + +#elif defined(HAVE_SSPISSL) + (void)credentials; + +#endif /* HAVE_LIBSSL */ +} + + +/* + * 'httpFreeCredentials()' - Free an array of credentials. + */ + +void +httpFreeCredentials( + cups_array_t *credentials) /* I - Array of credentials */ +{ + http_credential_t *credential; /* Credential */ + + + for (credential = (http_credential_t *)cupsArrayFirst(credentials); + credential; + credential = (http_credential_t *)cupsArrayNext(credentials)) + { + cupsArrayRemove(credentials, credential); + free((void *)credential->data); + free(credential); + } + + cupsArrayDelete(credentials); +} + + /* * 'httpGet()' - Send a GET request to the server. */ @@ -941,7 +1168,7 @@ httpGetSubField2(http_t *http, /* I - Connection to server */ * Skip leading whitespace... */ - while (isspace(*fptr & 255)) + while (_cups_isspace(*fptr)) fptr ++; if (*fptr == ',') @@ -955,7 +1182,7 @@ httpGetSubField2(http_t *http, /* I - Connection to server */ */ for (ptr = temp; - *fptr && *fptr != '=' && !isspace(*fptr & 255) && + *fptr && *fptr != '=' && !_cups_isspace(*fptr) && ptr < (temp + sizeof(temp) - 1); *ptr++ = *fptr++); @@ -967,7 +1194,7 @@ httpGetSubField2(http_t *http, /* I - Connection to server */ * Skip trailing chars up to the '='... */ - while (isspace(*fptr & 255)) + while (_cups_isspace(*fptr)) fptr ++; if (!*fptr) @@ -982,7 +1209,7 @@ httpGetSubField2(http_t *http, /* I - Connection to server */ fptr ++; - while (isspace(*fptr & 255)) + while (_cups_isspace(*fptr)) fptr ++; if (*fptr == '\"') @@ -1010,12 +1237,12 @@ httpGetSubField2(http_t *http, /* I - Connection to server */ */ for (ptr = value; - *fptr && !isspace(*fptr & 255) && *fptr != ',' && ptr < end; + *fptr && !_cups_isspace(*fptr) && *fptr != ',' && ptr < end; *ptr++ = *fptr++); *ptr = '\0'; - while (*fptr && !isspace(*fptr & 255) && *fptr != ',') + while (*fptr && !_cups_isspace(*fptr) && *fptr != ',') fptr ++; } @@ -2084,6 +2311,28 @@ httpSetAuthString(http_t *http, /* I - Connection to server */ } +/* + * 'httpSetCredentials()' - Set the credentials associated with an encrypted + * connection. + * + * @since CUPS 1.5@ + */ + +int /* O - Status of call (0 = success) */ +httpSetCredentials(http_t *http, /* I - Connection to server */ + cups_array_t *credentials) /* I - Array of credentials */ +{ + if (!http || cupsArrayCount(credentials) < 1) + return (-1); + + _httpFreeCredentials(http->tls_credentials); + + http->tls_credentials = _httpConvertCredentials(credentials); + + return (http->tls_credentials ? 0 : -1); +} + + /* * 'httpSetCookie()' - Set the cookie value(s). * @@ -2351,7 +2600,7 @@ httpUpdate(http_t *http) /* I - Connection to server */ */ *value++ = '\0'; - while (isspace(*value & 255)) + while (_cups_isspace(*value)) value ++; /* @@ -2450,14 +2699,14 @@ _httpWait(http_t *http, /* I - Connection to server */ if (http->tls && usessl) { # ifdef HAVE_LIBSSL - if (SSL_pending((SSL *)(http->tls))) + if (SSL_pending(http->tls)) { DEBUG_puts("5_httpWait: Return 1 since there is pending SSL data."); return (1); } # elif defined(HAVE_GNUTLS) - if (gnutls_record_check_pending(((http_tls_t *)(http->tls))->session)) + if (gnutls_record_check_pending(http->tls)) { DEBUG_puts("5_httpWait: Return 1 since there is pending SSL data."); return (1); @@ -2466,7 +2715,7 @@ _httpWait(http_t *http, /* I - Connection to server */ # elif defined(HAVE_CDSASSL) size_t bytes; /* Bytes that are available */ - if (!SSLGetBufferedReadSize(((http_tls_t *)(http->tls))->session, &bytes) && + if (!SSLGetBufferedReadSize(http->tls, &bytes) && bytes > 0) { DEBUG_puts("5_httpWait: Return 1 since there is pending SSL data."); @@ -3007,7 +3256,7 @@ http_read_ssl(http_t *http, /* I - Connection to server */ ssize_t result; /* Return value */ - result = gnutls_record_recv(((http_tls_t *)(http->tls))->session, buf, len); + result = gnutls_record_recv(http->tls, buf, len); if (result < 0 && !errno) { @@ -3041,7 +3290,7 @@ http_read_ssl(http_t *http, /* I - Connection to server */ size_t processed; /* Number of bytes processed */ - error = SSLRead(((http_tls_t *)http->tls)->session, buf, len, &processed); + error = SSLRead(http->tls, buf, len, &processed); switch (error) { @@ -3248,6 +3497,111 @@ http_send(http_t *http, /* I - Connection to server */ #ifdef HAVE_SSL +/* + * 'http_set_credentials()' - Set the SSL/TLS credentials. + */ + +static int /* O - Status of connection */ +http_set_credentials(http_t *http) /* I - Connection to server */ +{ + _cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */ +# ifdef HAVE_CDSASSL + OSStatus error = 0; /* Error code */ + http_tls_credentials_t credentials = NULL; + /* TLS credentials */ +# endif /* HAVE_CDSASSL */ + + + DEBUG_printf(("7http_set_credentials(%p)", http)); + +# ifdef HAVE_LIBSSL + return (-1); + +# elif defined(HAVE_GNUTLS) + return (-1); + +# elif defined(HAVE_CDSASSL) + /* + * Prefer connection specific credentials... + */ + + if ((credentials = http->tls_credentials) == NULL) + credentials = cg->tls_credentials; + +# if HAVE_SECPOLICYCREATESSL + /* + * Otherwise root around in the user's keychain to see if one can be found... + */ + + if (!credentials) + { + CFDictionaryRef query; /* Query dictionary */ + CFTypeRef matches = NULL; /* Matching credentials */ + CFArrayRef dn_array = NULL;/* Distinguished names array */ + CFTypeRef keys[] = { kSecClass, + kSecMatchLimit, + kSecReturnRef }; + /* Keys for dictionary */ + CFTypeRef values[] = { kSecClassCertificate, + kSecMatchLimitOne, + kCFBooleanTrue }; + /* Values for dictionary */ + + /* + * Get the names associated with the server. + */ + + if ((error = SSLCopyDistinguishedNames(http->tls, &dn_array)) != noErr) + { + DEBUG_printf(("4http_set_credentials: SSLCopyDistinguishedNames, error=%d", + (int)error)); + return (error); + } + + /* + * Create a query which will return all identities that can sign and match + * the passed in policy. + */ + + query = CFDictionaryCreate(NULL, + (const void**)(&keys[0]), + (const void**)(&values[0]), + sizeof(keys) / sizeof(keys[0]), + &kCFTypeDictionaryKeyCallBacks, + &kCFTypeDictionaryValueCallBacks); + if (query) + { + error = SecItemCopyMatching(query, &matches); + DEBUG_printf(("4http_set_credentials: SecItemCopyMatching, error=%d", + (int)error)); + CFRelease(query); + } + + if (matches) + CFRelease(matches); + + if (dn_array) + CFRelease(dn_array); + } +# endif /* HAVE_SECPOLICYCREATESSL */ + + if (credentials) + { + error = SSLSetCertificate(http->tls, credentials); + DEBUG_printf(("4http_set_credentials: SSLSetCertificate, error=%d", + (int)error)); + } + else + DEBUG_puts("4http_set_credentials: No credentials to set."); + + return (error); + +# elif defined(HAVE_SSPISSL) + return (-1); +# endif /* HAVE_LIBSSL */ +} + + /* * 'http_setup_ssl()' - Set up SSL/TLS support on a connection. */ @@ -3255,27 +3609,46 @@ http_send(http_t *http, /* I - Connection to server */ static int /* O - Status of connection */ 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 */ + # ifdef HAVE_LIBSSL SSL_CTX *context; /* Context for encryption */ - SSL *conn; /* Connection for encryption */ BIO *bio; /* BIO data */ # elif defined(HAVE_GNUTLS) - http_tls_t *conn; /* TLS session object */ gnutls_certificate_client_credentials *credentials; /* TLS credentials */ # elif defined(HAVE_CDSASSL) OSStatus error; /* Error code */ - http_tls_t *conn; /* CDSA connection information */ + const char *message = NULL; /* Error message */ + cups_array_t *credentials; /* Credentials array */ + char *hostname; /* Hostname */ + 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 */ # elif defined(HAVE_SSPISSL) TCHAR username[256]; /* Username returned from GetUserName() */ TCHAR commonName[256]; /* Common name for certificate */ DWORD dwSize; /* 32 bit size */ - _sspi_struct_t *conn; /* SSPI connection information */ # endif /* HAVE_LIBSSL */ DEBUG_printf(("7http_setup_ssl(http=%p)", http)); + /* + * Always allow self-signed certificates for the local loopback address... + */ + + if (httpAddrLocalhost(http->hostaddr)) + any_root = 1; + else + any_root = cg->any_root; + # ifdef HAVE_LIBSSL context = SSL_CTX_new(SSLv23_client_method()); @@ -3284,10 +3657,10 @@ http_setup_ssl(http_t *http) /* I - Connection to server */ bio = BIO_new(_httpBIOMethods()); BIO_ctrl(bio, BIO_C_SET_FILE_PTR, 0, (char *)http); - conn = SSL_new(context); - SSL_set_bio(conn, bio, bio); + http->tls = SSL_new(context); + SSL_set_bio(http->tls_credentials, bio, bio); - if (SSL_connect(conn) != 1) + if (SSL_connect(http->tls) != 1) { # ifdef DEBUG unsigned long error; /* Error code */ @@ -3297,7 +3670,8 @@ http_setup_ssl(http_t *http) /* I - Connection to server */ # endif /* DEBUG */ SSL_CTX_free(context); - SSL_free(conn); + SSL_free(http->tls); + http->tls = NULL; # ifdef WIN32 http->error = WSAGetLastError(); @@ -3310,20 +3684,10 @@ http_setup_ssl(http_t *http) /* I - Connection to server */ } # elif defined(HAVE_GNUTLS) - if ((conn = (http_tls_t *)malloc(sizeof(http_tls_t))) == NULL) - { - http->error = errno; - http->status = HTTP_ERROR; - - return (-1); - } - credentials = (gnutls_certificate_client_credentials *) malloc(sizeof(gnutls_certificate_client_credentials)); if (credentials == NULL) { - free(conn); - http->error = errno; http->status = HTTP_ERROR; @@ -3332,107 +3696,298 @@ http_setup_ssl(http_t *http) /* I - Connection to server */ gnutls_certificate_allocate_credentials(credentials); - gnutls_init(&(conn->session), GNUTLS_CLIENT); - gnutls_set_default_priority(conn->session); - gnutls_credentials_set(conn->session, GNUTLS_CRD_CERTIFICATE, *credentials); - gnutls_transport_set_ptr(conn->session, (gnutls_transport_ptr)http); - gnutls_transport_set_pull_function(conn->session, _httpReadGNUTLS); - gnutls_transport_set_push_function(conn->session, _httpWriteGNUTLS); + gnutls_init(&http->tls, GNUTLS_CLIENT); + gnutls_set_default_priority(http->tls); + 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(conn->session)) != GNUTLS_E_SUCCESS) + if ((gnutls_handshake(http->tls)) != GNUTLS_E_SUCCESS) { http->error = errno; http->status = HTTP_ERROR; - gnutls_deinit(conn->session); + gnutls_deinit(http->tls); gnutls_certificate_free_credentials(*credentials); free(credentials); - free(conn); + http->tls = NULL; return (-1); } - conn->credentials = credentials; + http->tls_credentials = credentials; # elif defined(HAVE_CDSASSL) - conn = (http_tls_t *)calloc(1, sizeof(http_tls_t)); - - if (conn == NULL) - return (-1); - - if ((error = SSLNewContext(false, &conn->session))) + if ((error = SSLNewContext(false, &http->tls))) { http->error = error; http->status = HTTP_ERROR; - free(conn); return (-1); } - /* - * Use a union to resolve warnings about int/pointer size mismatches... - */ + error = SSLSetConnection(http->tls, http); + DEBUG_printf(("4http_setup_ssl: SSLSetConnection, error=%d", (int)error)); + + if (!error) + { + error = SSLSetIOFuncs(http->tls, _httpReadCDSA, _httpWriteCDSA); + 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)); + } - error = SSLSetConnection(conn->session, http); + if (!error) + { + error = SSLSetAllowsAnyRoot(http->tls, any_root); + DEBUG_printf(("4http_setup_ssl: SSLSetAllowsAnyRoot(%d), error=%d", + any_root, (int)error)); + } if (!error) - error = SSLSetIOFuncs(conn->session, _httpReadCDSA, _httpWriteCDSA); + { + error = SSLSetAllowsExpiredCerts(http->tls, cg->expired_certs); + DEBUG_printf(("4http_setup_ssl: SSLSetAllowsExpiredCerts(%d), error=%d", + cg->expired_certs, (int)error)); + } if (!error) - error = SSLSetAllowsExpiredCerts(conn->session, true); + { + error = SSLSetAllowsExpiredRoots(http->tls, cg->expired_root); + DEBUG_printf(("4http_setup_ssl: SSLSetAllowsExpiredRoots(%d), error=%d", + cg->expired_root, (int)error)); + } if (!error) - error = SSLSetAllowsAnyRoot(conn->session, true); + { + if (cg->client_cert_cb) + { + error = SSLSetSessionOption(http->tls, + kSSLSessionOptionBreakOnCertRequested, true); + DEBUG_printf(("4http_setup_ssl: kSSLSessionOptionBreakOnCertRequested, " + "error=%d", (int)error)); + } + else + { + error = http_set_credentials(http); + DEBUG_printf(("4http_setup_ssl: http_set_credentials, error=%d", + (int)error)); + } + } + + /* + * If there's a server certificate callback installed let it evaluate the + * certificate(s) during the handshake... + */ + + 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)); + } + } if (!error) - error = SSLSetProtocolVersionEnabled(conn->session, kSSLProtocol2, false); + { + hostname = httpAddrLocalhost(http->hostaddr) ? "localhost" : http->hostname; + error = SSLSetPeerDomainName(http->tls, hostname, strlen(hostname)); + + DEBUG_printf(("4http_setup_ssl: SSLSetPeerDomainName, error=%d", + (int)error)); + } if (!error) { - while ((error = SSLHandshake(conn->session)) == errSSLWouldBlock) - usleep(1000); + int done = 0; /* Are we done yet? */ + + while (!error && !done) + { + error = SSLHandshake(http->tls); + + DEBUG_printf(("4_httpWait: SSLHandshake returned %d.", (int)error)); + + switch (error) + { + case noErr : + done = 1; + break; + + case errSSLWouldBlock : + usleep(1000); + break; + + case errSSLServerAuthCompleted : + error = 0; + if (cg->server_cert_cb) + { + error = httpCopyCredentials(http, &credentials); + if (!error) + { + error = (cg->server_cert_cb)(http, http->tls, credentials, + cg->server_cert_data); + httpFreeCredentials(credentials); + } + + DEBUG_printf(("4_httpWait: Server certificate callback returned " + "%d.", (int)error)); + } + break; + + case errSSLClientCertRequested : + error = 0; + + if (cg->client_cert_cb) + { + names = NULL; + if (!(error = SSLCopyDistinguishedNames(http->tls, &dn_array)) && + dn_array) + { + if ((names = cupsArrayNew(NULL, NULL)) != NULL) + { + for (i = 0, count = CFArrayGetCount(dn_array); i < count; i++) + { + data = (CFDataRef)CFArrayGetValueAtIndex(dn_array, i); + + if ((credential = malloc(sizeof(*credential)))) + { + credential->datalen = CFDataGetLength(data); + if ((credential->data = malloc(credential->datalen))) + { + memcpy((void *)credential->data, CFDataGetBytePtr(data), + credential->datalen); + cupsArrayAdd(names, credential); + } + } + } + } + + CFRelease(dn_array); + } + + if (!error) + { + error = (cg->client_cert_cb)(http, http->tls, names, + cg->client_cert_data); + + DEBUG_printf(("4_httpWait: Client certificate callback " + "returned %d.", (int)error)); + } + + httpFreeCredentials(names); + } + break; + + case errSSLUnknownRootCert : + message = _("Unable to establish a secure connection to host " + "(untrusted certificate)."); + break; + + case errSSLNoRootCert : + message = _("Unable to establish a secure connection to host " + "(self-signed certificate)."); + break; + + case errSSLCertExpired : + message = _("Unable to establish a secure connection to host " + "(expired certificate)."); + break; + + case errSSLCertNotYetValid : + message = _("Unable to establish a secure connection to host " + "(certificate not yet valid)."); + break; + + case errSSLHostNameMismatch : + message = _("Unable to establish a secure connection to host " + "(host name mismatch)."); + break; + + case errSSLXCertChainInvalid : + message = _("Unable to establish a secure connection to host " + "(certificate chain invalid)."); + break; + + case errSSLConnectionRefused : + message = _("Unable to establish a secure connection to host " + "(peer dropped connection before responding)."); + break; + + default : + break; + } + } } if (error) { http->error = error; http->status = HTTP_ERROR; + errno = ECONNREFUSED; + + SSLDisposeContext(http->tls); + http->tls = NULL; - SSLDisposeContext(conn->session); + /* + * If an error string wasn't set by the callbacks use a generic one... + */ + + if (!message) +#ifdef HAVE_CSSMERRORSTRING + message = cssmErrorString(error); +#else + message = _("Unable to establish a secure connection to host."); +#endif /* HAVE_CSSMERRORSTRING */ - free(conn); + _cupsSetError(IPP_PKI_ERROR, message, 1); return (-1); } + # elif defined(HAVE_SSPISSL) - conn = _sspiAlloc(); + http->tls = _sspiAlloc(); - if (!conn) + if (!http->tls) return (-1); - conn->sock = http->fd; - dwSize = sizeof(username) / sizeof(TCHAR); + http->tls->sock = http->fd; + dwSize = sizeof(username) / sizeof(TCHAR); GetUserName(username, &dwSize); _sntprintf_s(commonName, sizeof(commonName) / sizeof(TCHAR), sizeof(commonName) / sizeof(TCHAR), TEXT("CN=%s"), username); - if (!_sspiGetCredentials(conn, L"ClientContainer", commonName, FALSE)) + if (!_sspiGetCredentials(http->tls_credentials, L"ClientContainer", + commonName, FALSE)) { - _sspiFree(conn); + _sspiFree(http->tls_credentials); + http->tls_credentials = NULL; return (-1); } - _sspiSetAllowsAnyRoot(conn, TRUE); - _sspiSetAllowsExpiredCerts(conn, TRUE); + _sspiSetAllowsAnyRoot(http->tls_credentials, TRUE); + _sspiSetAllowsExpiredCerts(http->tls_credentials, TRUE); - if (!_sspiConnect(conn, http->hostname)) + if (!_sspiConnect(http->tls_credentials, http->hostname)) { - _sspiFree(conn); + _sspiFree(http->tls_credentials); + http->tls_credentials = NULL; return (-1); } # endif /* HAVE_CDSASSL */ - http->tls = conn; return (0); } #endif /* HAVE_SSL */ @@ -3448,54 +4003,39 @@ http_shutdown_ssl(http_t *http) /* I - Connection to server */ { # ifdef HAVE_LIBSSL SSL_CTX *context; /* Context for encryption */ - SSL *conn; /* Connection for encryption */ + context = SSL_get_SSL_CTX(http->tls_credentials); - conn = (SSL *)(http->tls); - context = SSL_get_SSL_CTX(conn); - - SSL_shutdown(conn); + SSL_shutdown(http->tls_credentials); SSL_CTX_free(context); - SSL_free(conn); + SSL_free(http->tls_credentials); # elif defined(HAVE_GNUTLS) - http_tls_t *conn; /* Encryption session */ gnutls_certificate_client_credentials *credentials; /* TLS credentials */ + credentials = (gnutls_certificate_client_credentials *)(http->tls_credentials); - conn = (http_tls_t *)(http->tls); - credentials = (gnutls_certificate_client_credentials *)(conn->credentials); - - gnutls_bye(conn->session, GNUTLS_SHUT_RDWR); - gnutls_deinit(conn->session); + gnutls_bye(http->tls, GNUTLS_SHUT_RDWR); + gnutls_deinit(http->tls); gnutls_certificate_free_credentials(*credentials); free(credentials); - free(conn); # elif defined(HAVE_CDSASSL) - http_tls_t *conn; /* CDSA connection information */ - - - conn = (http_tls_t *)(http->tls); - - while (SSLClose(conn->session) == errSSLWouldBlock) + while (SSLClose(http->tls) == errSSLWouldBlock) usleep(1000); - SSLDisposeContext(conn->session); + SSLDisposeContext(http->tls); - if (conn->certsArray) - CFRelease(conn->certsArray); + if (http->tls_credentials) + CFRelease(http->tls_credentials); - free(conn); # elif defined(HAVE_SSPISSL) - _sspi_struct_t *conn; /* SSPI connection information */ - - conn = (_sspi_struct_t*)(http->tls); - _sspiFree(conn); + _sspiFree(http->tls_credentials); # endif /* HAVE_LIBSSL */ - http->tls = NULL; + http->tls = NULL; + http->tls_credentials = NULL; } #endif /* HAVE_SSL */ @@ -3554,7 +4094,7 @@ http_upgrade(http_t *http) /* I - Connection to server */ httpClearFields(http); httpSetField(http, HTTP_FIELD_CONNECTION, "upgrade"); - httpSetField(http, HTTP_FIELD_UPGRADE, "TLS/1.0, SSL/2.0, SSL/3.0"); + httpSetField(http, HTTP_FIELD_UPGRADE, "TLS/1.2, TLS/1.1, TLS/1.0, SSL/3.0"); if ((ret = httpOptions(http, "*")) == 0) { @@ -3735,7 +4275,7 @@ http_write_ssl(http_t *http, /* I - Connection to server */ result = SSL_write((SSL *)(http->tls), buf, len); # elif defined(HAVE_GNUTLS) - result = gnutls_record_send(((http_tls_t *)(http->tls))->session, buf, len); + result = gnutls_record_send(http->tls, buf, len); if (result < 0 && !errno) { @@ -3766,7 +4306,7 @@ http_write_ssl(http_t *http, /* I - Connection to server */ size_t processed; /* Number of bytes processed */ - error = SSLWrite(((http_tls_t *)http->tls)->session, buf, len, &processed); + error = SSLWrite(http->tls, buf, len, &processed); switch (error) { diff --git a/cups/http.h b/cups/http.h index 85a2c8b43..8dc79096c 100644 --- a/cups/http.h +++ b/cups/http.h @@ -1,10 +1,9 @@ /* * "$Id: http.h 7026 2007-10-19 00:57:45Z mike $" * - * Hyper-Text Transport Protocol definitions for the Common UNIX Printing - * System (CUPS). + * Hyper-Text Transport Protocol definitions for CUPS. * - * Copyright 2007-2009 by Apple Inc. + * Copyright 2007-2010 by Apple Inc. * Copyright 1997-2007 by Easy Software Products, all rights reserved. * * These coded instructions, statements, and computer programs are the @@ -24,6 +23,7 @@ */ # include "versioning.h" +# include "array.h" # include # include # include @@ -250,11 +250,11 @@ typedef enum http_status_e /**** HTTP status codes ****/ HTTP_GATEWAY_TIMEOUT, /* Gateway connection timed out */ HTTP_NOT_SUPPORTED, /* HTTP version not supported */ - HTTP_AUTHORIZATION_CANCELED = 1000 /* User canceled authorization */ - + HTTP_AUTHORIZATION_CANCELED = 1000, /* User canceled authorization @since CUPS 1.4@ */ + HTTP_PKI_ERROR /* Error negotiating a secure connection @since CUPS 1.5@ */ } http_status_t; -typedef enum http_uri_status_e /**** URI separation status @since CUPS1.2@ ****/ +typedef enum http_uri_status_e /**** URI separation status @since CUPS 1.2@ ****/ { HTTP_URI_OVERFLOW = -8, /* URI buffer for httpAssembleURI is too small */ HTTP_URI_BAD_ARGUMENTS = -7, /* Bad arguments to function (error) */ @@ -317,6 +317,12 @@ typedef struct http_addrlist_s /**** Socket address list, which is typedef struct _http_s http_t; /**** HTTP connection type ****/ +typedef struct http_credential_s /**** Credential data @since CUPS 1.5@ ****/ +{ + void *data; /* Pointer to credential data */ + size_t datalen; /* Credential length */ +} http_credential_t; + /* * Prototypes... @@ -440,6 +446,17 @@ extern char *httpGetAuthString(http_t *http) _CUPS_API_1_3; extern void httpSetAuthString(http_t *http, const char *scheme, const char *data) _CUPS_API_1_3; +/**** New in CUPS 1.5 ****/ +extern int httpAddCredential(cups_array_t *credentials, + const void *data, size_t datalen) + _CUPS_API_1_5; +extern int httpCopyCredentials(http_t *http, + cups_array_t **credentials) + _CUPS_API_1_5; +extern void httpFreeCredentials(cups_array_t *certs) _CUPS_API_1_5; +extern int httpSetCredentials(http_t *http, cups_array_t *certs) + _CUPS_API_1_5; + /* * C++ magic... */ diff --git a/cups/ipp-support.c b/cups/ipp-support.c index 05103dcdc..c1b556fe8 100644 --- a/cups/ipp-support.c +++ b/cups/ipp-support.c @@ -90,6 +90,12 @@ static const char * const ipp_status_oks[] = /* "OK" status codes */ "server-error-job-canceled", "server-error-multiple-document-jobs-not-supported", "server-error-printer-is-deactivated" + }, + * const ipp_status_1000s[] = /* CUPS internal */ + { + "cups-authorization-canceled", + "cups-pki-error", + "cups-upgrade-required" }; static char * const ipp_std_ops[] = { @@ -331,7 +337,7 @@ _ippAttrString(ipp_attribute_t *attr, /* I - Attribute */ { if (val > attr->values) { - if (bufptr < bufend) + if (buffer && bufptr < bufend) *bufptr++ = ','; else bufptr ++; @@ -346,7 +352,7 @@ _ippAttrString(ipp_attribute_t *attr, /* I - Attribute */ { ptr = printer_states[val->integer - IPP_PRINTER_IDLE]; - if (bufptr < bufend) + if (buffer && bufptr < bufend) strlcpy(bufptr, ptr, bufend - bufptr + 1); bufptr += strlen(ptr); @@ -358,7 +364,7 @@ _ippAttrString(ipp_attribute_t *attr, /* I - Attribute */ { ptr = job_states[val->integer - IPP_JOB_PENDING]; - if (bufptr < bufend) + if (buffer && bufptr < bufend) strlcpy(bufptr, ptr, bufend - bufptr + 1); bufptr += strlen(ptr); @@ -366,14 +372,14 @@ _ippAttrString(ipp_attribute_t *attr, /* I - Attribute */ } case IPP_TAG_INTEGER : - if (bufptr < bufend) + if (buffer && bufptr < bufend) bufptr += snprintf(bufptr, bufend - bufptr + 1, "%d", val->integer); else bufptr += snprintf(temp, sizeof(temp), "%d", val->integer); break; case IPP_TAG_BOOLEAN : - if (bufptr < bufend) + if (buffer && bufptr < bufend) strlcpy(bufptr, val->boolean ? "true" : "false", bufend - bufptr + 1); @@ -381,7 +387,7 @@ _ippAttrString(ipp_attribute_t *attr, /* I - Attribute */ break; case IPP_TAG_RANGE : - if (bufptr < bufend) + if (buffer && bufptr < bufend) bufptr += snprintf(bufptr, bufend - bufptr + 1, "%d-%d", val->range.lower, val->range.upper); else @@ -390,7 +396,7 @@ _ippAttrString(ipp_attribute_t *attr, /* I - Attribute */ break; case IPP_TAG_RESOLUTION : - if (bufptr < bufend) + if (buffer && bufptr < bufend) bufptr += snprintf(bufptr, bufend - bufptr + 1, "%dx%d%s", val->resolution.xres, val->resolution.yres, val->resolution.units == IPP_RES_PER_INCH ? @@ -419,7 +425,7 @@ _ippAttrString(ipp_attribute_t *attr, /* I - Attribute */ val->date[5], val->date[6], val->date[8], val->date[9], val->date[10]); - if (bufptr < bufend) + if (buffer && bufptr < bufend) strlcpy(bufptr, temp, bufend - bufptr + 1); bufptr += strlen(temp); @@ -435,23 +441,26 @@ _ippAttrString(ipp_attribute_t *attr, /* I - Attribute */ case IPP_TAG_LANGUAGE : case IPP_TAG_TEXTLANG : case IPP_TAG_NAMELANG : + if (!val->string.text) + break; + for (ptr = val->string.text; *ptr; ptr ++) { if (*ptr == '\\' || *ptr == '\"') { - if (bufptr < bufend) + if (buffer && bufptr < bufend) *bufptr = '\\'; bufptr ++; } - if (bufptr < bufend) + if (buffer && bufptr < bufend) *bufptr = *ptr; bufptr ++; } break; case IPP_TAG_BEGIN_COLLECTION : - if (bufptr < bufend) + if (buffer && bufptr < bufend) bufptr += ipp_col_string(val->collection, bufptr, bufend - bufptr + 1); else @@ -461,19 +470,19 @@ _ippAttrString(ipp_attribute_t *attr, /* I - Attribute */ case IPP_TAG_STRING : for (ptr = val->string.text; *ptr; ptr ++) { - if (*ptr == '\\' || isspace(*ptr & 255)) + if (*ptr == '\\' || _cups_isspace(*ptr)) { - if (bufptr < bufend) + if (buffer && bufptr < bufend) *bufptr = '\\'; bufptr ++; - if (bufptr < bufend) + if (buffer && bufptr < bufend) *bufptr = *ptr; bufptr ++; } else if (!isprint(*ptr & 255)) { - if (bufptr < bufend) + if (buffer && bufptr < bufend) bufptr += snprintf(bufptr, bufend - bufptr + 1, "\\%03o", *ptr & 255); else @@ -482,7 +491,7 @@ _ippAttrString(ipp_attribute_t *attr, /* I - Attribute */ } else { - if (bufptr < bufend) + if (buffer && bufptr < bufend) *bufptr = *ptr; bufptr ++; } @@ -491,14 +500,14 @@ _ippAttrString(ipp_attribute_t *attr, /* I - Attribute */ default : ptr = ippTagString(attr->value_tag); - if (bufptr < bufend) + if (buffer && bufptr < bufend) strlcpy(bufptr, ptr, bufend - bufptr + 1); bufptr += strlen(ptr); break; } } - if (bufptr < bufend) + if (buffer && bufptr < bufend) *bufptr = '\0'; else if (bufend) *bufend = '\0'; @@ -531,6 +540,8 @@ ippErrorString(ipp_status_t error) /* I - Error status */ return (ipp_status_400s[error - IPP_BAD_REQUEST]); else if (error >= IPP_INTERNAL_ERROR && error <= IPP_PRINTER_IS_DEACTIVATED) return (ipp_status_500s[error - IPP_INTERNAL_ERROR]); + else if (error >= IPP_AUTHORIZATION_CANCELED && error <= IPP_UPGRADE_REQUIRED) + return (ipp_status_1000s[error - IPP_AUTHORIZATION_CANCELED]); /* * No, build an "unknown-xxxx" error string... @@ -572,6 +583,10 @@ ippErrorValue(const char *name) /* I - Name */ if (!strcasecmp(name, ipp_status_500s[i])) return ((ipp_status_t)(i + 0x500)); + for (i = 0; i < (sizeof(ipp_status_1000s) / sizeof(ipp_status_1000s[0])); i ++) + if (!strcasecmp(name, ipp_status_1000s[i])) + return ((ipp_status_t)(i + 0x1000)); + return ((ipp_status_t)-1); } diff --git a/cups/ipp.h b/cups/ipp.h index 4f3dd5eec..e639d8ee8 100644 --- a/cups/ipp.h +++ b/cups/ipp.h @@ -310,7 +310,11 @@ typedef enum ipp_status_e /**** IPP status codes ****/ IPP_PRINTER_BUSY, /* server-error-busy */ 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_PRINTER_IS_DEACTIVATED, /* server-error-printer-is-deactivated */ + + IPP_AUTHORIZATION_CANCELED = 0x1000, /* Authorization canceled by user @since CUPS 1.4@ */ + IPP_PKI_ERROR, /* Error negotiating a secure connection @since CUPS 1.5@ */ + IPP_UPGRADE_REQUIRED /* TLS upgrade required */ } ipp_status_t; #define IPP_ERROR_JOB_CANCELLED IPP_ERROR_JOB_CANCELED diff --git a/cups/language.c b/cups/language.c index 38f8e5ae0..a4b2507c0 100644 --- a/cups/language.c +++ b/cups/language.c @@ -492,7 +492,7 @@ cupsLangGet(const char *language) /* I - Language or locale */ */ for (ptr = charset, csptr ++; *csptr; csptr ++) - if (ptr < (charset + sizeof(charset) - 1) && isalnum(*csptr & 255)) + if (ptr < (charset + sizeof(charset) - 1) && _cups_isalnum(*csptr)) *ptr++ = *csptr; *ptr = '\0'; @@ -552,7 +552,7 @@ cupsLangGet(const char *language) /* I - Language or locale */ */ for (ptr = charset; *csptr; csptr ++) - if (isalnum(*csptr & 255) && ptr < (charset + sizeof(charset) - 1)) + if (_cups_isalnum(*csptr) && ptr < (charset + sizeof(charset) - 1)) *ptr++ = *csptr; *ptr = '\0'; @@ -619,7 +619,7 @@ cupsLangGet(const char *language) /* I - Language or locale */ */ for (language ++, ptr = charset; *language; language ++) - if (isalnum(*language & 255) && ptr < (charset + sizeof(charset) - 1)) + if (_cups_isalnum(*language) && ptr < (charset + sizeof(charset) - 1)) *ptr++ = toupper(*language & 255); *ptr = '\0'; diff --git a/cups/libcups2.def b/cups/libcups2.def index 722a8ad95..a34c70032 100644 --- a/cups/libcups2.def +++ b/cups/libcups2.def @@ -1,5 +1,5 @@ LIBRARY libcups2 -VERSION 2.8 +VERSION 2.9 EXPORTS _cupsGetPassword _cupsGlobals @@ -154,6 +154,7 @@ cupsRemoveOption cupsResolveConflicts cupsSendRequest cupsServer +cupsSetCredentials cupsSetDests cupsSetDests2 cupsSetEncryption @@ -168,6 +169,7 @@ cupsUTF8ToCharset cupsUTF8ToUTF32 cupsUser cupsWriteRequestData +httpAddCredential httpAddrAny httpAddrConnect httpAddrEqual @@ -186,6 +188,7 @@ httpClearFields httpClose httpConnect httpConnectEncrypt +httpCopyCredentials httpDecode64 httpDecode64_2 httpDelete @@ -195,6 +198,7 @@ httpEncryption httpError httpFlush httpFlushWrite +httpFreeCredentials httpGet httpGetBlocking httpGetCookie @@ -227,6 +231,7 @@ httpSeparate httpSeparate2 httpSeparateURI httpSetCookie +httpSetCredentials httpSetExpect httpSetField httpSetLength diff --git a/cups/localize.c b/cups/localize.c index cd165a10c..25b068a98 100644 --- a/cups/localize.c +++ b/cups/localize.c @@ -387,7 +387,7 @@ ppdLocalizeIPPReason( valptr += 5; - while (*valptr && !isspace(*valptr & 255) && bufptr < bufend) + while (*valptr && !_cups_isspace(*valptr) && bufptr < bufend) { if (*valptr == '%' && isxdigit(valptr[1] & 255) && isxdigit(valptr[2] & 255)) @@ -425,7 +425,7 @@ ppdLocalizeIPPReason( * Skip this URI... */ - while (*valptr && !isspace(*valptr & 255)) + while (*valptr && !_cups_isspace(*valptr)) valptr++; } @@ -433,7 +433,7 @@ ppdLocalizeIPPReason( * Skip whitespace... */ - while (isspace(*valptr & 255)) + while (_cups_isspace(*valptr)) valptr ++; } @@ -461,7 +461,7 @@ ppdLocalizeIPPReason( * Copy URI... */ - while (*valptr && !isspace(*valptr & 255) && bufptr < bufend) + while (*valptr && !_cups_isspace(*valptr) && bufptr < bufend) *bufptr++ = *valptr++; *bufptr = '\0'; @@ -474,7 +474,7 @@ ppdLocalizeIPPReason( * Skip this URI... */ - while (*valptr && !isspace(*valptr & 255)) + while (*valptr && !_cups_isspace(*valptr)) valptr++; } @@ -482,7 +482,7 @@ ppdLocalizeIPPReason( * Skip whitespace... */ - while (isspace(*valptr & 255)) + while (_cups_isspace(*valptr)) valptr ++; } @@ -596,7 +596,7 @@ _ppdGetLanguages(ppd_file_t *ppd) /* I - PPD file */ * Skip leading whitespace... */ - while (isspace(*ptr & 255)) + while (_cups_isspace(*ptr)) ptr ++; if (!*ptr) @@ -606,7 +606,7 @@ _ppdGetLanguages(ppd_file_t *ppd) /* I - PPD file */ * Find the end of this language name... */ - for (start = ptr; *ptr && !isspace(*ptr & 255); ptr ++); + for (start = ptr; *ptr && !_cups_isspace(*ptr); ptr ++); if (*ptr) *ptr++ = '\0'; diff --git a/cups/mark.c b/cups/mark.c index 648e8f28b..21d41d176 100644 --- a/cups/mark.c +++ b/cups/mark.c @@ -461,7 +461,10 @@ ppdMarkDefaults(ppd_file_t *ppd) /* I - PPD file record */ for (c = (ppd_choice_t *)cupsArrayFirst(ppd->marked); c; c = (ppd_choice_t *)cupsArrayNext(ppd->marked)) + { cupsArrayRemove(ppd->marked, c); + c->marked = 0; + } /* * Then repopulate it with the defaults... @@ -560,7 +563,7 @@ _ppdParseOptions( cups_option_t **options, /* IO - Options */ _ppd_parse_t which) /* I - What to parse */ { - char option[PPD_MAX_NAME + 1], /* Current option/property */ + char option[PPD_MAX_NAME * 2 + 1], /* Current option/property */ choice[PPD_MAX_NAME], /* Current choice/value */ *ptr; /* Pointer into option or choice */ @@ -579,7 +582,7 @@ _ppdParseOptions( * Skip leading whitespace... */ - while (isspace(*s & 255)) + while (_cups_isspace(*s)) s ++; /* @@ -587,10 +590,10 @@ _ppdParseOptions( */ ptr = option; - while (*s && !isspace(*s & 255) && ptr < (option + sizeof(option) - 1)) + while (*s && !_cups_isspace(*s) && ptr < (option + sizeof(option) - 1)) *ptr++ = *s++; - if (ptr == s || !isspace(*s & 255)) + if (ptr == s || !_cups_isspace(*s)) break; *ptr = '\0'; @@ -599,17 +602,17 @@ _ppdParseOptions( * Get the choice... */ - while (isspace(*s & 255)) + while (_cups_isspace(*s)) s ++; if (!*s) break; ptr = choice; - while (*s && !isspace(*s & 255) && ptr < (choice + sizeof(choice) - 1)) + while (*s && !_cups_isspace(*s) && ptr < (choice + sizeof(choice) - 1)) *ptr++ = *s++; - if (!isspace(*s & 255) && *s) + if (*s && !_cups_isspace(*s)) break; *ptr = '\0'; diff --git a/cups/options.c b/cups/options.c index db82637ea..01845c75f 100644 --- a/cups/options.c +++ b/cups/options.c @@ -30,9 +30,7 @@ * Include necessary headers... */ -#include "cups.h" -#include "string-private.h" -#include "debug-private.h" +#include "cups-private.h" /* @@ -283,7 +281,7 @@ cupsParseOptions( * Skip leading spaces... */ - while (isspace(*ptr & 255)) + while (_cups_isspace(*ptr)) ptr ++; /* @@ -297,7 +295,7 @@ cupsParseOptions( */ name = ptr; - while (!isspace(*ptr & 255) && *ptr != '=' && *ptr) + while (!strchr("\f\n\r\t\v =", *ptr) && *ptr) ptr ++; /* @@ -311,7 +309,7 @@ cupsParseOptions( * Skip trailing spaces... */ - while (isspace(*ptr & 255)) + while (_cups_isspace(*ptr)) *ptr++ = '\0'; if ((sep = *ptr) == '=') @@ -340,7 +338,7 @@ cupsParseOptions( value = ptr; - while (*ptr && !isspace(*ptr & 255)) + while (*ptr && !_cups_isspace(*ptr)) { if (*ptr == ',') ptr ++; @@ -395,7 +393,7 @@ cupsParseOptions( * Normal space-delimited string... */ - while (!isspace(*ptr & 255) && *ptr) + while (*ptr && !_cups_isspace(*ptr)) { if (*ptr == '\\' && ptr[1]) _cups_strcpy(ptr, ptr + 1); @@ -414,7 +412,7 @@ cupsParseOptions( * Skip trailing whitespace... */ - while (isspace(*ptr & 255)) + while (_cups_isspace(*ptr)) ptr ++; /* @@ -539,7 +537,7 @@ _cupsGet1284Values( num_values = 0; while (*device_id) { - while (isspace(*device_id & 255)) + while (_cups_isspace(*device_id)) device_id ++; if (!*device_id) @@ -552,13 +550,13 @@ _cupsGet1284Values( if (!*device_id) break; - while (ptr > key && isspace(ptr[-1] & 255)) + while (ptr > key && _cups_isspace(ptr[-1])) ptr --; *ptr = '\0'; device_id ++; - while (isspace(*device_id & 255)) + while (_cups_isspace(*device_id)) device_id ++; if (!*device_id) @@ -571,7 +569,7 @@ _cupsGet1284Values( if (!*device_id) break; - while (ptr > value && isspace(ptr[-1] & 255)) + while (ptr > value && _cups_isspace(ptr[-1])) ptr --; *ptr = '\0'; diff --git a/cups/page.c b/cups/page.c index d240a407e..e82146616 100644 --- a/cups/page.c +++ b/cups/page.c @@ -136,10 +136,10 @@ ppdPageSize(ppd_file_t *ppd, /* I - PPD file record */ if ((coption = ppdFindCustomOption(ppd, "PageSize")) != NULL) { if ((cparam = ppdFindCustomParam(coption, "Width")) != NULL) - cparam->current.custom_points = w; + cparam->current.custom_points = (float)w; if ((cparam = ppdFindCustomParam(coption, "Height")) != NULL) - cparam->current.custom_points = l; + cparam->current.custom_points = (float)l; } /* diff --git a/cups/ppd-private.h b/cups/ppd-private.h index b5a769b49..d44c1ca04 100644 --- a/cups/ppd-private.h +++ b/cups/ppd-private.h @@ -148,7 +148,6 @@ extern const char *_pwgGetSource(_pwg_t *pwg, const char *input_slot); extern const char *_pwgGetType(_pwg_t *pwg, const char *media_type); extern const char *_pwgInputSlotForSource(const char *media_source, char *name, size_t namesize); -extern _pwg_media_t *_pwgMediaForPPD(const char *ppd); extern const char *_pwgMediaTypeForType(const char *media_type, char *name, size_t namesize); extern const char *_pwgPageSizeForMedia(_pwg_media_t *media, diff --git a/cups/ppd.c b/cups/ppd.c index f360134e0..bfcb2ff1c 100644 --- a/cups/ppd.c +++ b/cups/ppd.c @@ -663,6 +663,8 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ goto error; } + else if (!string) + continue; /* * Certain main keywords (as defined by the PPD spec) may be used @@ -1255,7 +1257,7 @@ ppdOpen2(cups_file_t *fp) /* I - File to read from */ if (name[0] == '*') _cups_strcpy(name, name + 1); /* Eliminate leading asterisk */ - for (i = (int)strlen(name) - 1; i > 0 && isspace(name[i] & 255); i --) + for (i = (int)strlen(name) - 1; i > 0 && _cups_isspace(name[i]); i --) name[i] = '\0'; /* Eliminate trailing spaces */ DEBUG_printf(("2ppdOpen2: OpenUI of %s in group %s...", name, @@ -2355,7 +2357,7 @@ ppd_decode(char *string) /* I - String to decode */ inptr ++; while (isxdigit(*inptr & 255)) { - if (isalpha(*inptr)) + if (_cups_isalpha(*inptr)) *outptr = (tolower(*inptr) - 'a' + 10) << 4; else *outptr = (*inptr - '0') << 4; @@ -2365,7 +2367,7 @@ ppd_decode(char *string) /* I - String to decode */ if (!isxdigit(*inptr & 255)) break; - if (isalpha(*inptr)) + if (_cups_isalpha(*inptr)) *outptr |= tolower(*inptr) - 'a' + 10; else *outptr |= *inptr - '0'; @@ -2996,7 +2998,7 @@ ppd_read(cups_file_t *fp, /* I - File to read from */ */ for (lineptr = line->buffer; *lineptr; lineptr ++) - if (!isspace(*lineptr & 255)) + if (*lineptr && !_cups_isspace(*lineptr)) break; if (*lineptr) @@ -3016,7 +3018,7 @@ ppd_read(cups_file_t *fp, /* I - File to read from */ keyptr = keyword; - while (*lineptr != '\0' && *lineptr != ':' && !isspace(*lineptr & 255)) + while (*lineptr && *lineptr != ':' && !_cups_isspace(*lineptr)) { if (*lineptr <= ' ' || *lineptr > 126 || *lineptr == '/' || (keyptr - keyword) >= (PPD_MAX_NAME - 1)) @@ -3035,18 +3037,18 @@ ppd_read(cups_file_t *fp, /* I - File to read from */ mask |= PPD_KEYWORD; - if (isspace(*lineptr & 255)) + if (_cups_isspace(*lineptr)) { /* * Get an option name... */ - while (isspace(*lineptr & 255)) + while (_cups_isspace(*lineptr)) lineptr ++; optptr = option; - while (*lineptr != '\0' && !isspace(*lineptr & 255) && *lineptr != ':' && + while (*lineptr && !_cups_isspace(*lineptr) && *lineptr != ':' && *lineptr != '/') { if (*lineptr <= ' ' || *lineptr > 126 || @@ -3061,13 +3063,13 @@ ppd_read(cups_file_t *fp, /* I - File to read from */ *optptr = '\0'; - if (isspace(*lineptr & 255) && cg->ppd_conform == PPD_CONFORM_STRICT) + if (_cups_isspace(*lineptr) && cg->ppd_conform == PPD_CONFORM_STRICT) { cg->ppd_status = PPD_ILLEGAL_WHITESPACE; return (0); } - while (isspace(*lineptr & 255)) + while (_cups_isspace(*lineptr)) lineptr ++; mask |= PPD_OPTION; @@ -3107,13 +3109,13 @@ ppd_read(cups_file_t *fp, /* I - File to read from */ } } - if (isspace(*lineptr & 255) && cg->ppd_conform == PPD_CONFORM_STRICT) + if (_cups_isspace(*lineptr) && cg->ppd_conform == PPD_CONFORM_STRICT) { cg->ppd_status = PPD_ILLEGAL_WHITESPACE; return (0); } - while (isspace(*lineptr & 255)) + while (_cups_isspace(*lineptr)) lineptr ++; if (*lineptr == ':') @@ -3123,11 +3125,11 @@ ppd_read(cups_file_t *fp, /* I - File to read from */ */ lineptr ++; - while (isspace(*lineptr & 255)) + while (_cups_isspace(*lineptr)) lineptr ++; strptr = lineptr + strlen(lineptr) - 1; - while (strptr >= lineptr && isspace(*strptr & 255)) + while (strptr >= lineptr && _cups_isspace(*strptr)) *strptr-- = '\0'; if (*strptr == '\"') diff --git a/cups/pwg-media.c b/cups/pwg-media.c index 909c90a8e..8e00ca031 100644 --- a/cups/pwg-media.c +++ b/cups/pwg-media.c @@ -60,26 +60,26 @@ static int pwg_compare_ppd(_pwg_media_t *a, _pwg_media_t *b); static _pwg_media_t const cups_pwg_media[] = { /* Media size lookup table */ /* North American Standard Sheet Media Sizes */ - _PWG_MEDIA_IN("na_index-3x5_3x5in", NULL, NULL, 3, 5), + _PWG_MEDIA_IN("na_index-3x5_3x5in", NULL, "3x5", 3, 5), _PWG_MEDIA_IN("na_personal_3.625x6.5in", NULL, "EnvPersonal", 3.625, 6.5), _PWG_MEDIA_IN("na_monarch_3.875x7.5in", "monarch-envelope", "EnvMonarch", 3.875, 7.5), _PWG_MEDIA_IN("na_number-9_3.875x8.875in", "na-number-9-envelope", "Env9", 3.875, 8.875), - _PWG_MEDIA_IN("na_index-4x6_4x6in", NULL, NULL, 4, 6), + _PWG_MEDIA_IN("na_index-4x6_4x6in", NULL, "4x6", 4, 6), _PWG_MEDIA_IN("na_number-10_4.125x9.5in", "na-number-10-envelope", "Env10", 4.125, 9.5), _PWG_MEDIA_IN("na_a2_4.375x5.75in", NULL, NULL, 4.375, 5.75), _PWG_MEDIA_IN("na_number-11_4.5x10.375in", NULL, "Env11", 4.5, 10.375), _PWG_MEDIA_IN("na_number-12_4.75x11in", NULL, "Env12", 4.75, 11), - _PWG_MEDIA_IN("na_5x7_5x7in", NULL, NULL, 5, 7), - _PWG_MEDIA_IN("na_index-5x8_5x8in", NULL, NULL, 5, 8), + _PWG_MEDIA_IN("na_5x7_5x7in", NULL, "5x7", 5, 7), + _PWG_MEDIA_IN("na_index-5x8_5x8in", NULL, "5x8", 5, 8), _PWG_MEDIA_IN("na_number-14_5x11.5in", NULL, "Env14", 5, 11.5), _PWG_MEDIA_IN("na_invoice_5.5x8.5in", "invoice", "Statement", 5.5, 8.5), _PWG_MEDIA_IN("na_index-4x6-ext_6x8in", NULL, NULL, 6, 8), - _PWG_MEDIA_IN("na_6x9_6x9in", "na-6x9-envelope", NULL, 6, 9), - _PWG_MEDIA_IN("na_c5_6.5x9.5in", NULL, NULL, 6.5, 9.5), + _PWG_MEDIA_IN("na_6x9_6x9in", "na-6x9-envelope", "6x9", 6, 9), + _PWG_MEDIA_IN("na_c5_6.5x9.5in", NULL, "6.5x9.5", 6.5, 9.5), _PWG_MEDIA_IN("na_7x9_7x9in", "na-7x9-envelope", "7x9", 7, 9), _PWG_MEDIA_IN("na_executive_7.25x10.5in", "executive", "Executive", 7.25, 10.5), _PWG_MEDIA_IN("na_govt-letter_8x10in", "na-8x10", "8x10", 8, 10), - _PWG_MEDIA_IN("na_govt-legal_8x13in", NULL, NULL, 8, 13), + _PWG_MEDIA_IN("na_govt-legal_8x13in", NULL, "8x13", 8, 13), _PWG_MEDIA_IN("na_quarto_8.5x10.83in", "quarto", "Quarto", 8.5, 10.83), _PWG_MEDIA_IN("na_letter_8.5x11in", "na-letter", "Letter", 8.5, 11), _PWG_MEDIA_IN("na_fanfold-eur_8.5x12in", NULL, "FanFoldGerman", 8.5, 12), @@ -94,15 +94,15 @@ static _pwg_media_t const cups_pwg_media[] = _PWG_MEDIA_IN("na_10x11_10x11in", NULL, "10x11", 10, 11), _PWG_MEDIA_IN("na_10x13_10x13in", "na-10x13-envelope", "10x13", 10, 13), _PWG_MEDIA_IN("na_10x14_10x14in", "na-10x14-envelope", "10x14", 10, 14), - _PWG_MEDIA_IN("na_10x15_10x15in", "na-10x15-envelope", NULL, 10, 15), - _PWG_MEDIA_IN("na_11x12_11x12in", NULL, NULL, 11, 12), - _PWG_MEDIA_IN("na_edp_11x14in", NULL, NULL, 11, 14), + _PWG_MEDIA_IN("na_10x15_10x15in", "na-10x15-envelope", "10x15", 10, 15), + _PWG_MEDIA_IN("na_11x12_11x12in", NULL, "11x12", 11, 12), + _PWG_MEDIA_IN("na_edp_11x14in", NULL, "11x14", 11, 14), _PWG_MEDIA_IN("na_fanfold-us_11x14.875in", NULL, NULL, 11, 14.875), - _PWG_MEDIA_IN("na_11x15_11x15in", NULL, NULL, 11, 15), + _PWG_MEDIA_IN("na_11x15_11x15in", NULL, "11x15", 11, 15), _PWG_MEDIA_IN("na_ledger_11x17in", "tabloid", "Tabloid", 11, 17), _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, NULL, 12, 19), + _PWG_MEDIA_IN("na_12x19_12x19in", NULL, "12x19", 12, 19), _PWG_MEDIA_IN("na_b-plus_12x19.17in", NULL, "SuperB", 12, 19.17), _PWG_MEDIA_IN("na_super-b_13x19in", "super-b", NULL, 13, 19), _PWG_MEDIA_IN("na_c_17x22in", "c", "AnsiC", 17, 22), @@ -113,7 +113,7 @@ static _pwg_media_t const cups_pwg_media[] = _PWG_MEDIA_IN("na_wide-format_30x42in", NULL, NULL, 30, 42), _PWG_MEDIA_IN("na_e_34x44in", "e", "AnsiE", 34, 44), _PWG_MEDIA_IN("na_arch-e_36x48in", "arch-e", "ARCHE", 36, 48), - _PWG_MEDIA_IN("na_f_44x68in", NULL, NULL, 44, 68), + _PWG_MEDIA_IN("na_f_44x68in", NULL, "AnsiF", 44, 68), /* Chinese Standard Sheet Media Inch Sizes */ _PWG_MEDIA_IN("roc_16k_7.75x10.75in", NULL, NULL, 7.75, 10.75), @@ -353,8 +353,8 @@ _pwgInitSize(_pwg_size_t *size, /* I - Size to initialize */ */ if ((media_size = ippFindAttribute(media_col->values[0].collection, - "media-size", - IPP_TAG_BEGIN_COLLECTION)) != NULL) + "media-size", + IPP_TAG_BEGIN_COLLECTION)) != NULL) { /* * Got media-size, look for x-dimension and y-dimension member @@ -417,12 +417,42 @@ _pwgInitSize(_pwg_size_t *size, /* I - Size to initialize */ else { if ((media = ippFindAttribute(job, "media", IPP_TAG_NAME)) == NULL) - media = ippFindAttribute(job, "media", IPP_TAG_KEYWORD); + if ((media = ippFindAttribute(job, "media", IPP_TAG_KEYWORD)) == NULL) + if ((media = ippFindAttribute(job, "PageSize", IPP_TAG_NAME)) == NULL) + media = ippFindAttribute(job, "PageRegion", IPP_TAG_NAME); if (media) { - if ((pwg = _pwgMediaForPWG(media->values[0].string.text)) == NULL) - pwg = _pwgMediaForLegacy(media->values[0].string.text); + const char *name = media->values[0].string.text; + /* Name string */ + + if ((pwg = _pwgMediaForPWG(name)) == NULL) + { + /* + * Not a PWG name, try a legacy name... + */ + + if ((pwg = _pwgMediaForLegacy(name)) == NULL) + { + /* + * Not a legacy name, try a PPD name... + */ + + const char *suffix; /* Suffix on media string */ + + pwg = _pwgMediaForPPD(name); + if (pwg && + (suffix = name + strlen(name) - 10 /* .FullBleed */) > name && + !strcasecmp(suffix, ".FullBleed")) + { + /* + * Indicate that margins are set with the default values of 0. + */ + + *margins_set = 1; + } + } + } if (pwg) { @@ -501,7 +531,8 @@ _pwgMediaForLegacy( _pwg_media_t * /* O - Matching size or NULL */ _pwgMediaForPPD(const char *ppd) /* I - PPD size name */ { - _pwg_media_t key; /* Search key */ + _pwg_media_t key, /* Search key */ + *size; /* Matching size */ _cups_globals_t *cg = _cupsGlobals(); /* Global data */ @@ -518,8 +549,7 @@ _pwgMediaForPPD(const char *ppd) /* I - PPD size name */ if (!cg->ppd_size_lut) { - int i; /* Looping var */ - _pwg_media_t *size; /* Current size */ + int i; /* Looping var */ cg->ppd_size_lut = cupsArrayNew((cups_array_func_t)pwg_compare_ppd, NULL); @@ -536,7 +566,96 @@ _pwgMediaForPPD(const char *ppd) /* I - PPD size name */ */ key.ppd = ppd; - return ((_pwg_media_t *)cupsArrayFind(cg->ppd_size_lut, &key)); + if ((size = (_pwg_media_t *)cupsArrayFind(cg->ppd_size_lut, &key)) == NULL) + { + /* + * See if the name is of the form: + * + * [Custom.]WIDTHxLENGTH[.FullBleed] - Size in points/inches [borderless] + * [Custom.]WIDTHxLENGTHcm[.FullBleed] - Size in centimeters [borderless] + * [Custom.]WIDTHxLENGTHft[.FullBleed] - Size in feet [borderless] + * [Custom.]WIDTHxLENGTHin[.FullBleed] - Size in inches [borderless] + * [Custom.]WIDTHxLENGTHm[.FullBleed] - Size in meters [borderless] + * [Custom.]WIDTHxLENGTHmm[.FullBleed] - Size in millimeters [borderless] + * [Custom.]WIDTHxLENGTHpt[.FullBleed] - Size in points [borderless] + */ + + double w, l, /* Width and length of page */ + factor; /* Unit scaling factor */ + char *ptr; /* Pointer into name */ + struct lconv *loc; /* Locale data */ + int custom; /* Custom page size? */ + + if (!strncasecmp(ppd, "Custom.", 7)) + { + custom = 1; + factor = 2540.0 / 72.0; + ptr = (char *)ppd + 7; + } + else + { + custom = 0; + factor = 2540.0; + ptr = (char *)ppd; + } + + loc = localeconv(); + w = _cupsStrScand(ptr, &ptr, loc); + + if (ptr && ptr > ppd && *ptr == 'x') + { + l = _cupsStrScand(ptr + 1, &ptr, loc); + + if (ptr && + (!*ptr || + !strcasecmp(ptr, "FullBleed") || + !strcasecmp(ptr, ".FullBleed") || + !strcasecmp(ptr, "cm") || + !strcasecmp(ptr, "cm.FullBleed") || + !strcasecmp(ptr, "ft") || + !strcasecmp(ptr, "ft.FullBleed") || + !strcasecmp(ptr, "in") || + !strcasecmp(ptr, "in.FullBleed") || + !strcasecmp(ptr, "m") || + !strcasecmp(ptr, "m.FullBleed") || + !strcasecmp(ptr, "mm") || + !strcasecmp(ptr, "mm.FullBleed") || + !strcasecmp(ptr, "pt") || + !strcasecmp(ptr, "pt.FullBleed"))) + { + size = &(cg->pwg_media); + + if (!strncasecmp(ptr, "cm", 2)) + factor = 1000.0; + else if (!strncasecmp(ptr, "ft", 2)) + factor = 2540.0 * 12.0; + else if (!strncasecmp(ptr, "in", 2)) + factor = 2540.0; + else if (!strncasecmp(ptr, "mm", 2)) + factor = 100.0; + else if (*ptr == 'm' || *ptr == 'M') + factor = 100000.0; + else if (!strncasecmp(ptr, "pt", 2)) + factor = 2540.0 / 72.0; + + /* + * Not a standard size; convert it to a PWG custom name of the form: + * + * [oe|om]_WIDTHxHEIGHTuu_WIDTHxHEIGHTuu + */ + + size->width = (int)(w * factor); + size->length = (int)(l * factor); + size->pwg = cg->pwg_name; + + _pwgGenerateSize(cg->pwg_name, sizeof(cg->pwg_name), + custom ? "custom" : NULL, custom ? ppd + 7 : NULL, + size->width, size->length); + } + } + } + + return (size); } @@ -547,7 +666,9 @@ _pwgMediaForPPD(const char *ppd) /* I - PPD size name */ _pwg_media_t * /* O - Matching size or NULL */ _pwgMediaForPWG(const char *pwg) /* I - PWG size name */ { - _pwg_media_t key; /* Search key */ + char *ptr; /* Pointer into name */ + _pwg_media_t key, /* Search key */ + *size; /* Matching size */ _cups_globals_t *cg = _cupsGlobals(); /* Global data */ @@ -564,8 +685,7 @@ _pwgMediaForPWG(const char *pwg) /* I - PWG size name */ if (!cg->pwg_size_lut) { - int i; /* Looping var */ - _pwg_media_t *size; /* Current size */ + int i; /* Looping var */ cg->pwg_size_lut = cupsArrayNew((cups_array_func_t)pwg_compare_pwg, NULL); @@ -581,7 +701,50 @@ _pwgMediaForPWG(const char *pwg) /* I - PWG size name */ */ key.pwg = pwg; - return ((_pwg_media_t *)cupsArrayFind(cg->pwg_size_lut, &key)); + if ((size = (_pwg_media_t *)cupsArrayFind(cg->pwg_size_lut, &key)) == NULL && + (ptr = (char *)strchr(pwg, '_')) != NULL && + (ptr = (char *)strchr(ptr + 1, '_')) != NULL) + { + /* + * Try decoding the self-describing name of the form: + * + * class_name_WWWxHHHin + * class_name_WWWxHHHmm + */ + + double w, l; /* Width and length of page */ + struct lconv *loc; /* Locale data */ + + ptr ++; + loc = localeconv(); + w = _cupsStrScand(ptr, &ptr, loc); + + if (ptr && *ptr == 'x') + { + l = _cupsStrScand(ptr + 1, &ptr, loc); + + if (ptr && (!strcmp(ptr, "in") || !strcmp(ptr, "mm"))) + { + size = &(cg->pwg_media); + + if (!strcmp(ptr, "mm")) + { + size->width = (int)(w * 100); + size->length = (int)(l * 100); + } + else + { + size->width = (int)(w * 2540); + size->length = (int)(l * 2540); + } + + strlcpy(cg->pwg_name, pwg, sizeof(cg->pwg_name)); + size->pwg = cg->pwg_name; + } + } + } + + return (size); } diff --git a/cups/pwg-ppd.c b/cups/pwg-ppd.c index 071eb7b17..9cd27f6e2 100644 --- a/cups/pwg-ppd.c +++ b/cups/pwg-ppd.c @@ -47,6 +47,13 @@ #include +/* + * Macro to test for two almost-equal PWG measurements. + */ + +#define _PWG_EQUIVALENT(x, y) (abs((x)-(y)) < 2) + + /* * Local functions... */ @@ -62,7 +69,7 @@ static void pwg_unppdize_name(const char *ppd, char *name, size_t namesize); _pwg_t * /* O - PWG mapping data */ _pwgCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */ { - int i, j; /* Looping vars */ + int i, j, k; /* Looping vars */ _pwg_t *pwg; /* PWG mapping data */ ppd_option_t *input_slot, /* InputSlot option */ *media_type, /* MediaType option */ @@ -85,6 +92,19 @@ _pwgCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */ _pwg_output_mode_t pwg_output_mode;/* output-mode index */ _pwg_print_quality_t pwg_print_quality; /* print-quality index */ + int similar; /* Are the old and new size similar? */ + _pwg_size_t *old_size; /* Current old size */ + int old_imageable, /* Old imageable length in 2540ths */ + old_borderless; /* Old borderless state */ + int new_width, /* New width in 2540ths */ + new_length, /* New length in 2540ths */ + new_left, /* New left margin in 2540ths */ + new_bottom, /* New bottom margin in 2540ths */ + new_right, /* New right margin in 2540ths */ + new_top, /* New top margin in 2540ths */ + new_imageable, /* New imageable length in 2540ths */ + new_borderless; /* New borderless state */ + _pwg_size_t *new_size; /* New size to add, if any */ DEBUG_printf(("_pwgCreateWithPPD(ppd=%p)", ppd)); @@ -133,7 +153,7 @@ _pwgCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */ if (!strcasecmp(ppd_size->name, "Custom")) continue; - + /* * Convert the PPD size name to the corresponding PWG keyword name. */ @@ -162,6 +182,7 @@ _pwgCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */ } else { + /* * Not a standard name; convert it to a PWG vendor name of the form: * @@ -177,20 +198,71 @@ _pwgCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */ } /* - * Save this size... + * If we have a similar paper with non-zero margins then we only + * want to keep it if it has a larger imageable area length. */ - pwg_size->map.ppd = _cupsStrAlloc(ppd_size->name); - pwg_size->map.pwg = _cupsStrAlloc(pwg_name); - pwg_size->width = _PWG_FROMPTS(ppd_size->width); - pwg_size->length = _PWG_FROMPTS(ppd_size->length); - pwg_size->left = _PWG_FROMPTS(ppd_size->left); - pwg_size->bottom = _PWG_FROMPTS(ppd_size->bottom); - pwg_size->right = _PWG_FROMPTS(ppd_size->width - ppd_size->right); - pwg_size->top = _PWG_FROMPTS(ppd_size->length - ppd_size->top); - - pwg->num_sizes ++; - pwg_size ++; + new_width = _PWG_FROMPTS(ppd_size->width); + new_length = _PWG_FROMPTS(ppd_size->length); + new_left = _PWG_FROMPTS(ppd_size->left); + new_bottom = _PWG_FROMPTS(ppd_size->bottom); + new_right = _PWG_FROMPTS(ppd_size->width - ppd_size->right); + new_top = _PWG_FROMPTS(ppd_size->length - ppd_size->top); + new_imageable = new_length - new_top - new_bottom; + new_borderless = new_bottom == 0 && new_top == 0 && + new_left == 0 && new_right == 0; + + for (k = pwg->num_sizes, similar = 0, old_size = pwg->sizes, new_size = NULL; + k > 0 && !similar; + k --, old_size ++) + { + old_imageable = old_size->length - old_size->top - old_size->bottom; + old_borderless = old_size->left == 0 && old_size->bottom == 0 && + old_size->right == 0 && old_size->top == 0; + + similar = old_borderless == new_borderless && + _PWG_EQUIVALENT(old_size->width, new_width) && + _PWG_EQUIVALENT(old_size->length, new_length); + + if (similar && new_imageable > old_imageable) + { + /* + * The new paper has a larger imageable area so it will replace + * the older paper. + */ + + new_size = old_size; + _cupsStrFree(old_size->map.ppd); + _cupsStrFree(old_size->map.pwg); + } + } + + if (!similar) + { + /* + * The paper was unique enough to deserve its own entry so add it to the + * end. + */ + + new_size = pwg_size ++; + pwg->num_sizes ++; + } + + if (new_size) + { + /* + * Save this size... + */ + + new_size->map.ppd = _cupsStrAlloc(ppd_size->name); + new_size->map.pwg = _cupsStrAlloc(pwg_name); + new_size->width = new_width; + new_size->length = new_length; + new_size->left = new_left; + new_size->bottom = new_bottom; + new_size->right = new_right; + new_size->top = new_top; + } } if (ppd->variable_sizes) @@ -387,7 +459,9 @@ _pwgCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */ const char *quality, /* com.apple.print.preset.quality value */ *output_mode, /* com.apple.print.preset.output-mode value */ - *color_model_val; /* ColorModel choice */ + *color_model_val, /* ColorModel choice */ + *graphics_type, /* com.apple.print.preset.graphicsType value */ + *paper_coating; /* com.apple.print.preset.media-front-coating value */ do @@ -409,6 +483,31 @@ _pwgCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */ else pwg_print_quality = _PWG_PRINT_QUALITY_NORMAL; + /* + * Ignore graphicsType "Photo" presets that are not high quality. + */ + + graphics_type = cupsGetOption("com.apple.print.preset.graphicsType", + num_options, options); + + if (pwg_print_quality != _PWG_PRINT_QUALITY_HIGH && graphics_type && + !strcmp(graphics_type, "Photo")) + continue; + + /* + * Ignore presets for normal and draft quality where the coating + * isn't "none" or "autodetect". + */ + + paper_coating = cupsGetOption( + "com.apple.print.preset.media-front-coating", + num_options, options); + + if (pwg_print_quality != _PWG_PRINT_QUALITY_HIGH && paper_coating && + strcmp(paper_coating, "none") && + strcmp(paper_coating, "autodetect")) + continue; + /* * Get the output mode for this preset... */ @@ -804,6 +903,7 @@ _pwgGetPageSize(_pwg_t *pwg, /* I - PWG mapping data */ dtop, /* Difference in top margins */ dmin, /* Minimum difference */ dclosest; /* Closest difference */ + const char *ppd_name; /* PPD media name */ /* @@ -816,6 +916,36 @@ _pwgGetPageSize(_pwg_t *pwg, /* I - PWG mapping data */ if (exact) *exact = 0; + ppd_name = keyword; + + if (job) + { + /* + * Try getting the PPD media name from the job attributes... + */ + + ipp_attribute_t *attr; /* Job attribute */ + + if ((attr = ippFindAttribute(job, "PageSize", IPP_TAG_ZERO)) == NULL) + if ((attr = ippFindAttribute(job, "PageRegion", IPP_TAG_ZERO)) == NULL) + attr = ippFindAttribute(job, "media", IPP_TAG_ZERO); + + if (attr && (attr->value_tag == IPP_TAG_NAME || + attr->value_tag == IPP_TAG_KEYWORD)) + ppd_name = attr->values[0].string.text; + } + + if (ppd_name) + { + /* + * Try looking up the named PPD size first... + */ + + for (i = pwg->num_sizes, size = pwg->sizes; i > 0; i --, size ++) + if (!strcasecmp(ppd_name, size->map.ppd)) + return (ppd_name); + } + if (job && !keyword) { /* @@ -837,7 +967,8 @@ _pwgGetPageSize(_pwg_t *pwg, /* I - PWG mapping data */ if ((media = _pwgMediaForPWG(keyword)) == NULL) if ((media = _pwgMediaForLegacy(keyword)) == NULL) - return (NULL); + if ((media = _pwgMediaForPPD(keyword)) == NULL) + return (NULL); jobsize.width = media->width; jobsize.length = media->length; @@ -1223,7 +1354,7 @@ _pwgPageSizeForMedia( else if (!media->pwg || !strncmp(media->pwg, "custom_", 7) || (sizeptr = strchr(media->pwg, '_')) == NULL || (dimptr = strchr(sizeptr + 1, '_')) == NULL || - (dimptr - sizeptr) > namesize) + (size_t)(dimptr - sizeptr) > namesize) { /* * Use a name of the form "wNNNhNNN"... @@ -1263,7 +1394,7 @@ pwg_ppdize_name(const char *ipp, /* I - IPP keyword */ for (ptr = name + 1, end = name + namesize - 1; *ipp && ptr < end;) { - if (*ipp == '-' && isalpha(ipp[1] & 255)) + if (*ipp == '-' && _cups_isalpha(ipp[1])) { ipp ++; *ptr++ = toupper(*ipp++ & 255); @@ -1291,13 +1422,13 @@ pwg_unppdize_name(const char *ppd, /* I - PPD keyword */ for (ptr = name, end = name + namesize - 1; *ppd && ptr < end; ppd ++) { - if (isalnum(*ppd & 255) || *ppd == '-' || *ppd == '.') + if (_cups_isalnum(*ppd) || *ppd == '-') *ptr++ = tolower(*ppd & 255); - else if (*ppd == '_') + else if (*ppd == '_' || *ppd == '.') *ptr++ = '-'; - if (!isupper(*ppd & 255) && isalnum(*ppd & 255) && - isupper(ppd[1] & 255) && ptr < end) + if (!_cups_isupper(*ppd) && _cups_isalnum(*ppd) && + _cups_isupper(ppd[1]) && ptr < end) *ptr++ = '-'; } diff --git a/cups/pwg-private.h b/cups/pwg-private.h index 33a0790af..41849b48c 100644 --- a/cups/pwg-private.h +++ b/cups/pwg-private.h @@ -86,6 +86,7 @@ extern void _pwgGenerateSize(char *keyword, size_t keysize, extern int _pwgInitSize(_pwg_size_t *size, ipp_t *job, int *margins_set); extern _pwg_media_t *_pwgMediaForLegacy(const char *legacy); +extern _pwg_media_t *_pwgMediaForPPD(const char *ppd); extern _pwg_media_t *_pwgMediaForPWG(const char *pwg); extern _pwg_media_t *_pwgMediaForSize(int width, int length); diff --git a/cups/request.c b/cups/request.c index 4285eeb87..3320131fb 100644 --- a/cups/request.c +++ b/cups/request.c @@ -438,7 +438,7 @@ cupsGetResponse(http_t *http, /* I - Connection to server or @code CUPS_HTTP DEBUG_puts("2cupsGetResponse: Need authorization..."); if (!cupsDoAuthentication(http, "POST", resource)) - httpReconnect(http); + httpReconnect(http); else status = HTTP_AUTHORIZATION_CANCELED; } @@ -969,10 +969,13 @@ _cupsSetHTTPError(http_status_t status) /* I - HTTP status code */ break; case HTTP_UNAUTHORIZED : - case HTTP_AUTHORIZATION_CANCELED : _cupsSetError(IPP_NOT_AUTHORIZED, httpStatus(status), 0); break; + case HTTP_AUTHORIZATION_CANCELED : + _cupsSetError(IPP_AUTHORIZATION_CANCELED, httpStatus(status), 0); + break; + case HTTP_FORBIDDEN : _cupsSetError(IPP_FORBIDDEN, httpStatus(status), 0); break; @@ -993,6 +996,14 @@ _cupsSetHTTPError(http_status_t status) /* I - HTTP status code */ _cupsSetError(IPP_VERSION_NOT_SUPPORTED, httpStatus(status), 0); break; + case HTTP_UPGRADE_REQUIRED : + _cupsSetError(IPP_UPGRADE_REQUIRED, httpStatus(status), 0); + break; + + case HTTP_PKI_ERROR : + _cupsSetError(IPP_PKI_ERROR, httpStatus(status), 0); + break; + default : DEBUG_printf(("4_cupsSetHTTPError: HTTP error %d mapped to " "IPP_SERVICE_UNAVAILABLE!", status)); diff --git a/cups/string-private.h b/cups/string-private.h index d542d89af..9c3acd324 100644 --- a/cups/string-private.h +++ b/cups/string-private.h @@ -79,6 +79,62 @@ typedef struct _cups_sp_item_s /**** String Pool Item ****/ } _cups_sp_item_t; +/* + * Replacements for the ctype macros that are not affected by locale, since we + * really only care about testing for ASCII characters when parsing files, etc. + * These are used only within libcups since the rest of CUPS doesn't call + * setlocale() for LC_CTYPE and doesn't have to worry about third-party + * libraries doing so (and if they do that is a bug: NetSNMP, I'm looking at + * you!) + * + * The _CUPS_INLINE definition controls whether we get an inline function body, + * and external function body, or an external definition. + */ + +# if defined(__GNUC__) || __STDC_VERSION__ >= 199901L +# define _CUPS_INLINE static inline +# elif defined(_MSC_VER) +# define _CUPS_INLINE static __inline +# elif defined(_CUPS_STRING_C_) +# define _CUPS_INLINE +# endif /* __GNUC__ || __STDC_VERSION__ */ + +# ifdef _CUPS_INLINE +_CUPS_INLINE int /* O - 1 on match, 0 otherwise */ +_cups_isalnum(int ch) /* I - Character to test */ +{ + return ((ch >= '0' && ch <= '9') || + (ch >= 'A' && ch <= 'Z') || + (ch >= 'a' && ch <= 'z')); +} + +_CUPS_INLINE int /* O - 1 on match, 0 otherwise */ +_cups_isalpha(int ch) /* I - Character to test */ +{ + return ((ch >= 'A' && ch <= 'Z') || + (ch >= 'a' && ch <= 'z')); +} + +_CUPS_INLINE int /* O - 1 on match, 0 otherwise */ +_cups_isspace(int ch) /* I - Character to test */ +{ + return (ch == ' ' || ch == '\f' || ch == '\n' || ch == '\r' || ch == '\t' || + ch == '\v'); +} + +_CUPS_INLINE int /* O - 1 on match, 0 otherwise */ +_cups_isupper(int ch) /* I - Character to test */ +{ + return (ch >= 'A' && ch <= 'Z'); +} +# else +extern int _cups_isalnum(int ch); +extern int _cups_isalpha(int ch); +extern int _cups_isspace(int ch); +extern int _cups_isupper(int ch); +# endif /* _CUPS_INLINE */ + + /* * Prototypes... */ diff --git a/cups/string.c b/cups/string.c index 96f6728a8..f40f5f5fb 100644 --- a/cups/string.c +++ b/cups/string.c @@ -36,6 +36,7 @@ * Include necessary headers... */ +#define _CUPS_STRING_C_ #include "string-private.h" #include "debug-private.h" #include "thread-private.h" @@ -401,7 +402,7 @@ _cupsStrScand(const char *buf, /* I - Pointer to number */ * Skip leading whitespace... */ - while (isspace(*buf & 255)) + while (_cups_isspace(*buf)) buf ++; /* diff --git a/cups/testfile.c b/cups/testfile.c index 74da14b64..fd0858dea 100644 --- a/cups/testfile.c +++ b/cups/testfile.c @@ -469,7 +469,7 @@ read_write_tests(int compression) /* I - Use compression? */ * Initialize the write buffer with random data... */ - CUPS_SRAND(time(NULL)); + CUPS_SRAND((unsigned)time(NULL)); for (i = 0; i < (int)sizeof(writebuf); i ++) writebuf[i] = CUPS_RAND(); diff --git a/cups/testhttp.c b/cups/testhttp.c index b4213d990..ccb7c19dd 100644 --- a/cups/testhttp.c +++ b/cups/testhttp.c @@ -93,6 +93,8 @@ static uri_test_t uri_tests[] = /* URI test data */ "http", "", "server", "/admin?DEVICE_URI=usb://HP/Photosmart%25202600%2520series?serial=MY53OK70V10400", 80, 0 }, { HTTP_URI_OK, "lpd://Acme%20Laser%20(01%3A23%3A45).local._tcp._printer/", "lpd", "", "Acme Laser (01:23:45).local._tcp._printer", "/", 515, 0 }, + { HTTP_URI_OK, "ipp://HP%20Officejet%204500%20G510n-z%20%40%20Will's%20MacBook%20Pro%2015%22._ipp._tcp.local./", + "ipp", "", "HP Officejet 4500 G510n-z @ Will's MacBook Pro 15\"._ipp._tcp.local.", "/", 631, 0 }, /* Missing scheme */ { HTTP_URI_MISSING_SCHEME, "/path/to/file/index.html", diff --git a/cups/testpwg.c b/cups/testpwg.c index 051d734cd..c77033613 100644 --- a/cups/testpwg.c +++ b/cups/testpwg.c @@ -94,6 +94,101 @@ main(int argc, /* I - Number of command-line args */ puts("PASS"); } + fputs("_pwgMediaForPWG(\"iso_a4_210x297mm\"): ", stdout); + if ((pwgmedia = _pwgMediaForPWG("iso_a4_210x297mm")) == NULL) + { + puts("FAIL (not found)"); + status ++; + } + else if (strcmp(pwgmedia->pwg, "iso_a4_210x297mm")) + { + printf("FAIL (%s)\n", pwgmedia->pwg); + status ++; + } + else if (pwgmedia->width != 21000 || pwgmedia->length != 29700) + { + printf("FAIL (%dx%d)\n", pwgmedia->width, pwgmedia->length); + status ++; + } + else + puts("PASS"); + + fputs("_pwgMediaForLegacy(\"na-letter\"): ", stdout); + if ((pwgmedia = _pwgMediaForLegacy("na-letter")) == NULL) + { + puts("FAIL (not found)"); + status ++; + } + else if (strcmp(pwgmedia->pwg, "na_letter_8.5x11in")) + { + printf("FAIL (%s)\n", pwgmedia->pwg); + status ++; + } + else if (pwgmedia->width != 21590 || pwgmedia->length != 27940) + { + printf("FAIL (%dx%d)\n", pwgmedia->width, pwgmedia->length); + status ++; + } + else + puts("PASS"); + + fputs("_pwgMediaForPPD(\"4x6\"): ", stdout); + if ((pwgmedia = _pwgMediaForPPD("4x6")) == NULL) + { + puts("FAIL (not found)"); + status ++; + } + else if (strcmp(pwgmedia->pwg, "na_index-4x6_4x6in")) + { + printf("FAIL (%s)\n", pwgmedia->pwg); + status ++; + } + else if (pwgmedia->width != 10160 || pwgmedia->length != 15240) + { + printf("FAIL (%dx%d)\n", pwgmedia->width, pwgmedia->length); + status ++; + } + else + puts("PASS"); + + fputs("_pwgMediaForPPD(\"10x15cm\"): ", stdout); + if ((pwgmedia = _pwgMediaForPPD("10x15cm")) == NULL) + { + puts("FAIL (not found)"); + status ++; + } + else if (strcmp(pwgmedia->pwg, "om_100x150mm_100x150mm")) + { + printf("FAIL (%s)\n", pwgmedia->pwg); + status ++; + } + else if (pwgmedia->width != 10000 || pwgmedia->length != 15000) + { + printf("FAIL (%dx%d)\n", pwgmedia->width, pwgmedia->length); + status ++; + } + else + puts("PASS"); + + fputs("_pwgMediaForPPD(\"Custom.10x15cm\"): ", stdout); + if ((pwgmedia = _pwgMediaForPPD("Custom.10x15cm")) == NULL) + { + puts("FAIL (not found)"); + status ++; + } + else if (strcmp(pwgmedia->pwg, "custom_10x15cm_100x150mm")) + { + printf("FAIL (%s)\n", pwgmedia->pwg); + status ++; + } + else if (pwgmedia->width != 10000 || pwgmedia->length != 15000) + { + printf("FAIL (%dx%d)\n", pwgmedia->width, pwgmedia->length); + status ++; + } + else + puts("PASS"); + fputs("_pwgMediaForSize(29700, 42000): ", stdout); if ((pwgmedia = _pwgMediaForSize(29700, 42000)) == NULL) { diff --git a/cups/transcode.c b/cups/transcode.c index f437dfe09..a24c8a851 100644 --- a/cups/transcode.c +++ b/cups/transcode.c @@ -88,8 +88,10 @@ cupsCharsetToUTF8( const cups_encoding_t encoding) /* I - Encoding */ { cups_utf8_t *destptr; /* Pointer into UTF-8 buffer */ +#ifdef HAVE_ICONV_H size_t srclen, /* Length of source string */ outBytesLeft; /* Bytes remaining in output buffer */ +#endif /* HAVE_ICONV_H */ /* @@ -206,8 +208,10 @@ cupsUTF8ToCharset( const cups_encoding_t encoding) /* I - Encoding */ { char *destptr; /* Pointer into destination */ +#ifdef HAVE_ICONV_H size_t srclen, /* Length of source string */ outBytesLeft; /* Bytes remaining in output buffer */ +#endif /* HAVE_ICONV_H */ /* diff --git a/cups/usersys.c b/cups/usersys.c index 4a774c7d8..abee546c3 100644 --- a/cups/usersys.c +++ b/cups/usersys.c @@ -22,10 +22,12 @@ * password callback. * cupsServer() - Return the hostname/address of the current * server. + * cupsSetClientCertCB() - Set the client certificate callback. * cupsSetEncryption() - Set the encryption preference. * cupsSetPasswordCB() - Set the password callback for CUPS. * cupsSetPasswordCB2() - Set the advanced password callback for CUPS. * cupsSetServer() - Set the default server name and port. + * cupsSetServerCertCB() - Set the server certificate callback. * cupsSetUser() - Set the default user name. * cupsUser() - Return the current user's name. * _cupsGetPassword() - Get a password from the user. @@ -54,7 +56,10 @@ static void cups_read_client_conf(cups_file_t *fp, _cups_globals_t *cg, const char *cups_encryption, - const char *cups_server); + const char *cups_server, + const char *cups_anyroot, + const char *cups_expiredroot, + const char *cups_expiredcerts); /* @@ -167,6 +172,59 @@ cupsServer(void) } +/* + * 'cupsSetClientCertCB()' - Set the client certificate callback. + * + * Pass @code NULL@ to restore the default callback. + * + * Note: The current certificate callback is tracked separately for each thread + * in a program. Multi-threaded programs that override the callback need to do + * so in each thread for the same callback to be used. + * + * @since CUPS 1.5@ + */ + +void +cupsSetClientCertCB( + cups_client_cert_cb_t cb, /* I - Callback function */ + void *user_data) /* I - User data pointer */ +{ + _cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */ + + + cg->client_cert_cb = cb; + cg->client_cert_data = user_data; +} + + +/* + * 'cupsSetCredentials()' - Set the default credentials to be used for SSL/TLS + * connections. + * + * Note: The default credentials are tracked separately for each thread in a + * program. Multi-threaded programs that override the setting need to do so in + * each thread for the same setting to be used. + * + * @since CUPS 1.5@ + */ + +int /* O - Status of call (0 = success) */ +cupsSetCredentials( + cups_array_t *credentials) /* I - Array of credentials */ +{ + _cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */ + + + if (cupsArrayCount(credentials) < 1) + return (-1); + + _httpFreeCredentials(cg->tls_credentials); + cg->tls_credentials = _httpConvertCredentials(credentials); + + return (cg->tls_credentials ? 0 : -1); +} + + /* * 'cupsSetEncryption()' - Set the encryption preference. * @@ -305,6 +363,31 @@ cupsSetServer(const char *server) /* I - Server name */ } +/* + * 'cupsSetServerCertCB()' - Set the server certificate callback. + * + * Pass @code NULL@ to restore the default callback. + * + * Note: The current credentials callback is tracked separately for each thread + * in a program. Multi-threaded programs that override the callback need to do + * so in each thread for the same callback to be used. + * + * @since CUPS 1.5@ + */ + +void +cupsSetServerCertCB( + cups_server_cert_cb_t cb, /* I - Callback function */ + void *user_data) /* I - User data pointer */ +{ + _cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */ + + + cg->server_cert_cb = cb; + cg->server_cert_data = user_data; +} + + /* * 'cupsSetUser()' - Set the default user name. * @@ -410,10 +493,17 @@ _cupsGetPassword(const char *prompt) /* I - Prompt string */ #else /* - * Use the standard getpass function to get a password from the console. + * Use the standard getpass function to get a password from the console. An + * empty password is treated as canceling the authentication request. */ - return (getpass(prompt)); + const char *password = getpass(prompt); + /* Password string */ + + if (!password || !password[0]) + return (NULL); + else + return (password); #endif /* WIN32 */ } @@ -428,7 +518,10 @@ _cupsSetDefaults(void) cups_file_t *fp; /* File */ const char *home, /* Home directory of user */ *cups_encryption, /* CUPS_ENCRYPTION env var */ - *cups_server; /* CUPS_SERVER env var */ + *cups_server, /* CUPS_SERVER env var */ + *cups_anyroot, /* CUPS_ANYROOT env var */ + *cups_expiredroot, /* CUPS_EXPIREDROOT env var */ + *cups_expiredcerts; /* CUPS_EXPIREDCERTS env var */ char filename[1024]; /* Filename */ _cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */ @@ -439,8 +532,11 @@ _cupsSetDefaults(void) * First collect environment variables... */ - cups_encryption = getenv("CUPS_ENCRYPTION"); - cups_server = getenv("CUPS_SERVER"); + cups_encryption = getenv("CUPS_ENCRYPTION"); + cups_server = getenv("CUPS_SERVER"); + cups_anyroot = getenv("CUPS_ANYROOT"); + cups_expiredroot = getenv("CUPS_EXPIREDROOT"); + cups_expiredcerts = getenv("CUPS_EXPIREDCERTS"); /* * Then, if needed, the .cups/client.conf or .cupsrc file in the home @@ -457,7 +553,10 @@ _cupsSetDefaults(void) snprintf(filename, sizeof(filename), "%s/.cups/client.conf", home); if ((fp = cupsFileOpen(filename, "r")) != NULL) { - cups_read_client_conf(fp, cg, cups_encryption, cups_server); + cups_read_client_conf(fp, cg, cups_encryption, cups_server, + cups_anyroot, cups_expiredroot, + cups_expiredcerts); + cupsFileClose(fp); } } @@ -472,7 +571,9 @@ _cupsSetDefaults(void) snprintf(filename, sizeof(filename), "%s/client.conf", cg->cups_serverroot); if ((fp = cupsFileOpen(filename, "r")) != NULL) { - cups_read_client_conf(fp, cg, cups_encryption, cups_server); + cups_read_client_conf(fp, cg, cups_encryption, cups_server, + cups_anyroot, cups_expiredroot, + cups_expiredcerts); cupsFileClose(fp); } } @@ -536,13 +637,19 @@ cups_read_client_conf( cups_file_t *fp, /* I - File to read */ _cups_globals_t *cg, /* I - Global data */ const char *cups_encryption, /* I - CUPS_ENCRYPTION env var */ - const char *cups_server) /* I - CUPS_SERVER env var */ + const char *cups_server, /* I - CUPS_SERVER env var */ + const char *cups_anyroot, /* I - CUPS_ANYROOT env var */ + const char *cups_expiredroot, /* I - CUPS_EXPIREDROOT env var */ + const char *cups_expiredcerts) /* I - CUPS_EXPIREDCERTS env var */ { int linenum; /* Current line number */ char line[1024], /* Line from file */ *value, /* Pointer into line */ encryption[1024], /* Encryption value */ - server_name[1024]; /* ServerName value */ + server_name[1024], /* ServerName value */ + any_root[1024], /* AllowAnyRoot value */ + expired_root[1024], /* AllowExpiredRoot value */ + expired_certs[1024]; /* AllowExpiredCerts value */ /* @@ -564,6 +671,23 @@ cups_read_client_conf( strlcpy(server_name, value, sizeof(server_name)); cups_server = server_name; } + else if (!cups_anyroot && !strcasecmp(line, "AllowAnyRoot") && value) + { + strlcpy(any_root, value, sizeof(any_root)); + cups_anyroot = any_root; + } + else if (!cups_expiredroot && !strcasecmp(line, "AllowExpiredRoot") && + value) + { + strlcpy(expired_root, value, sizeof(expired_root)); + cups_expiredroot = expired_root; + } + else if (!cups_expiredcerts && !strcasecmp(line, "AllowExpiredCerts") && + value) + { + strlcpy(expired_certs, value, sizeof(expired_certs)); + cups_expiredcerts = expired_certs; + } } /* @@ -613,6 +737,21 @@ cups_read_client_conf( if (!cg->ipp_port && value) cg->ipp_port = atoi(value); } + + if (cups_anyroot) + cg->any_root = !strcasecmp(cups_anyroot, "yes") || + !strcasecmp(cups_anyroot, "on") || + !strcasecmp(cups_anyroot, "true"); + + if (cups_expiredroot) + cg->expired_root = !strcasecmp(cups_expiredroot, "yes") || + !strcasecmp(cups_expiredroot, "on") || + !strcasecmp(cups_expiredroot, "true"); + + if (cups_expiredcerts) + cg->expired_certs = !strcasecmp(cups_expiredcerts, "yes") || + !strcasecmp(cups_expiredcerts, "on") || + !strcasecmp(cups_expiredcerts, "true"); } diff --git a/cups/versioning.h b/cups/versioning.h index 323fea5a8..92a0a52eb 100644 --- a/cups/versioning.h +++ b/cups/versioning.h @@ -20,8 +20,8 @@ /* * This header defines several constants - _CUPS_DEPRECATED, * _CUPS_API_1_1, _CUPS_API_1_1_19, _CUPS_API_1_1_20, _CUPS_API_1_1_21, - * _CUPS_API_1_2, _CUPS_API_1_3, _CUPS_API_1_4 - which add compiler- - * specific attributes that flag functions that are deprecated or added + * _CUPS_API_1_2, _CUPS_API_1_3, _CUPS_API_1_4, _CUPS_API_1_5 - which add + * compiler-specific attributes that flag functions that are deprecated or added * in particular releases. * * On Mac OS X, the _CUPS_API_* constants are defined based on the values of @@ -43,13 +43,16 @@ # ifndef AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER # define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER __attribute__((unavailable)) # endif /* !AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER */ +# ifndef AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER +# define AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER __attribute__((unavailable)) +# endif /* !AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER */ # define _CUPS_API_1_1_19 AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER # define _CUPS_API_1_1_20 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER # define _CUPS_API_1_1_21 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER # define _CUPS_API_1_2 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER # define _CUPS_API_1_3 AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER # define _CUPS_API_1_4 AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER -# define _CUPS_API_1_5 +# define _CUPS_API_1_5 AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER # else # define _CUPS_API_1_1_19 # define _CUPS_API_1_1_20 diff --git a/doc/Makefile b/doc/Makefile index 07350e3fc..15a79cb1f 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -28,6 +28,7 @@ WEBIMAGES = \ images/color-wheel.png \ images/cups.png \ images/cups-icon.png \ + images/generic.png \ images/left.gif \ images/right.gif \ images/sel.gif \ diff --git a/driver/Dependencies b/driver/Dependencies index 7d12f2f0b..20783b950 100644 --- a/driver/Dependencies +++ b/driver/Dependencies @@ -1,65 +1,65 @@ # DO NOT DELETE commandtoescpx.o: ../cups/cups.h ../cups/file.h ../cups/versioning.h -commandtoescpx.o: ../cups/ipp.h ../cups/http.h ../cups/language.h -commandtoescpx.o: ../cups/array.h driver.h ../cups/raster.h ../cups/cups.h +commandtoescpx.o: ../cups/ipp.h ../cups/http.h ../cups/array.h +commandtoescpx.o: ../cups/language.h driver.h ../cups/raster.h ../cups/cups.h commandtoescpx.o: ../cups/ppd.h ../cups/string-private.h ../config.h commandtoescpx.o: ../data/escp.h commandtopclx.o: ../cups/cups.h ../cups/file.h ../cups/versioning.h -commandtopclx.o: ../cups/ipp.h ../cups/http.h ../cups/language.h -commandtopclx.o: ../cups/array.h driver.h ../cups/raster.h ../cups/cups.h +commandtopclx.o: ../cups/ipp.h ../cups/http.h ../cups/array.h +commandtopclx.o: ../cups/language.h driver.h ../cups/raster.h ../cups/cups.h commandtopclx.o: ../cups/ppd.h ../cups/string-private.h ../config.h commandtopclx.o: ../data/pcl.h rastertoescpx.o: driver.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -rastertoescpx.o: ../cups/ipp.h ../cups/http.h ../cups/language.h -rastertoescpx.o: ../cups/array.h ../cups/raster.h ../cups/cups.h +rastertoescpx.o: ../cups/ipp.h ../cups/http.h ../cups/array.h +rastertoescpx.o: ../cups/language.h ../cups/raster.h ../cups/cups.h rastertoescpx.o: ../cups/ppd.h ../cups/language-private.h ../cups/transcode.h rastertoescpx.o: ../cups/string-private.h ../config.h ../data/escp.h rastertopclx.o: driver.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -rastertopclx.o: ../cups/ipp.h ../cups/http.h ../cups/language.h -rastertopclx.o: ../cups/array.h ../cups/raster.h ../cups/cups.h ../cups/ppd.h -rastertopclx.o: ../cups/language-private.h ../cups/transcode.h +rastertopclx.o: ../cups/ipp.h ../cups/http.h ../cups/array.h +rastertopclx.o: ../cups/language.h ../cups/raster.h ../cups/cups.h +rastertopclx.o: ../cups/ppd.h ../cups/language-private.h ../cups/transcode.h rastertopclx.o: ../cups/string-private.h ../config.h pcl-common.h rastertopclx.o: ../data/pcl.h pcl-common.o: driver.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -pcl-common.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +pcl-common.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h pcl-common.o: ../cups/raster.h ../cups/cups.h ../cups/ppd.h pcl-common.h pcl-common.o: ../cups/string-private.h ../config.h ../data/pcl.h testcmyk.o: ../cups/string-private.h ../config.h driver.h ../cups/cups.h testcmyk.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -testcmyk.o: ../cups/language.h ../cups/array.h ../cups/raster.h +testcmyk.o: ../cups/array.h ../cups/language.h ../cups/raster.h testcmyk.o: ../cups/cups.h ../cups/ppd.h testdither.o: driver.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -testdither.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +testdither.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h testdither.o: ../cups/raster.h ../cups/cups.h ../cups/ppd.h testdither.o: ../cups/string-private.h ../config.h testrgb.o: ../cups/string-private.h ../config.h driver.h ../cups/cups.h testrgb.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -testrgb.o: ../cups/language.h ../cups/array.h ../cups/raster.h ../cups/cups.h +testrgb.o: ../cups/array.h ../cups/language.h ../cups/raster.h ../cups/cups.h testrgb.o: ../cups/ppd.h attr.o: driver.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -attr.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +attr.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h attr.o: ../cups/raster.h ../cups/cups.h ../cups/ppd.h attr.o: ../cups/string-private.h ../config.h check.o: driver.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -check.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +check.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h check.o: ../cups/raster.h ../cups/cups.h ../cups/ppd.h cmyk.o: driver.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -cmyk.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +cmyk.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h cmyk.o: ../cups/raster.h ../cups/cups.h ../cups/ppd.h cmyk.o: ../cups/string-private.h ../config.h dither.o: driver.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -dither.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +dither.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h dither.o: ../cups/raster.h ../cups/cups.h ../cups/ppd.h ../config.h lut.o: driver.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -lut.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +lut.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h lut.o: ../cups/raster.h ../cups/cups.h ../cups/ppd.h pack.o: driver.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -pack.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +pack.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h pack.o: ../cups/raster.h ../cups/cups.h ../cups/ppd.h rgb.o: driver.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -rgb.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +rgb.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h rgb.o: ../cups/raster.h ../cups/cups.h ../cups/ppd.h srgb.o: driver.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -srgb.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +srgb.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h srgb.o: ../cups/raster.h ../cups/cups.h ../cups/ppd.h diff --git a/filter/Dependencies b/filter/Dependencies index c84e4072f..ef7b6661f 100644 --- a/filter/Dependencies +++ b/filter/Dependencies @@ -2,461 +2,455 @@ image-bmp.o: image-private.h image.h ../cups/raster.h ../cups/cups.h image-bmp.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -image-bmp.o: ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h +image-bmp.o: ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h image-bmp.o: ../cups/debug-private.h ../cups/string-private.h ../config.h image-colorspace.o: image-private.h image.h ../cups/raster.h ../cups/cups.h image-colorspace.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h -image-colorspace.o: ../cups/http.h ../cups/language.h ../cups/array.h +image-colorspace.o: ../cups/http.h ../cups/array.h ../cups/language.h image-colorspace.o: ../cups/ppd.h ../cups/cups.h ../cups/debug-private.h image-colorspace.o: ../cups/string-private.h ../config.h image-gif.o: image-private.h image.h ../cups/raster.h ../cups/cups.h image-gif.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -image-gif.o: ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h +image-gif.o: ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h image-gif.o: ../cups/debug-private.h ../cups/string-private.h ../config.h image-jpeg.o: image-private.h image.h ../cups/raster.h ../cups/cups.h image-jpeg.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h -image-jpeg.o: ../cups/http.h ../cups/language.h ../cups/array.h ../cups/ppd.h +image-jpeg.o: ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h image-jpeg.o: ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h image-jpeg.o: ../config.h image-photocd.o: image-private.h image.h ../cups/raster.h ../cups/cups.h image-photocd.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h -image-photocd.o: ../cups/http.h ../cups/language.h ../cups/array.h +image-photocd.o: ../cups/http.h ../cups/array.h ../cups/language.h image-photocd.o: ../cups/ppd.h ../cups/cups.h ../cups/debug-private.h image-photocd.o: ../cups/string-private.h ../config.h image-pix.o: image-private.h image.h ../cups/raster.h ../cups/cups.h image-pix.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -image-pix.o: ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h +image-pix.o: ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h image-pix.o: ../cups/debug-private.h ../cups/string-private.h ../config.h image-png.o: image-private.h image.h ../cups/raster.h ../cups/cups.h image-png.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -image-png.o: ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h +image-png.o: ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h image-png.o: ../cups/debug-private.h ../cups/string-private.h ../config.h image-pnm.o: image-private.h image.h ../cups/raster.h ../cups/cups.h image-pnm.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -image-pnm.o: ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h +image-pnm.o: ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h image-pnm.o: ../cups/debug-private.h ../cups/string-private.h ../config.h image-sgi.o: image-private.h image.h ../cups/raster.h ../cups/cups.h image-sgi.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -image-sgi.o: ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h +image-sgi.o: ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h image-sgi.o: ../cups/debug-private.h ../cups/string-private.h ../config.h image-sgi.o: image-sgi.h image-sgilib.o: image-sgi.h image-sun.o: image-private.h image.h ../cups/raster.h ../cups/cups.h image-sun.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -image-sun.o: ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h +image-sun.o: ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h image-sun.o: ../cups/debug-private.h ../cups/string-private.h ../config.h image-tiff.o: image-private.h image.h ../cups/raster.h ../cups/cups.h image-tiff.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h -image-tiff.o: ../cups/http.h ../cups/language.h ../cups/array.h ../cups/ppd.h +image-tiff.o: ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h image-tiff.o: ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h image-tiff.o: ../config.h image-zoom.o: image-private.h image.h ../cups/raster.h ../cups/cups.h image-zoom.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h -image-zoom.o: ../cups/http.h ../cups/language.h ../cups/array.h ../cups/ppd.h +image-zoom.o: ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h image-zoom.o: ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h image-zoom.o: ../config.h image.o: image-private.h image.h ../cups/raster.h ../cups/cups.h image.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -image.o: ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h +image.o: ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h image.o: ../cups/debug-private.h ../cups/string-private.h ../config.h error.o: image-private.h image.h ../cups/raster.h ../cups/cups.h error.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -error.o: ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h +error.o: ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h error.o: ../cups/debug-private.h ../cups/string-private.h ../config.h interpret.o: image-private.h image.h ../cups/raster.h ../cups/cups.h interpret.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -interpret.o: ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h +interpret.o: ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h interpret.o: ../cups/debug-private.h ../cups/string-private.h ../config.h raster.o: image-private.h image.h ../cups/raster.h ../cups/cups.h raster.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -raster.o: ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h +raster.o: ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h raster.o: ../cups/debug-private.h ../cups/string-private.h ../config.h bannertops.o: pstext.h common.h ../cups/string-private.h ../config.h bannertops.o: ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h bannertops.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -bannertops.o: ../cups/language.h ../cups/array.h ../cups/transcode.h image.h +bannertops.o: ../cups/array.h ../cups/language.h ../cups/transcode.h image.h bannertops.o: ../cups/raster.h ../cups/ppd.h ../cups/language-private.h commandtops.o: ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h commandtops.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -commandtops.o: ../cups/language.h ../cups/array.h ../cups/string-private.h +commandtops.o: ../cups/array.h ../cups/language.h ../cups/string-private.h commandtops.o: ../config.h ../cups/sidechannel.h gziptoany.o: ../cups/cups-private.h ../cups/cups.h ../cups/string-private.h gziptoany.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h gziptoany.o: ../cups/ppd.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -gziptoany.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +gziptoany.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h gziptoany.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h gziptoany.o: ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h gziptoany.o: ../cups/language-private.h ../cups/transcode.h gziptoany.o: ../cups/thread-private.h imagetops.o: common.h ../cups/string-private.h ../config.h ../cups/cups.h imagetops.o: ../cups/ppd.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -imagetops.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +imagetops.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h imagetops.o: image.h ../cups/raster.h ../cups/ppd.h imagetops.o: ../cups/language-private.h ../cups/transcode.h imagetoraster.o: common.h ../cups/string-private.h ../config.h ../cups/cups.h imagetoraster.o: ../cups/ppd.h ../cups/cups.h ../cups/file.h imagetoraster.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -imagetoraster.o: ../cups/language.h ../cups/array.h image-private.h image.h +imagetoraster.o: ../cups/array.h ../cups/language.h image-private.h image.h imagetoraster.o: ../cups/raster.h ../cups/ppd.h ../cups/debug-private.h imagetoraster.o: ../cups/language-private.h ../cups/transcode.h common.o: common.h ../cups/string-private.h ../config.h ../cups/cups.h common.o: ../cups/ppd.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -common.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +common.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h pdftops.o: ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h -pdftops.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -pdftops.o: ../cups/language.h ../cups/array.h ../cups/string-private.h -pdftops.o: ../config.h ../cups/language-private.h ../cups/transcode.h +pdftops.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +pdftops.o: ../cups/language.h ../cups/string-private.h ../config.h +pdftops.o: ../cups/language-private.h ../cups/transcode.h pstext.o: pstext.h common.h ../cups/string-private.h ../config.h pstext.o: ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h -pstext.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -pstext.o: ../cups/language.h ../cups/array.h ../cups/transcode.h -pstext.o: ../cups/language-private.h +pstext.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +pstext.o: ../cups/language.h ../cups/transcode.h ../cups/language-private.h pstops.o: common.h ../cups/string-private.h ../config.h ../cups/cups.h pstops.o: ../cups/ppd.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -pstops.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +pstops.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h pstops.o: ../cups/file.h ../cups/array.h ../cups/language-private.h pstops.o: ../cups/transcode.h rasterbench.o: ../config.h ../cups/raster.h ../cups/cups.h ../cups/file.h rasterbench.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -rasterbench.o: ../cups/language.h ../cups/array.h ../cups/ppd.h +rasterbench.o: ../cups/array.h ../cups/language.h ../cups/ppd.h rastertoepson.o: ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h rastertoepson.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -rastertoepson.o: ../cups/language.h ../cups/array.h ../cups/string-private.h +rastertoepson.o: ../cups/array.h ../cups/language.h ../cups/string-private.h rastertoepson.o: ../config.h ../cups/language-private.h ../cups/transcode.h rastertoepson.o: ../cups/raster.h ../cups/ppd.h rastertohp.o: ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h rastertohp.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -rastertohp.o: ../cups/language.h ../cups/array.h ../cups/string-private.h +rastertohp.o: ../cups/array.h ../cups/language.h ../cups/string-private.h rastertohp.o: ../config.h ../cups/language-private.h ../cups/transcode.h rastertohp.o: ../cups/raster.h ../cups/ppd.h rastertolabel.o: ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h rastertolabel.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -rastertolabel.o: ../cups/language.h ../cups/array.h ../cups/string-private.h +rastertolabel.o: ../cups/array.h ../cups/language.h ../cups/string-private.h rastertolabel.o: ../config.h ../cups/language-private.h ../cups/transcode.h rastertolabel.o: ../cups/raster.h ../cups/ppd.h testimage.o: image.h ../cups/raster.h ../cups/cups.h ../cups/file.h testimage.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -testimage.o: ../cups/language.h ../cups/array.h ../cups/ppd.h +testimage.o: ../cups/array.h ../cups/language.h ../cups/ppd.h testraster.o: image-private.h image.h ../cups/raster.h ../cups/cups.h testraster.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h -testraster.o: ../cups/http.h ../cups/language.h ../cups/array.h ../cups/ppd.h +testraster.o: ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h testraster.o: ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h testraster.o: ../config.h textcommon.o: textcommon.h common.h ../cups/string-private.h ../config.h textcommon.o: ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h textcommon.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -textcommon.o: ../cups/language.h ../cups/array.h ../cups/language-private.h +textcommon.o: ../cups/array.h ../cups/language.h ../cups/language-private.h textcommon.o: ../cups/transcode.h texttops.o: textcommon.h common.h ../cups/string-private.h ../config.h texttops.o: ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h -texttops.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -texttops.o: ../cups/language.h ../cups/array.h ../cups/language-private.h -texttops.o: ../cups/transcode.h +texttops.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +texttops.o: ../cups/language.h ../cups/language-private.h ../cups/transcode.h # DO NOT DELETE image-bmp.32.o: image-bmp.c image-private.h image.h ../cups/raster.h ../cups/cups.h image-bmp.32.o: image-bmp.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -image-bmp.32.o: image-bmp.c ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h +image-bmp.32.o: image-bmp.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h image-bmp.32.o: image-bmp.c ../cups/debug-private.h ../cups/string-private.h ../config.h image-colorspace.32.o: image-colorspace.c image-private.h image.h ../cups/raster.h ../cups/cups.h image-colorspace.32.o: image-colorspace.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h -image-colorspace.32.o: image-colorspace.c ../cups/http.h ../cups/language.h ../cups/array.h +image-colorspace.32.o: image-colorspace.c ../cups/http.h ../cups/array.h ../cups/language.h image-colorspace.32.o: image-colorspace.c ../cups/ppd.h ../cups/cups.h ../cups/debug-private.h image-colorspace.32.o: image-colorspace.c ../cups/string-private.h ../config.h image-gif.32.o: image-gif.c image-private.h image.h ../cups/raster.h ../cups/cups.h image-gif.32.o: image-gif.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -image-gif.32.o: image-gif.c ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h +image-gif.32.o: image-gif.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h image-gif.32.o: image-gif.c ../cups/debug-private.h ../cups/string-private.h ../config.h image-jpeg.32.o: image-jpeg.c image-private.h image.h ../cups/raster.h ../cups/cups.h image-jpeg.32.o: image-jpeg.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h -image-jpeg.32.o: image-jpeg.c ../cups/http.h ../cups/language.h ../cups/array.h ../cups/ppd.h +image-jpeg.32.o: image-jpeg.c ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h image-jpeg.32.o: image-jpeg.c ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h image-jpeg.32.o: image-jpeg.c ../config.h image-photocd.32.o: image-photocd.c image-private.h image.h ../cups/raster.h ../cups/cups.h image-photocd.32.o: image-photocd.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h -image-photocd.32.o: image-photocd.c ../cups/http.h ../cups/language.h ../cups/array.h +image-photocd.32.o: image-photocd.c ../cups/http.h ../cups/array.h ../cups/language.h image-photocd.32.o: image-photocd.c ../cups/ppd.h ../cups/cups.h ../cups/debug-private.h image-photocd.32.o: image-photocd.c ../cups/string-private.h ../config.h image-pix.32.o: image-pix.c image-private.h image.h ../cups/raster.h ../cups/cups.h image-pix.32.o: image-pix.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -image-pix.32.o: image-pix.c ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h +image-pix.32.o: image-pix.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h image-pix.32.o: image-pix.c ../cups/debug-private.h ../cups/string-private.h ../config.h image-png.32.o: image-png.c image-private.h image.h ../cups/raster.h ../cups/cups.h image-png.32.o: image-png.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -image-png.32.o: image-png.c ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h +image-png.32.o: image-png.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h image-png.32.o: image-png.c ../cups/debug-private.h ../cups/string-private.h ../config.h image-pnm.32.o: image-pnm.c image-private.h image.h ../cups/raster.h ../cups/cups.h image-pnm.32.o: image-pnm.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -image-pnm.32.o: image-pnm.c ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h +image-pnm.32.o: image-pnm.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h image-pnm.32.o: image-pnm.c ../cups/debug-private.h ../cups/string-private.h ../config.h image-sgi.32.o: image-sgi.c image-private.h image.h ../cups/raster.h ../cups/cups.h image-sgi.32.o: image-sgi.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -image-sgi.32.o: image-sgi.c ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h +image-sgi.32.o: image-sgi.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h image-sgi.32.o: image-sgi.c ../cups/debug-private.h ../cups/string-private.h ../config.h image-sgi.32.o: image-sgi.c image-sgi.h image-sgilib.32.o: image-sgilib.c image-sgi.h image-sun.32.o: image-sun.c image-private.h image.h ../cups/raster.h ../cups/cups.h image-sun.32.o: image-sun.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -image-sun.32.o: image-sun.c ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h +image-sun.32.o: image-sun.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h image-sun.32.o: image-sun.c ../cups/debug-private.h ../cups/string-private.h ../config.h image-tiff.32.o: image-tiff.c image-private.h image.h ../cups/raster.h ../cups/cups.h image-tiff.32.o: image-tiff.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h -image-tiff.32.o: image-tiff.c ../cups/http.h ../cups/language.h ../cups/array.h ../cups/ppd.h +image-tiff.32.o: image-tiff.c ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h image-tiff.32.o: image-tiff.c ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h image-tiff.32.o: image-tiff.c ../config.h image-zoom.32.o: image-zoom.c image-private.h image.h ../cups/raster.h ../cups/cups.h image-zoom.32.o: image-zoom.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h -image-zoom.32.o: image-zoom.c ../cups/http.h ../cups/language.h ../cups/array.h ../cups/ppd.h +image-zoom.32.o: image-zoom.c ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h image-zoom.32.o: image-zoom.c ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h image-zoom.32.o: image-zoom.c ../config.h image.32.o: image.c image-private.h image.h ../cups/raster.h ../cups/cups.h image.32.o: image.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -image.32.o: image.c ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h +image.32.o: image.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h image.32.o: image.c ../cups/debug-private.h ../cups/string-private.h ../config.h error.32.o: error.c image-private.h image.h ../cups/raster.h ../cups/cups.h error.32.o: error.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -error.32.o: error.c ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h +error.32.o: error.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h error.32.o: error.c ../cups/debug-private.h ../cups/string-private.h ../config.h interpret.32.o: interpret.c image-private.h image.h ../cups/raster.h ../cups/cups.h interpret.32.o: interpret.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -interpret.32.o: interpret.c ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h +interpret.32.o: interpret.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h interpret.32.o: interpret.c ../cups/debug-private.h ../cups/string-private.h ../config.h raster.32.o: raster.c image-private.h image.h ../cups/raster.h ../cups/cups.h raster.32.o: raster.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -raster.32.o: raster.c ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h +raster.32.o: raster.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h raster.32.o: raster.c ../cups/debug-private.h ../cups/string-private.h ../config.h bannertops.32.o: bannertops.c pstext.h common.h ../cups/string-private.h ../config.h bannertops.32.o: bannertops.c ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h bannertops.32.o: bannertops.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h -bannertops.32.o: bannertops.c ../cups/language.h ../cups/array.h ../cups/transcode.h image.h +bannertops.32.o: bannertops.c ../cups/array.h ../cups/language.h ../cups/transcode.h image.h bannertops.32.o: bannertops.c ../cups/raster.h ../cups/ppd.h ../cups/language-private.h commandtops.32.o: commandtops.c ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h commandtops.32.o: commandtops.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h -commandtops.32.o: commandtops.c ../cups/language.h ../cups/array.h ../cups/string-private.h +commandtops.32.o: commandtops.c ../cups/array.h ../cups/language.h ../cups/string-private.h commandtops.32.o: commandtops.c ../config.h ../cups/sidechannel.h gziptoany.32.o: gziptoany.c ../cups/cups-private.h ../cups/cups.h ../cups/string-private.h gziptoany.32.o: gziptoany.c ../config.h ../cups/debug-private.h ../cups/ppd-private.h gziptoany.32.o: gziptoany.c ../cups/ppd.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -gziptoany.32.o: gziptoany.c ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +gziptoany.32.o: gziptoany.c ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h gziptoany.32.o: gziptoany.c ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h gziptoany.32.o: gziptoany.c ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h gziptoany.32.o: gziptoany.c ../cups/language-private.h ../cups/transcode.h gziptoany.32.o: gziptoany.c ../cups/thread-private.h imagetops.32.o: imagetops.c common.h ../cups/string-private.h ../config.h ../cups/cups.h imagetops.32.o: imagetops.c ../cups/ppd.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -imagetops.32.o: imagetops.c ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +imagetops.32.o: imagetops.c ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h imagetops.32.o: imagetops.c image.h ../cups/raster.h ../cups/ppd.h imagetops.32.o: imagetops.c ../cups/language-private.h ../cups/transcode.h imagetoraster.32.o: imagetoraster.c common.h ../cups/string-private.h ../config.h ../cups/cups.h imagetoraster.32.o: imagetoraster.c ../cups/ppd.h ../cups/cups.h ../cups/file.h imagetoraster.32.o: imagetoraster.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h -imagetoraster.32.o: imagetoraster.c ../cups/language.h ../cups/array.h image-private.h image.h +imagetoraster.32.o: imagetoraster.c ../cups/array.h ../cups/language.h image-private.h image.h imagetoraster.32.o: imagetoraster.c ../cups/raster.h ../cups/ppd.h ../cups/debug-private.h imagetoraster.32.o: imagetoraster.c ../cups/language-private.h ../cups/transcode.h common.32.o: common.c common.h ../cups/string-private.h ../config.h ../cups/cups.h common.32.o: common.c ../cups/ppd.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -common.32.o: common.c ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +common.32.o: common.c ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h pdftops.32.o: pdftops.c ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h -pdftops.32.o: pdftops.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h -pdftops.32.o: pdftops.c ../cups/language.h ../cups/array.h ../cups/string-private.h -pdftops.32.o: pdftops.c ../config.h ../cups/language-private.h ../cups/transcode.h +pdftops.32.o: pdftops.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +pdftops.32.o: pdftops.c ../cups/language.h ../cups/string-private.h ../config.h +pdftops.32.o: pdftops.c ../cups/language-private.h ../cups/transcode.h pstext.32.o: pstext.c pstext.h common.h ../cups/string-private.h ../config.h pstext.32.o: pstext.c ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h -pstext.32.o: pstext.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h -pstext.32.o: pstext.c ../cups/language.h ../cups/array.h ../cups/transcode.h -pstext.32.o: pstext.c ../cups/language-private.h +pstext.32.o: pstext.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +pstext.32.o: pstext.c ../cups/language.h ../cups/transcode.h ../cups/language-private.h pstops.32.o: pstops.c common.h ../cups/string-private.h ../config.h ../cups/cups.h pstops.32.o: pstops.c ../cups/ppd.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -pstops.32.o: pstops.c ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +pstops.32.o: pstops.c ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h pstops.32.o: pstops.c ../cups/file.h ../cups/array.h ../cups/language-private.h pstops.32.o: pstops.c ../cups/transcode.h rasterbench.32.o: rasterbench.c ../config.h ../cups/raster.h ../cups/cups.h ../cups/file.h rasterbench.32.o: rasterbench.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h -rasterbench.32.o: rasterbench.c ../cups/language.h ../cups/array.h ../cups/ppd.h +rasterbench.32.o: rasterbench.c ../cups/array.h ../cups/language.h ../cups/ppd.h rastertoepson.32.o: rastertoepson.c ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h rastertoepson.32.o: rastertoepson.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h -rastertoepson.32.o: rastertoepson.c ../cups/language.h ../cups/array.h ../cups/string-private.h +rastertoepson.32.o: rastertoepson.c ../cups/array.h ../cups/language.h ../cups/string-private.h rastertoepson.32.o: rastertoepson.c ../config.h ../cups/language-private.h ../cups/transcode.h rastertoepson.32.o: rastertoepson.c ../cups/raster.h ../cups/ppd.h rastertohp.32.o: rastertohp.c ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h rastertohp.32.o: rastertohp.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h -rastertohp.32.o: rastertohp.c ../cups/language.h ../cups/array.h ../cups/string-private.h +rastertohp.32.o: rastertohp.c ../cups/array.h ../cups/language.h ../cups/string-private.h rastertohp.32.o: rastertohp.c ../config.h ../cups/language-private.h ../cups/transcode.h rastertohp.32.o: rastertohp.c ../cups/raster.h ../cups/ppd.h rastertolabel.32.o: rastertolabel.c ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h rastertolabel.32.o: rastertolabel.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h -rastertolabel.32.o: rastertolabel.c ../cups/language.h ../cups/array.h ../cups/string-private.h +rastertolabel.32.o: rastertolabel.c ../cups/array.h ../cups/language.h ../cups/string-private.h rastertolabel.32.o: rastertolabel.c ../config.h ../cups/language-private.h ../cups/transcode.h rastertolabel.32.o: rastertolabel.c ../cups/raster.h ../cups/ppd.h testimage.32.o: testimage.c image.h ../cups/raster.h ../cups/cups.h ../cups/file.h testimage.32.o: testimage.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h -testimage.32.o: testimage.c ../cups/language.h ../cups/array.h ../cups/ppd.h +testimage.32.o: testimage.c ../cups/array.h ../cups/language.h ../cups/ppd.h testraster.32.o: testraster.c image-private.h image.h ../cups/raster.h ../cups/cups.h testraster.32.o: testraster.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h -testraster.32.o: testraster.c ../cups/http.h ../cups/language.h ../cups/array.h ../cups/ppd.h +testraster.32.o: testraster.c ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h testraster.32.o: testraster.c ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h testraster.32.o: testraster.c ../config.h textcommon.32.o: textcommon.c textcommon.h common.h ../cups/string-private.h ../config.h textcommon.32.o: textcommon.c ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h textcommon.32.o: textcommon.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h -textcommon.32.o: textcommon.c ../cups/language.h ../cups/array.h ../cups/language-private.h +textcommon.32.o: textcommon.c ../cups/array.h ../cups/language.h ../cups/language-private.h textcommon.32.o: textcommon.c ../cups/transcode.h texttops.32.o: texttops.c textcommon.h common.h ../cups/string-private.h ../config.h texttops.32.o: texttops.c ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h -texttops.32.o: texttops.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h -texttops.32.o: texttops.c ../cups/language.h ../cups/array.h ../cups/language-private.h -texttops.32.o: texttops.c ../cups/transcode.h +texttops.32.o: texttops.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +texttops.32.o: texttops.c ../cups/language.h ../cups/language-private.h ../cups/transcode.h # DO NOT DELETE image-bmp.64.o: image-bmp.c image-private.h image.h ../cups/raster.h ../cups/cups.h image-bmp.64.o: image-bmp.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -image-bmp.64.o: image-bmp.c ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h +image-bmp.64.o: image-bmp.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h image-bmp.64.o: image-bmp.c ../cups/debug-private.h ../cups/string-private.h ../config.h image-colorspace.64.o: image-colorspace.c image-private.h image.h ../cups/raster.h ../cups/cups.h image-colorspace.64.o: image-colorspace.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h -image-colorspace.64.o: image-colorspace.c ../cups/http.h ../cups/language.h ../cups/array.h +image-colorspace.64.o: image-colorspace.c ../cups/http.h ../cups/array.h ../cups/language.h image-colorspace.64.o: image-colorspace.c ../cups/ppd.h ../cups/cups.h ../cups/debug-private.h image-colorspace.64.o: image-colorspace.c ../cups/string-private.h ../config.h image-gif.64.o: image-gif.c image-private.h image.h ../cups/raster.h ../cups/cups.h image-gif.64.o: image-gif.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -image-gif.64.o: image-gif.c ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h +image-gif.64.o: image-gif.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h image-gif.64.o: image-gif.c ../cups/debug-private.h ../cups/string-private.h ../config.h image-jpeg.64.o: image-jpeg.c image-private.h image.h ../cups/raster.h ../cups/cups.h image-jpeg.64.o: image-jpeg.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h -image-jpeg.64.o: image-jpeg.c ../cups/http.h ../cups/language.h ../cups/array.h ../cups/ppd.h +image-jpeg.64.o: image-jpeg.c ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h image-jpeg.64.o: image-jpeg.c ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h image-jpeg.64.o: image-jpeg.c ../config.h image-photocd.64.o: image-photocd.c image-private.h image.h ../cups/raster.h ../cups/cups.h image-photocd.64.o: image-photocd.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h -image-photocd.64.o: image-photocd.c ../cups/http.h ../cups/language.h ../cups/array.h +image-photocd.64.o: image-photocd.c ../cups/http.h ../cups/array.h ../cups/language.h image-photocd.64.o: image-photocd.c ../cups/ppd.h ../cups/cups.h ../cups/debug-private.h image-photocd.64.o: image-photocd.c ../cups/string-private.h ../config.h image-pix.64.o: image-pix.c image-private.h image.h ../cups/raster.h ../cups/cups.h image-pix.64.o: image-pix.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -image-pix.64.o: image-pix.c ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h +image-pix.64.o: image-pix.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h image-pix.64.o: image-pix.c ../cups/debug-private.h ../cups/string-private.h ../config.h image-png.64.o: image-png.c image-private.h image.h ../cups/raster.h ../cups/cups.h image-png.64.o: image-png.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -image-png.64.o: image-png.c ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h +image-png.64.o: image-png.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h image-png.64.o: image-png.c ../cups/debug-private.h ../cups/string-private.h ../config.h image-pnm.64.o: image-pnm.c image-private.h image.h ../cups/raster.h ../cups/cups.h image-pnm.64.o: image-pnm.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -image-pnm.64.o: image-pnm.c ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h +image-pnm.64.o: image-pnm.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h image-pnm.64.o: image-pnm.c ../cups/debug-private.h ../cups/string-private.h ../config.h image-sgi.64.o: image-sgi.c image-private.h image.h ../cups/raster.h ../cups/cups.h image-sgi.64.o: image-sgi.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -image-sgi.64.o: image-sgi.c ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h +image-sgi.64.o: image-sgi.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h image-sgi.64.o: image-sgi.c ../cups/debug-private.h ../cups/string-private.h ../config.h image-sgi.64.o: image-sgi.c image-sgi.h image-sgilib.64.o: image-sgilib.c image-sgi.h image-sun.64.o: image-sun.c image-private.h image.h ../cups/raster.h ../cups/cups.h image-sun.64.o: image-sun.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -image-sun.64.o: image-sun.c ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h +image-sun.64.o: image-sun.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h image-sun.64.o: image-sun.c ../cups/debug-private.h ../cups/string-private.h ../config.h image-tiff.64.o: image-tiff.c image-private.h image.h ../cups/raster.h ../cups/cups.h image-tiff.64.o: image-tiff.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h -image-tiff.64.o: image-tiff.c ../cups/http.h ../cups/language.h ../cups/array.h ../cups/ppd.h +image-tiff.64.o: image-tiff.c ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h image-tiff.64.o: image-tiff.c ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h image-tiff.64.o: image-tiff.c ../config.h image-zoom.64.o: image-zoom.c image-private.h image.h ../cups/raster.h ../cups/cups.h image-zoom.64.o: image-zoom.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h -image-zoom.64.o: image-zoom.c ../cups/http.h ../cups/language.h ../cups/array.h ../cups/ppd.h +image-zoom.64.o: image-zoom.c ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h image-zoom.64.o: image-zoom.c ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h image-zoom.64.o: image-zoom.c ../config.h image.64.o: image.c image-private.h image.h ../cups/raster.h ../cups/cups.h image.64.o: image.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -image.64.o: image.c ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h +image.64.o: image.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h image.64.o: image.c ../cups/debug-private.h ../cups/string-private.h ../config.h error.64.o: error.c image-private.h image.h ../cups/raster.h ../cups/cups.h error.64.o: error.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -error.64.o: error.c ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h +error.64.o: error.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h error.64.o: error.c ../cups/debug-private.h ../cups/string-private.h ../config.h interpret.64.o: interpret.c image-private.h image.h ../cups/raster.h ../cups/cups.h interpret.64.o: interpret.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -interpret.64.o: interpret.c ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h +interpret.64.o: interpret.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h interpret.64.o: interpret.c ../cups/debug-private.h ../cups/string-private.h ../config.h raster.64.o: raster.c image-private.h image.h ../cups/raster.h ../cups/cups.h raster.64.o: raster.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -raster.64.o: raster.c ../cups/language.h ../cups/array.h ../cups/ppd.h ../cups/cups.h +raster.64.o: raster.c ../cups/array.h ../cups/language.h ../cups/ppd.h ../cups/cups.h raster.64.o: raster.c ../cups/debug-private.h ../cups/string-private.h ../config.h bannertops.64.o: bannertops.c pstext.h common.h ../cups/string-private.h ../config.h bannertops.64.o: bannertops.c ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h bannertops.64.o: bannertops.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h -bannertops.64.o: bannertops.c ../cups/language.h ../cups/array.h ../cups/transcode.h image.h +bannertops.64.o: bannertops.c ../cups/array.h ../cups/language.h ../cups/transcode.h image.h bannertops.64.o: bannertops.c ../cups/raster.h ../cups/ppd.h ../cups/language-private.h commandtops.64.o: commandtops.c ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h commandtops.64.o: commandtops.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h -commandtops.64.o: commandtops.c ../cups/language.h ../cups/array.h ../cups/string-private.h +commandtops.64.o: commandtops.c ../cups/array.h ../cups/language.h ../cups/string-private.h commandtops.64.o: commandtops.c ../config.h ../cups/sidechannel.h gziptoany.64.o: gziptoany.c ../cups/cups-private.h ../cups/cups.h ../cups/string-private.h gziptoany.64.o: gziptoany.c ../config.h ../cups/debug-private.h ../cups/ppd-private.h gziptoany.64.o: gziptoany.c ../cups/ppd.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -gziptoany.64.o: gziptoany.c ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +gziptoany.64.o: gziptoany.c ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h gziptoany.64.o: gziptoany.c ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h gziptoany.64.o: gziptoany.c ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h gziptoany.64.o: gziptoany.c ../cups/language-private.h ../cups/transcode.h gziptoany.64.o: gziptoany.c ../cups/thread-private.h imagetops.64.o: imagetops.c common.h ../cups/string-private.h ../config.h ../cups/cups.h imagetops.64.o: imagetops.c ../cups/ppd.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -imagetops.64.o: imagetops.c ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +imagetops.64.o: imagetops.c ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h imagetops.64.o: imagetops.c image.h ../cups/raster.h ../cups/ppd.h imagetops.64.o: imagetops.c ../cups/language-private.h ../cups/transcode.h imagetoraster.64.o: imagetoraster.c common.h ../cups/string-private.h ../config.h ../cups/cups.h imagetoraster.64.o: imagetoraster.c ../cups/ppd.h ../cups/cups.h ../cups/file.h imagetoraster.64.o: imagetoraster.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h -imagetoraster.64.o: imagetoraster.c ../cups/language.h ../cups/array.h image-private.h image.h +imagetoraster.64.o: imagetoraster.c ../cups/array.h ../cups/language.h image-private.h image.h imagetoraster.64.o: imagetoraster.c ../cups/raster.h ../cups/ppd.h ../cups/debug-private.h imagetoraster.64.o: imagetoraster.c ../cups/language-private.h ../cups/transcode.h common.64.o: common.c common.h ../cups/string-private.h ../config.h ../cups/cups.h common.64.o: common.c ../cups/ppd.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -common.64.o: common.c ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +common.64.o: common.c ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h pdftops.64.o: pdftops.c ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h -pdftops.64.o: pdftops.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h -pdftops.64.o: pdftops.c ../cups/language.h ../cups/array.h ../cups/string-private.h -pdftops.64.o: pdftops.c ../config.h ../cups/language-private.h ../cups/transcode.h +pdftops.64.o: pdftops.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +pdftops.64.o: pdftops.c ../cups/language.h ../cups/string-private.h ../config.h +pdftops.64.o: pdftops.c ../cups/language-private.h ../cups/transcode.h pstext.64.o: pstext.c pstext.h common.h ../cups/string-private.h ../config.h pstext.64.o: pstext.c ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h -pstext.64.o: pstext.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h -pstext.64.o: pstext.c ../cups/language.h ../cups/array.h ../cups/transcode.h -pstext.64.o: pstext.c ../cups/language-private.h +pstext.64.o: pstext.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +pstext.64.o: pstext.c ../cups/language.h ../cups/transcode.h ../cups/language-private.h pstops.64.o: pstops.c common.h ../cups/string-private.h ../config.h ../cups/cups.h pstops.64.o: pstops.c ../cups/ppd.h ../cups/cups.h ../cups/file.h ../cups/versioning.h -pstops.64.o: pstops.c ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +pstops.64.o: pstops.c ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h pstops.64.o: pstops.c ../cups/file.h ../cups/array.h ../cups/language-private.h pstops.64.o: pstops.c ../cups/transcode.h rasterbench.64.o: rasterbench.c ../config.h ../cups/raster.h ../cups/cups.h ../cups/file.h rasterbench.64.o: rasterbench.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h -rasterbench.64.o: rasterbench.c ../cups/language.h ../cups/array.h ../cups/ppd.h +rasterbench.64.o: rasterbench.c ../cups/array.h ../cups/language.h ../cups/ppd.h rastertoepson.64.o: rastertoepson.c ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h rastertoepson.64.o: rastertoepson.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h -rastertoepson.64.o: rastertoepson.c ../cups/language.h ../cups/array.h ../cups/string-private.h +rastertoepson.64.o: rastertoepson.c ../cups/array.h ../cups/language.h ../cups/string-private.h rastertoepson.64.o: rastertoepson.c ../config.h ../cups/language-private.h ../cups/transcode.h rastertoepson.64.o: rastertoepson.c ../cups/raster.h ../cups/ppd.h rastertohp.64.o: rastertohp.c ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h rastertohp.64.o: rastertohp.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h -rastertohp.64.o: rastertohp.c ../cups/language.h ../cups/array.h ../cups/string-private.h +rastertohp.64.o: rastertohp.c ../cups/array.h ../cups/language.h ../cups/string-private.h rastertohp.64.o: rastertohp.c ../config.h ../cups/language-private.h ../cups/transcode.h rastertohp.64.o: rastertohp.c ../cups/raster.h ../cups/ppd.h rastertolabel.64.o: rastertolabel.c ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h rastertolabel.64.o: rastertolabel.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h -rastertolabel.64.o: rastertolabel.c ../cups/language.h ../cups/array.h ../cups/string-private.h +rastertolabel.64.o: rastertolabel.c ../cups/array.h ../cups/language.h ../cups/string-private.h rastertolabel.64.o: rastertolabel.c ../config.h ../cups/language-private.h ../cups/transcode.h rastertolabel.64.o: rastertolabel.c ../cups/raster.h ../cups/ppd.h testimage.64.o: testimage.c image.h ../cups/raster.h ../cups/cups.h ../cups/file.h testimage.64.o: testimage.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h -testimage.64.o: testimage.c ../cups/language.h ../cups/array.h ../cups/ppd.h +testimage.64.o: testimage.c ../cups/array.h ../cups/language.h ../cups/ppd.h testraster.64.o: testraster.c image-private.h image.h ../cups/raster.h ../cups/cups.h testraster.64.o: testraster.c ../cups/file.h ../cups/versioning.h ../cups/ipp.h -testraster.64.o: testraster.c ../cups/http.h ../cups/language.h ../cups/array.h ../cups/ppd.h +testraster.64.o: testraster.c ../cups/http.h ../cups/array.h ../cups/language.h ../cups/ppd.h testraster.64.o: testraster.c ../cups/cups.h ../cups/debug-private.h ../cups/string-private.h testraster.64.o: testraster.c ../config.h textcommon.64.o: textcommon.c textcommon.h common.h ../cups/string-private.h ../config.h textcommon.64.o: textcommon.c ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h textcommon.64.o: textcommon.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h -textcommon.64.o: textcommon.c ../cups/language.h ../cups/array.h ../cups/language-private.h +textcommon.64.o: textcommon.c ../cups/array.h ../cups/language.h ../cups/language-private.h textcommon.64.o: textcommon.c ../cups/transcode.h texttops.64.o: texttops.c textcommon.h common.h ../cups/string-private.h ../config.h texttops.64.o: texttops.c ../cups/cups.h ../cups/ppd.h ../cups/cups.h ../cups/file.h -texttops.64.o: texttops.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h -texttops.64.o: texttops.c ../cups/language.h ../cups/array.h ../cups/language-private.h -texttops.64.o: texttops.c ../cups/transcode.h +texttops.64.o: texttops.c ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +texttops.64.o: texttops.c ../cups/language.h ../cups/language-private.h ../cups/transcode.h diff --git a/filter/pstops.c b/filter/pstops.c index 96e1e66cb..06e1f93d3 100644 --- a/filter/pstops.c +++ b/filter/pstops.c @@ -2389,6 +2389,7 @@ set_pstops_options( ppd_attr_t *attr; /* PPD attribute */ ppd_option_t *option; /* PPD option */ ppd_choice_t *choice; /* PPD choice */ + const char *content_type; /* Original content type */ /* @@ -2415,6 +2416,18 @@ set_pstops_options( doc->new_bounding_box[2] = INT_MIN; doc->new_bounding_box[3] = INT_MIN; + /* + * See what the source content type is. When printing PostScript content we + * want to do scaling and orientation, but otherwise we don't want to change + * anything... + */ + + if ((content_type = getenv("CONTENT_TYPE")) == NULL) + content_type = "application/postscript"; + + if (!strcasecmp(content_type, "application/postscript")) + Orientation = 0; + /* * AP_FIRSTPAGE_* and the corresponding non-first-page options. */ @@ -2445,7 +2458,6 @@ set_pstops_options( if ((choice = ppdFindMarkedChoice(ppd, "PageSize")) != NULL) doc->page_size = choice->choice; - /* * brightness */ @@ -2505,15 +2517,24 @@ set_pstops_options( doc->emit_jcl = 1; /* - * fitplot/fit-to-page + * fitplot/fit-to-page/ipp-attribute-fidelity + * + * (Only for original PostScript content) */ - if ((val = cupsGetOption("fitplot", num_options, options)) != NULL && - !strcasecmp(val, "true")) - doc->fitplot = 1; - else if ((val = cupsGetOption("fit-to-page", num_options, options)) != NULL && - !strcasecmp(val, "true")) - doc->fitplot = 1; + if (!strcasecmp(content_type, "application/postscript")) + { + if ((val = cupsGetOption("fitplot", num_options, options)) != NULL && + !strcasecmp(val, "true")) + doc->fitplot = 1; + else if ((val = cupsGetOption("fit-to-page", num_options, options)) != NULL && + !strcasecmp(val, "true")) + doc->fitplot = 1; + else if ((val = cupsGetOption("ipp-attribute-fidelity", num_options, + options)) != NULL && + !strcasecmp(val, "true")) + doc->fitplot = 1; + } /* * gamma diff --git a/locale/Dependencies b/locale/Dependencies index da2e94cd3..45dd3faec 100644 --- a/locale/Dependencies +++ b/locale/Dependencies @@ -1,16 +1,16 @@ # DO NOT DELETE THIS LINE -- make depend depends on it. checkpo.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -checkpo.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -checkpo.o: ../cups/language.h ../cups/array.h ../cups/string-private.h -checkpo.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h -checkpo.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h -checkpo.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h -checkpo.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h -checkpo.o: ../cups/transcode.h ../cups/thread-private.h +checkpo.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +checkpo.o: ../cups/language.h ../cups/string-private.h ../config.h +checkpo.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h +checkpo.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h +checkpo.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h +checkpo.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h +checkpo.o: ../cups/thread-private.h po2strings.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h po2strings.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -po2strings.o: ../cups/language.h ../cups/array.h ../cups/string-private.h +po2strings.o: ../cups/array.h ../cups/language.h ../cups/string-private.h po2strings.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h po2strings.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h po2strings.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h @@ -18,7 +18,7 @@ po2strings.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h po2strings.o: ../cups/transcode.h ../cups/thread-private.h translate.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h translate.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -translate.o: ../cups/language.h ../cups/array.h ../cups/string-private.h +translate.o: ../cups/array.h ../cups/language.h ../cups/string-private.h translate.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h translate.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h translate.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h diff --git a/man/ipptoolfile.man b/man/ipptoolfile.man index 3eb02f3dc..15ae814d1 100644 --- a/man/ipptoolfile.man +++ b/man/ipptoolfile.man @@ -238,7 +238,7 @@ matches. IF-DEFINED variable-name Makes the EXPECT conditions apply only if the specified variable is defined. .TP 5 -IF-UNDEFINED variable-name +IF-NOT-DEFINED variable-name Makes the EXPECT conditions apply only if the specified variable is not defined. .TP 5 @@ -267,7 +267,7 @@ The following predicates are understood following the STATUS test directive: IF-DEFINED variable-name Makes the STATUS apply only if the specified variable is defined. .TP 5 -IF-UNDEFINED variable-name +IF-NOT-DEFINED variable-name Makes the STATUS apply only if the specified variable is not defined. .SH OPERATION CODES diff --git a/man/lp.man b/man/lp.man index 853b1e757..5b183556c 100644 --- a/man/lp.man +++ b/man/lp.man @@ -3,7 +3,7 @@ .\" .\" lp man page for the Common UNIX Printing System (CUPS). .\" -.\" Copyright 2007-2009 by Apple Inc. +.\" Copyright 2007-2010 by Apple Inc. .\" Copyright 1997-2006 by Easy Software Products. .\" .\" These coded instructions, statements, and computer programs are the @@ -12,7 +12,7 @@ .\" which should have been included with this file. If this file is .\" file is missing or damaged, see the license at "http://www.cups.org/". .\" -.TH lp 1 "CUPS" "17 November 2008" "Apple Inc." +.TH lp 1 "CUPS" "31 August 2010" "Apple Inc." .SH NAME lp - print files .SH SYNOPSIS @@ -157,7 +157,6 @@ contain a list of numbers and ranges (#-#) separated by commas (e.g. 1,3-5,16). The page numbers refer to the output pages and not the document's original pages - options like "number-up" can affect the numbering of the pages. -that are .SH COMMON JOB OPTIONS Aside from the printer-specific options reported by the \fIlpoptions(1)\fR command, the following generic options are @@ -258,7 +257,7 @@ is highest priority). .br http://localhost:631/help .SH COPYRIGHT -Copyright 2007-2009 by Apple Inc. +Copyright 2007-2010 by Apple Inc. .\" .\" End of "$Id: lp.man 7889 2008-08-29 22:03:35Z mike $". .\" diff --git a/man/lpadmin.man b/man/lpadmin.man index cf34cd474..694f0b817 100644 --- a/man/lpadmin.man +++ b/man/lpadmin.man @@ -3,7 +3,7 @@ .\" .\" lpadmin man page for the Common UNIX Printing System (CUPS). .\" -.\" Copyright 2007-2009 by Apple Inc. +.\" Copyright 2007-2010 by Apple Inc. .\" Copyright 1997-2006 by Easy Software Products. .\" .\" These coded instructions, statements, and computer programs are the @@ -12,7 +12,7 @@ .\" which should have been included with this file. If this file is .\" file is missing or damaged, see the license at "http://www.cups.org/". .\" -.TH lpadmin 8 "CUPS" "3 November 2008" "Apple Inc." +.TH lpadmin 8 "CUPS" "1 September 2010" "Apple Inc." .SH NAME lpadmin \- configure cups printers and classes .SH SYNOPSIS @@ -30,7 +30,7 @@ lpadmin \- configure cups printers and classes ] [ -h .I server[:port] ] -p -.I printer option(s) +.I destination option(s) .br .B lpadmin [ -E ] [-U @@ -55,7 +55,7 @@ destination unless the user specifies otherwise with the \fIlpoptions(1)\fR command. .LP The second form of the command (\fI-p\fR) configures the named -printer. The additional options are described below. +printer or class. The additional options are described below. .LP The third form of the command (\fI-x\fR) deletes the printer or class \fIdestination\fR. Any jobs that are pending for the @@ -78,8 +78,9 @@ and is intended for providing support for legacy printer drivers. .TP 5 -m model .br -Sets a standard System V interface script or PPD file from the -\fImodel\fR directory. +Sets a standard System V interface script or PPD file for the printer from the +\fImodel\fR directory or using one of the driver interfaces. Use the \fI-m\fR +option with the \fIlpinfo(8)\fR command to get a list of supported models. .TP 5 -o job-k-limit=value .br @@ -105,13 +106,12 @@ Sets the default banner page(s) to use for print jobs. .TP 5 -o name=value .br -Sets a PPD option for the printer. PPD options can be -listed using the \fI-l\fR option with the \fIlpoptions(1)\fR -command. +Sets a PPD option for the printer. PPD options can be listed using the \fI-l\fR +option with the \fIlpoptions(1)\fR command. .TP 5 -o name-default=value .br -Sets a default server-side option for the printer. Any print-time +Sets a default server-side option for the destination. Any print-time option can be defaulted, e.g. "-o cpi-default=17" to set the default "cpi" option value to 17. .TP 5 @@ -125,20 +125,21 @@ specified port monitor must be listed in the printer's PPD file. .br Sets the error policy to be used when the printer backend is unable to send the job to the printer. The name must be one of -"abort-job", "retry-job" or "stop-printer". The default error -policy is "stop-printer". +"abort-job", "retry-job", "retry-current-job", or "stop-printer". The default +error policy is "stop-printer" for printers and "retry-current-job" for +classes. .TP 5 -o printer-is-shared=true/false .br -Sets the printer to shared/published or unshared/unpublished. -Shared/published printers are publically announced by the server +Sets the destination to shared/published or unshared/unpublished. +Shared/published destinations are publically announced by the server on the LAN based on the browsing configuration in -\fBcupsd.conf\fR, while unshared/unpublished printers are not +\fBcupsd.conf\fR, while unshared/unpublished destinations are not announced. The default value is "true". .TP 5 -o printer-op-policy=name .br -Sets the IPP operation policy associated with the printer. The +Sets the IPP operation policy associated with the destination. The name must be defined in the \fBcupsd.conf\fR in a Policy section. The default operation policy is "default". .TP 5 @@ -155,7 +156,7 @@ resulting class becomes empty it is removed. .TP 5 -u deny:none .br -Sets user-level access control on a printer. Names starting with +Sets user-level access control on a destination. Names starting with "@" are interpreted as UNIX groups. The latter two forms turn user-level access control off. .TP 5 @@ -163,21 +164,21 @@ user-level access control off. .br Sets the \fIdevice-uri\fR attribute of the printer queue. If \fIdevice-uri\fR is a filename it is automatically converted to -the form \fIfile:///file/name\fR. Use the \fIlpinfo(8)\fR command -to get a list of supported device URIs and schemes. +the form \fIfile:///file/name\fR. Use the \fI-v\fR option with the +\fIlpinfo(8)\fR command to get a list of supported device URIs and schemes. .TP 5 -D "info" .br -Provides a textual description of the printer. +Provides a textual description of the destination. .TP 5 -E .br -Enables the printer and accepts jobs; this is the same as running the -\fIcupsaccept(8)\fR and \fIcupsenable(8)\fR programs on the printer. +Enables the destination and accepts jobs; this is the same as running the +\fIcupsaccept(8)\fR and \fIcupsenable(8)\fR programs on the destination. .TP 5 -L "location" .br -Provides a textual location of the printer. +Provides a textual location of the destination. .TP 5 -P ppd-file .br @@ -201,7 +202,7 @@ System V or Solaris printing system configuration options. .br http://localhost:631/help .SH COPYRIGHT -Copyright 2007-2009 by Apple Inc. +Copyright 2007-2010 by Apple Inc. .\" .\" End of "$Id: lpadmin.man 7600 2008-05-20 21:06:23Z mike $". .\" diff --git a/monitor/Dependencies b/monitor/Dependencies index d5130c0b0..83791215b 100644 --- a/monitor/Dependencies +++ b/monitor/Dependencies @@ -1,8 +1,8 @@ # DO NOT DELETE THIS LINE -- make depend depends on it. bcp.o: ../cups/string-private.h ../config.h ../cups/cups.h ../cups/file.h -bcp.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h -bcp.o: ../cups/array.h ../cups/ppd.h ../cups/cups.h +bcp.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +bcp.o: ../cups/language.h ../cups/ppd.h ../cups/cups.h tbcp.o: ../cups/string-private.h ../config.h ../cups/cups.h ../cups/file.h -tbcp.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h -tbcp.o: ../cups/array.h ../cups/ppd.h ../cups/cups.h +tbcp.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +tbcp.o: ../cups/language.h ../cups/ppd.h ../cups/cups.h diff --git a/notifier/Dependencies b/notifier/Dependencies index 85597442d..0915fde6e 100644 --- a/notifier/Dependencies +++ b/notifier/Dependencies @@ -1,15 +1,15 @@ # DO NOT DELETE THIS LINE -- make depend depends on it. dbus.o: ../cups/cups.h ../cups/file.h ../cups/versioning.h ../cups/ipp.h -dbus.o: ../cups/http.h ../cups/language.h ../cups/array.h +dbus.o: ../cups/http.h ../cups/array.h ../cups/language.h dbus.o: ../cups/string-private.h ../config.h mailto.o: ../cups/cups.h ../cups/file.h ../cups/versioning.h ../cups/ipp.h -mailto.o: ../cups/http.h ../cups/language.h ../cups/array.h +mailto.o: ../cups/http.h ../cups/array.h ../cups/language.h mailto.o: ../cups/language-private.h ../cups/transcode.h mailto.o: ../cups/string-private.h ../config.h rss.o: ../cups/cups.h ../cups/file.h ../cups/versioning.h ../cups/ipp.h -rss.o: ../cups/http.h ../cups/language.h ../cups/array.h ../cups/language.h +rss.o: ../cups/http.h ../cups/array.h ../cups/language.h ../cups/language.h rss.o: ../cups/string-private.h ../config.h ../cups/array.h testnotify.o: ../cups/cups.h ../cups/file.h ../cups/versioning.h -testnotify.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +testnotify.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h testnotify.o: ../cups/language.h ../cups/string-private.h ../config.h diff --git a/ppdc/Dependencies b/ppdc/Dependencies index 42c909e10..8d49d5843 100644 --- a/ppdc/Dependencies +++ b/ppdc/Dependencies @@ -2,7 +2,7 @@ ppdc-array.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h ppdc-array.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -ppdc-array.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +ppdc-array.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h ppdc-array.o: ../cups/string-private.h ../config.h ../cups/debug-private.h ppdc-array.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h ppdc-array.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h @@ -11,7 +11,7 @@ ppdc-array.o: ../cups/language-private.h ../cups/transcode.h ppdc-array.o: ../cups/thread-private.h ppdc-attr.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h ppdc-attr.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -ppdc-attr.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +ppdc-attr.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h ppdc-attr.o: ../cups/string-private.h ../config.h ../cups/debug-private.h ppdc-attr.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h ppdc-attr.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h @@ -20,8 +20,8 @@ ppdc-attr.o: ../cups/language-private.h ../cups/transcode.h ppdc-attr.o: ../cups/thread-private.h ppdc-catalog.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h ppdc-catalog.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -ppdc-catalog.o: ../cups/ipp.h ../cups/http.h ../cups/language.h -ppdc-catalog.o: ../cups/array.h ../cups/string-private.h ../config.h +ppdc-catalog.o: ../cups/ipp.h ../cups/http.h ../cups/array.h +ppdc-catalog.o: ../cups/language.h ../cups/string-private.h ../config.h ppdc-catalog.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h ppdc-catalog.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h ppdc-catalog.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h @@ -29,8 +29,8 @@ ppdc-catalog.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h ppdc-catalog.o: ../cups/thread-private.h ppdc-choice.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h ppdc-choice.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -ppdc-choice.o: ../cups/ipp.h ../cups/http.h ../cups/language.h -ppdc-choice.o: ../cups/array.h ../cups/string-private.h ../config.h +ppdc-choice.o: ../cups/ipp.h ../cups/http.h ../cups/array.h +ppdc-choice.o: ../cups/language.h ../cups/string-private.h ../config.h ppdc-choice.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h ppdc-choice.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h ppdc-choice.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h @@ -38,8 +38,8 @@ ppdc-choice.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h ppdc-choice.o: ../cups/thread-private.h ppdc-constraint.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h ppdc-constraint.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -ppdc-constraint.o: ../cups/ipp.h ../cups/http.h ../cups/language.h -ppdc-constraint.o: ../cups/array.h ../cups/string-private.h ../config.h +ppdc-constraint.o: ../cups/ipp.h ../cups/http.h ../cups/array.h +ppdc-constraint.o: ../cups/language.h ../cups/string-private.h ../config.h ppdc-constraint.o: ../cups/debug-private.h ../cups/ppd-private.h ppdc-constraint.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h ppdc-constraint.o: ../cups/http-private.h ../cups/http.h @@ -48,8 +48,8 @@ ppdc-constraint.o: ../cups/language-private.h ../cups/transcode.h ppdc-constraint.o: ../cups/thread-private.h ppdc-driver.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h ppdc-driver.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -ppdc-driver.o: ../cups/ipp.h ../cups/http.h ../cups/language.h -ppdc-driver.o: ../cups/array.h ../cups/string-private.h ../config.h +ppdc-driver.o: ../cups/ipp.h ../cups/http.h ../cups/array.h +ppdc-driver.o: ../cups/language.h ../cups/string-private.h ../config.h ppdc-driver.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h ppdc-driver.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h ppdc-driver.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h @@ -57,7 +57,7 @@ ppdc-driver.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h ppdc-driver.o: ../cups/thread-private.h ppdc-file.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h ppdc-file.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -ppdc-file.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +ppdc-file.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h ppdc-file.o: ../cups/string-private.h ../config.h ../cups/debug-private.h ppdc-file.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h ppdc-file.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h @@ -66,8 +66,8 @@ ppdc-file.o: ../cups/language-private.h ../cups/transcode.h ppdc-file.o: ../cups/thread-private.h ppdc-filter.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h ppdc-filter.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -ppdc-filter.o: ../cups/ipp.h ../cups/http.h ../cups/language.h -ppdc-filter.o: ../cups/array.h ../cups/string-private.h ../config.h +ppdc-filter.o: ../cups/ipp.h ../cups/http.h ../cups/array.h +ppdc-filter.o: ../cups/language.h ../cups/string-private.h ../config.h ppdc-filter.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h ppdc-filter.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h ppdc-filter.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h @@ -75,7 +75,7 @@ ppdc-filter.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h ppdc-filter.o: ../cups/thread-private.h ppdc-font.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h ppdc-font.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -ppdc-font.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +ppdc-font.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h ppdc-font.o: ../cups/string-private.h ../config.h ../cups/debug-private.h ppdc-font.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h ppdc-font.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h @@ -84,7 +84,7 @@ ppdc-font.o: ../cups/language-private.h ../cups/transcode.h ppdc-font.o: ../cups/thread-private.h ppdc-group.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h ppdc-group.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -ppdc-group.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +ppdc-group.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h ppdc-group.o: ../cups/string-private.h ../config.h ../cups/debug-private.h ppdc-group.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h ppdc-group.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h @@ -93,8 +93,8 @@ ppdc-group.o: ../cups/language-private.h ../cups/transcode.h ppdc-group.o: ../cups/thread-private.h ppdc-import.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h ppdc-import.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -ppdc-import.o: ../cups/ipp.h ../cups/http.h ../cups/language.h -ppdc-import.o: ../cups/array.h ../cups/string-private.h ../config.h +ppdc-import.o: ../cups/ipp.h ../cups/http.h ../cups/array.h +ppdc-import.o: ../cups/language.h ../cups/string-private.h ../config.h ppdc-import.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h ppdc-import.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h ppdc-import.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h @@ -102,8 +102,8 @@ ppdc-import.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h ppdc-import.o: ../cups/thread-private.h ppdc-mediasize.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h ppdc-mediasize.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -ppdc-mediasize.o: ../cups/ipp.h ../cups/http.h ../cups/language.h -ppdc-mediasize.o: ../cups/array.h ../cups/string-private.h ../config.h +ppdc-mediasize.o: ../cups/ipp.h ../cups/http.h ../cups/array.h +ppdc-mediasize.o: ../cups/language.h ../cups/string-private.h ../config.h ppdc-mediasize.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h ppdc-mediasize.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h ppdc-mediasize.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h @@ -111,8 +111,8 @@ ppdc-mediasize.o: ../cups/ipp.h ../cups/language-private.h ppdc-mediasize.o: ../cups/transcode.h ../cups/thread-private.h ppdc-message.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h ppdc-message.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -ppdc-message.o: ../cups/ipp.h ../cups/http.h ../cups/language.h -ppdc-message.o: ../cups/array.h ../cups/string-private.h ../config.h +ppdc-message.o: ../cups/ipp.h ../cups/http.h ../cups/array.h +ppdc-message.o: ../cups/language.h ../cups/string-private.h ../config.h ppdc-message.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h ppdc-message.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h ppdc-message.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h @@ -120,8 +120,8 @@ ppdc-message.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h ppdc-message.o: ../cups/thread-private.h ppdc-option.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h ppdc-option.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -ppdc-option.o: ../cups/ipp.h ../cups/http.h ../cups/language.h -ppdc-option.o: ../cups/array.h ../cups/string-private.h ../config.h +ppdc-option.o: ../cups/ipp.h ../cups/http.h ../cups/array.h +ppdc-option.o: ../cups/language.h ../cups/string-private.h ../config.h ppdc-option.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h ppdc-option.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h ppdc-option.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h @@ -129,8 +129,8 @@ ppdc-option.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h ppdc-option.o: ../cups/thread-private.h ppdc-profile.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h ppdc-profile.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -ppdc-profile.o: ../cups/ipp.h ../cups/http.h ../cups/language.h -ppdc-profile.o: ../cups/array.h ../cups/string-private.h ../config.h +ppdc-profile.o: ../cups/ipp.h ../cups/http.h ../cups/array.h +ppdc-profile.o: ../cups/language.h ../cups/string-private.h ../config.h ppdc-profile.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h ppdc-profile.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h ppdc-profile.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h @@ -138,8 +138,8 @@ ppdc-profile.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h ppdc-profile.o: ../cups/thread-private.h ppdc-shared.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h ppdc-shared.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -ppdc-shared.o: ../cups/ipp.h ../cups/http.h ../cups/language.h -ppdc-shared.o: ../cups/array.h ../cups/string-private.h ../config.h +ppdc-shared.o: ../cups/ipp.h ../cups/http.h ../cups/array.h +ppdc-shared.o: ../cups/language.h ../cups/string-private.h ../config.h ppdc-shared.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h ppdc-shared.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h ppdc-shared.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h @@ -147,8 +147,8 @@ ppdc-shared.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h ppdc-shared.o: ../cups/thread-private.h ppdc-source.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h ppdc-source.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -ppdc-source.o: ../cups/ipp.h ../cups/http.h ../cups/language.h -ppdc-source.o: ../cups/array.h ../cups/string-private.h ../config.h +ppdc-source.o: ../cups/ipp.h ../cups/http.h ../cups/array.h +ppdc-source.o: ../cups/language.h ../cups/string-private.h ../config.h ppdc-source.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h ppdc-source.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h ppdc-source.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h @@ -158,8 +158,8 @@ ppdc-source.o: ../data/epson.h ../data/escp.h ../data/hp.h ../data/label.h ppdc-source.o: ../data/pcl.h ppdc-string.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h ppdc-string.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -ppdc-string.o: ../cups/ipp.h ../cups/http.h ../cups/language.h -ppdc-string.o: ../cups/array.h ../cups/string-private.h ../config.h +ppdc-string.o: ../cups/ipp.h ../cups/http.h ../cups/array.h +ppdc-string.o: ../cups/language.h ../cups/string-private.h ../config.h ppdc-string.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h ppdc-string.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h ppdc-string.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h @@ -167,8 +167,8 @@ ppdc-string.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h ppdc-string.o: ../cups/thread-private.h ppdc-variable.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h ppdc-variable.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -ppdc-variable.o: ../cups/ipp.h ../cups/http.h ../cups/language.h -ppdc-variable.o: ../cups/array.h ../cups/string-private.h ../config.h +ppdc-variable.o: ../cups/ipp.h ../cups/http.h ../cups/array.h +ppdc-variable.o: ../cups/language.h ../cups/string-private.h ../config.h ppdc-variable.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h ppdc-variable.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h ppdc-variable.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h @@ -176,7 +176,7 @@ ppdc-variable.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h ppdc-variable.o: ../cups/thread-private.h genstrings.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h genstrings.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -genstrings.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +genstrings.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h genstrings.o: ../cups/string-private.h ../config.h ../cups/debug-private.h genstrings.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h genstrings.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h @@ -185,7 +185,7 @@ genstrings.o: ../cups/language-private.h ../cups/transcode.h genstrings.o: ../cups/thread-private.h ppdc.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h ppdc.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h ../cups/ipp.h -ppdc.o: ../cups/http.h ../cups/language.h ../cups/array.h +ppdc.o: ../cups/http.h ../cups/array.h ../cups/language.h ppdc.o: ../cups/string-private.h ../config.h ../cups/debug-private.h ppdc.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h ppdc.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h @@ -194,7 +194,7 @@ ppdc.o: ../cups/language-private.h ../cups/transcode.h ppdc.o: ../cups/thread-private.h ppdhtml.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h ppdhtml.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h ../cups/ipp.h -ppdhtml.o: ../cups/http.h ../cups/language.h ../cups/array.h +ppdhtml.o: ../cups/http.h ../cups/array.h ../cups/language.h ppdhtml.o: ../cups/string-private.h ../config.h ../cups/debug-private.h ppdhtml.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h ppdhtml.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h @@ -203,7 +203,7 @@ ppdhtml.o: ../cups/language-private.h ../cups/transcode.h ppdhtml.o: ../cups/thread-private.h ppdi.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h ppdi.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h ../cups/ipp.h -ppdi.o: ../cups/http.h ../cups/language.h ../cups/array.h +ppdi.o: ../cups/http.h ../cups/array.h ../cups/language.h ppdi.o: ../cups/string-private.h ../config.h ../cups/debug-private.h ppdi.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h ppdi.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h @@ -211,17 +211,16 @@ ppdi.o: ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h ppdi.o: ../cups/language-private.h ../cups/transcode.h ppdi.o: ../cups/thread-private.h ppdmerge.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -ppdmerge.o: ../cups/ipp.h ../cups/http.h ../cups/versioning.h -ppdmerge.o: ../cups/language.h ../cups/array.h ../cups/string-private.h -ppdmerge.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h -ppdmerge.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h -ppdmerge.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h -ppdmerge.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h -ppdmerge.o: ../cups/transcode.h ../cups/thread-private.h -ppdmerge.o: ../cups/ppd-private.h ../cups/array.h +ppdmerge.o: ../cups/ipp.h ../cups/http.h ../cups/versioning.h ../cups/array.h +ppdmerge.o: ../cups/language.h ../cups/string-private.h ../config.h +ppdmerge.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h +ppdmerge.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h +ppdmerge.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h +ppdmerge.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h +ppdmerge.o: ../cups/thread-private.h ../cups/ppd-private.h ../cups/array.h ppdpo.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h ppdpo.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h ../cups/ipp.h -ppdpo.o: ../cups/http.h ../cups/language.h ../cups/array.h +ppdpo.o: ../cups/http.h ../cups/array.h ../cups/language.h ppdpo.o: ../cups/string-private.h ../config.h ../cups/debug-private.h ppdpo.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h ppdpo.o: ../cups/pwg-private.h ../cups/http-private.h ../cups/http.h @@ -230,8 +229,8 @@ ppdpo.o: ../cups/language-private.h ../cups/transcode.h ppdpo.o: ../cups/thread-private.h testcatalog.o: ppdc-private.h ppdc.h ../cups/file.h ../cups/versioning.h testcatalog.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -testcatalog.o: ../cups/ipp.h ../cups/http.h ../cups/language.h -testcatalog.o: ../cups/array.h ../cups/string-private.h ../config.h +testcatalog.o: ../cups/ipp.h ../cups/http.h ../cups/array.h +testcatalog.o: ../cups/language.h ../cups/string-private.h ../config.h testcatalog.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h testcatalog.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h testcatalog.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h diff --git a/scheduler/Dependencies b/scheduler/Dependencies index 9d86f98dc..d1e099d39 100644 --- a/scheduler/Dependencies +++ b/scheduler/Dependencies @@ -1,8 +1,8 @@ # DO NOT DELETE auth.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h -auth.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h -auth.o: ../cups/array.h ../cups/string-private.h ../config.h +auth.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +auth.o: ../cups/language.h ../cups/string-private.h ../config.h auth.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h auth.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h auth.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h @@ -12,19 +12,19 @@ auth.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h auth.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h auth.o: network.h subscriptions.h banners.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h -banners.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -banners.o: ../cups/language.h ../cups/array.h ../cups/string-private.h -banners.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h -banners.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h -banners.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h -banners.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h -banners.o: ../cups/transcode.h ../cups/thread-private.h mime.h -banners.o: ../cups/array.h ../cups/file.h sysman.h statbuf.h cert.h auth.h -banners.o: client.h policy.h printers.h ../cups/pwg-private.h classes.h job.h -banners.o: conf.h banners.h dirsvc.h network.h subscriptions.h ../cups/dir.h +banners.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +banners.o: ../cups/language.h ../cups/string-private.h ../config.h +banners.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h +banners.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h +banners.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h +banners.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h +banners.o: ../cups/thread-private.h mime.h ../cups/array.h ../cups/file.h +banners.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h +banners.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h +banners.o: network.h subscriptions.h ../cups/dir.h cert.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h -cert.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h -cert.o: ../cups/array.h ../cups/string-private.h ../config.h +cert.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +cert.o: ../cups/language.h ../cups/string-private.h ../config.h cert.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h cert.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h cert.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h @@ -34,30 +34,30 @@ cert.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h cert.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h cert.o: network.h subscriptions.h classes.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h -classes.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -classes.o: ../cups/language.h ../cups/array.h ../cups/string-private.h -classes.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h -classes.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h -classes.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h -classes.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h -classes.o: ../cups/transcode.h ../cups/thread-private.h mime.h -classes.o: ../cups/array.h ../cups/file.h sysman.h statbuf.h cert.h auth.h -classes.o: client.h policy.h printers.h ../cups/pwg-private.h classes.h job.h -classes.o: conf.h banners.h dirsvc.h network.h subscriptions.h +classes.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +classes.o: ../cups/language.h ../cups/string-private.h ../config.h +classes.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h +classes.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h +classes.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h +classes.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h +classes.o: ../cups/thread-private.h mime.h ../cups/array.h ../cups/file.h +classes.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h +classes.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h +classes.o: network.h subscriptions.h client.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h -client.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -client.o: ../cups/language.h ../cups/array.h ../cups/string-private.h -client.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h -client.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h -client.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h -client.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h -client.o: ../cups/transcode.h ../cups/thread-private.h mime.h ../cups/array.h -client.o: ../cups/file.h sysman.h statbuf.h cert.h auth.h client.h policy.h -client.o: printers.h ../cups/pwg-private.h classes.h job.h conf.h banners.h -client.o: dirsvc.h network.h subscriptions.h +client.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +client.o: ../cups/language.h ../cups/string-private.h ../config.h +client.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h +client.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h +client.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h +client.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h +client.o: ../cups/thread-private.h mime.h ../cups/array.h ../cups/file.h +client.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h +client.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h +client.o: network.h subscriptions.h conf.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h -conf.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h -conf.o: ../cups/array.h ../cups/string-private.h ../config.h +conf.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +conf.o: ../cups/language.h ../cups/string-private.h ../config.h conf.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h conf.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h conf.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h @@ -67,19 +67,19 @@ conf.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h conf.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h conf.o: network.h subscriptions.h dirsvc.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h -dirsvc.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -dirsvc.o: ../cups/language.h ../cups/array.h ../cups/string-private.h -dirsvc.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h -dirsvc.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h -dirsvc.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h -dirsvc.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h -dirsvc.o: ../cups/transcode.h ../cups/thread-private.h mime.h ../cups/array.h -dirsvc.o: ../cups/file.h sysman.h statbuf.h cert.h auth.h client.h policy.h -dirsvc.o: printers.h ../cups/pwg-private.h classes.h job.h conf.h banners.h -dirsvc.o: dirsvc.h network.h subscriptions.h +dirsvc.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +dirsvc.o: ../cups/language.h ../cups/string-private.h ../config.h +dirsvc.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h +dirsvc.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h +dirsvc.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h +dirsvc.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h +dirsvc.o: ../cups/thread-private.h mime.h ../cups/array.h ../cups/file.h +dirsvc.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h +dirsvc.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h +dirsvc.o: network.h subscriptions.h env.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h -env.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h -env.o: ../cups/array.h ../cups/string-private.h ../config.h +env.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +env.o: ../cups/language.h ../cups/string-private.h ../config.h env.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h env.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h env.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h @@ -89,8 +89,8 @@ env.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h env.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h env.o: network.h subscriptions.h main.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h -main.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h -main.o: ../cups/array.h ../cups/string-private.h ../config.h +main.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +main.o: ../cups/language.h ../cups/string-private.h ../config.h main.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h main.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h main.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h @@ -100,8 +100,8 @@ main.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h main.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h main.o: network.h subscriptions.h ../cups/dir.h ipp.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h -ipp.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h -ipp.o: ../cups/array.h ../cups/string-private.h ../config.h +ipp.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +ipp.o: ../cups/language.h ../cups/string-private.h ../config.h ipp.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h ipp.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h ipp.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h @@ -111,19 +111,19 @@ ipp.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h ipp.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h ipp.o: network.h subscriptions.h ../cups/ppd-private.h listen.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h -listen.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -listen.o: ../cups/language.h ../cups/array.h ../cups/string-private.h -listen.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h -listen.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h -listen.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h -listen.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h -listen.o: ../cups/transcode.h ../cups/thread-private.h mime.h ../cups/array.h -listen.o: ../cups/file.h sysman.h statbuf.h cert.h auth.h client.h policy.h -listen.o: printers.h ../cups/pwg-private.h classes.h job.h conf.h banners.h -listen.o: dirsvc.h network.h subscriptions.h +listen.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +listen.o: ../cups/language.h ../cups/string-private.h ../config.h +listen.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h +listen.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h +listen.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h +listen.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h +listen.o: ../cups/thread-private.h mime.h ../cups/array.h ../cups/file.h +listen.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h +listen.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h +listen.o: network.h subscriptions.h job.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h -job.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h -job.o: ../cups/array.h ../cups/string-private.h ../config.h +job.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +job.o: ../cups/language.h ../cups/string-private.h ../config.h job.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h job.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h job.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h @@ -133,8 +133,8 @@ job.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h job.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h job.o: network.h subscriptions.h ../cups/backend.h ../cups/dir.h log.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h -log.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h -log.o: ../cups/array.h ../cups/string-private.h ../config.h +log.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +log.o: ../cups/language.h ../cups/string-private.h ../config.h log.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h log.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h log.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h @@ -146,8 +146,8 @@ log.o: network.h subscriptions.h network.o: ../cups/http-private.h ../config.h ../cups/http.h network.o: ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h cupsd.h network.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -network.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -network.o: ../cups/language.h ../cups/array.h ../cups/string-private.h +network.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +network.o: ../cups/language.h ../cups/string-private.h network.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h network.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h network.o: ../cups/language-private.h ../cups/transcode.h @@ -156,53 +156,52 @@ network.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h network.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h network.o: network.h subscriptions.h policy.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h -policy.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -policy.o: ../cups/language.h ../cups/array.h ../cups/string-private.h -policy.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h -policy.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h -policy.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h -policy.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h -policy.o: ../cups/transcode.h ../cups/thread-private.h mime.h ../cups/array.h -policy.o: ../cups/file.h sysman.h statbuf.h cert.h auth.h client.h policy.h -policy.o: printers.h ../cups/pwg-private.h classes.h job.h conf.h banners.h -policy.o: dirsvc.h network.h subscriptions.h +policy.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +policy.o: ../cups/language.h ../cups/string-private.h ../config.h +policy.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h +policy.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h +policy.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h +policy.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h +policy.o: ../cups/thread-private.h mime.h ../cups/array.h ../cups/file.h +policy.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h +policy.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h +policy.o: network.h subscriptions.h printers.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h -printers.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -printers.o: ../cups/language.h ../cups/array.h ../cups/string-private.h -printers.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h -printers.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h -printers.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h -printers.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h -printers.o: ../cups/transcode.h ../cups/thread-private.h mime.h -printers.o: ../cups/array.h ../cups/file.h sysman.h statbuf.h cert.h auth.h -printers.o: client.h policy.h printers.h ../cups/pwg-private.h classes.h -printers.o: job.h conf.h banners.h dirsvc.h network.h subscriptions.h -printers.o: ../cups/dir.h +printers.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +printers.o: ../cups/language.h ../cups/string-private.h ../config.h +printers.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h +printers.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h +printers.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h +printers.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h +printers.o: ../cups/thread-private.h mime.h ../cups/array.h ../cups/file.h +printers.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h +printers.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h +printers.o: network.h subscriptions.h ../cups/dir.h process.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h -process.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -process.o: ../cups/language.h ../cups/array.h ../cups/string-private.h -process.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h -process.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h -process.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h -process.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h -process.o: ../cups/transcode.h ../cups/thread-private.h mime.h -process.o: ../cups/array.h ../cups/file.h sysman.h statbuf.h cert.h auth.h -process.o: client.h policy.h printers.h ../cups/pwg-private.h classes.h job.h -process.o: conf.h banners.h dirsvc.h network.h subscriptions.h +process.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +process.o: ../cups/language.h ../cups/string-private.h ../config.h +process.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h +process.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h +process.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h +process.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h +process.o: ../cups/thread-private.h mime.h ../cups/array.h ../cups/file.h +process.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h +process.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h +process.o: network.h subscriptions.h quotas.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h -quotas.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -quotas.o: ../cups/language.h ../cups/array.h ../cups/string-private.h -quotas.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h -quotas.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h -quotas.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h -quotas.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h -quotas.o: ../cups/transcode.h ../cups/thread-private.h mime.h ../cups/array.h -quotas.o: ../cups/file.h sysman.h statbuf.h cert.h auth.h client.h policy.h -quotas.o: printers.h ../cups/pwg-private.h classes.h job.h conf.h banners.h -quotas.o: dirsvc.h network.h subscriptions.h +quotas.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +quotas.o: ../cups/language.h ../cups/string-private.h ../config.h +quotas.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h +quotas.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h +quotas.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h +quotas.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h +quotas.o: ../cups/thread-private.h mime.h ../cups/array.h ../cups/file.h +quotas.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h +quotas.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h +quotas.o: network.h subscriptions.h removefile.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h removefile.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -removefile.o: ../cups/language.h ../cups/array.h ../cups/string-private.h +removefile.o: ../cups/array.h ../cups/language.h ../cups/string-private.h removefile.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h removefile.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h removefile.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h @@ -212,42 +211,42 @@ removefile.o: ../cups/array.h ../cups/file.h sysman.h statbuf.h cert.h auth.h removefile.o: client.h policy.h printers.h ../cups/pwg-private.h classes.h removefile.o: job.h conf.h banners.h dirsvc.h network.h subscriptions.h select.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h -select.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -select.o: ../cups/language.h ../cups/array.h ../cups/string-private.h -select.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h -select.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h -select.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h -select.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h -select.o: ../cups/transcode.h ../cups/thread-private.h mime.h ../cups/array.h -select.o: ../cups/file.h sysman.h statbuf.h cert.h auth.h client.h policy.h -select.o: printers.h ../cups/pwg-private.h classes.h job.h conf.h banners.h -select.o: dirsvc.h network.h subscriptions.h +select.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +select.o: ../cups/language.h ../cups/string-private.h ../config.h +select.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h +select.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h +select.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h +select.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h +select.o: ../cups/thread-private.h mime.h ../cups/array.h ../cups/file.h +select.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h +select.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h +select.o: network.h subscriptions.h server.o: ../cups/http-private.h ../config.h ../cups/http.h server.o: ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h cupsd.h server.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -server.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -server.o: ../cups/language.h ../cups/array.h ../cups/string-private.h -server.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h -server.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h +server.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +server.o: ../cups/language.h ../cups/string-private.h ../cups/debug-private.h +server.o: ../cups/ppd-private.h ../cups/ppd.h ../cups/cups.h +server.o: ../cups/pwg-private.h ../cups/http-private.h server.o: ../cups/language-private.h ../cups/transcode.h server.o: ../cups/thread-private.h mime.h ../cups/array.h ../cups/file.h server.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h server.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h server.o: network.h subscriptions.h statbuf.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h -statbuf.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -statbuf.o: ../cups/language.h ../cups/array.h ../cups/string-private.h -statbuf.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h -statbuf.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h -statbuf.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h -statbuf.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h -statbuf.o: ../cups/transcode.h ../cups/thread-private.h mime.h -statbuf.o: ../cups/array.h ../cups/file.h sysman.h statbuf.h cert.h auth.h -statbuf.o: client.h policy.h printers.h ../cups/pwg-private.h classes.h job.h -statbuf.o: conf.h banners.h dirsvc.h network.h subscriptions.h +statbuf.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +statbuf.o: ../cups/language.h ../cups/string-private.h ../config.h +statbuf.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h +statbuf.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h +statbuf.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h +statbuf.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h +statbuf.o: ../cups/thread-private.h mime.h ../cups/array.h ../cups/file.h +statbuf.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h +statbuf.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h +statbuf.o: network.h subscriptions.h subscriptions.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h subscriptions.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -subscriptions.o: ../cups/language.h ../cups/array.h ../cups/string-private.h +subscriptions.o: ../cups/array.h ../cups/language.h ../cups/string-private.h subscriptions.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h subscriptions.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h subscriptions.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h @@ -258,16 +257,16 @@ subscriptions.o: ../cups/file.h sysman.h statbuf.h cert.h auth.h client.h subscriptions.o: policy.h printers.h ../cups/pwg-private.h classes.h job.h subscriptions.o: conf.h banners.h dirsvc.h network.h subscriptions.h sysman.o: cupsd.h ../cups/cups-private.h ../cups/cups.h ../cups/file.h -sysman.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -sysman.o: ../cups/language.h ../cups/array.h ../cups/string-private.h -sysman.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h -sysman.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h -sysman.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h -sysman.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h -sysman.o: ../cups/transcode.h ../cups/thread-private.h mime.h ../cups/array.h -sysman.o: ../cups/file.h sysman.h statbuf.h cert.h auth.h client.h policy.h -sysman.o: printers.h ../cups/pwg-private.h classes.h job.h conf.h banners.h -sysman.o: dirsvc.h network.h subscriptions.h +sysman.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +sysman.o: ../cups/language.h ../cups/string-private.h ../config.h +sysman.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h +sysman.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h +sysman.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h +sysman.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h +sysman.o: ../cups/thread-private.h mime.h ../cups/array.h ../cups/file.h +sysman.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h +sysman.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h +sysman.o: network.h subscriptions.h filter.o: ../cups/string-private.h ../config.h ../cups/debug-private.h mime.h filter.o: ../cups/array.h ../cups/ipp.h ../cups/file.h mime.o: ../cups/string-private.h ../config.h ../cups/debug-private.h @@ -277,7 +276,7 @@ type.o: ../cups/string-private.h ../config.h ../cups/debug-private.h mime.h type.o: ../cups/array.h ../cups/ipp.h ../cups/file.h cupsfilter.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h cupsfilter.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -cupsfilter.o: ../cups/language.h ../cups/array.h ../cups/string-private.h +cupsfilter.o: ../cups/array.h ../cups/language.h ../cups/string-private.h cupsfilter.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h cupsfilter.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h cupsfilter.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h @@ -286,48 +285,48 @@ cupsfilter.o: ../cups/transcode.h ../cups/thread-private.h mime.h cupsfilter.o: ../cups/array.h ../cups/file.h cups-deviced.o: util.h ../cups/file-private.h ../cups/cups-private.h cups-deviced.o: ../cups/cups.h ../cups/file.h ../cups/versioning.h -cups-deviced.o: ../cups/ipp.h ../cups/http.h ../cups/language.h -cups-deviced.o: ../cups/array.h ../cups/string-private.h ../config.h +cups-deviced.o: ../cups/ipp.h ../cups/http.h ../cups/array.h +cups-deviced.o: ../cups/language.h ../cups/string-private.h ../config.h cups-deviced.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h cups-deviced.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h cups-deviced.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h cups-deviced.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h cups-deviced.o: ../cups/thread-private.h ../cups/array.h ../cups/dir.h cups-lpd.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -cups-lpd.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -cups-lpd.o: ../cups/language.h ../cups/array.h ../cups/string-private.h -cups-lpd.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h -cups-lpd.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h -cups-lpd.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h -cups-lpd.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h -cups-lpd.o: ../cups/transcode.h ../cups/thread-private.h +cups-lpd.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +cups-lpd.o: ../cups/language.h ../cups/string-private.h ../config.h +cups-lpd.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h +cups-lpd.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h +cups-lpd.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h +cups-lpd.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h +cups-lpd.o: ../cups/thread-private.h cups-polld.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h cups-polld.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -cups-polld.o: ../cups/language.h ../cups/array.h ../cups/string-private.h +cups-polld.o: ../cups/array.h ../cups/language.h ../cups/string-private.h cups-polld.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h cups-polld.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h cups-polld.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h cups-polld.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h cups-polld.o: ../cups/transcode.h ../cups/thread-private.h testdirsvc.o: ../cups/cups.h ../cups/file.h ../cups/versioning.h -testdirsvc.o: ../cups/ipp.h ../cups/http.h ../cups/language.h ../cups/array.h +testdirsvc.o: ../cups/ipp.h ../cups/http.h ../cups/array.h ../cups/language.h testdirsvc.o: ../cups/string-private.h ../config.h testlpd.o: ../cups/cups.h ../cups/file.h ../cups/versioning.h ../cups/ipp.h -testlpd.o: ../cups/http.h ../cups/language.h ../cups/array.h +testlpd.o: ../cups/http.h ../cups/array.h ../cups/language.h testlpd.o: ../cups/string-private.h ../config.h testmime.o: ../cups/string-private.h ../config.h ../cups/dir.h testmime.o: ../cups/versioning.h mime.h ../cups/array.h ../cups/ipp.h testmime.o: ../cups/file.h testspeed.o: ../cups/string-private.h ../config.h ../cups/cups.h testspeed.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -testspeed.o: ../cups/language.h ../cups/array.h ../cups/language.h +testspeed.o: ../cups/array.h ../cups/language.h ../cups/language.h testspeed.o: ../cups/debug-private.h testsub.o: ../cups/cups.h ../cups/file.h ../cups/versioning.h ../cups/ipp.h -testsub.o: ../cups/http.h ../cups/language.h ../cups/array.h +testsub.o: ../cups/http.h ../cups/array.h ../cups/language.h testsub.o: ../cups/debug-private.h ../cups/string-private.h ../config.h util.o: util.h ../cups/file-private.h ../cups/cups-private.h ../cups/cups.h util.o: ../cups/file.h ../cups/versioning.h ../cups/ipp.h ../cups/http.h -util.o: ../cups/language.h ../cups/array.h ../cups/string-private.h +util.o: ../cups/array.h ../cups/language.h ../cups/string-private.h util.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h util.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h util.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h @@ -335,8 +334,8 @@ util.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h util.o: ../cups/transcode.h ../cups/thread-private.h cups-driverd.o: util.h ../cups/file-private.h ../cups/cups-private.h cups-driverd.o: ../cups/cups.h ../cups/file.h ../cups/versioning.h -cups-driverd.o: ../cups/ipp.h ../cups/http.h ../cups/language.h -cups-driverd.o: ../cups/array.h ../cups/string-private.h ../config.h +cups-driverd.o: ../cups/ipp.h ../cups/http.h ../cups/array.h +cups-driverd.o: ../cups/language.h ../cups/string-private.h ../config.h cups-driverd.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h cups-driverd.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h cups-driverd.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h diff --git a/scheduler/auth.c b/scheduler/auth.c index 73a0c98c4..497997d6f 100644 --- a/scheduler/auth.c +++ b/scheduler/auth.c @@ -993,6 +993,24 @@ cupsdAuthorize(cupsd_client_t *con) /* I - Client connection */ "cupsdAuthorize: Copying credentials for UID %d...", CUPSD_UCRED_UID(peercred)); + if (!KerberosInitialized) + { + /* + * Setup a Kerberos context for the scheduler to use... + */ + + KerberosInitialized = 1; + + if (krb5_init_context(&KerberosContext)) + { + KerberosContext = NULL; + + cupsdLogMessage(CUPSD_LOG_ERROR, + "Unable to initialize Kerberos context"); + return; + } + } + krb5_ipc_client_set_target_uid(CUPSD_UCRED_UID(peercred)); if ((error = krb5_cc_default(KerberosContext, &peerccache)) != 0) diff --git a/scheduler/classes.c b/scheduler/classes.c index fca0d18b1..72b5dbff0 100644 --- a/scheduler/classes.c +++ b/scheduler/classes.c @@ -41,6 +41,7 @@ cupsd_printer_t * /* O - New class */ cupsdAddClass(const char *name) /* I - Name of class */ { cupsd_printer_t *c; /* New class */ + char uri[1024]; /* Class URI */ /* @@ -55,8 +56,10 @@ cupsdAddClass(const char *name) /* I - Name of class */ c->type = CUPS_PRINTER_CLASS; - cupsdSetStringf(&c->uri, "ipp://%s:%d/classes/%s", ServerName, RemotePort, - name); + httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL, + ServerName, RemotePort, "/classes/%s", name); + cupsdSetString(&c->uri, uri); + cupsdSetString(&c->error_policy, "retry-current-job"); } @@ -722,7 +725,7 @@ cupsdSaveAllClasses(void) */ fchown(cupsFileNumber(fp), RunUser, Group); - fchmod(cupsFileNumber(fp), 0600); + fchmod(cupsFileNumber(fp), ConfigFilePerm); /* * Write a small header to the file... diff --git a/scheduler/client.c b/scheduler/client.c index 631bc9eee..298fdfe30 100644 --- a/scheduler/client.c +++ b/scheduler/client.c @@ -52,40 +52,6 @@ #include "cupsd.h" -#ifdef HAVE_CDSASSL -# include -# include -# ifdef HAVE_SECITEMPRIV_H -# include -# else /* Declare constant from that header... */ -extern const CFTypeRef kSecClassIdentity; -# endif /* HAVE_SECITEMPRIV_H */ -# ifdef HAVE_SECIDENTITYSEARCHPRIV_H -# include -# else /* Declare prototype for function in that header... */ -extern OSStatus SecIdentitySearchCreateWithPolicy(SecPolicyRef policy, - CFStringRef idString, CSSM_KEYUSE keyUsage, - CFTypeRef keychainOrArray, - Boolean returnOnlyValidIdentities, - SecIdentitySearchRef* searchRef); -# endif /* HAVE_SECIDENTITYSEARCHPRIV_H */ -# ifdef HAVE_SECPOLICYPRIV_H -# include -# else /* Declare prototype for function in that header... */ -extern OSStatus SecPolicySetValue(SecPolicyRef policyRef, - const CSSM_DATA *value); -# endif /* HAVE_SECPOLICYPRIV_H */ -# ifdef HAVE_SECBASEPRIV_H -# include -# else /* Declare prototype for function in that header... */ -extern const char *cssmErrorString(int error); -# endif /* HAVE_SECBASEPRIV_H */ -#endif /* HAVE_CDSASSL */ - -#ifdef HAVE_GNUTLS -# include -#endif /* HAVE_GNUTLS */ - #ifdef HAVE_TCPD_H # include #endif /* HAVE_TCPD_H */ @@ -538,15 +504,12 @@ cupsdCloseClient(cupsd_client_t *con) /* I - Client to close */ int partial; /* Do partial close for SSL? */ #ifdef HAVE_LIBSSL SSL_CTX *context; /* Context for encryption */ - SSL *conn; /* Connection for encryption */ unsigned long error; /* Error code */ #elif defined(HAVE_GNUTLS) - http_tls_t *conn; /* TLS connection information */ int error; /* Error code */ gnutls_certificate_server_credentials *credentials; /* TLS credentials */ # elif defined(HAVE_CDSASSL) - http_tls_t *conn; /* CDSA connection information */ #endif /* HAVE_LIBSSL */ @@ -570,10 +533,9 @@ cupsdCloseClient(cupsd_client_t *con) /* I - Client to close */ partial = 1; # ifdef HAVE_LIBSSL - conn = (SSL *)(con->http.tls); - context = SSL_get_SSL_CTX(conn); + context = SSL_get_SSL_CTX(con->http.tls); - switch (SSL_shutdown(conn)) + switch (SSL_shutdown(con->http.tls)) { case 1 : cupsdLogMessage(CUPSD_LOG_DEBUG, @@ -590,13 +552,12 @@ cupsdCloseClient(cupsd_client_t *con) /* I - Client to close */ } SSL_CTX_free(context); - SSL_free(conn); + SSL_free(con->http.tls); # elif defined(HAVE_GNUTLS) - conn = (http_tls_t *)(con->http.tls); - credentials = (gnutls_certificate_server_credentials *)(conn->credentials); + credentials = (gnutls_certificate_server_credentials *)(con->http.tls_credentials); - error = gnutls_bye(conn->session, GNUTLS_SHUT_WR); + error = gnutls_bye(con->http.tls, GNUTLS_SHUT_WR); switch (error) { case GNUTLS_E_SUCCESS: @@ -609,23 +570,19 @@ cupsdCloseClient(cupsd_client_t *con) /* I - Client to close */ break; } - gnutls_deinit(conn->session); + gnutls_deinit(con->http.tls); gnutls_certificate_free_credentials(*credentials); free(credentials); - free(conn); # elif defined(HAVE_CDSASSL) - conn = (http_tls_t *)(con->http.tls); - - while (SSLClose(conn->session) == errSSLWouldBlock) + while (SSLClose(con->http.tls) == errSSLWouldBlock) usleep(1000); - SSLDisposeContext(conn->session); + SSLDisposeContext(con->http.tls); - if (conn->certsArray) - CFRelease(conn->certsArray); + if (con->http.tls_credentials) + CFRelease(con->http.tls_credentials); - free(conn); # endif /* HAVE_LIBSSL */ con->http.tls = NULL; @@ -1382,6 +1339,35 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */ break; } } + else if ((!strncmp(con->uri, "/printers/", 10) || + !strncmp(con->uri, "/classes/", 9)) && + !strcmp(con->uri + strlen(con->uri) - 4, ".png")) + { + /* + * Send icon file - get the real queue name since queue names are + * not case sensitive but filenames can be... + */ + + con->uri[strlen(con->uri) - 4] = '\0'; /* Drop ".png" */ + + if (!strncmp(con->uri, "/printers/", 10)) + p = cupsdFindPrinter(con->uri + 10); + else + p = cupsdFindClass(con->uri + 9); + + if (p) + snprintf(con->uri, sizeof(con->uri), "/icons/%s.png", p->name); + else + { + if (!cupsdSendError(con, HTTP_NOT_FOUND, CUPSD_AUTH_NONE)) + { + cupsdCloseClient(con); + return; + } + + break; + } + } if ((!strncmp(con->uri, "/admin", 6) && strncmp(con->uri, "/admin/conf/", 12) && @@ -3091,13 +3077,12 @@ data_ready(cupsd_client_t *con) /* I - Client */ if (SSL_pending((SSL *)(con->http.tls))) return (1); # elif defined(HAVE_GNUTLS) - if (gnutls_record_check_pending(((http_tls_t *)(con->http.tls))->session)) + if (gnutls_record_check_pending(con->http.tls)) return (1); # elif defined(HAVE_CDSASSL) size_t bytes; /* Bytes that are available */ - if (!SSLGetBufferedReadSize(((http_tls_t *)(con->http.tls))->session, - &bytes) && bytes > 0) + if (!SSLGetBufferedReadSize(con->http.tls, &bytes) && bytes > 0) return (1); # endif /* HAVE_LIBSSL */ } @@ -3117,7 +3102,6 @@ encrypt_client(cupsd_client_t *con) /* I - Client to encrypt */ { # ifdef HAVE_LIBSSL SSL_CTX *context; /* Context for encryption */ - SSL *conn; /* Connection for encryption */ BIO *bio; /* BIO data */ unsigned long error; /* Error code */ @@ -3154,10 +3138,10 @@ encrypt_client(cupsd_client_t *con) /* I - Client to encrypt */ bio = BIO_new(_httpBIOMethods()); BIO_ctrl(bio, BIO_C_SET_FILE_PTR, 0, (char *)HTTP(con)); - conn = SSL_new(context); - SSL_set_bio(conn, bio, bio); + con->http.tls = SSL_new(context); + SSL_set_bio(con->http.tls, bio, bio); - if (SSL_accept(conn) != 1) + if (SSL_accept(con->http.tls) != 1) { cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to encrypt connection from %s!", con->http.hostname); @@ -3166,18 +3150,17 @@ encrypt_client(cupsd_client_t *con) /* I - Client to encrypt */ cupsdLogMessage(CUPSD_LOG_ERROR, "%s", ERR_error_string(error, NULL)); SSL_CTX_free(context); - SSL_free(conn); + SSL_free(con->http.tls); + con->http.tls = NULL; return (0); } cupsdLogMessage(CUPSD_LOG_DEBUG, "Connection from %s now encrypted.", con->http.hostname); - con->http.tls = conn; return (1); # elif defined(HAVE_GNUTLS) - http_tls_t *conn; /* TLS session object */ int error; /* Error code */ gnutls_certificate_server_credentials *credentials; /* TLS credentials */ @@ -3204,11 +3187,6 @@ encrypt_client(cupsd_client_t *con) /* I - Client to encrypt */ * Create the SSL object and perform the SSL handshake... */ - conn = (http_tls_t *)malloc(sizeof(http_tls_t)); - - if (conn == NULL) - return (0); - credentials = (gnutls_certificate_server_credentials *) malloc(sizeof(gnutls_certificate_server_credentials)); if (credentials == NULL) @@ -3217,7 +3195,6 @@ encrypt_client(cupsd_client_t *con) /* I - Client to encrypt */ "Unable to encrypt connection from %s - %s", con->http.hostname, strerror(errno)); - free(conn); return (0); } @@ -3225,14 +3202,14 @@ encrypt_client(cupsd_client_t *con) /* I - Client to encrypt */ gnutls_certificate_set_x509_key_file(*credentials, ServerCertificate, ServerKey, GNUTLS_X509_FMT_PEM); - gnutls_init(&(conn->session), GNUTLS_SERVER); - gnutls_set_default_priority(conn->session); - gnutls_credentials_set(conn->session, GNUTLS_CRD_CERTIFICATE, *credentials); - gnutls_transport_set_ptr(conn->session, (gnutls_transport_ptr)HTTP(con)); - gnutls_transport_set_pull_function(conn->session, _httpReadGNUTLS); - gnutls_transport_set_push_function(conn->session, _httpWriteGNUTLS); + gnutls_init(&con->http.tls), GNUTLS_SERVER); + gnutls_set_default_priority(con->http.tls); + gnutls_credentials_set(con->http.tls, GNUTLS_CRD_CERTIFICATE, *credentials); + gnutls_transport_set_ptr(con->http.tls, (gnutls_transport_ptr)HTTP(con)); + gnutls_transport_set_pull_function(con->http.tls, _httpReadGNUTLS); + gnutls_transport_set_push_function(con->http.tls, _httpWriteGNUTLS); - error = gnutls_handshake(conn->session); + error = gnutls_handshake(con->http.tls); if (error != GNUTLS_E_SUCCESS) { @@ -3240,9 +3217,9 @@ encrypt_client(cupsd_client_t *con) /* I - Client to encrypt */ "Unable to encrypt connection from %s - %s", con->http.hostname, gnutls_strerror(error)); - gnutls_deinit(conn->session); + gnutls_deinit(con->http.tls); gnutls_certificate_free_credentials(*credentials); - free(conn); + con->http.tls = NULL; free(credentials); return (0); } @@ -3250,36 +3227,30 @@ encrypt_client(cupsd_client_t *con) /* I - Client to encrypt */ cupsdLogMessage(CUPSD_LOG_DEBUG, "Connection from %s now encrypted.", con->http.hostname); - conn->credentials = credentials; - con->http.tls = conn; + con->http.tls_credentials = credentials; return (1); # elif defined(HAVE_CDSASSL) OSStatus error; /* Error code */ - http_tls_t *conn; /* CDSA connection information */ cupsdLogMessage(CUPSD_LOG_DEBUG2, "encrypt_client(con=%p(%d))", con, con->http.fd); - if ((conn = (http_tls_t *)malloc(sizeof(http_tls_t))) == NULL) - return (0); - - error = 0; - conn->session = NULL; - conn->certsArray = get_cdsa_certificate(con); + error = 0; + con->http.tls_credentials = get_cdsa_certificate(con); - if (!conn->certsArray) + if (!con->http.tls_credentials) { /* * No keychain (yet), make a self-signed certificate... */ if (make_certificate(con)) - conn->certsArray = get_cdsa_certificate(con); + con->http.tls_credentials = get_cdsa_certificate(con); } - if (!conn->certsArray) + if (!con->http.tls_credentials) { cupsdLogMessage(CUPSD_LOG_ERROR, "Could not find signing key in keychain \"%s\"", @@ -3288,25 +3259,25 @@ encrypt_client(cupsd_client_t *con) /* I - Client to encrypt */ } if (!error) - error = SSLNewContext(true, &conn->session); + error = SSLNewContext(true, &con->http.tls); if (!error) - error = SSLSetIOFuncs(conn->session, _httpReadCDSA, _httpWriteCDSA); + error = SSLSetIOFuncs(con->http.tls, _httpReadCDSA, _httpWriteCDSA); if (!error) - error = SSLSetProtocolVersionEnabled(conn->session, kSSLProtocol2, false); + error = SSLSetProtocolVersionEnabled(con->http.tls, kSSLProtocol2, false); if (!error) - error = SSLSetConnection(conn->session, HTTP(con)); + error = SSLSetConnection(con->http.tls, HTTP(con)); if (!error) - error = SSLSetAllowsExpiredCerts(conn->session, true); + error = SSLSetAllowsExpiredCerts(con->http.tls, true); if (!error) - error = SSLSetAllowsAnyRoot(conn->session, true); + error = SSLSetAllowsAnyRoot(con->http.tls, true); if (!error) - error = SSLSetCertificate(conn->session, conn->certsArray); + error = SSLSetCertificate(con->http.tls, con->http.tls_credentials); if (!error) { @@ -3314,7 +3285,7 @@ encrypt_client(cupsd_client_t *con) /* I - Client to encrypt */ * Perform SSL/TLS handshake */ - while ((error = SSLHandshake(conn->session)) == errSSLWouldBlock) + while ((error = SSLHandshake(con->http.tls)) == errSSLWouldBlock) usleep(1000); } @@ -3327,13 +3298,17 @@ encrypt_client(cupsd_client_t *con) /* I - Client to encrypt */ con->http.error = error; con->http.status = HTTP_ERROR; - if (conn->session) - SSLDisposeContext(conn->session); - - if (conn->certsArray) - CFRelease(conn->certsArray); + if (con->http.tls) + { + SSLDisposeContext(con->http.tls); + con->http.tls = NULL; + } - free(conn); + if (con->http.tls_credentials) + { + CFRelease(con->http.tls_credentials); + con->http.tls_credentials = NULL; + } return (0); } @@ -3341,7 +3316,16 @@ encrypt_client(cupsd_client_t *con) /* I - Client to encrypt */ cupsdLogMessage(CUPSD_LOG_DEBUG, "Connection from %s now encrypted.", con->http.hostname); - con->http.tls = conn; + CFArrayRef peerCerts; /* Peer certificates */ + + if (!(error = SSLCopyPeerCertificates(con->http.tls, &peerCerts)) && peerCerts) + { + cupsdLogMessage(CUPSD_LOG_DEBUG, "Received %d peer certificates!", + (int)CFArrayGetCount(peerCerts)); + } + else + cupsdLogMessage(CUPSD_LOG_DEBUG, "Received NO peer certificates!"); + return (1); # endif /* HAVE_LIBSSL */ @@ -3354,9 +3338,9 @@ encrypt_client(cupsd_client_t *con) /* I - Client to encrypt */ * 'get_cdsa_certificate()' - Get a SSL/TLS certificate from the System keychain. */ -static CFArrayRef /* O - Array of certificates */ +static CFArrayRef /* O - Array of certificates */ get_cdsa_certificate( - cupsd_client_t *con) /* I - Client connection */ + cupsd_client_t *con) /* I - Client connection */ { OSStatus err; /* Error info */ SecKeychainRef keychain = NULL;/* Keychain reference */ @@ -3462,7 +3446,7 @@ get_cdsa_certificate( # elif defined(HAVE_SECIDENTITYSEARCHCREATEWITHPOLICY) /* - * Use a policy to search for valid certificates who's common name matches the + * Use a policy to search for valid certificates whose common name matches the * servername... */ @@ -3588,7 +3572,6 @@ get_cdsa_certificate( CFRelease(policy); if (query) CFRelease(query); - # elif defined(HAVE_SECIDENTITYSEARCHCREATEWITHPOLICY) if (policy) CFRelease(policy); @@ -3623,8 +3606,14 @@ get_file(cupsd_client_t *con, /* I - Client connection */ language[0] = '\0'; - if (!strncmp(con->uri, "/ppd/", 5)) + if (!strncmp(con->uri, "/ppd/", 5) && !strchr(con->uri + 5, '/')) snprintf(filename, len, "%s%s", ServerRoot, con->uri); + else if (!strncmp(con->uri, "/icons/", 7) && !strchr(con->uri + 7, '/')) + { + snprintf(filename, len, "%s/%s", CacheDir, con->uri + 7); + if (access(filename, F_OK) < 0) + snprintf(filename, len, "%s/images/generic.png", DocumentRoot); + } else if (!strncmp(con->uri, "/rss/", 5) && !strchr(con->uri + 5, '/')) snprintf(filename, len, "%s/rss/%s", CacheDir, con->uri + 5); else if (!strncmp(con->uri, "/admin/conf/", 12)) @@ -3657,7 +3646,9 @@ get_file(cupsd_client_t *con, /* I - Client connection */ */ if ((status = stat(filename, filestats)) != 0 && language[0] && + strncmp(con->uri, "/icons/", 7) && strncmp(con->uri, "/ppd/", 5) && + strncmp(con->uri, "/rss/", 5) && strncmp(con->uri, "/admin/conf/", 12) && strncmp(con->uri, "/admin/log/", 11)) { @@ -4517,7 +4508,7 @@ make_certificate(cupsd_client_t *con) /* I - Client connection */ return (0); } - cupsFilePrintf(fp, "%s\nr\n\ny\nb\ns\ny\n%s\n\n\n\n\n%s\ny\n", + cupsFilePrintf(fp, "%s\nr\n\ny\nb\ns\ny\n%s\n\n\n\n\n%s\ny\n", con->servername, con->servername, ServerAdmin); cupsFileClose(fp); diff --git a/scheduler/cupsd.h b/scheduler/cupsd.h index 73e4d3bf0..1c5ce2560 100644 --- a/scheduler/cupsd.h +++ b/scheduler/cupsd.h @@ -153,8 +153,10 @@ VAR int MaxFDs VALUE(0); VAR time_t ReloadTime VALUE(0); /* Time of reload request... */ -VAR int NeedReload VALUE(RELOAD_ALL); +VAR int NeedReload VALUE(RELOAD_ALL), /* Need to load configuration? */ + DoingShutdown VALUE(0); + /* Shutting down the scheduler? */ VAR void *DefaultProfile VALUE(0); /* Default security profile */ diff --git a/scheduler/dirsvc.c b/scheduler/dirsvc.c index 51ee11378..581ab6763 100644 --- a/scheduler/dirsvc.c +++ b/scheduler/dirsvc.c @@ -2347,8 +2347,8 @@ dnssdBuildTxtRecord( int for_lpd) /* I - 1 = LPD, 0 = IPP */ { int i; /* Looping var */ - char adminurl_str[256], /* URL for th admin page */ - type_str[32], /* Type to string buffer */ + char adminurl_str[256], /* URL for the admin page */ + type_str[32], /* Type to string buffer */ state_str[32], /* State to string buffer */ rp_str[1024], /* Queue name string buffer */ air_str[1024], /* auth-info-required string buffer */ diff --git a/scheduler/ipp.c b/scheduler/ipp.c index 897c2f46d..f711b8bd0 100644 --- a/scheduler/ipp.c +++ b/scheduler/ipp.c @@ -2943,11 +2943,11 @@ add_printer(cupsd_client_t *con, /* I - Client connection */ char cache_name[1024]; /* Cache filename for printer attrs */ - snprintf(cache_name, sizeof(cache_name), "%s/%s.ipp3", CacheDir, + snprintf(cache_name, sizeof(cache_name), "%s/%s.ipp4", CacheDir, printer->name); unlink(cache_name); - snprintf(cache_name, sizeof(cache_name), "%s/%s.pwg2", CacheDir, + snprintf(cache_name, sizeof(cache_name), "%s/%s.pwg3", CacheDir, printer->name); unlink(cache_name); @@ -5664,6 +5664,8 @@ copy_printer_attrs( { char printer_uri[HTTP_MAX_URI]; /* Printer URI */ + char printer_icons[HTTP_MAX_URI]; + /* Printer icons */ time_t curtime; /* Current time */ int i; /* Looping var */ ipp_attribute_t *history; /* History collection */ @@ -5763,6 +5765,16 @@ copy_printer_attrs( sizeof(errors) / sizeof(errors[0]), NULL, errors); } + if (!ra || cupsArrayFind(ra, "printer-icons")) + { + httpAssembleURIf(HTTP_URI_CODING_ALL, printer_icons, sizeof(printer_icons), + "http", NULL, con->servername, con->serverport, + "/icons/%s.png", printer->name); + ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_URI, "printer-icons", + NULL, printer_icons); + cupsdLogMessage(CUPSD_LOG_DEBUG2, "printer-icons=\"%s\"", printer_icons); + } + if (!ra || cupsArrayFind(ra, "printer-is-accepting-jobs")) ippAddBoolean(con->response, IPP_TAG_PRINTER, "printer-is-accepting-jobs", printer->accepting); @@ -6656,10 +6668,13 @@ delete_printer(cupsd_client_t *con, /* I - Client connection */ printer->name); unlink(filename); - snprintf(filename, sizeof(filename), "%s/%s.ipp3", CacheDir, printer->name); + snprintf(filename, sizeof(filename), "%s/%s.ipp4", CacheDir, printer->name); + unlink(filename); + + snprintf(filename, sizeof(filename), "%s/%s.png", CacheDir, printer->name); unlink(filename); - snprintf(filename, sizeof(filename), "%s/%s.pwg2", CacheDir, printer->name); + snprintf(filename, sizeof(filename), "%s/%s.pwg3", CacheDir, printer->name); unlink(filename); #ifdef __APPLE__ diff --git a/scheduler/job.c b/scheduler/job.c index 62b634540..cc395d311 100644 --- a/scheduler/job.c +++ b/scheduler/job.c @@ -1,7 +1,7 @@ /* * "$Id: job.c 7902 2008-09-03 14:20:17Z mike $" * - * Job management routines for the Common UNIX Printing System (CUPS). + * Job management routines for the CUPS scheduler. * * Copyright 2007-2010 by Apple Inc. * Copyright 1997-2007 by Easy Software Products, all rights reserved. @@ -348,7 +348,7 @@ cupsdCheckJobs(void) */ if (job->state_value == IPP_JOB_PENDING && !NeedReload && !Sleeping && - !job->printer) + !DoingShutdown && !job->printer) { printer = cupsdFindDest(job->dest); pclass = NULL; @@ -2856,7 +2856,7 @@ finalize_job(cupsd_job_t *job, /* I - Job */ job->tries ++; - if (job->tries >= JobRetryLimit) + if (job->tries > JobRetryLimit && JobRetryLimit > 0) { /* * Too many tries... @@ -3049,8 +3049,17 @@ get_options(cupsd_job_t *job, /* I - Job */ num_pwgppds = 0; pwgppds = NULL; - if (pwg) + if (pwg && + !ippFindAttribute(job->attrs, + "com.apple.print.DocumentTicket.PMSpoolFormat", + IPP_TAG_ZERO) && + (ippFindAttribute(job->attrs, "output-mode", IPP_TAG_ZERO) || + ippFindAttribute(job->attrs, "print-quality", IPP_TAG_ZERO))) { + /* + * Map output-mode and print-quality to a preset... + */ + if ((attr = ippFindAttribute(job->attrs, "output-mode", IPP_TAG_KEYWORD)) != NULL && !strcmp(attr->values[0].string.text, "monochrome")) @@ -3101,7 +3110,10 @@ get_options(cupsd_job_t *job, /* I - Job */ &pwgppds); } } + } + if (pwg) + { if (pwg->sides_option && !ippFindAttribute(job->attrs, pwg->sides_option, IPP_TAG_ZERO) && (attr = ippFindAttribute(job->attrs, "sides", IPP_TAG_KEYWORD)) != NULL) diff --git a/scheduler/main.c b/scheduler/main.c index 8248c526c..1c0bdf4f8 100644 --- a/scheduler/main.c +++ b/scheduler/main.c @@ -706,6 +706,8 @@ main(int argc, /* I - Number of command-line args */ * Shutdown the server... */ + DoingShutdown = 1; + cupsdStopServer(); /* @@ -736,6 +738,8 @@ main(int argc, /* I - Number of command-line args */ * Startup the server... */ + DoingShutdown = 0; + cupsdStartServer(); /* @@ -1111,6 +1115,8 @@ main(int argc, /* I - Number of command-line args */ * Close all network clients... */ + DoingShutdown = 1; + cupsdStopServer(); #ifdef HAVE_LAUNCHD diff --git a/scheduler/printers.c b/scheduler/printers.c index b0298c0ec..537d6e4f4 100644 --- a/scheduler/printers.c +++ b/scheduler/printers.c @@ -65,6 +65,21 @@ #include "cupsd.h" #include +#ifdef HAVE_APPLICATIONSERVICES_H +# include +#endif /* HAVE_APPLICATIONSERVICES_H */ +#ifdef HAVE_SYS_MOUNT_H +# include +#endif /* HAVE_SYS_MOUNT_H */ +#ifdef HAVE_SYS_STATFS_H +# include +#endif /* HAVE_SYS_STATFS_H */ +#ifdef HAVE_SYS_STATVFS_H +# include +#endif /* HAVE_SYS_STATVFS_H */ +#ifdef HAVE_SYS_VFS_H +# include +#endif /* HAVE_SYS_VFS_H */ /* @@ -97,6 +112,7 @@ cupsd_printer_t * /* O - New printer */ cupsdAddPrinter(const char *name) /* I - Name of printer */ { cupsd_printer_t *p; /* New printer */ + char uri[1024]; /* Printer URI */ /* @@ -120,8 +136,9 @@ cupsdAddPrinter(const char *name) /* I - Name of printer */ cupsdSetString(&p->info, name); cupsdSetString(&p->hostname, ServerName); - cupsdSetStringf(&p->uri, "ipp://%s:%d/printers/%s", ServerName, RemotePort, - name); + httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL, + ServerName, RemotePort, "/printers/%s", name); + cupsdSetString(&p->uri, uri); cupsdSetDeviceURI(p, "file:///dev/null"); p->state = IPP_PRINTER_STOPPED; @@ -270,6 +287,14 @@ cupsdCreateCommonData(void) char filename[1024], /* Filename */ *notifier; /* Current notifier */ cupsd_policy_t *p; /* Current policy */ + int k_supported; /* Maximum file size supported */ +#ifdef HAVE_STATFS + struct statfs spoolinfo; /* FS info for spool directory */ + double spoolsize; /* FS size */ +#elif defined(HAVE_STATVFS) + struct statvfs spoolinfo; /* FS info for spool directory */ + double spoolsize; /* FS size */ +#endif /* HAVE_STATFS */ static const int nups[] = /* number-up-supported values */ { 1, 2, 4, 6, 9, 16 }; static const int orients[4] =/* orientation-requested-supported values */ @@ -419,6 +444,7 @@ cupsdCreateCommonData(void) "multiple-document-handling", "number-up", "output-bin", + "output-mode", "orientation-requested", "page-ranges", "print-quality", @@ -437,6 +463,7 @@ cupsdCreateCommonData(void) "multiple-document-handling", "number-up", "output-bin", + "output-mode", "orientation-requested", "page-ranges", "print-quality", @@ -449,17 +476,17 @@ cupsdCreateCommonData(void) "printer-location" }; static const char * const which_jobs[] = - { /* which-jobs-supported values */ - "completed", - "not-completed", - "aborted", - "all", - "canceled", - "pending", - "pending-held", - "processing", - "processing-stopped" - }; + { /* which-jobs-supported values */ + "completed", + "not-completed", + "aborted", + "all", + "canceled", + "pending", + "pending-held", + "processing", + "processing-stopped" + }; if (CommonData) @@ -467,6 +494,34 @@ cupsdCreateCommonData(void) CommonData = ippNew(); + /* + * Get the maximum spool size based on the size of the filesystem used for + * the RequestRoot directory. If the host OS doesn't support the statfs call + * or the filesystem is larger than 2TiB, always report INT_MAX. + */ + +#ifdef HAVE_STATFS + if (statfs(RequestRoot, &spoolinfo)) + k_supported = INT_MAX; + else if ((spoolsize = (double)spoolinfo.f_bsize * spoolinfo.f_blocks / 1024) > + INT_MAX) + k_supported = INT_MAX; + else + k_supported = (int)spoolsize; + +#elif defined(HAVE_STATVFS) + if (statvfs(RequestRoot, &spoolinfo)) + k_supported = INT_MAX; + else if ((spoolsize = (double)spoolinfo.f_frsize * spoolinfo.f_blocks / 1024) > + INT_MAX) + k_supported = INT_MAX; + else + k_supported = (int)spoolsize; + +#else + k_supported = INT_MAX; +#endif /* HAVE_STATFS */ + /* * This list of attributes is sorted to improve performance when the * client provides a requested-attributes attribute... @@ -521,6 +576,10 @@ cupsdCreateCommonData(void) /* job-ids-supported */ ippAddBoolean(CommonData, IPP_TAG_PRINTER, "job-ids-supported", 1); + /* job-k-octets-supported */ + ippAddInteger(CommonData, IPP_TAG_PRINTER, IPP_TAG_INTEGER, + "job-k-octets-supported", k_supported); + /* job-priority-supported */ ippAddInteger(CommonData, IPP_TAG_PRINTER, IPP_TAG_INTEGER, "job-priority-supported", 100); @@ -663,9 +722,9 @@ cupsdCreateCommonData(void) /* page-ranges-supported */ ippAddBoolean(CommonData, IPP_TAG_PRINTER, "page-ranges-supported", 1); - /* pdf-override-supported */ + /* pdl-override-supported */ ippAddString(CommonData, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | IPP_TAG_COPY, - "pdl-override-supported", NULL, "not-attempted"); + "pdl-override-supported", NULL, "attempted"); /* printer-op-policy-supported */ attr = ippAddStrings(CommonData, IPP_TAG_PRINTER, IPP_TAG_NAME | IPP_TAG_COPY, @@ -1564,7 +1623,7 @@ cupsdSaveAllPrinters(void) */ fchown(cupsFileNumber(fp), getuid(), Group); - fchmod(cupsFileNumber(fp), 0600); + fchmod(cupsFileNumber(fp), ConfigFilePerm & 0600); /* * Write a small header to the file... @@ -3633,12 +3692,11 @@ add_printer_filter( if (!RunUser) { /* - * Only use filters that are owned by root and do not have group or world - * write permissions. + * Only use filters that are owned by root and do not have world write + * permissions. */ - if (fileinfo.st_uid || - (fileinfo.st_mode & (S_ISUID | S_IWGRP | S_IWOTH)) != 0) + if (fileinfo.st_uid || (fileinfo.st_mode & (S_ISUID | S_IWOTH)) != 0) { if (fileinfo.st_uid) snprintf(p->state_message, sizeof(p->state_message), @@ -3665,7 +3723,7 @@ add_printer_filter( if (!stat(filename, &fileinfo) && (fileinfo.st_uid || - (fileinfo.st_mode & (S_ISUID | S_IWGRP | S_IWOTH)) != 0)) + (fileinfo.st_mode & (S_ISUID | S_IWOTH)) != 0)) { if (fileinfo.st_uid) snprintf(p->state_message, sizeof(p->state_message), @@ -4002,11 +4060,11 @@ load_ppd(cupsd_printer_t *p) /* I - Printer */ * Check to see if the cache is up-to-date... */ - snprintf(cache_name, sizeof(cache_name), "%s/%s.ipp3", CacheDir, p->name); + snprintf(cache_name, sizeof(cache_name), "%s/%s.ipp4", CacheDir, p->name); if (stat(cache_name, &cache_info)) cache_info.st_mtime = 0; - snprintf(pwg_name, sizeof(pwg_name), "%s/%s.pwg2", CacheDir, p->name); + snprintf(pwg_name, sizeof(pwg_name), "%s/%s.pwg3", CacheDir, p->name); if (stat(pwg_name, &pwg_info)) pwg_info.st_mtime = 0; @@ -4490,8 +4548,9 @@ load_ppd(cupsd_printer_t *p) /* I - Printer */ else if (((ppd_attr = ppdFindAttr(ppd, "DefaultOutputOrder", NULL)) != NULL && !strcasecmp(ppd_attr->value, "Reverse")) || - (!ppd_attr && ppd->manufacturer && /* EPSON "compatibility heuristic" */ - !strcasecmp(ppd->manufacturer, "epson"))) + (!ppd_attr && ppd->manufacturer && /* "Compatibility heuristic" */ + (!strcasecmp(ppd->manufacturer, "epson") || + !strcasecmp(ppd->manufacturer, "lexmark")))) { /* * Report that this printer has a single output bin that leaves pages face @@ -4511,6 +4570,31 @@ load_ppd(cupsd_printer_t *p) /* I - Printer */ "output-bin-default", NULL, "face-down"); } + /* + * output-mode... + */ + + if (ppd->color_device) + { + static const char * const output_modes[] = + { + "monochrome", + "color" + }; + + ippAddStrings(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, + "output-mode-supported", 2, NULL, output_modes); + ippAddString(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, + "output-mode-default", NULL, "color"); + } + else + { + ippAddString(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, + "output-mode-supported", NULL, "monochrome"); + ippAddString(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, + "output-mode-default", NULL, "monochrome"); + } + /* * Printer resolutions... */ @@ -4544,7 +4628,7 @@ load_ppd(cupsd_printer_t *p) /* I - Printer */ cupsdLogMessage(CUPSD_LOG_WARN, "Bad resolution \"%s\" for printer %s.", choice->choice, p->name); - xdpi = ydpi = 72; + xdpi = ydpi = 300; } attr->values[i].resolution.xres = xdpi; @@ -4578,7 +4662,7 @@ load_ppd(cupsd_printer_t *p) /* I - Printer */ cupsdLogMessage(CUPSD_LOG_WARN, "Bad default resolution \"%s\" for printer %s.", ppd_attr->value, p->name); - xdpi = ydpi = 72; + xdpi = ydpi = 300; } ippAddResolution(p->ppd_attrs, IPP_TAG_PRINTER, @@ -4596,16 +4680,18 @@ load_ppd(cupsd_printer_t *p) /* I - Printer */ ippAddResolution(p->ppd_attrs, IPP_TAG_PRINTER, "printer-resolution-default", IPP_RES_PER_INCH, - 72, 72); + 300, 300); ippAddResolution(p->ppd_attrs, IPP_TAG_PRINTER, "printer-resolution-supported", IPP_RES_PER_INCH, - 72, 72); + 300, 300); } /* * Duplexing, etc... */ + ppdMarkDefaults(ppd); + if ((duplex = ppdFindOption(ppd, "Duplex")) == NULL) if ((duplex = ppdFindOption(ppd, "EFDuplex")) == NULL) if ((duplex = ppdFindOption(ppd, "EFDuplexing")) == NULL) @@ -4867,6 +4953,129 @@ load_ppd(cupsd_printer_t *p) /* I - Printer */ if (ppdFindAttr(ppd, "APRemoteQueueID", NULL)) p->type |= CUPS_PRINTER_REMOTE; +#ifdef HAVE_APPLICATIONSERVICES_H + /* + * Convert the file referenced in APPrinterIconPath to a 128x128 PNG + * and save it as cacheDir/printername.png + */ + + if ((ppd_attr = ppdFindAttr(ppd, "APPrinterIconPath", NULL)) != NULL && + ppd_attr->value) + { + CGImageRef imageRef = NULL;/* Current icon image */ + CGImageRef biggestIconRef = NULL; + /* Biggest icon image */ + CGImageRef closestTo128IconRef = NULL; + /* Icon image closest to and >= 128 */ + CGImageSourceRef sourceRef; /* The file's image source */ + char outPath[HTTP_MAX_URI]; + /* The path to the PNG file */ + CFURLRef outUrl; /* The URL made from the outPath */ + CFURLRef icnsFileUrl; /* The URL of the original ICNS icon file */ + CGImageDestinationRef destRef; /* The image destination to write */ + size_t bytesPerRow; /* The bytes per row used for resizing */ + CGContextRef context; /* The CG context used for resizing */ + + snprintf(outPath, sizeof(outPath), "%s/%s.png", CacheDir, p->name); + outUrl = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault, + (UInt8 *)outPath, + strlen(outPath), + FALSE); + icnsFileUrl = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault, + (UInt8 *)ppd_attr->value, + strlen(ppd_attr->value), + FALSE); + if (outUrl && icnsFileUrl) + { + sourceRef = CGImageSourceCreateWithURL(icnsFileUrl, NULL); + if (sourceRef) + { + for (i = 0; i < CGImageSourceGetCount(sourceRef); i ++) + { + imageRef = CGImageSourceCreateImageAtIndex(sourceRef, i, NULL); + if (imageRef && + CGImageGetWidth(imageRef) == CGImageGetHeight(imageRef)) + { + /* + * Loop through remembering the icon closest to 128 but >= 128 + * and then remember the largest icon. + */ + + if (CGImageGetWidth(imageRef) >= 128 && + (!closestTo128IconRef || + CGImageGetWidth(imageRef) < + CGImageGetWidth(closestTo128IconRef))) + { + CGImageRelease(closestTo128IconRef); + CGImageRetain(imageRef); + closestTo128IconRef = imageRef; + } + + if (!biggestIconRef || + CGImageGetWidth(imageRef) > CGImageGetWidth(biggestIconRef)) + { + CGImageRelease(biggestIconRef); + CGImageRetain(imageRef); + biggestIconRef = imageRef; + } + + CGImageRelease(imageRef); + } + } + + if (biggestIconRef) + { + /* + * If biggestIconRef is NULL, we found no icons. Otherwise we first + * want the closest to 128, but if none are larger than 128, we want + * the largest icon available. + */ + + imageRef = closestTo128IconRef ? closestTo128IconRef : + biggestIconRef; + CGImageRetain(imageRef); + CGImageRelease(biggestIconRef); + CGImageRelease(closestTo128IconRef); + destRef = CGImageDestinationCreateWithURL(outUrl, kUTTypePNG, 1, + NULL); + if (destRef) + { + if (CGImageGetWidth(imageRef) != 128) + { + bytesPerRow = CGImageGetBytesPerRow(imageRef) / + CGImageGetWidth(imageRef) * 128; + context = CGBitmapContextCreate(NULL, 128, 128, + CGImageGetBitsPerComponent(imageRef), + bytesPerRow, + CGImageGetColorSpace(imageRef), + kCGImageAlphaPremultipliedFirst); + if (context) + { + CGContextDrawImage(context, CGRectMake(0, 0, 128, 128), + imageRef); + CGImageRelease(imageRef); + imageRef = CGBitmapContextCreateImage(context); + CGContextRelease(context); + } + } + + CGImageDestinationAddImage(destRef, imageRef, NULL); + CGImageDestinationFinalize(destRef); + CFRelease(destRef); + } + + CGImageRelease(imageRef); + } + + CFRelease(sourceRef); + CFRelease(icnsFileUrl); + } + + CFRelease(outUrl); + } + } +#endif /* HAVE_APPLICATIONSERVICES_H */ + /* * Close the PPD and set the type... */ diff --git a/scheduler/process.c b/scheduler/process.c index 69da9f198..153ba2746 100644 --- a/scheduler/process.c +++ b/scheduler/process.c @@ -137,6 +137,13 @@ cupsdCreateProfile(int job_id) /* I - Job ID or 0 for none */ " #\"^/System/\"" "))\n", root, root); + /* Specifically allow applications to stat RequestRoot */ + cupsFilePrintf(fp, + "(allow file-read-metadata\n" + " (regex" + " #\"^%s$\"" /* RequestRoot */ + "))\n", + request); cupsFilePrintf(fp, "(allow file-write* file-read-data file-read-metadata\n" " (regex" diff --git a/scripting/php/Dependencies b/scripting/php/Dependencies index 7775c994a..d3c60c70f 100644 --- a/scripting/php/Dependencies +++ b/scripting/php/Dependencies @@ -2,6 +2,6 @@ phpcups.o: ../../cups/string-private.h ../../config.h phpcups.h phpcups.o: ../../cups/cups.h ../../cups/file.h ../../cups/versioning.h -phpcups.o: ../../cups/ipp.h ../../cups/http.h ../../cups/language.h -phpcups.o: ../../cups/array.h ../../cups/language.h +phpcups.o: ../../cups/ipp.h ../../cups/http.h ../../cups/array.h +phpcups.o: ../../cups/language.h ../../cups/language.h phpcups.o: ../../cups/debug-private.h diff --git a/systemv/Dependencies b/systemv/Dependencies index eca4275eb..a7aa88c31 100644 --- a/systemv/Dependencies +++ b/systemv/Dependencies @@ -1,16 +1,16 @@ # DO NOT DELETE THIS LINE -- make depend depends on it. cancel.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -cancel.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -cancel.o: ../cups/language.h ../cups/array.h ../cups/string-private.h -cancel.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h -cancel.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h -cancel.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h -cancel.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h -cancel.o: ../cups/transcode.h ../cups/thread-private.h +cancel.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +cancel.o: ../cups/language.h ../cups/string-private.h ../config.h +cancel.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h +cancel.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h +cancel.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h +cancel.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h +cancel.o: ../cups/thread-private.h cupsaccept.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h cupsaccept.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -cupsaccept.o: ../cups/language.h ../cups/array.h ../cups/string-private.h +cupsaccept.o: ../cups/array.h ../cups/language.h ../cups/string-private.h cupsaccept.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h cupsaccept.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h cupsaccept.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h @@ -18,7 +18,7 @@ cupsaccept.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h cupsaccept.o: ../cups/transcode.h ../cups/thread-private.h cupsaddsmb.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h cupsaddsmb.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -cupsaddsmb.o: ../cups/language.h ../cups/array.h ../cups/string-private.h +cupsaddsmb.o: ../cups/array.h ../cups/language.h ../cups/string-private.h cupsaddsmb.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h cupsaddsmb.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h cupsaddsmb.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h @@ -26,16 +26,16 @@ cupsaddsmb.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h cupsaddsmb.o: ../cups/transcode.h ../cups/thread-private.h cupsaddsmb.o: ../cups/adminutil.h cupsctl.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -cupsctl.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -cupsctl.o: ../cups/language.h ../cups/array.h ../cups/string-private.h -cupsctl.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h -cupsctl.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h -cupsctl.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h -cupsctl.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h -cupsctl.o: ../cups/transcode.h ../cups/thread-private.h ../cups/adminutil.h +cupsctl.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +cupsctl.o: ../cups/language.h ../cups/string-private.h ../config.h +cupsctl.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h +cupsctl.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h +cupsctl.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h +cupsctl.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h +cupsctl.o: ../cups/thread-private.h ../cups/adminutil.h cupstestdsc.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h cupstestdsc.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -cupstestdsc.o: ../cups/language.h ../cups/array.h ../cups/string-private.h +cupstestdsc.o: ../cups/array.h ../cups/language.h ../cups/string-private.h cupstestdsc.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h cupstestdsc.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h cupstestdsc.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h @@ -43,7 +43,7 @@ cupstestdsc.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h cupstestdsc.o: ../cups/transcode.h ../cups/thread-private.h cupstestppd.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h cupstestppd.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -cupstestppd.o: ../cups/language.h ../cups/array.h ../cups/string-private.h +cupstestppd.o: ../cups/array.h ../cups/language.h ../cups/string-private.h cupstestppd.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h cupstestppd.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h cupstestppd.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h @@ -51,59 +51,58 @@ cupstestppd.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h cupstestppd.o: ../cups/transcode.h ../cups/thread-private.h ../cups/dir.h cupstestppd.o: ../cups/ppd-private.h ../cups/raster.h ../cups/ppd.h lp.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -lp.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/language.h -lp.o: ../cups/array.h ../cups/string-private.h ../config.h +lp.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +lp.o: ../cups/language.h ../cups/string-private.h ../config.h lp.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h lp.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h lp.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h lp.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h lp.o: ../cups/thread-private.h lpadmin.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -lpadmin.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -lpadmin.o: ../cups/language.h ../cups/array.h ../cups/string-private.h -lpadmin.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h -lpadmin.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h -lpadmin.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h -lpadmin.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h -lpadmin.o: ../cups/transcode.h ../cups/thread-private.h +lpadmin.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +lpadmin.o: ../cups/language.h ../cups/string-private.h ../config.h +lpadmin.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h +lpadmin.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h +lpadmin.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h +lpadmin.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h +lpadmin.o: ../cups/thread-private.h lpinfo.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -lpinfo.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -lpinfo.o: ../cups/language.h ../cups/array.h ../cups/string-private.h -lpinfo.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h -lpinfo.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h -lpinfo.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h -lpinfo.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h -lpinfo.o: ../cups/transcode.h ../cups/thread-private.h +lpinfo.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +lpinfo.o: ../cups/language.h ../cups/string-private.h ../config.h +lpinfo.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h +lpinfo.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h +lpinfo.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h +lpinfo.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h +lpinfo.o: ../cups/thread-private.h lpmove.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -lpmove.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -lpmove.o: ../cups/language.h ../cups/array.h ../cups/string-private.h -lpmove.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h -lpmove.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h -lpmove.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h -lpmove.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h -lpmove.o: ../cups/transcode.h ../cups/thread-private.h +lpmove.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +lpmove.o: ../cups/language.h ../cups/string-private.h ../config.h +lpmove.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h +lpmove.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h +lpmove.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h +lpmove.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h +lpmove.o: ../cups/thread-private.h lpoptions.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h lpoptions.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -lpoptions.o: ../cups/language.h ../cups/array.h ../cups/string-private.h +lpoptions.o: ../cups/array.h ../cups/language.h ../cups/string-private.h lpoptions.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h lpoptions.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h lpoptions.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h lpoptions.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h lpoptions.o: ../cups/transcode.h ../cups/thread-private.h lppasswd.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -lppasswd.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -lppasswd.o: ../cups/language.h ../cups/array.h ../cups/string-private.h -lppasswd.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h -lppasswd.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h -lppasswd.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h -lppasswd.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h -lppasswd.o: ../cups/transcode.h ../cups/thread-private.h -lppasswd.o: ../cups/md5-private.h +lppasswd.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +lppasswd.o: ../cups/language.h ../cups/string-private.h ../config.h +lppasswd.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h +lppasswd.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h +lppasswd.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h +lppasswd.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h +lppasswd.o: ../cups/thread-private.h ../cups/md5-private.h lpstat.o: ../cups/cups-private.h ../cups/cups.h ../cups/file.h -lpstat.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h -lpstat.o: ../cups/language.h ../cups/array.h ../cups/string-private.h -lpstat.o: ../config.h ../cups/debug-private.h ../cups/ppd-private.h -lpstat.o: ../cups/ppd.h ../cups/cups.h ../cups/pwg-private.h -lpstat.o: ../cups/http-private.h ../cups/http.h ../cups/md5-private.h -lpstat.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/language-private.h -lpstat.o: ../cups/transcode.h ../cups/thread-private.h +lpstat.o: ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h +lpstat.o: ../cups/language.h ../cups/string-private.h ../config.h +lpstat.o: ../cups/debug-private.h ../cups/ppd-private.h ../cups/ppd.h +lpstat.o: ../cups/cups.h ../cups/pwg-private.h ../cups/http-private.h +lpstat.o: ../cups/http.h ../cups/md5-private.h ../cups/ipp-private.h +lpstat.o: ../cups/ipp.h ../cups/language-private.h ../cups/transcode.h +lpstat.o: ../cups/thread-private.h diff --git a/systemv/cupsaddsmb.c b/systemv/cupsaddsmb.c index 32b90b929..955202ddb 100644 --- a/systemv/cupsaddsmb.c +++ b/systemv/cupsaddsmb.c @@ -219,6 +219,7 @@ export_dest(http_t *http, /* I - Connection to server */ int status; /* Status of export */ char ppdfile[1024], /* PPD file for printer drivers */ prompt[1024]; /* Password prompt */ + int tries; /* Number of tries */ /* @@ -238,7 +239,7 @@ export_dest(http_t *http, /* I - Connection to server */ * Try to export it... */ - for (status = 0; !status;) + for (status = 0, tries = 0; !status && tries < 3; tries ++) { /* * Get the password, as needed... diff --git a/systemv/lpadmin.c b/systemv/lpadmin.c index cc0e2d620..aad224184 100644 --- a/systemv/lpadmin.c +++ b/systemv/lpadmin.c @@ -17,17 +17,12 @@ * main() - Parse options and configure the scheduler. * add_printer_to_class() - Add a printer to a class. * default_printer() - Set the default printing destination. - * delete_printer() - Delete a printer from the system... + * delete_printer() - Delete a printer from the system. * delete_printer_from_class() - Delete a printer from a class. - * enable_printer() - Enable a printer... - * set_printer_device() - Set the device-uri attribute. - * set_printer_file() - Set the interface script or PPD file. - * set_printer_info() - Set the printer description string. - * set_printer_location() - Set the printer location string. - * set_printer_model() - Set the driver model file. - * set_printer_options() - Set the printer options. + * enable_printer() - Enable a printer. + * set_printer_options() - Set the printer options and/or file. * validate_name() - Make sure the printer name only contains - * valid chars... + * valid chars. */ /* @@ -35,28 +30,22 @@ */ #include -#ifdef HAVE_LIBZ -# include -#endif /* HAVE_LIBZ */ /* * Local functions... */ -static int add_printer_to_class(http_t *, char *, char *); -static int default_printer(http_t *, char *); -static int delete_printer(http_t *, char *); -static int delete_printer_from_class(http_t *, char *, char *); -static int enable_printer(http_t *, char *); -static char *get_line(char *, int, FILE *fp); -static int set_printer_device(http_t *, char *, char *); -static int set_printer_file(http_t *, char *, char *); -static int set_printer_info(http_t *, char *, char *); -static int set_printer_location(http_t *, char *, char *); -static int set_printer_model(http_t *, char *, char *); -static int set_printer_options(http_t *, char *, int, cups_option_t *); -static int validate_name(const char *); +static int add_printer_to_class(http_t *http, char *printer, char *pclass); +static int default_printer(http_t *http, char *printer); +static int delete_printer(http_t *http, char *printer); +static int delete_printer_from_class(http_t *http, char *printer, + char *pclass); +static int enable_printer(http_t *http, char *printer); +static int set_printer_options(http_t *http, char *printer, + int num_options, cups_option_t *options, + char *file); +static int validate_name(const char *name); /* @@ -74,6 +63,7 @@ main(int argc, /* I - Number of command-line arguments */ *val; /* Pointer to allow/deny value */ int num_options; /* Number of options */ cups_option_t *options; /* Options */ + char *file; /* New PPD file/interface script */ _cupsSetLocale(argv); @@ -82,6 +72,7 @@ main(int argc, /* I - Number of command-line arguments */ printer = NULL; num_options = 0; options = NULL; + file = NULL; for (i = 1; i < argc; i ++) if (argv[i][0] == '-') @@ -212,34 +203,8 @@ main(int argc, /* I - Number of command-line arguments */ break; case 'i' : /* Use the specified interface script */ - if (!http) - { - http = httpConnectEncrypt(cupsServer(), ippPort(), - cupsEncryption()); - - if (http == NULL) - { - _cupsLangPrintf(stderr, - _("lpadmin: Unable to connect to server: %s\n"), - strerror(errno)); - return (1); - } - } - - if (printer == NULL) - { - _cupsLangPuts(stderr, - _("lpadmin: Unable to set the interface script:\n" - " You must specify a printer name " - "first\n")); - return (1); - } - if (argv[i][2]) - { - if (set_printer_file(http, printer, argv[i] + 2)) - return (1); - } + file = argv[i] + 2; else { i ++; @@ -252,8 +217,7 @@ main(int argc, /* I - Number of command-line arguments */ return (1); } - if (set_printer_file(http, printer, argv[i])) - return (1); + file = argv[i]; } break; @@ -292,35 +256,9 @@ main(int argc, /* I - Number of command-line arguments */ break; case 'm' : /* Use the specified standard script/PPD file */ - if (!http) - { - http = httpConnectEncrypt(cupsServer(), ippPort(), - cupsEncryption()); - - if (http == NULL) - { - _cupsLangPrintf(stderr, - _("lpadmin: Unable to connect to server: %s\n"), - strerror(errno)); - return (1); - } - } - - if (printer == NULL) - { - _cupsLangPuts(stderr, - _("lpadmin: Unable to set the interface script or " - "PPD file:\n" - " You must specify a printer name " - "first\n")); - return (1); - } - if (argv[i][2]) - { - if (set_printer_model(http, printer, argv[i] + 2)) - return (1); - } + num_options = cupsAddOption("ppd-name", argv[i] + 2, num_options, + &options); else { i ++; @@ -333,8 +271,8 @@ main(int argc, /* I - Number of command-line arguments */ return (1); } - if (set_printer_model(http, printer, argv[i])) - return (1); + num_options = cupsAddOption("ppd-name", argv[i], num_options, + &options); } break; @@ -358,20 +296,6 @@ main(int argc, /* I - Number of command-line arguments */ break; case 'p' : /* Add/modify a printer */ - if (!http) - { - http = httpConnectEncrypt(cupsServer(), ippPort(), - cupsEncryption()); - - if (http == NULL) - { - _cupsLangPrintf(stderr, - _("lpadmin: Unable to connect to server: %s\n"), - strerror(errno)); - return (1); - } - } - if (argv[i][2]) printer = argv[i] + 2; else @@ -505,34 +429,9 @@ main(int argc, /* I - Number of command-line arguments */ break; case 'v' : /* Set the device-uri attribute */ - if (!http) - { - http = httpConnectEncrypt(cupsServer(), ippPort(), - cupsEncryption()); - - if (http == NULL) - { - _cupsLangPrintf(stderr, - _("lpadmin: Unable to connect to server: %s\n"), - strerror(errno)); - return (1); - } - } - - if (printer == NULL) - { - _cupsLangPuts(stderr, - _("lpadmin: Unable to set the device URI:\n" - " You must specify a printer name " - "first\n")); - return (1); - } - if (argv[i][2]) - { - if (set_printer_device(http, printer, argv[i] + 2)) - return (1); - } + num_options = cupsAddOption("device-uri", argv[i] + 2, + num_options, &options); else { i ++; @@ -545,8 +444,8 @@ main(int argc, /* I - Number of command-line arguments */ return (1); } - if (set_printer_device(http, printer, argv[i])) - return (1); + num_options = cupsAddOption("device-uri", argv[i], + num_options, &options); } break; @@ -597,35 +496,9 @@ main(int argc, /* I - Number of command-line arguments */ break; case 'D' : /* Set the printer-info attribute */ - if (!http) - { - http = httpConnectEncrypt(cupsServer(), ippPort(), - cupsEncryption()); - - if (http == NULL) - { - _cupsLangPrintf(stderr, - _("lpadmin: Unable to connect to server: %s\n"), - strerror(errno)); - return (1); - } - } - - if (printer == NULL) - { - _cupsLangPuts(stderr, - _("lpadmin: Unable to set the printer " - "description:\n" - " You must specify a printer name " - "first\n")); - return (1); - } - if (argv[i][2]) - { - if (set_printer_info(http, printer, argv[i] + 2)) - return (1); - } + num_options = cupsAddOption("printer-info", argv[i] + 2, + num_options, &options); else { i ++; @@ -638,8 +511,8 @@ main(int argc, /* I - Number of command-line arguments */ return (1); } - if (set_printer_info(http, printer, argv[i])) - return (1); + num_options = cupsAddOption("printer-info", argv[i], + num_options, &options); } break; @@ -659,34 +532,9 @@ main(int argc, /* I - Number of command-line arguments */ break; case 'L' : /* Set the printer-location attribute */ - if (!http) - { - http = httpConnectEncrypt(cupsServer(), ippPort(), - cupsEncryption()); - - if (http == NULL) - { - _cupsLangPrintf(stderr, - _("lpadmin: Unable to connect to server: %s\n"), - strerror(errno)); - return (1); - } - } - - if (printer == NULL) - { - _cupsLangPuts(stderr, - _("lpadmin: Unable to set the printer location:\n" - " You must specify a printer name " - "first\n")); - return (1); - } - if (argv[i][2]) - { - if (set_printer_location(http, printer, argv[i] + 2)) - return (1); - } + num_options = cupsAddOption("printer-location", argv[i] + 2, + num_options, &options); else { i ++; @@ -699,40 +547,14 @@ main(int argc, /* I - Number of command-line arguments */ return (1); } - if (set_printer_location(http, printer, argv[i])) - return (1); + num_options = cupsAddOption("printer-location", argv[i], + num_options, &options); } break; case 'P' : /* Use the specified PPD file */ - if (!http) - { - http = httpConnectEncrypt(cupsServer(), ippPort(), - cupsEncryption()); - - if (http == NULL) - { - _cupsLangPrintf(stderr, - _("lpadmin: Unable to connect to server: %s\n"), - strerror(errno)); - return (1); - } - } - - if (printer == NULL) - { - _cupsLangPuts(stderr, - _("lpadmin: Unable to set the PPD file:\n" - " You must specify a printer name " - "first\n")); - return (1); - } - if (argv[i][2]) - { - if (set_printer_file(http, printer, argv[i] + 2)) - return (1); - } + file = argv[i] + 2; else { i ++; @@ -744,8 +566,7 @@ main(int argc, /* I - Number of command-line arguments */ return (1); } - if (set_printer_file(http, printer, argv[i])) - return (1); + file = argv[i]; } break; @@ -765,7 +586,7 @@ main(int argc, /* I - Number of command-line arguments */ * Set options as needed... */ - if (num_options) + if (num_options || file) { if (!http) { @@ -788,7 +609,7 @@ main(int argc, /* I - Number of command-line arguments */ return (1); } - if (set_printer_options(http, printer, num_options, options)) + if (set_printer_options(http, printer, num_options, options, file)) return (1); } @@ -1281,429 +1102,6 @@ enable_printer(http_t *http, /* I - Server connection */ } -/* - * 'get_line()' - Get a line that is terminated by a LF, CR, or CR LF. - */ - -static char * /* O - Pointer to buf or NULL on EOF */ -get_line(char *buf, /* I - Line buffer */ - int length, /* I - Length of buffer */ - FILE *fp) /* I - File to read from */ -{ - char *bufptr; /* Pointer into buffer */ - int ch; /* Character from file */ - - - length --; - bufptr = buf; - - while ((ch = getc(fp)) != EOF) - { - if (ch == '\n') - break; - else if (ch == '\r') - { - /* - * Look for LF... - */ - - ch = getc(fp); - if (ch != '\n' && ch != EOF) - ungetc(ch, fp); - - break; - } - - *bufptr++ = ch; - length --; - if (length == 0) - break; - } - - *bufptr = '\0'; - - if (ch == EOF) - return (NULL); - else - return (buf); -} - - -/* - * 'set_printer_device()' - Set the device-uri attribute. - */ - -static int /* O - 0 on success, 1 on fail */ -set_printer_device(http_t *http, /* I - Server connection */ - char *printer, /* I - Printer */ - char *device) /* I - New device URI */ -{ - ipp_t *request, /* IPP Request */ - *response; /* IPP Response */ - char uri[HTTP_MAX_URI]; /* URI for printer/class */ - - - DEBUG_printf(("set_printer_device(%p, \"%s\", \"%s\")\n", http, printer, - device)); - - /* - * Build a CUPS_ADD_PRINTER request, which requires the following - * attributes: - * - * attributes-charset - * attributes-natural-language - * printer-uri - */ - - request = ippNewRequest(CUPS_ADD_PRINTER); - - httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL, - "localhost", 0, "/printers/%s", printer); - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, - "printer-uri", NULL, uri); - - /* - * Add the device URI... - */ - - if (device[0] == '/') - { - /* - * Convert filename to URI... - */ - - snprintf(uri, sizeof(uri), "file://%s", device); - ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_URI, "device-uri", NULL, - uri); - } - else - ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_URI, "device-uri", NULL, - device); - - /* - * Do the request and get back a response... - */ - - if ((response = cupsDoRequest(http, request, "/admin/")) == NULL) - { - _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString()); - - return (1); - } - else if (response->request.status.status_code > IPP_OK_CONFLICT) - { - _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString()); - - ippDelete(response); - - return (1); - } - else - { - ippDelete(response); - - return (0); - } -} - - -/* - * 'set_printer_file()' - Set the interface script or PPD file. - */ - -static int /* O - 0 on success, 1 on fail */ -set_printer_file(http_t *http, /* I - Server connection */ - char *printer, /* I - Printer */ - char *file) /* I - PPD file or interface script */ -{ - ipp_t *request, /* IPP Request */ - *response; /* IPP Response */ - char uri[HTTP_MAX_URI]; /* URI for printer/class */ -#ifdef HAVE_LIBZ - char tempfile[1024]; /* Temporary filename */ - int fd; /* Temporary file */ - gzFile *gz; /* GZIP'd file */ - char buffer[8192]; /* Copy buffer */ - int bytes; /* Bytes in buffer */ - - - DEBUG_printf(("set_printer_file(%p, \"%s\", \"%s\")\n", http, printer, - file)); - - /* - * See if the file is gzip'd; if so, unzip it to a temporary file and - * send the uncompressed file. - */ - - if (!strcmp(file + strlen(file) - 3, ".gz")) - { - /* - * Yes, the file is compressed; uncompress to a temp file... - */ - - if ((fd = cupsTempFd(tempfile, sizeof(tempfile))) < 0) - { - _cupsLangPrintError(_("ERROR: Unable to create temporary file")); - return (1); - } - - if ((gz = gzopen(file, "rb")) == NULL) - { - _cupsLangPrintf(stderr, - _("lpadmin: Unable to open file \"%s\": %s\n"), - file, strerror(errno)); - close(fd); - unlink(tempfile); - return (1); - } - - while ((bytes = gzread(gz, buffer, sizeof(buffer))) > 0) - write(fd, buffer, bytes); - - close(fd); - gzclose(gz); - - file = tempfile; - } -#endif /* HAVE_LIBZ */ - - /* - * Build a CUPS_ADD_PRINTER request, which requires the following - * attributes: - * - * attributes-charset - * attributes-natural-language - * printer-uri - */ - - request = ippNewRequest(CUPS_ADD_PRINTER); - - httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL, - "localhost", 0, "/printers/%s", printer); - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, - "printer-uri", NULL, uri); - - /* - * Do the request and get back a response... - */ - - response = cupsDoFileRequest(http, request, "/admin/", file); - ippDelete(response); - -#ifdef HAVE_LIBZ - /* - * Remove the temporary file as needed... - */ - - if (file == tempfile) - unlink(tempfile); -#endif /* HAVE_LIBZ */ - - if (cupsLastError() > IPP_OK_CONFLICT) - { - _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString()); - - return (1); - } - else - return (0); -} - - -/* - * 'set_printer_info()' - Set the printer description string. - */ - -static int /* O - 0 on success, 1 on fail */ -set_printer_info(http_t *http, /* I - Server connection */ - char *printer, /* I - Printer */ - char *info) /* I - New description string */ -{ - ipp_t *request, /* IPP Request */ - *response; /* IPP Response */ - char uri[HTTP_MAX_URI]; /* URI for printer/class */ - - - DEBUG_printf(("set_printer_info(%p, \"%s\", \"%s\")\n", http, printer, - info)); - - /* - * Build a CUPS_ADD_PRINTER request, which requires the following - * attributes: - * - * attributes-charset - * attributes-natural-language - * printer-uri - */ - - request = ippNewRequest(CUPS_ADD_PRINTER); - - httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL, - "localhost", 0, "/printers/%s", printer); - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, - "printer-uri", NULL, uri); - - /* - * Add the info string... - */ - - ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_TEXT, "printer-info", NULL, - info); - - /* - * Do the request and get back a response... - */ - - if ((response = cupsDoRequest(http, request, "/admin/")) == NULL) - { - _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString()); - return (1); - } - else if (response->request.status.status_code > IPP_OK_CONFLICT) - { - _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString()); - - ippDelete(response); - - return (1); - } - else - { - ippDelete(response); - - return (0); - } -} - - -/* - * 'set_printer_location()' - Set the printer location string. - */ - -static int /* O - 0 on success, 1 on fail */ -set_printer_location(http_t *http, /* I - Server connection */ - char *printer, /* I - Printer */ - char *location) /* I - New location string */ -{ - ipp_t *request, /* IPP Request */ - *response; /* IPP Response */ - char uri[HTTP_MAX_URI]; /* URI for printer/class */ - - - DEBUG_printf(("set_printer_location(%p, \"%s\", \"%s\")\n", http, printer, - location)); - - /* - * Build a CUPS_ADD_PRINTER request, which requires the following - * attributes: - * - * attributes-charset - * attributes-natural-language - * printer-uri - */ - - request = ippNewRequest(CUPS_ADD_PRINTER); - - httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL, - "localhost", 0, "/printers/%s", printer); - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, - "printer-uri", NULL, uri); - - /* - * Add the location string... - */ - - ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_TEXT, "printer-location", NULL, - location); - - /* - * Do the request and get back a response... - */ - - if ((response = cupsDoRequest(http, request, "/admin/")) == NULL) - { - _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString()); - - return (1); - } - else if (response->request.status.status_code > IPP_OK_CONFLICT) - { - _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString()); - - ippDelete(response); - - return (1); - } - else - { - ippDelete(response); - - return (0); - } -} - - -/* - * 'set_printer_model()' - Set the driver model file. - */ - -static int /* O - 0 on success, 1 on fail */ -set_printer_model(http_t *http, /* I - Server connection */ - char *printer, /* I - Printer */ - char *model) /* I - Driver model file */ -{ - ipp_t *request, /* IPP Request */ - *response; /* IPP Response */ - char uri[HTTP_MAX_URI]; /* URI for printer/class */ - - - /* - * Build a CUPS_ADD_PRINTER request, which requires the following - * attributes: - * - * attributes-charset - * attributes-natural-language - * printer-uri - * ppd-name - */ - - request = ippNewRequest(CUPS_ADD_PRINTER); - - httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL, - "localhost", 0, "/printers/%s", printer); - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, - "printer-uri", NULL, uri); - - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, - "ppd-name", NULL, model); - - /* - * Do the request and get back a response... - */ - - if ((response = cupsDoRequest(http, request, "/admin/")) == NULL) - { - _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString()); - - return (1); - } - else if (response->request.status.status_code > IPP_OK_CONFLICT) - { - _cupsLangPrintf(stderr, "lpadmin: %s\n", cupsLastErrorString()); - - ippDelete(response); - - return (1); - } - else - { - ippDelete(response); - - return (0); - } -} - - /* * 'set_printer_options()' - Set the printer options. */ @@ -1713,7 +1111,8 @@ set_printer_options( http_t *http, /* I - Server connection */ char *printer, /* I - Printer */ int num_options, /* I - Number of options */ - cups_option_t *options) /* I - Options */ + cups_option_t *options, /* I - Options */ + char *file) /* I - PPD file/interface script */ { ipp_t *request, /* IPP Request */ *response; /* IPP Response */ @@ -1728,14 +1127,15 @@ set_printer_options( keyword[1024], /* Keyword from Default line */ *keyptr, /* Pointer into keyword... */ tempfile[1024]; /* Temporary filename */ - FILE *in, /* PPD file */ + cups_file_t *in, /* PPD file */ *out; /* Temporary file */ - int outfd; /* Temporary file descriptor */ - const char *protocol; /* Old protocol option */ + const char *protocol, /* Old protocol option */ + *customval; /* Custom option value */ - DEBUG_printf(("set_printer_options(%p, \"%s\", %d, %p)\n", http, printer, - num_options, options)); + DEBUG_printf(("set_printer_options(http=%p, printer=\"%s\", num_options=%d, " + "options=%p, file=\"%s\")\n", http, printer, num_options, + options, file)); httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL, "localhost", 0, "/printers/%s", printer); @@ -1754,7 +1154,6 @@ set_printer_options( ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes", NULL, "printer-type"); @@ -1762,7 +1161,7 @@ set_printer_options( * Do the request... */ - op = CUPS_ADD_PRINTER; + op = CUPS_ADD_MODIFY_PRINTER; if ((response = cupsDoRequest(http, request, "/")) != NULL) { @@ -1775,7 +1174,7 @@ set_printer_options( { if (attr->values[0].integer & (CUPS_PRINTER_CLASS | CUPS_PRINTER_IMPLICIT)) { - op = CUPS_ADD_CLASS; + op = CUPS_ADD_MODIFY_CLASS; httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL, "localhost", 0, "/classes/%s", printer); } @@ -1785,8 +1184,8 @@ set_printer_options( } /* - * Build a CUPS_ADD_PRINTER or CUPS_ADD_CLASS request, which requires - * the following attributes: + * Build a CUPS_ADD_MODIFY_PRINTER or CUPS_ADD_MODIFY_CLASS request, which + * requires the following attributes: * * attributes-charset * attributes-natural-language @@ -1798,6 +1197,8 @@ set_printer_options( ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, + "requesting-user-name", NULL, cupsUser()); /* * Add the options... @@ -1815,7 +1216,9 @@ set_printer_options( NULL, "tbcp"); } - if (op == CUPS_ADD_PRINTER) + if (file) + ppdfile = file; + else if (op == CUPS_ADD_MODIFY_PRINTER) ppdfile = cupsGetPPD(printer); else ppdfile = NULL; @@ -1830,33 +1233,34 @@ set_printer_options( ppdMarkDefaults(ppd); cupsMarkOptions(ppd, num_options, options); - if ((outfd = cupsTempFd(tempfile, sizeof(tempfile))) < 0) + if ((out = cupsTempFile2(tempfile, sizeof(tempfile))) < 0) { _cupsLangPrintError(_("ERROR: Unable to create temporary file")); ippDelete(request); - unlink(ppdfile); + if (ppdfile != file) + unlink(ppdfile); return (1); } - if ((in = fopen(ppdfile, "rb")) == NULL) + if ((in = cupsFileOpen(ppdfile, "r")) == NULL) { _cupsLangPrintf(stderr, _("lpadmin: Unable to open PPD file \"%s\" - %s\n"), ppdfile, strerror(errno)); ippDelete(request); - unlink(ppdfile); - close(outfd); + if (ppdfile != file) + unlink(ppdfile); + cupsFileClose(out); unlink(tempfile); return (1); } - out = fdopen(outfd, "wb"); ppdchanged = 0; - while (get_line(line, sizeof(line), in) != NULL) + while (cupsFileGets(in, line, sizeof(line))) { if (strncmp(line, "*Default", 8)) - fprintf(out, "%s\n", line); + cupsFilePrintf(out, "%s\n", line); else { /* @@ -1886,17 +1290,27 @@ set_printer_options( if (choice && strcmp(choice->choice, keyptr)) { - fprintf(out, "*Default%s: %s\n", keyword, choice->choice); - ppdchanged = 1; + if (strcmp(choice->choice, "Custom")) + { + cupsFilePrintf(out, "*Default%s: %s\n", keyword, choice->choice); + ppdchanged = 1; + } + else if ((customval = cupsGetOption(keyword, num_options, + options)) != NULL) + { + cupsFilePrintf(out, "*Default%s: %s\n", keyword, customval); + ppdchanged = 1; + } + else + cupsFilePrintf(out, "%s\n", line); } else - fprintf(out, "%s\n", line); + cupsFilePrintf(out, "%s\n", line); } } - fclose(in); - fclose(out); - close(outfd); + cupsFileClose(in); + cupsFileClose(out); ppdClose(ppd); /* @@ -1904,14 +1318,15 @@ set_printer_options( */ ippDelete(cupsDoFileRequest(http, request, "/admin/", - ppdchanged ? tempfile : NULL)); + ppdchanged ? tempfile : file)); /* * Clean up temp files... (TODO: catch signals in case we CTRL-C during * lpadmin) */ - unlink(ppdfile); + if (ppdfile != file) + unlink(ppdfile); unlink(tempfile); } else diff --git a/systemv/lpstat.c b/systemv/lpstat.c index 212cd89f4..d278b2f2d 100644 --- a/systemv/lpstat.c +++ b/systemv/lpstat.c @@ -1529,7 +1529,8 @@ show_printers(const char *printers, /* I - Destinations */ }; static const char *jattrs[] = /* Attributes we need for jobs... */ { - "job-id" + "job-id", + "job-state" }; diff --git a/templates/de/add-class.tmpl b/templates/de/add-class.tmpl index 264a019bf..2753bb919 100644 --- a/templates/de/add-class.tmpl +++ b/templates/de/add-class.tmpl @@ -1,6 +1,6 @@
-

>Klasse hinzufügen

+

Klasse hinzufügen

diff --git a/templates/de/add-rss-subscription.tmpl b/templates/de/add-rss-subscription.tmpl index cef109ca9..86b08b2f6 100644 --- a/templates/de/add-rss-subscription.tmpl +++ b/templates/de/add-rss-subscription.tmpl @@ -2,7 +2,7 @@ -

>RSS Subskription hinzufügen

+

RSS Subskription hinzufügen

diff --git a/templates/de/search.tmpl b/templates/de/search.tmpl index fd1d5d954..a462ae0b0 100644 --- a/templates/de/search.tmpl +++ b/templates/de/search.tmpl @@ -1,4 +1,4 @@ - + {WHICH_JOBS?:} {ORDER?:} diff --git a/templates/ja/option-pickone.tmpl b/templates/ja/option-pickone.tmpl index e927e7ca8..58b267a9c 100644 --- a/templates/ja/option-pickone.tmpl +++ b/templates/ja/option-pickone.tmpl @@ -6,7 +6,7 @@ {iscustom=1?
{[params]
{paramtext}: {params=Units? -{HAVE_AUTOCONFIGURE?:} +{HAVE_AUTOCONFIGURE?:}