From 411affcf6ae840dbe82786a1f42c16cb3127d20f Mon Sep 17 00:00:00 2001 From: jlovell Date: Thu, 16 Nov 2006 17:01:30 +0000 Subject: [PATCH] Load cups into easysw/current. git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@245 a1ca3aef-8c08-0410-bb20-df032aa958be --- CHANGES.txt | 23 +- CREDITS.txt | 3 +- INSTALL.txt | 2 +- README.txt | 2 +- backend/pap.c | 364 ++- backend/snmp.c | 8 +- backend/usb-darwin.c | 78 +- backend/usb-unix.c | 7 +- config-scripts/cups-common.m4 | 11 +- config-scripts/cups-defaults.m4 | 6 +- cups/cups.h | 8 +- cups/http-private.h | 23 +- cups/http.c | 319 +- cups/libcups_s.exp | 1 + cups/transcode.c | 75 +- desktop/cups.desktop | 2 + doc/help/spec-ppd.html | 7 +- doc/it/images/button-accept-jobs.gif | Bin 0 -> 667 bytes doc/it/images/button-add-class.gif | Bin 0 -> 626 bytes doc/it/images/button-add-printer.gif | Bin 0 -> 699 bytes doc/it/images/button-add-this-printer.gif | Bin 0 -> 854 bytes doc/it/images/button-cancel-all-jobs.gif | Bin 0 -> 682 bytes doc/it/images/button-cancel-job.gif | Bin 0 -> 588 bytes doc/it/images/button-change-settings.gif | Bin 0 -> 658 bytes doc/it/images/button-clean-print-heads.gif | Bin 0 -> 496 bytes doc/it/images/button-clear.gif | Bin 0 -> 346 bytes doc/it/images/button-continue.gif | Bin 0 -> 406 bytes doc/it/images/button-delete-class.gif | Bin 0 -> 520 bytes doc/it/images/button-delete-printer.gif | Bin 0 -> 547 bytes .../images/button-edit-configuration-file.gif | Bin 0 -> 778 bytes doc/it/images/button-export-samba.gif | Bin 0 -> 766 bytes doc/it/images/button-help.gif | Bin 0 -> 354 bytes doc/it/images/button-hold-job.gif | Bin 0 -> 646 bytes doc/it/images/button-manage-classes.gif | Bin 0 -> 558 bytes doc/it/images/button-manage-jobs.gif | Bin 0 -> 628 bytes doc/it/images/button-manage-printers.gif | Bin 0 -> 624 bytes doc/it/images/button-manage-server.gif | Bin 0 -> 558 bytes doc/it/images/button-modify-class.gif | Bin 0 -> 558 bytes doc/it/images/button-modify-printer.gif | Bin 0 -> 630 bytes doc/it/images/button-move-job.gif | Bin 0 -> 623 bytes doc/it/images/button-move-jobs.gif | Bin 0 -> 733 bytes doc/it/images/button-print-self-test-page.gif | Bin 0 -> 826 bytes doc/it/images/button-print-test-page.gif | Bin 0 -> 711 bytes doc/it/images/button-publish-printer.gif | Bin 0 -> 628 bytes doc/it/images/button-reject-jobs.gif | Bin 0 -> 579 bytes doc/it/images/button-release-job.gif | Bin 0 -> 613 bytes doc/it/images/button-restart-job.gif | Bin 0 -> 579 bytes doc/it/images/button-save-changes.gif | Bin 0 -> 583 bytes doc/it/images/button-search.gif | Bin 0 -> 356 bytes doc/it/images/button-set-allowed-users.gif | Bin 0 -> 697 bytes doc/it/images/button-set-as-default.gif | Bin 0 -> 723 bytes doc/it/images/button-set-printer-options.gif | Bin 0 -> 734 bytes doc/it/images/button-show-active.gif | Bin 0 -> 709 bytes doc/it/images/button-show-all.gif | Bin 0 -> 714 bytes doc/it/images/button-show-completed.gif | Bin 0 -> 804 bytes doc/it/images/button-show-next.gif | Bin 0 -> 613 bytes doc/it/images/button-show-previous.gif | Bin 0 -> 625 bytes doc/it/images/button-sort-ascending.gif | Bin 0 -> 564 bytes doc/it/images/button-sort-descending.gif | Bin 0 -> 618 bytes doc/it/images/button-start-class.gif | Bin 0 -> 515 bytes doc/it/images/button-start-printer.gif | Bin 0 -> 589 bytes doc/it/images/button-stop-class.gif | Bin 0 -> 490 bytes doc/it/images/button-stop-printer.gif | Bin 0 -> 547 bytes doc/it/images/button-unpublish-printer.gif | Bin 0 -> 729 bytes doc/it/images/button-use-default-config.gif | Bin 0 -> 909 bytes doc/it/images/button-view-access-log.gif | Bin 0 -> 697 bytes doc/it/images/button-view-error-log.gif | Bin 0 -> 631 bytes doc/it/images/button-view-page-log.gif | Bin 0 -> 694 bytes .../images/button-view-printable-version.gif | Bin 0 -> 778 bytes doc/it/index.html.in | 138 + filter/pstops.c | 44 +- locale/cups_it.po | 2819 +++++++++++++++++ packaging/cups.list.in | 17 +- packaging/cups.spec.in | 23 +- scheduler/client.c | 41 +- scheduler/dirsvc.c | 15 +- scheduler/main.c | 595 ++-- scheduler/network.c | 14 +- scheduler/network.h | 8 +- scheduler/sysman.c | 85 +- systemv/lpstat.c | 6 +- templates/it/add-class.tmpl | 33 + templates/it/add-printer.tmpl | 28 + templates/it/admin.tmpl | 77 + templates/it/choose-device.tmpl | 26 + templates/it/choose-make.tmpl | 42 + templates/it/choose-model.tmpl | 34 + templates/it/choose-serial.tmpl | 47 + templates/it/choose-uri.tmpl | 42 + templates/it/class-added.tmpl | 2 + templates/it/class-confirm.tmpl | 7 + templates/it/class-deleted.tmpl | 1 + templates/it/class-jobs-header.tmpl | 1 + templates/it/class-modified.tmpl | 2 + templates/it/classes-header.tmpl | 1 + templates/it/classes.tmpl | 54 + templates/it/edit-config.tmpl.in | 91 + templates/it/error-op.tmpl | 3 + templates/it/error.tmpl | 3 + templates/it/header.tmpl.in | 63 + templates/it/help-header.tmpl | 47 + templates/it/help-printable.tmpl | 11 + templates/it/job-cancel.tmpl | 1 + templates/it/job-hold.tmpl | 1 + templates/it/job-move.tmpl | 22 + templates/it/job-moved.tmpl | 2 + templates/it/job-release.tmpl | 1 + templates/it/job-restart.tmpl | 1 + templates/it/jobs-header.tmpl | 15 + templates/it/jobs.tmpl | 42 + templates/it/maintenance.tmpl | 2 + templates/it/modify-class.tmpl | 34 + templates/it/modify-printer.tmpl | 29 + templates/it/norestart.tmpl | 2 + templates/it/option-boolean.tmpl | 6 + templates/it/option-conflict.tmpl | 7 + templates/it/option-header.tmpl | 3 + templates/it/option-pickmany.tmpl | 6 + templates/it/option-pickone.tmpl | 6 + templates/it/option-trailer.tmpl | 5 + templates/it/pager.tmpl | 7 + templates/it/printer-accept.tmpl | 3 + templates/it/printer-added.tmpl | 2 + templates/it/printer-configured.tmpl | 2 + templates/it/printer-confirm.tmpl | 7 + templates/it/printer-default.tmpl | 7 + templates/it/printer-deleted.tmpl | 1 + templates/it/printer-jobs-header.tmpl | 1 + templates/it/printer-modified.tmpl | 2 + templates/it/printer-purge.tmpl | 3 + templates/it/printer-reject.tmpl | 3 + templates/it/printer-start.tmpl | 3 + templates/it/printer-stop.tmpl | 3 + templates/it/printers-header.tmpl | 1 + templates/it/printers.tmpl | 64 + templates/it/restart.tmpl | 1 + templates/it/samba-export.tmpl | 54 + templates/it/samba-exported.tmpl | 1 + templates/it/search.tmpl | 13 + templates/it/set-printer-options-header.tmpl | 3 + templates/it/set-printer-options-trailer.tmpl | 1 + templates/it/test-page.tmpl | 2 + templates/it/trailer.tmpl | 21 + templates/it/users.tmpl | 26 + test/run-stp-tests.sh | 31 +- 145 files changed, 5205 insertions(+), 601 deletions(-) create mode 100644 doc/it/images/button-accept-jobs.gif create mode 100644 doc/it/images/button-add-class.gif create mode 100644 doc/it/images/button-add-printer.gif create mode 100644 doc/it/images/button-add-this-printer.gif create mode 100644 doc/it/images/button-cancel-all-jobs.gif create mode 100644 doc/it/images/button-cancel-job.gif create mode 100644 doc/it/images/button-change-settings.gif create mode 100644 doc/it/images/button-clean-print-heads.gif create mode 100644 doc/it/images/button-clear.gif create mode 100644 doc/it/images/button-continue.gif create mode 100644 doc/it/images/button-delete-class.gif create mode 100644 doc/it/images/button-delete-printer.gif create mode 100644 doc/it/images/button-edit-configuration-file.gif create mode 100644 doc/it/images/button-export-samba.gif create mode 100644 doc/it/images/button-help.gif create mode 100644 doc/it/images/button-hold-job.gif create mode 100644 doc/it/images/button-manage-classes.gif create mode 100644 doc/it/images/button-manage-jobs.gif create mode 100644 doc/it/images/button-manage-printers.gif create mode 100644 doc/it/images/button-manage-server.gif create mode 100644 doc/it/images/button-modify-class.gif create mode 100644 doc/it/images/button-modify-printer.gif create mode 100644 doc/it/images/button-move-job.gif create mode 100644 doc/it/images/button-move-jobs.gif create mode 100644 doc/it/images/button-print-self-test-page.gif create mode 100644 doc/it/images/button-print-test-page.gif create mode 100644 doc/it/images/button-publish-printer.gif create mode 100644 doc/it/images/button-reject-jobs.gif create mode 100644 doc/it/images/button-release-job.gif create mode 100644 doc/it/images/button-restart-job.gif create mode 100644 doc/it/images/button-save-changes.gif create mode 100644 doc/it/images/button-search.gif create mode 100644 doc/it/images/button-set-allowed-users.gif create mode 100644 doc/it/images/button-set-as-default.gif create mode 100644 doc/it/images/button-set-printer-options.gif create mode 100644 doc/it/images/button-show-active.gif create mode 100644 doc/it/images/button-show-all.gif create mode 100644 doc/it/images/button-show-completed.gif create mode 100644 doc/it/images/button-show-next.gif create mode 100644 doc/it/images/button-show-previous.gif create mode 100644 doc/it/images/button-sort-ascending.gif create mode 100644 doc/it/images/button-sort-descending.gif create mode 100644 doc/it/images/button-start-class.gif create mode 100644 doc/it/images/button-start-printer.gif create mode 100644 doc/it/images/button-stop-class.gif create mode 100644 doc/it/images/button-stop-printer.gif create mode 100644 doc/it/images/button-unpublish-printer.gif create mode 100644 doc/it/images/button-use-default-config.gif create mode 100644 doc/it/images/button-view-access-log.gif create mode 100644 doc/it/images/button-view-error-log.gif create mode 100644 doc/it/images/button-view-page-log.gif create mode 100644 doc/it/images/button-view-printable-version.gif create mode 100644 doc/it/index.html.in create mode 100644 locale/cups_it.po create mode 100644 templates/it/add-class.tmpl create mode 100644 templates/it/add-printer.tmpl create mode 100644 templates/it/admin.tmpl create mode 100644 templates/it/choose-device.tmpl create mode 100644 templates/it/choose-make.tmpl create mode 100644 templates/it/choose-model.tmpl create mode 100644 templates/it/choose-serial.tmpl create mode 100644 templates/it/choose-uri.tmpl create mode 100644 templates/it/class-added.tmpl create mode 100644 templates/it/class-confirm.tmpl create mode 100644 templates/it/class-deleted.tmpl create mode 100644 templates/it/class-jobs-header.tmpl create mode 100644 templates/it/class-modified.tmpl create mode 100644 templates/it/classes-header.tmpl create mode 100644 templates/it/classes.tmpl create mode 100644 templates/it/edit-config.tmpl.in create mode 100644 templates/it/error-op.tmpl create mode 100644 templates/it/error.tmpl create mode 100644 templates/it/header.tmpl.in create mode 100644 templates/it/help-header.tmpl create mode 100644 templates/it/help-printable.tmpl create mode 100644 templates/it/job-cancel.tmpl create mode 100644 templates/it/job-hold.tmpl create mode 100644 templates/it/job-move.tmpl create mode 100644 templates/it/job-moved.tmpl create mode 100644 templates/it/job-release.tmpl create mode 100644 templates/it/job-restart.tmpl create mode 100644 templates/it/jobs-header.tmpl create mode 100644 templates/it/jobs.tmpl create mode 100644 templates/it/maintenance.tmpl create mode 100644 templates/it/modify-class.tmpl create mode 100644 templates/it/modify-printer.tmpl create mode 100644 templates/it/norestart.tmpl create mode 100644 templates/it/option-boolean.tmpl create mode 100644 templates/it/option-conflict.tmpl create mode 100644 templates/it/option-header.tmpl create mode 100644 templates/it/option-pickmany.tmpl create mode 100644 templates/it/option-pickone.tmpl create mode 100644 templates/it/option-trailer.tmpl create mode 100644 templates/it/pager.tmpl create mode 100644 templates/it/printer-accept.tmpl create mode 100644 templates/it/printer-added.tmpl create mode 100644 templates/it/printer-configured.tmpl create mode 100644 templates/it/printer-confirm.tmpl create mode 100644 templates/it/printer-default.tmpl create mode 100644 templates/it/printer-deleted.tmpl create mode 100644 templates/it/printer-jobs-header.tmpl create mode 100644 templates/it/printer-modified.tmpl create mode 100644 templates/it/printer-purge.tmpl create mode 100644 templates/it/printer-reject.tmpl create mode 100644 templates/it/printer-start.tmpl create mode 100644 templates/it/printer-stop.tmpl create mode 100644 templates/it/printers-header.tmpl create mode 100644 templates/it/printers.tmpl create mode 100644 templates/it/restart.tmpl create mode 100644 templates/it/samba-export.tmpl create mode 100644 templates/it/samba-exported.tmpl create mode 100644 templates/it/search.tmpl create mode 100644 templates/it/set-printer-options-header.tmpl create mode 100644 templates/it/set-printer-options-trailer.tmpl create mode 100644 templates/it/test-page.tmpl create mode 100644 templates/it/trailer.tmpl create mode 100644 templates/it/users.tmpl diff --git a/CHANGES.txt b/CHANGES.txt index 9fa60c3d9..49fe7d702 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,27 @@ -CHANGES.txt - 2006-11-02 +CHANGES.txt - 2006-11-16 ------------------------ +CHANGES IN CUPS V1.2.7 + + - Documentation updates (STR #2089) + - Added an Italian translation (STR #2105) + - The PostScript filter now rotates the bounding box + values as needed (STR #2079) + - The scheduler no longer loads the remote printer cache + when browsing is disabled (STR #2084) + - The scheduler no longer writes a new launchd + configuration file if it doesn't have to (STR #2083) + - Updated the USB and PAP backends for Mac OS X (STR + #2086) + - The scheduler now picks up on changes to IPv6 and DNS + configuration on Mac OS X (STR #2085) + - The lpstat program could still hang (STR #2098) + - Fixed an inefficiency in the SNMP IPP detection code + (STR #2100) + - The SSL negotiation code did not implement short + timeouts (STR #2091) + + CHANGES IN CUPS V1.2.6 - The web interface was not localized on Mac OS X (STR diff --git a/CREDITS.txt b/CREDITS.txt index 09db1ccb7..cfd4fcd33 100644 --- a/CREDITS.txt +++ b/CREDITS.txt @@ -29,8 +29,9 @@ like to thank the following individuals for their contributions: Giulio Orsero - Bug fixes and testing. Michal Osowiecki - Polish localization. Kurt Pfeifle - Bug fixes, beta testing, evangelism. + Vincenzo Reale - Italian localization. Petter Reinholdtsen - HP-UX compiler stuff. - Juan Pablo González Riopedre - Spanish localization + Juan Pablo González Riopedre - Spanish localization. Stuart Stevens - HP JetDirect IPP information. Andrea Suatoni - IRIX desktop integration and testing. Tomohiro Kato - Japanese localization. diff --git a/INSTALL.txt b/INSTALL.txt index 7a3694081..d6f9a0179 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -1,4 +1,4 @@ -INSTALL - CUPS v1.2.6 - 2006-11-06 +INSTALL - CUPS v1.2.7 - 2006-11-16 ---------------------------------- This file describes how to compile and install CUPS from source diff --git a/README.txt b/README.txt index 0d312bca9..d8b6b0fb0 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -README - CUPS v1.2.6 - 2006-11-06 +README - CUPS v1.2.7 - 2006-11-16 --------------------------------- Looking for compile instructions? Read the file "INSTALL.txt" diff --git a/backend/pap.c b/backend/pap.c index f5eadae33..dd599f83f 100644 --- a/backend/pap.c +++ b/backend/pap.c @@ -1,5 +1,5 @@ /* -* "$Id: pap.c 5480 2006-05-02 15:17:04Z mike $" +* "$Id: pap.c 6090 2006-11-14 16:35:27Z mike $" * * © Copyright 2004 Apple Computer, Inc. All rights reserved. * @@ -42,31 +42,35 @@ * 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. +* 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 from a file descriptor to an NBP specified printer. +* printFile() - Print file. * papOpen() - Open a pap session to a printer. -* papClose() - Close a pap session after cleaning up pending transactions. +* papClose() - Close a pap session. * papWrite() - Write bytes to a printer. -* papCloseResp() - Send a pap close response in the rare case we receive a close connection request. +* papCloseResp() - Send a pap close response. * papSendRequest() - Fomrat and send a pap packet. * papCancelRequest() - Cancel a pending pap request. * statusUpdate() - Print printer status to stderr. * parseUri() - Extract the print name and zone from a uri. * addPercentEscapes() - Encode a string with percent escapes. -* removePercentEscapes - Returns a string with any percent escape sequences replaced with their equivalent. +* 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. */ +#include + #include #include #include @@ -86,7 +90,8 @@ #include #include -#include +#include +#include #include @@ -95,19 +100,25 @@ #else /* These definitions come from at_proto.h... */ # define ZIP_DEF_INTERFACE NULL -enum { RUNNING, NOTLOADED, LOADED, OTHERERROR }; /* Appletalk Stack status Function. */ +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_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 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 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 */ @@ -116,7 +127,7 @@ extern int zip_getmyzone(char *ifName, at_nvestr_t *zone); #include /* Defines */ -#define MAX_PRINTERS 500 /* Max number of printers we can lookup in listDevices */ +#define MAX_PRINTERS 500 /* Max number of printers we can lookup */ #define PAP_CONNID 0 #define PAP_TYPE 1 #define PAP_EOF 2 @@ -126,43 +137,35 @@ extern int zip_getmyzone(char *ifName, at_nvestr_t *zone); #define SEQUENCE_NUM(p) (((u_char *)&p)[2]) #define IS_PAP_EOF(p) (((u_char *)&p)[2]) -#define PAPPacketStr(x) \ - ((x) == AT_PAP_TYPE_OPEN_CONN) ? "PAP_OPEN_CONN" : \ - ((x) == AT_PAP_TYPE_OPEN_CONN_REPLY) ? "PAP_OPEN_CONN_REPLY" : \ - ((x) == AT_PAP_TYPE_SEND_DATA) ? "PAP_SEND_DATA" : \ - ((x) == AT_PAP_TYPE_DATA) ? "PAP_DATA" : \ - ((x) == AT_PAP_TYPE_TICKLE) ? "PAP_TICKLE" : \ - ((x) == AT_PAP_TYPE_CLOSE_CONN) ? "PAP_CLOSE_CONN" : \ - ((x) == AT_PAP_TYPE_CLOSE_CONN_REPLY) ? "PAP_CLOSE_CONN_REPLY" : \ - ((x) == AT_PAP_TYPE_SEND_STATUS) ? "PAP_SEND_STATUS" : \ - ((x) == AT_PAP_TYPE_SEND_STS_REPLY) ? "PAP_SEND_STS_REPLY" : \ - ((x) == AT_PAP_TYPE_READ_LW) ? "PAP_READ_LW" : \ - "" - #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 our pending send-data request */ -u_short gTickleID = 0; /* Transaction id of our outstanding tickle request*/ -int gWaitEOF = false; /* Option: causes us to wait for a remote's EOF */ +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: causes us to emit debugging info */ +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(int abortflag); -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 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 statusUpdate(char* status, u_char statusLen); static int parseUri(const char* argv0, char* name, char* type, char* zone); @@ -170,6 +173,7 @@ 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); @@ -199,10 +203,13 @@ int main (int argc, const char * argv[]) if (argc == 1 || (argc == 2 && strcmp(argv[1], "-discover") == 0)) { - /* Ignore errors returned by listDevices - they may be transitory - * and we don't want cupsd to think that pap is forever unusable. + /* If listDevices() didn't find any devices or returns an error output a + * legacy style announcement. + * */ - listDevices(); + if (listDevices() <= 0) + puts("network pap \"Unknown\" \"AppleTalk Printer Access Protocol (pap)\""); + return 0; } @@ -239,9 +246,9 @@ int main (int argc, const char * argv[]) } /* Extract the device name and options from the URI... */ - parseUri(argv[0], name, type, zone); + parseUri(cupsBackendDeviceURI((char **)argv), name, type, zone); - err = printFile(name, type, zone, fileno(fp), 3, STDERR_FILENO, copies, argc); + err = printFile(name, type, zone, fileno(fp), STDOUT_FILENO, STDERR_FILENO, copies, argc); if (fp != stdin) fclose(fp); @@ -263,7 +270,7 @@ int main (int argc, const char * argv[]) static int listDevices(void) { int err = noErr; - int ind; + int i; int numberFound; at_nvestr_t at_zone; @@ -287,10 +294,13 @@ static int listDevices(void) perror("ERROR: 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'; - err = addPercentEscapes(zone, encodedZone, sizeof(encodedZone)); + fprintf(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); @@ -310,10 +320,10 @@ static int listDevices(void) /* Not required but sort them so they look nice */ qsort(buf, numberFound, sizeof(at_nbptuple_t), nbptuple_compare); - for (ind = 0; ind < numberFound; ind++) + for (i = 0; i < numberFound; i++) { - memcpy(name, buf[ind].enu_entity.object.str, MIN(buf[ind].enu_entity.object.len, sizeof(name)-1)); - name[MIN(buf[ind].enu_entity.object.len, sizeof(name)-1)] = '\0'; + 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) { @@ -371,7 +381,7 @@ static int printFile(char* name, char* type, char* zone, int fdin, int fdout, in int err; int rc; int val; - int len, ind; + int len, i; char fileBuffer[4096]; /* File buffer */ int fileBufferNbytes; @@ -390,20 +400,19 @@ static int printFile(char* name, char* type, char* zone, int fdin, int fdout, in int userdata, xo, reqlen; u_short tid; u_char bitmap; - int maxfdp1; + int maxfdp1, + nbp_failures = 0; struct timeval timeout, *timeoutPtr; u_char flowQuantum = 1; u_short recvSequence = 0; time_t now, - connect_time, + start_time, elasped_time, sleep_time, connect_timeout = -1, nextStatusTime = 0; at_entity_t entity; at_retry_t retry; - Boolean recoverableErrShown = false; - #if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET) struct sigaction action; /* Actions for POSIX signals */ @@ -420,51 +429,60 @@ static int printFile(char* name, char* type, char* zone, int fdin, int fdout, in * Remember when we started looking for the printer. */ - connect_time = time(NULL); + 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 (recoverableErrShown) - { - fprintf(stderr, "INFO: recovered: \n"); - sleep(5); - recoverableErrShown = false; + 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; - fprintf(stderr, "WARNING: Unable to open \"%s:%s\": %s\n", name, zone, strerror(errno)); + fprintf(stderr, "WARNING: Unable to open \"%s:%s\": %s\n", name, zone, strerror(err)); } else { - fprintf(stderr, "WARNING: recoverable: Printer not responding\n"); - recoverableErrShown = true; + /* 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"); + fprintf(stderr, "WARNING: Printer not responding\n"); + } } } else { - fprintf(stderr, "WARNING: recoverable: AppleTalk disabled in System Preferences.\n"); - recoverableErrShown = true; + fprintf(stderr, "STATE: +apple-appletalk-disabled-warning\n"); + fprintf(stderr, "INFO: AppleTalk disabled in System Preferences.\n"); } - retry.retries = 3; - elasped_time = time(NULL) - connect_time; + elasped_time = time(NULL) - start_time; if (connect_timeout == -1) connect_timeout = connectTimeout(); @@ -475,9 +493,9 @@ static int printFile(char* name, char* type, char* zone, int fdin, int fdout, in err = ETIMEDOUT; goto Exit; /* Waiting too long... */ } - else if (elasped_time < 30 /*(30 * 60)*/) + else if (elasped_time < (30 * 60)) sleep_time = 10; /* Waiting < 30 minutes */ - else if (elasped_time < 60 /*(24 * 60 * 60)*/) + else if (elasped_time < (24 * 60 * 60)) sleep_time = 30; /* Waiting < 24 hours */ else sleep_time = 60; /* Waiting > 24 hours */ @@ -486,6 +504,8 @@ static int printFile(char* name, char* type, char* zone, int fdin, int fdout, in 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 @@ -536,21 +556,6 @@ static int printFile(char* name, char* type, char* zone, int fdin, int fdout, in val = fcntl(fdin, F_GETFL, 0); fcntl(fdin, F_SETFL, val | O_NONBLOCK); - /* Set non-blocking mode on our data destination descriptor */ - val = fcntl(fdout, F_GETFL, 0); - if (val < 0) - { - /* - * Map output to stdout if we don't have the backchannel pipe - * available on file descriptor 3... - */ - - if (fdout == 3 && errno == EBADF) - fdout = 1; - } - else - fcntl(fdout, F_SETFL, val | O_NONBLOCK); - fileBufferNbytes = 0; fileTbytes = 0; fileEOFRead = fileEOFSent = false; @@ -666,7 +671,7 @@ static int printFile(char* name, char* type, char* zone, int fdin, int fdout, in } } - fprintf(stderr, "DEBUG: <- %s\n", PAPPacketStr(TYPE_OF(userdata))); + fprintf(stderr, "DEBUG: <- %s\n", packet_name(TYPE_OF(userdata))); switch (TYPE_OF(userdata)) { @@ -707,10 +712,10 @@ static int printFile(char* name, char* type, char* zone, int fdin, int fdout, in break; case AT_PAP_TYPE_DATA: /* Data packet */ - for (len=0, ind=0; ind < ATP_TRESP_MAX; ind++) + for (len=0, i=0; i < ATP_TRESP_MAX; i++) { - if (resp.bitmap & (1 << ind)) - len += resp.resp[ind].iov_len; + 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" : ""); @@ -722,7 +727,7 @@ static int printFile(char* name, char* type, char* zone, int fdin, int fdout, in char logstr[512]; int logstrlen; - write(fdout, sockBuffer, len); + cupsBackChannelWrite(sockBuffer, len, 1.0); sockBuffer[len] = '\0'; /* We always reserve room for the nul so we can use strstr() below*/ pLineBegin = sockBuffer; @@ -835,7 +840,7 @@ Exit: /* * Close the socket and return... */ - papClose(false); + papClose(); return err; } @@ -854,37 +859,35 @@ Exit: * * @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) +static int papOpen(at_nbptuple_t* tuple, u_char* connID, int* fd, + at_inet_t* sessionAddr, u_char* flowQuantum) { int result, - openResult; - long tm; - char data[10], rdata[ATP_DATA_SIZE]; - int userdata; - u_char *puserdata = (u_char *)&userdata; - at_socket sock = 0; - u_short waitTime; - int status; + open_result, + userdata, + atp_err; + 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; - if (tuple == NULL) - { - errno = EINVAL; - return -1; - } + result = 0; + socketfd = 0; + puserdata = (u_char *)&userdata; fprintf(stderr, "INFO: Opening connection\n"); - errno = 0; - result = 0; - - *fd = atp_open(&sock); - if (*fd < 0) + if ((*fd = atp_open(&socketfd)) < 0) return -1; - /* Build the open connection request packet. + /* + * Build the open connection request packet. */ + tm = time(NULL); srand(tm); @@ -901,64 +904,67 @@ static int papOpen(at_nbptuple_t* tuple, u_char* connID, int* fd, at_inet_t* ses resp.resp[0].iov_base = rdata; resp.resp[0].iov_len = sizeof(rdata); - data[0] = sock; + data[0] = socketfd; data[1] = 8; for (;;) { - waitTime = (u_short)(time(NULL) - tm); - OSWriteBigInt16(&data[2], 0, waitTime); - - fprintf(stderr, "DEBUG: -> %s\n", PAPPacketStr(AT_PAP_TYPE_OPEN_CONN)); + waitTime = time(NULL) - tm; + OSWriteBigInt16(&data[2], 0, (u_short)waitTime); - status = atp_sendreq(*fd, &tuple->enu_addr, data, 4, userdata, 1, 0, 0, &resp, &retry, 0); + fprintf(stderr, "DEBUG: -> %s\n", packet_name(AT_PAP_TYPE_OPEN_CONN)); - if (status < 0) + if ((atp_err = atp_sendreq(*fd, &tuple->enu_addr, data, 4, userdata, 1, 0, + 0, &resp, &retry, 0)) < 0) { statusUpdate("Destination unreachable", 23); result = EHOSTUNREACH; - errno = EHOSTUNREACH; - sleep(1); - goto Exit; + break; } - else - { - puserdata = (u_char *)&resp.userdata[0]; - openResult = OSReadBigInt16(&rdata[2], 0); - fprintf(stderr, "DEBUG: <- %s, status %d\n", PAPPacketStr(puserdata[1]), openResult); + puserdata = (u_char *)&resp.userdata[0]; + open_result = OSReadBigInt16(&rdata[2], 0); - /* Just for the sake of our sanity check the other fields in the packet - */ - if (puserdata[1] != AT_PAP_TYPE_OPEN_CONN_REPLY || - (openResult == 0 && (puserdata[0] & 0xff) != *connID)) - { - result = EINVAL; - errno = EINVAL; - goto Exit; - } - - statusUpdate(&rdata[5], rdata[4] & 0xff); + 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 (openResult == 0) - break; /* Connection established okay, exit from the loop */ + 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); } - /* Update the session address - */ - sessionAddr->net = tuple->enu_addr.net; - sessionAddr->node = tuple->enu_addr.node; - sessionAddr->socket = rdata[0]; - *flowQuantum = rdata[1]; - -Exit: - if (result != 0) + 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; @@ -970,12 +976,9 @@ Exit: * @abstract End a PAP session by canceling outstanding send-data & tickle * transactions and sending a PAP close request. * - * @param abort If we're aborting then send the close request - * with 0 retries (not yet implemented) - * * @result A non-zero return value for errors */ -static int papClose(int abortflag) +static int papClose() { int fd; u_short tmpID; @@ -1018,7 +1021,7 @@ static int papClose(int abortflag) if (gWaitEOF == false) sleep(2); - fprintf(stderr, "DEBUG: -> %s\n", PAPPacketStr(AT_PAP_TYPE_CLOSE_CONN)); + fprintf(stderr, "DEBUG: -> %s\n", packet_name(AT_PAP_TYPE_CLOSE_CONN)); puserdata[0] = gConnID; puserdata[1] = AT_PAP_TYPE_CLOSE_CONN; @@ -1058,7 +1061,7 @@ static int papClose(int abortflag) 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 ind; + int i; u_char* puserdata; at_resp_t resp; @@ -1076,26 +1079,26 @@ static int papWrite(int sockfd, at_inet_t* dest, u_short tid, u_char connID, u_c * response packets to reply to an incoming * PAP 'SENDDATA' request */ - for (ind = 0; ind < flowQuantum; ind++) + for (i = 0; i < flowQuantum; i++) { - resp.userdata[ind] = 0; - puserdata = (u_char *)&resp.userdata[ind]; + 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[ind].iov_base = (caddr_t)data; + resp.resp[i].iov_base = (caddr_t)data; if (data) data += AT_PAP_DATA_SIZE; - resp.resp[ind].iov_len = MIN((int)len, (int)AT_PAP_DATA_SIZE); - len -= resp.resp[ind].iov_len; + 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 << (ind + 1)) - 1; + resp.bitmap = (1 << (i + 1)) - 1; /* * Write out the data as a PAP 'DATA' response @@ -1168,7 +1171,7 @@ static int papSendRequest(int sockfd, at_inet_t* dest, u_char connID, int functi at_resp_t resp; static u_short pap_send_count = 0; - fprintf(stderr, "DEBUG: -> %s\n", PAPPacketStr(function)); + fprintf(stderr, "DEBUG: -> %s\n", packet_name(function)); puserdata[0] = connID; puserdata[1] = function; @@ -1274,7 +1277,7 @@ void statusUpdate(char* status, u_char statusLen) */ static int parseUri(const char* argv0, char* name, char* type, char* zone) { - char scheme[255], /* Scheme in URI */ + char method[255], /* Method in URI */ hostname[1024], /* Hostname */ username[255], /* Username info (not used) */ resource[1024], /* Resource info (device and options) */ @@ -1290,8 +1293,10 @@ static int parseUri(const char* argv0, char* name, char* type, char* zone) /* * 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, scheme, sizeof(scheme), + httpSeparateURI(HTTP_URI_CODING_NONE, argv0, method, sizeof(method), username, sizeof(username), hostname, sizeof(hostname), &port, resource, sizeof(resource)); @@ -1527,6 +1532,31 @@ static int okayToUseAppleTalk() } +/*! + * @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. @@ -1562,7 +1592,7 @@ static void signalHandler(int sigraised) { fprintf(stderr, "ERROR: There was a timeout error while sending data to the printer\n"); - papClose(true); + papClose(); _exit(1); } diff --git a/backend/snmp.c b/backend/snmp.c index f2a2b893f..b76283aa2 100644 --- a/backend/snmp.c +++ b/backend/snmp.c @@ -1,5 +1,5 @@ /* - * "$Id: snmp.c 6049 2006-10-20 15:07:21Z mike $" + * "$Id: snmp.c 6090 2006-11-14 16:35:27Z mike $" * * SNMP discovery backend for the Common UNIX Printing System (CUPS). * @@ -1126,7 +1126,7 @@ asn1_set_packed(unsigned char **buffer, /* IO - Pointer in buffer */ { if (integer > 0xfffffff) { - **buffer = (integer >> 14) & 0x7f; + **buffer = (integer >> 28) & 0x7f; (*buffer) ++; } @@ -1752,7 +1752,7 @@ probe_device(snmp_cache_t *device) /* I - Device */ alarm(0); } - if (http); + if (http) { /* * IPP is supported... @@ -2455,5 +2455,5 @@ update_cache(snmp_cache_t *device, /* I - Device */ /* - * End of "$Id: snmp.c 6049 2006-10-20 15:07:21Z mike $". + * End of "$Id: snmp.c 6090 2006-11-14 16:35:27Z mike $". */ diff --git a/backend/usb-darwin.c b/backend/usb-darwin.c index 03e0373ff..d1da59b9b 100644 --- a/backend/usb-darwin.c +++ b/backend/usb-darwin.c @@ -1,5 +1,5 @@ /* - * "$Id: usb-darwin.c 5630 2006-06-05 18:42:53Z mike $" + * "$Id: usb-darwin.c 6090 2006-11-14 16:35:27Z mike $" * * © Copyright 2005-2006 Apple Computer, Inc. All rights reserved. * @@ -198,12 +198,13 @@ static void copy_deviceinfo(CFStringRef deviceIDString, CFStringRef *make, CFStr static void release_deviceinfo(CFStringRef *make, CFStringRef *model, CFStringRef *serial); static kern_return_t load_classdriver(CFStringRef driverPath, printer_interface_t intf, classdriver_context_t ***driver); static kern_return_t unload_classdriver(classdriver_context_t ***classDriver); -static kern_return_t load_printerdriver(printer_data_t *printer); -static kern_return_t registry_open(printer_data_t *printer); +static kern_return_t load_printerdriver(printer_data_t *printer, CFStringRef *driverBundlePath); +static kern_return_t registry_open(printer_data_t *printer, CFStringRef *driverBundlePath); static kern_return_t registry_close(printer_data_t *printer); static OSStatus copy_deviceid(classdriver_context_t **printer, CFStringRef *deviceID); static void copy_devicestring(io_service_t usbInterface, CFStringRef *deviceID, UInt32 *deviceLocation); static CFStringRef copy_value_for_key(CFStringRef deviceID, CFStringRef *keys); +static CFStringRef cfstr_create_and_trim(const char *cstr); static void parse_options(const char *options, char *serial, UInt32 *location, Boolean *waitEOF); static void setup_cfLanguage(void); static void *read_thread(void *reference); @@ -255,6 +256,7 @@ print_device(const char *uri, /* I - Device URI */ int countdown = INITIAL_LOG_INTERVAL; /* Logging interval */ pthread_cond_t *readCompleteConditionPtr = NULL; /* Read complete condition */ pthread_mutex_t *readMutexPtr = NULL; /* Read mutex */ + CFStringRef driverBundlePath; /* Class driver path */ setup_cfLanguage(); parse_options(options, serial, &printer_data.location, &printer_data.waitEOF); @@ -263,9 +265,10 @@ print_device(const char *uri, /* I - Device URI */ resource++; printer_data.uri = uri; - printer_data.make = CFStringCreateWithCString(NULL, hostname, kCFStringEncodingUTF8); - printer_data.model = CFStringCreateWithCString(NULL, resource, kCFStringEncodingUTF8); - printer_data.serial = CFStringCreateWithCString(NULL, serial, kCFStringEncodingUTF8); + + printer_data.make = cfstr_create_and_trim(hostname); + printer_data.model = cfstr_create_and_trim(resource); + printer_data.serial = cfstr_create_and_trim(serial); fputs("STATE: +connecting-to-device\n", stderr); @@ -281,7 +284,9 @@ print_device(const char *uri, /* I - Device URI */ iterate_printers(find_device_callback, &printer_data); fprintf(stderr, "INFO: Opening Connection\n"); - status = registry_open(&printer_data); + + driverBundlePath = NULL; + status = registry_open(&printer_data, &driverBundlePath); #if defined(__i386__) /* * If we were unable to load the class drivers for this printer it's probably because they're ppc-only. @@ -292,6 +297,26 @@ print_device(const char *uri, /* I - Device URI */ /* Never returns here */ } #endif /* __i386__ */ + if (status == -2) { + /* + * If we still were unable to load the class drivers for this printer log + * the error and stop the queue... + */ + + if (driverBundlePath == NULL || !CFStringGetCString(driverBundlePath, buffer, sizeof(buffer), kCFStringEncodingUTF8)) + strlcpy(buffer, "USB class driver", sizeof(buffer)); + + fprintf(stderr, "STATE: +apple-missing-usbclassdriver-error\n" \ + "FATAL: Could not load %s\n", buffer); + + if (driverBundlePath) + CFRelease(driverBundlePath); + + return CUPS_BACKEND_STOP; + } + + if (driverBundlePath) + CFRelease(driverBundlePath); if (status != noErr) { sleep( PRINTER_POLLING_INTERVAL ); @@ -508,7 +533,7 @@ static Boolean find_device_callback(void *refcon, io_service_t obj) if (CFStringCompare(make, userData->make, kCFCompareCaseInsensitive) == kCFCompareEqualTo) { if (CFStringCompare(model, userData->model, kCFCompareCaseInsensitive) == kCFCompareEqualTo) { if (userData->serial != NULL) { - if (serial != NULL && CFStringCompare(model, userData->model, kCFCompareCaseInsensitive) == kCFCompareEqualTo) { + if (serial != NULL && CFStringCompare(serial, userData->serial, kCFCompareCaseInsensitive) == kCFCompareEqualTo) { IOObjectRetain(obj); userData->printerObj = obj; keepLooking = false; @@ -728,9 +753,11 @@ static kern_return_t unload_classdriver(classdriver_context_t ***classDriver) /* * 'load_printerdriver()' - Load a vendor's (or generic) classdriver. + * + * If driverBundlePath is not NULL on return it is the callers responsbility to release it! */ -static kern_return_t load_printerdriver(printer_data_t *printer) +static kern_return_t load_printerdriver(printer_data_t *printer, CFStringRef *driverBundlePath) { IOCFPlugInInterface **iodev = NULL; SInt32 score; @@ -744,11 +771,10 @@ static kern_return_t load_printerdriver(printer_data_t *printer) kr = IORegistryEntryCreateCFProperties(printer->printerObj, &properties, NULL, kNilOptions); if (kr == kIOReturnSuccess) { - CFStringRef driverBundlePath = NULL; if (properties != NULL) { - driverBundlePath = (CFStringRef) CFDictionaryGetValue(properties, kUSBClassDriverProperty); + *driverBundlePath = (CFStringRef) CFDictionaryGetValue(properties, kUSBClassDriverProperty); } - kr = load_classdriver(driverBundlePath, intf, &printer->printerDriver); + kr = load_classdriver(*driverBundlePath, intf, &printer->printerDriver); } if (kr != kIOReturnSuccess) @@ -764,9 +790,9 @@ static kern_return_t load_printerdriver(printer_data_t *printer) * 'registry_open()' - Open a connection to the printer. */ -static kern_return_t registry_open(printer_data_t *printer) +static kern_return_t registry_open(printer_data_t *printer, CFStringRef *driverBundlePath) { - kern_return_t kr = load_printerdriver(printer); + kern_return_t kr = load_printerdriver(printer, driverBundlePath); if (kr != kIOReturnSuccess) { kr = -2; } @@ -975,6 +1001,27 @@ static CFStringRef copy_value_for_key(CFStringRef deviceID, CFStringRef *keys) } +/* + * 'cfstr_create_and_trim()' - Create a CFString from a c-string and + * trim it's whitespace characters. + */ + +CFStringRef cfstr_create_and_trim(const char *cstr) +{ + CFStringRef cfstr; + CFMutableStringRef cfmutablestr = NULL; + + if ((cfstr = CFStringCreateWithCString(NULL, cstr, kCFStringEncodingUTF8)) != NULL) + { + if ((cfmutablestr = CFStringCreateMutableCopy(NULL, 1024, cfstr)) != NULL) + CFStringTrimWhitespace(cfmutablestr); + + CFRelease(cfstr); + } + return (CFStringRef) cfmutablestr; +} + + #pragma mark - /* * 'parse_options()' - Parse uri options. @@ -1344,7 +1391,6 @@ static void *read_thread(void *reference) return NULL; } - /* - * End of "$Id: usb-darwin.c 5630 2006-06-05 18:42:53Z mike $". + * End of "$Id: usb-darwin.c 6090 2006-11-14 16:35:27Z mike $". */ diff --git a/backend/usb-unix.c b/backend/usb-unix.c index 47b2cf1f0..4a4cbe259 100644 --- a/backend/usb-unix.c +++ b/backend/usb-unix.c @@ -1,5 +1,5 @@ /* - * "$Id: usb-unix.c 6032 2006-10-12 19:19:47Z mike $" + * "$Id: usb-unix.c 6111 2006-11-15 20:28:39Z mike $" * * USB port backend for the Common UNIX Printing System (CUPS). * @@ -84,8 +84,7 @@ print_device(const char *uri, /* I - Device URI */ * device ID over and over and over when they get a read request... */ - use_bc = strcasecmp(hostname, "Canon") != 0 || - strstr(hostname, "Minolta") != NULL; + use_bc = strcasecmp(hostname, "Canon") && !strstr(hostname, "Minolta"); if ((device_fd = open_device(uri, &use_bc)) == -1) { @@ -525,5 +524,5 @@ open_device(const char *uri, /* I - Device URI */ /* - * End of "$Id: usb-unix.c 6032 2006-10-12 19:19:47Z mike $". + * End of "$Id: usb-unix.c 6111 2006-11-15 20:28:39Z mike $". */ diff --git a/config-scripts/cups-common.m4 b/config-scripts/cups-common.m4 index 257f70933..7e54767fe 100644 --- a/config-scripts/cups-common.m4 +++ b/config-scripts/cups-common.m4 @@ -1,5 +1,5 @@ dnl -dnl "$Id: cups-common.m4 6052 2006-10-20 20:35:41Z mike $" +dnl "$Id: cups-common.m4 6092 2006-11-14 16:36:36Z mike $" dnl dnl Common configuration stuff for the Common UNIX Printing System (CUPS). dnl @@ -28,12 +28,9 @@ AC_PREREQ(2.50) dnl Set the name of the config header file... AC_CONFIG_HEADER(config.h) -dnl Versio number information... -CUPS_VERSION="1.2.6" +dnl Version number information... +CUPS_VERSION="1.2.7" CUPS_REVISION="" -if test -z "$CUPS_REVISION" -a -d .svn; then - CUPS_REVISION="-r`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[[a-zA-Z]]*//g'`" -fi AC_SUBST(CUPS_VERSION) AC_SUBST(CUPS_REVISION) @@ -267,5 +264,5 @@ AC_SUBST(DEFAULT_IPP_PORT) AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT) dnl -dnl End of "$Id: cups-common.m4 6052 2006-10-20 20:35:41Z mike $". +dnl End of "$Id: cups-common.m4 6092 2006-11-14 16:36:36Z mike $". dnl diff --git a/config-scripts/cups-defaults.m4 b/config-scripts/cups-defaults.m4 index 786411680..66810f9e5 100644 --- a/config-scripts/cups-defaults.m4 +++ b/config-scripts/cups-defaults.m4 @@ -1,5 +1,5 @@ dnl -dnl "$Id: cups-defaults.m4 6003 2006-10-02 16:26:04Z mike $" +dnl "$Id: cups-defaults.m4 6118 2006-11-16 13:34:44Z mike $" dnl dnl Default cupsd configuration settings for the Common UNIX Printing System dnl (CUPS). @@ -28,7 +28,7 @@ AC_ARG_WITH(languages, [ --with-languages set installed languages, defau if test "x$withval" != xno; then LANGUAGES="$withval" fi, - LANGUAGES="de es et ja pl sv") + LANGUAGES="de es et it ja pl sv") AC_SUBST(LANGUAGES) dnl Default ConfigFilePerm @@ -252,5 +252,5 @@ fi AC_DEFINE_UNQUOTED(CUPS_DEFAULT_PRINTCAP, "$CUPS_DEFAULT_PRINTCAP") dnl -dnl End of "$Id: cups-defaults.m4 6003 2006-10-02 16:26:04Z mike $". +dnl End of "$Id: cups-defaults.m4 6118 2006-11-16 13:34:44Z mike $". dnl diff --git a/cups/cups.h b/cups/cups.h index bca22de82..9ae366298 100644 --- a/cups/cups.h +++ b/cups/cups.h @@ -1,5 +1,5 @@ /* - * "$Id: cups.h 6052 2006-10-20 20:35:41Z mike $" + * "$Id: cups.h 6092 2006-11-14 16:36:36Z mike $" * * API definitions for the Common UNIX Printing System (CUPS). * @@ -61,10 +61,10 @@ extern "C" { * Constants... */ -# define CUPS_VERSION 1.0206 +# define CUPS_VERSION 1.0207 # define CUPS_VERSION_MAJOR 1 # define CUPS_VERSION_MINOR 2 -# define CUPS_VERSION_PATCH 6 +# define CUPS_VERSION_PATCH 7 # define CUPS_DATE_ANY -1 @@ -244,5 +244,5 @@ extern cups_file_t *cupsTempFile2(char *filename, int len); #endif /* !_CUPS_CUPS_H_ */ /* - * End of "$Id: cups.h 6052 2006-10-20 20:35:41Z mike $". + * End of "$Id: cups.h 6092 2006-11-14 16:36:36Z mike $". */ diff --git a/cups/http-private.h b/cups/http-private.h index bef934ed9..d5b030d28 100644 --- a/cups/http-private.h +++ b/cups/http-private.h @@ -1,5 +1,5 @@ /* - * "$Id: http-private.h 5504 2006-05-10 18:57:46Z mike $" + * "$Id: http-private.h 6111 2006-11-15 20:28:39Z mike $" * * Private HTTP definitions for the Common UNIX Printing System (CUPS). * @@ -70,7 +70,8 @@ typedef int socklen_t; # if defined HAVE_LIBSSL /* * The OpenSSL library provides its own SSL/TLS context structure for its - * IO and protocol management... + * IO and protocol management. However, we need to provide our own BIO + * (basic IO) implementation to do timeouts... */ # include @@ -79,6 +80,8 @@ typedef int socklen_t; typedef SSL http_tls_t; +extern BIO_METHOD *_httpBIOMethods(void); + # elif defined HAVE_GNUTLS /* * The GNU TLS library is more of a "bare metal" SSL/TLS library... @@ -91,6 +94,11 @@ typedef struct void *credentials; /* GNU TLS credentials object */ } http_tls_t; +extern ssize_t _httpReadGNUTLS(gnutls_transport_ptr ptr, void *data, + size_t length); +extern ssize_t _httpWriteGNUTLS(gnutls_transport_ptr ptr, const void *data, + size_t length); + # elif defined(HAVE_CDSASSL) /* * Darwin's Security framework provides its own SSL/TLS context structure @@ -105,15 +113,6 @@ typedef struct /**** CDSA connection information ****/ CFArrayRef certsArray; /* Certificates array */ } http_tls_t; -typedef union _cdsa_conn_ref_u /**** CDSA Connection reference union - **** used to resolve 64-bit casting - **** warnings. - ****/ -{ - SSLConnectionRef connection; /* SSL connection pointer */ - int sock; /* Socket */ -} cdsa_conn_ref_t; - extern OSStatus _httpReadCDSA(SSLConnectionRef connection, void *data, size_t *dataLength); extern OSStatus _httpWriteCDSA(SSLConnectionRef connection, const void *data, @@ -187,5 +186,5 @@ extern void _cups_freeifaddrs(struct ifaddrs *addrs); #endif /* !_CUPS_HTTP_PRIVATE_H_ */ /* - * End of "$Id: http-private.h 5504 2006-05-10 18:57:46Z mike $". + * End of "$Id: http-private.h 6111 2006-11-15 20:28:39Z mike $". */ diff --git a/cups/http.c b/cups/http.c index 169aece66..3e0fef0ed 100644 --- a/cups/http.c +++ b/cups/http.c @@ -1,5 +1,5 @@ /* - * "$Id: http.c 5961 2006-09-16 19:08:36Z mike $" + * "$Id: http.c 6111 2006-11-15 20:28:39Z mike $" * * HTTP routines for the Common UNIX Printing System (CUPS). * @@ -25,6 +25,7 @@ * * 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. @@ -60,7 +61,8 @@ * 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 CDSA decryption code. + * _httpReadCDSA() - Read function for the CDSA library. + * _httpReadGNUTLS() - Read function for the GNU TLS library. * httpReconnect() - Reconnect to a HTTP server... * httpSetCookie() - Set the cookie value(s)... * httpSetExpect() - Set the Expect: header in a request. @@ -71,7 +73,14 @@ * 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 CDSA encryption code. + * _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_field() - Return the field index for a field name. * http_read_ssl() - Read from a SSL/TLS connection. * http_send() - Send a request with all fields and the trailing @@ -118,7 +127,7 @@ static http_field_t http_field(const char *name); static int http_send(http_t *http, http_state_t request, const char *uri); -static int http_wait(http_t *http, int msec); +static int http_wait(http_t *http, int msec, int usessl); static int http_write(http_t *http, const char *buffer, int length); static int http_write_chunk(http_t *http, const char *buffer, @@ -168,6 +177,45 @@ static const char * const http_fields[] = }; +#if defined(HAVE_SSL) && defined(HAVE_LIBSSL) +/* + * BIO methods for OpenSSL... + */ + +static int http_bio_write(BIO *h, const char *buf, int num); +static int http_bio_read(BIO *h, char *buf, int size); +static int http_bio_puts(BIO *h, const char *str); +static long http_bio_ctrl(BIO *h, int cmd, long arg1, void *arg2); +static int http_bio_new(BIO *h); +static int http_bio_free(BIO *data); + +static BIO_METHOD http_bio_methods = + { + BIO_TYPE_SOCKET, + "http", + http_bio_write, + http_bio_read, + http_bio_puts, + NULL, /* http_bio_gets, */ + http_bio_ctrl, + http_bio_new, + http_bio_free, + NULL, + }; + + +/* + * '_httpBIOMethods()' - Get the OpenSSL BIO methods for HTTP connections. + */ + +BIO_METHOD * /* O - BIO methods for OpenSSL */ +_httpBIOMethods(void) +{ + return (&http_bio_methods); +} +#endif /* HAVE_SSL && HAVE_LIBSSL */ + + /* * 'httpBlocking()' - Set blocking/non-blocking behavior on a connection. */ @@ -869,7 +917,7 @@ httpGets(char *line, /* I - Line to read into */ * No newline; see if there is more data to be read... */ - if (!http->blocking && !http_wait(http, 10000)) + if (!http->blocking && !http_wait(http, 10000, 1)) { DEBUG_puts("httpGets: Timed out!"); http->error = ETIMEDOUT; @@ -1391,7 +1439,7 @@ httpRead2(http_t *http, /* I - HTTP connection */ #if defined(HAVE_SSL) && defined(HAVE_CDSASSL) /* - * '_httpReadCDSA()' - Read function for CDSA decryption code. + * '_httpReadCDSA()' - Read function for the CDSA library. */ OSStatus /* O - -1 on error, 0 on success */ @@ -1400,19 +1448,36 @@ _httpReadCDSA( void *data, /* I - Data buffer */ size_t *dataLength) /* IO - Number of bytes */ { - OSStatus result; /* Return value */ - ssize_t bytes; /* Number of bytes read */ - cdsa_conn_ref_t u; /* Connection reference union */ + OSStatus result; /* Return value */ + ssize_t bytes; /* Number of bytes read */ + http_t *http; /* HTTP connection */ + + + http = (http_t *)connection; + if (!http->blocking) + { + /* + * Make sure we have data before we read... + */ - u.connection = connection; + if (!http_wait(http, 10000, 0)) + { + http->error = ETIMEDOUT; + return (-1); + } + } do - bytes = recv(u.sock, data, *dataLength, 0); + { + bytes = recv(http->fd, data, *dataLength, 0); + } while (bytes == -1 && errno == EINTR); if (bytes == *dataLength) + { result = 0; + } else if (bytes > 0) { *dataLength = bytes; @@ -1430,11 +1495,45 @@ _httpReadCDSA( result = errSSLClosedAbort; } - return result; + return (result); } #endif /* HAVE_SSL && HAVE_CDSASSL */ +#if defined(HAVE_SSL) && defined(HAVE_GNUTLS) +/* + * '_httpReadGNUTLS()' - Read function for the GNU TLS library. + */ + +ssize_t /* O - Number of bytes read or -1 on error */ +_httpReadGNUTLS( + gnutls_transport_ptr ptr, /* I - HTTP connection */ + void *data, /* I - Buffer */ + size_t length) /* I - Number of bytes to read */ +{ + http_t *http; /* HTTP connection */ + + + http = (http_t *)ptr; + + if (!http->blocking) + { + /* + * Make sure we have data before we read... + */ + + if (!http_wait(http, 10000, 0)) + { + http->error = ETIMEDOUT; + return (-1); + } + } + + return (recv(http->fd, data, length, 0)); +} +#endif /* HAVE_SSL && HAVE_GNUTLS */ + + /* * 'httpReconnect()' - Reconnect to a HTTP server. */ @@ -1830,7 +1929,7 @@ httpWait(http_t *http, /* I - HTTP connection */ * If not, check the SSL/TLS buffers and do a select() on the connection... */ - return (http_wait(http, msec)); + return (http_wait(http, msec, 1)); } @@ -1977,7 +2076,7 @@ httpWrite2(http_t *http, /* I - HTTP connection */ #if defined(HAVE_SSL) && defined(HAVE_CDSASSL) /* - * '_httpWriteCDSA()' - Write function for CDSA encryption code. + * '_httpWriteCDSA()' - Write function for the CDSA library. */ OSStatus /* O - -1 on error, 0 on success */ @@ -1986,19 +2085,23 @@ _httpWriteCDSA( const void *data, /* I - Data buffer */ size_t *dataLength) /* IO - Number of bytes */ { - OSStatus result; /* Return value */ - ssize_t bytes; /* Number of bytes read */ - cdsa_conn_ref_t u; /* Connection reference union */ + OSStatus result; /* Return value */ + ssize_t bytes; /* Number of bytes read */ + http_t *http; /* HTTP connection */ - u.connection = connection; + http = (http_t *)connection; do - bytes = write(u.sock, data, *dataLength); + { + bytes = write(http->fd, data, *dataLength); + } while (bytes == -1 && errno == EINTR); if (bytes == *dataLength) + { result = 0; + } else if (bytes >= 0) { *dataLength = bytes; @@ -2014,11 +2117,164 @@ _httpWriteCDSA( result = errSSLClosedAbort; } - return result; + return (result); } #endif /* HAVE_SSL && HAVE_CDSASSL */ +#if defined(HAVE_SSL) && defined(HAVE_GNUTLS) +/* + * '_httpWriteGNUTLS()' - Write function for the GNU TLS library. + */ + +ssize_t /* O - Number of bytes written or -1 on error */ +_httpWriteGNUTLS( + gnutls_transport_ptr ptr, /* I - HTTP connection */ + const void *data, /* I - Data buffer */ + size_t length) /* I - Number of bytes to write */ +{ + return (send(((http_t *)ptr)->fd, data, length, 0)); +} +#endif /* HAVE_SSL && HAVE_GNUTLS */ + + +#if defined(HAVE_SSL) && defined(HAVE_LIBSSL) +/* + * 'http_bio_ctrl()' - Control the HTTP connection. + */ + +static long /* O - Result/data */ +http_bio_ctrl(BIO *h, /* I - BIO data */ + int cmd, /* I - Control command */ + long arg1, /* I - First argument */ + void *arg2) /* I - Second argument */ +{ + switch (cmd) + { + default : + return (0); + + case BIO_CTRL_RESET : + h->ptr = NULL; + return (0); + + case BIO_C_SET_FILE_PTR : + h->ptr = arg2; + h->init = 1; + return (1); + + case BIO_C_GET_FILE_PTR : + if (arg2) + { + *((void **)arg2) = h->ptr; + return (1); + } + else + return (0); + + case BIO_CTRL_DUP : + case BIO_CTRL_FLUSH : + return (1); + } +} + + +/* + * 'http_bio_free()' - Free OpenSSL data. + */ + +static int /* O - 1 on success, 0 on failure */ +http_bio_free(BIO *h) /* I - BIO data */ +{ + if (!h) + return (0); + + if (h->shutdown) + { + h->init = 0; + h->flags = 0; + } + + return (1); +} + + +/* + * 'http_bio_new()' - Initialize an OpenSSL BIO structure. + */ + +static int /* O - 1 on success, 0 on failure */ +http_bio_new(BIO *h) /* I - BIO data */ +{ + if (!h) + return (0); + + h->init = 0; + h->num = 0; + h->ptr = NULL; + h->flags = 0; + + return (1); +} + + +/* + * 'http_bio_puts()' - Send a string for OpenSSL. + */ + +static int /* O - Bytes written */ +http_bio_puts(BIO *h, /* I - BIO data */ + const char *str) /* I - String to write */ +{ + return (send(((http_t *)h->ptr)->fd, str, strlen(str), 0)); +} + + +/* + * 'http_bio_read()' - Read data for OpenSSL. + */ + +static int /* O - Bytes read */ +http_bio_read(BIO *h, /* I - BIO data */ + char *buf, /* I - Buffer */ + int size) /* I - Number of bytes to read */ +{ + http_t *http; /* HTTP connection */ + + + http = (http_t *)h->ptr; + + if (!http->blocking) + { + /* + * Make sure we have data before we read... + */ + + if (!http_wait(http, 10000, 0)) + { + http->error = ETIMEDOUT; + return (-1); + } + } + + return (recv(http->fd, buf, size, 0)); +} + + +/* + * 'http_bio_write()' - Write data for OpenSSL. + */ + +static int /* O - Bytes written */ +http_bio_write(BIO *h, /* I - BIO data */ + const char *buf, /* I - Buffer to write */ + int num) /* I - Number of bytes to write */ +{ + return (send(((http_t *)h->ptr)->fd, buf, num, 0)); +} +#endif /* HAVE_SSL && HAVE_LIBSSL */ + + /* * 'http_field()' - Return the field index for a field name. */ @@ -2247,6 +2503,7 @@ http_setup_ssl(http_t *http) /* I - HTTP connection */ # 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; @@ -2254,7 +2511,6 @@ http_setup_ssl(http_t *http) /* I - HTTP connection */ # elif defined(HAVE_CDSASSL) OSStatus error; /* Error code */ http_tls_t *conn; /* CDSA connection information */ - cdsa_conn_ref_t u; /* Connection reference union */ # endif /* HAVE_LIBSSL */ @@ -2265,9 +2521,12 @@ http_setup_ssl(http_t *http) /* I - HTTP connection */ SSL_CTX_set_options(context, SSL_OP_NO_SSLv2); /* Only use SSLv3 or TLS */ + 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); - SSL_set_fd(conn, http->fd); if (SSL_connect(conn) != 1) { # ifdef DEBUG @@ -2316,8 +2575,9 @@ http_setup_ssl(http_t *http) /* I - HTTP connection */ 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)((long)http->fd)); + 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); if ((gnutls_handshake(conn->session)) != GNUTLS_E_SUCCESS) { @@ -2348,9 +2608,7 @@ http_setup_ssl(http_t *http) /* I - HTTP connection */ * Use a union to resolve warnings about int/pointer size mismatches... */ - u.connection = NULL; - u.sock = http->fd; - error = SSLSetConnection(conn->session, u.connection); + error = SSLSetConnection(conn->session, http); if (!error) error = SSLSetIOFuncs(conn->session, _httpReadCDSA, _httpWriteCDSA); @@ -2544,7 +2802,8 @@ http_upgrade(http_t *http) /* I - HTTP connection */ static int /* O - 1 if data is available, 0 otherwise */ http_wait(http_t *http, /* I - HTTP connection */ - int msec) /* I - Milliseconds to wait */ + int msec, /* I - Milliseconds to wait */ + int usessl) /* I - Use SSL context? */ { #ifndef WIN32 struct rlimit limit; /* Runtime limit */ @@ -2564,7 +2823,7 @@ http_wait(http_t *http, /* I - HTTP connection */ */ #ifdef HAVE_SSL - if (http->tls) + if (http->tls && usessl) { # ifdef HAVE_LIBSSL if (SSL_pending((SSL *)(http->tls))) @@ -2829,5 +3088,5 @@ http_write_ssl(http_t *http, /* I - HTTP connection */ /* - * End of "$Id: http.c 5961 2006-09-16 19:08:36Z mike $". + * End of "$Id: http.c 6111 2006-11-15 20:28:39Z mike $". */ diff --git a/cups/libcups_s.exp b/cups/libcups_s.exp index cad2f10af..71f9c7e69 100644 --- a/cups/libcups_s.exp +++ b/cups/libcups_s.exp @@ -28,6 +28,7 @@ _cups_freeifaddrs _cups_strcpy _cups_strlcat _cups_strlcpy +_httpBIOMethods _ippAddAttr _ippFreeAttr _ppdGetEncoding diff --git a/cups/transcode.c b/cups/transcode.c index b0b5166fc..dc9d4dcb1 100644 --- a/cups/transcode.c +++ b/cups/transcode.c @@ -1,5 +1,5 @@ /* - * "$Id: transcode.c 6038 2006-10-14 15:53:10Z mike $" + * "$Id: transcode.c 6115 2006-11-15 22:21:18Z mike $" * * Transcoding support for the Common UNIX Printing System (CUPS). * @@ -295,6 +295,38 @@ cupsCharsetToUTF8( return (strlen((char *)dest)); } + /* + * Handle ISO-8859-1 to UTF-8 directly... + */ + + if (encoding == CUPS_ISO8859_1) + { + int ch; /* Character from string */ + cups_utf8_t *destptr, /* Pointer into UTF-8 buffer */ + *destend; /* End of UTF-8 buffer */ + + + destptr = dest; + destend = dest + maxout - 2; + + while (*src && destptr < destend) + { + ch = *src++ & 255; + + if (ch & 128) + { + *destptr++ = 0xc0 | (ch >> 6); + *destptr++ = 0x80 | (ch & 0x3f); + } + else + *destptr++ = ch; + } + + *destptr = '\0'; + + return (destptr - dest); + } + /* * Convert input legacy charset to UTF-8... */ @@ -363,6 +395,45 @@ cupsUTF8ToCharset( return (strlen(dest)); } + /* + * Handle UTF-8 to ISO-8859-1 directly... + */ + + if (encoding == CUPS_ISO8859_1) + { + int ch; /* Character from string */ + char *destptr, /* Pointer into ISO-8859-1 buffer */ + *destend; /* End of ISO-8859-1 buffer */ + + + destptr = dest; + destend = dest + maxout - 1; + + while (*src && destptr < destend) + { + ch = *src++; + + if ((ch & 0xe0) == 0xc0) + { + ch = ((ch & 0x1f) << 6) | (*src++ & 0x3f); + + if (ch < 256) + *destptr++ = ch; + else + *destptr++ = '?'; + } + else if ((ch & 0xf0) == 0xe0 || + (ch & 0xf8) == 0xf0) + *destptr++ = '?'; + else if (!(ch & 0x80)) + *destptr++ = ch; + } + + *destptr = '\0'; + + return (destptr - dest); + } + /* * Convert input UTF-8 to legacy charset... */ @@ -1584,5 +1655,5 @@ get_vbcs_charmap( /* - * End of "$Id: transcode.c 6038 2006-10-14 15:53:10Z mike $" + * End of "$Id: transcode.c 6115 2006-11-15 22:21:18Z mike $" */ diff --git a/desktop/cups.desktop b/desktop/cups.desktop index 48ac645bb..0bb1c4620 100644 --- a/desktop/cups.desktop +++ b/desktop/cups.desktop @@ -23,3 +23,5 @@ Name[et]=Trükkimise haldur Comment[et]=CUPS-i veebiliides Name[pl]=Zarządzanie drukowaniem Comment[pl]=Interfejs WWW CUPS +Name[it]=Gestione stampa +Comment[it]=Interfaccia web di CUPS \ No newline at end of file diff --git a/doc/help/spec-ppd.html b/doc/help/spec-ppd.html index 621fbcc1a..089aef83d 100644 --- a/doc/help/spec-ppd.html +++ b/doc/help/spec-ppd.html @@ -8,7 +8,7 @@ + + + {refresh_page?:} + + + + + + + + + + + + + + + + + + diff --git a/templates/it/option-conflict.tmpl b/templates/it/option-conflict.tmpl new file mode 100644 index 000000000..c0e20317d --- /dev/null +++ b/templates/it/option-conflict.tmpl @@ -0,0 +1,7 @@ +

Errore: Le seguenti opzioni sono in conflitto:

+ + + +

Modifica una o più opzioni per risolvere il problema.

diff --git a/templates/it/option-header.tmpl b/templates/it/option-header.tmpl new file mode 100644 index 000000000..cafc9f9fe --- /dev/null +++ b/templates/it/option-header.tmpl @@ -0,0 +1,3 @@ +

{printer_name}: {group}

+ +

{title}

+ +  Home   + +   Amministrazione   + +   Classi   + +   Documentazione/Aiuto   + +   Operazioni   + +   Stampanti   + +
  diff --git a/templates/it/help-header.tmpl b/templates/it/help-header.tmpl new file mode 100644 index 000000000..2caf5d2c7 --- /dev/null +++ b/templates/it/help-header.tmpl @@ -0,0 +1,47 @@ +
+{TOPIC?:} + +

Cerca in +{HELPTITLE?{HELPTITLE}:{TOPIC?{TOPIC}:Tutti i documenti}}: +Pulisci

+ +
+ + + + +{QUERY?

Cerca risultati in {HELPFILE?{HELPTITLE}:{TOPIC?{TOPIC}:Tutti i documenti}}\:

+{QTEXT?:} +:

Nessuna corrispondenza trovata.

} +
:} +{HELPTITLE?

{HELPTITLE} +Mostra versione stampabile

:

Pagine della guida di CUPS

+ +

Questa è l'interfaccia di guida in linea di CUPS. Inserisci sopra i termini di +ricerca o fai clic su ognuno dei collegamenti alla documentazione per visualizzare +le informazioni.

+ +

Se sei nuovo di CUPS, leggi la pagina "Sommario di CUPS". Gli utenti di vecchia data +dovrebbero leggere la pagina "Cosa c'è di nuovo in CUPS +1.2".

+ +

La pagina principale di CUPS fornisce +inoltre molte risorse tra cui forum di discussione per utenti, risposte +alla domande frequenti, e un modulo per la segnalazione di bug +e richieste di nuove funzionalità.

} diff --git a/templates/it/help-printable.tmpl b/templates/it/help-printable.tmpl new file mode 100644 index 000000000..305112a33 --- /dev/null +++ b/templates/it/help-printable.tmpl @@ -0,0 +1,11 @@ + + + + + {HELPTITLE} + + + + + +

{HELPTITLE}

diff --git a/templates/it/job-cancel.tmpl b/templates/it/job-cancel.tmpl new file mode 100644 index 000000000..24054cff4 --- /dev/null +++ b/templates/it/job-cancel.tmpl @@ -0,0 +1 @@ +

L'operazione {job_id} è stata annullata. diff --git a/templates/it/job-hold.tmpl b/templates/it/job-hold.tmpl new file mode 100644 index 000000000..97df9d34a --- /dev/null +++ b/templates/it/job-hold.tmpl @@ -0,0 +1 @@ +

L'operazione {job_id} è stata bloccata. diff --git a/templates/it/job-move.tmpl b/templates/it/job-move.tmpl new file mode 100644 index 000000000..cc4a8a07d --- /dev/null +++ b/templates/it/job-move.tmpl @@ -0,0 +1,22 @@ +

+ +{job_id?:} + +

{job_id?Sposta l'operazione {job_id}:Sposta tutte le operazioni}

+ + + + + + + + + + +
Nuova destinazione: + +
+ +
diff --git a/templates/it/job-moved.tmpl b/templates/it/job-moved.tmpl new file mode 100644 index 000000000..d14cc58e9 --- /dev/null +++ b/templates/it/job-moved.tmpl @@ -0,0 +1,2 @@ +

{job_id?Operazione {job_id}:Tutte le operazioni} spostat{job_id?a:e} su +{job_printer_name}.

diff --git a/templates/it/job-release.tmpl b/templates/it/job-release.tmpl new file mode 100644 index 000000000..fc82ff0bf --- /dev/null +++ b/templates/it/job-release.tmpl @@ -0,0 +1 @@ +

L'operazione {job_id} è stata rilasciata per la stampa. diff --git a/templates/it/job-restart.tmpl b/templates/it/job-restart.tmpl new file mode 100644 index 000000000..9f1b74061 --- /dev/null +++ b/templates/it/job-restart.tmpl @@ -0,0 +1 @@ +

L'operazione {job_id} è stata riavviata. diff --git a/templates/it/jobs-header.tmpl b/templates/it/jobs-header.tmpl new file mode 100644 index 000000000..385534fa2 --- /dev/null +++ b/templates/it/jobs-header.tmpl @@ -0,0 +1,15 @@ +

{?which_jobs=?Mostra operazioni completate +Mostra tutte le operazioni:{which_jobs=all?Mostra operazioni completate +Mostra operazioni attive:Mostra operazioni attive +Mostra tutte le operazioni}}

+ +

{total=0?Nessuna operazione:Mostrat{total=1?a:e} {#job_id} di {total} operazion{total=1?e:i} {?which_jobs=?attiva:{which_jobs=all?:completata}} }.

diff --git a/templates/it/jobs.tmpl b/templates/it/jobs.tmpl new file mode 100644 index 000000000..6f8f555ec --- /dev/null +++ b/templates/it/jobs.tmpl @@ -0,0 +1,42 @@ +{#job_id=0?: + + + + + + + + + + + +{[job_id] + + + + + + + + + +} +
ID Nome Utente Dimensione Pagine Stato Controllo 
{job_printer_name}-{job_id} {?job_name=?Sconosciuto:{job_name}} {job_originating_user_name} {job_k_octets}k {job_media_sheets_completed=0?Sconosciuto:{?job_media_sheets_completed}}{job_state=3?in sospeso da
{time_at_creation}:{job_state=4?bloccata da
{time_at_creation}: +{job_state=5?elaborazione in corso da
{time_at_processing}:{job_state=6?fermata: +{job_state=7?annullata a
{time_at_completed}:{job_state=8?interrotta:completata a
{time_at_completed}}}}}}} 
+{job_preserved>0? + +Ristampa operazione:} +{job_state=4? + +Rilascia operazione:} +{job_state=3? + +Blocca operazione:} +{job_state<7? + +Annulla operazione +Sposta operazione:} + 
+} diff --git a/templates/it/maintenance.tmpl b/templates/it/maintenance.tmpl new file mode 100644 index 000000000..1b88d6c78 --- /dev/null +++ b/templates/it/maintenance.tmpl @@ -0,0 +1,2 @@ +

comandi di manutenzione inviati; l'ID dell'operazione è +{printer_name}-{job_id}.

diff --git a/templates/it/modify-class.tmpl b/templates/it/modify-class.tmpl new file mode 100644 index 000000000..25d158a2d --- /dev/null +++ b/templates/it/modify-class.tmpl @@ -0,0 +1,34 @@ +
+ + +

Modifica classe {printer_name}

+ + + + + + + + + + + + + + + + + + + + + + +
Nome: +{printer_name}
Posizione:
Descrizione:
Membri: + +
+ +
diff --git a/templates/it/modify-printer.tmpl b/templates/it/modify-printer.tmpl new file mode 100644 index 000000000..a9eafb130 --- /dev/null +++ b/templates/it/modify-printer.tmpl @@ -0,0 +1,29 @@ +
+ +{?device_uri=?:} +{?printer_make_and_model=?:} + +

Modifica stampante {printer_name}

+ + + + + + + + + + + + + + + + + + +
Nome:{printer_name}
Posizione:
+(Posizione comprensibile del tipo "Laboratorio 1")
Descrizione:
+(Descrizione comprensibile del tipo "HP LaserJet con Duplexer")
+ +
diff --git a/templates/it/norestart.tmpl b/templates/it/norestart.tmpl new file mode 100644 index 000000000..780f7661c --- /dev/null +++ b/templates/it/norestart.tmpl @@ -0,0 +1,2 @@ +

Il server non è riavviato poiché non ci sono state modifiche +della configurazione...

diff --git a/templates/it/option-boolean.tmpl b/templates/it/option-boolean.tmpl new file mode 100644 index 000000000..72c85189a --- /dev/null +++ b/templates/it/option-boolean.tmpl @@ -0,0 +1,6 @@ +
{keytext}: +{[choices]{text}} +
diff --git a/templates/it/option-pickmany.tmpl b/templates/it/option-pickmany.tmpl new file mode 100644 index 000000000..d2534af75 --- /dev/null +++ b/templates/it/option-pickmany.tmpl @@ -0,0 +1,6 @@ + + + + diff --git a/templates/it/option-pickone.tmpl b/templates/it/option-pickone.tmpl new file mode 100644 index 000000000..08342d06e --- /dev/null +++ b/templates/it/option-pickone.tmpl @@ -0,0 +1,6 @@ + + + + diff --git a/templates/it/option-trailer.tmpl b/templates/it/option-trailer.tmpl new file mode 100644 index 000000000..25af37874 --- /dev/null +++ b/templates/it/option-trailer.tmpl @@ -0,0 +1,5 @@ + + + + +
{keytext}:
{keytext}:
diff --git a/templates/it/pager.tmpl b/templates/it/pager.tmpl new file mode 100644 index 000000000..e3dbd099a --- /dev/null +++ b/templates/it/pager.tmpl @@ -0,0 +1,7 @@ + + + + + + +
{PREVURL?Mostra precedente: }{ORDER=dec?Ordine crescente:Ordine decrescente}{NEXTURL?Mostra successivo: }
diff --git a/templates/it/printer-accept.tmpl b/templates/it/printer-accept.tmpl new file mode 100644 index 000000000..19de4a1d4 --- /dev/null +++ b/templates/it/printer-accept.tmpl @@ -0,0 +1,3 @@ +

{is_class?La classe:La stampante} {printer_name} +adesso accetta operazioni.

diff --git a/templates/it/printer-added.tmpl b/templates/it/printer-added.tmpl new file mode 100644 index 000000000..e45fb7fd6 --- /dev/null +++ b/templates/it/printer-added.tmpl @@ -0,0 +1,2 @@ +

La stampante {printer_name} è stata aggiunta +con successo. diff --git a/templates/it/printer-configured.tmpl b/templates/it/printer-configured.tmpl new file mode 100644 index 000000000..c28b9d09d --- /dev/null +++ b/templates/it/printer-configured.tmpl @@ -0,0 +1,2 @@ +

La stampante {printer_name} è +stata configurata con successo. diff --git a/templates/it/printer-confirm.tmpl b/templates/it/printer-confirm.tmpl new file mode 100644 index 000000000..1f3e891a2 --- /dev/null +++ b/templates/it/printer-confirm.tmpl @@ -0,0 +1,7 @@ +

Attenzione: Sei sicuro di voler eliminare la stampante +{printer_name}?

+ +

Elimina stampante

diff --git a/templates/it/printer-default.tmpl b/templates/it/printer-default.tmpl new file mode 100644 index 000000000..cab22c3b6 --- /dev/null +++ b/templates/it/printer-default.tmpl @@ -0,0 +1,7 @@ +

{is_class?La classe:La stampante} {printer_name} +è stata impostata come predefinita sul server.

+ +
Nota: Qualunque valore inserito dall'utente impostato con +il comando lpoptions sarà scavalcato da questa impostazione +predefinita.
diff --git a/templates/it/printer-deleted.tmpl b/templates/it/printer-deleted.tmpl new file mode 100644 index 000000000..fe498a50c --- /dev/null +++ b/templates/it/printer-deleted.tmpl @@ -0,0 +1 @@ +

La stampante {printer_name} è stata eliminata con successo. diff --git a/templates/it/printer-jobs-header.tmpl b/templates/it/printer-jobs-header.tmpl new file mode 100644 index 000000000..2a0cadc33 --- /dev/null +++ b/templates/it/printer-jobs-header.tmpl @@ -0,0 +1 @@ +

Operazioni

diff --git a/templates/it/printer-modified.tmpl b/templates/it/printer-modified.tmpl new file mode 100644 index 000000000..a36b81d85 --- /dev/null +++ b/templates/it/printer-modified.tmpl @@ -0,0 +1,2 @@ +

La stampante {printer_name} è stata +modificata con successo. diff --git a/templates/it/printer-purge.tmpl b/templates/it/printer-purge.tmpl new file mode 100644 index 000000000..b196be041 --- /dev/null +++ b/templates/it/printer-purge.tmpl @@ -0,0 +1,3 @@ +

{is_class?La classe:La stampante} {printer_name} +è stata svuotata di tutte le operazioni.

diff --git a/templates/it/printer-reject.tmpl b/templates/it/printer-reject.tmpl new file mode 100644 index 000000000..225783f9e --- /dev/null +++ b/templates/it/printer-reject.tmpl @@ -0,0 +1,3 @@ +

{is_class?La classe:La stampante} {printer_name} +non accetta altre operazioni.

diff --git a/templates/it/printer-start.tmpl b/templates/it/printer-start.tmpl new file mode 100644 index 000000000..b5abdc97a --- /dev/null +++ b/templates/it/printer-start.tmpl @@ -0,0 +1,3 @@ +

{is_class?La classe:La stampante} {printer_name} +è stata avviata.

diff --git a/templates/it/printer-stop.tmpl b/templates/it/printer-stop.tmpl new file mode 100644 index 000000000..5af7bffb4 --- /dev/null +++ b/templates/it/printer-stop.tmpl @@ -0,0 +1,3 @@ +

{is_class?La classe:La stampante} {printer_name} +è stata fermata.

diff --git a/templates/it/printers-header.tmpl b/templates/it/printers-header.tmpl new file mode 100644 index 000000000..e10112df7 --- /dev/null +++ b/templates/it/printers-header.tmpl @@ -0,0 +1 @@ +

{total=0?Nessuna stampante:Mostrat{total=1?a:e} {#printer_name} di {total} stampant{total=1?e:i}}.

diff --git a/templates/it/printers.tmpl b/templates/it/printers.tmpl new file mode 100644 index 000000000..106974498 --- /dev/null +++ b/templates/it/printers.tmpl @@ -0,0 +1,64 @@ +{printer_type?:}{#printer_name=0?: +{[printer_name] +

{printer_name}{default_name={printer_name}? (Default Printer):} +{?printer_state_message=?:"{printer_state_message}"}

+ + + + + + +
+ +Descrizione: {printer_info}
+Posizione: {printer_location}
+Marca e modello: {printer_make_and_model}
+Stato della stampante: {printer_state=3?in attesa:{printer_state=4?elaborazione in corso:fermata}}, +{printer_is_accepting_jobs=0?scarta operazioni:accetta operazioni}, {printer_is_shared=0?non:} pubblicata. +{?device_uri=?:
URI del dispositivo: {device_uri}} + +

+ +Stampa pagina di prova +{?cupscommand=1? +Pulizia delle testine + +Stampa pagina di prova predefinita:} +{printer_state=5? + +Avvia stampante +: + +Ferma stampante +} +{printer_is_accepting_jobs=0? + +Accetta operazioni +: + +Scarta operazioni +} + +Sposta tutte le operazioni + +Annulla tutte le operazioni +{printer_is_shared=0? + +Pubblica stampante +: + +Non pubblicare stampante +} + +Modifica stampante + +Imposta opzioni stampante + +Elimina stampante + +Imposta come predefinita + +Imposta utenti autorizzati +

+
+}} diff --git a/templates/it/restart.tmpl b/templates/it/restart.tmpl new file mode 100644 index 000000000..7ba2a5817 --- /dev/null +++ b/templates/it/restart.tmpl @@ -0,0 +1 @@ +

Attendere il riavvio del server...

diff --git a/templates/it/samba-export.tmpl b/templates/it/samba-export.tmpl new file mode 100644 index 000000000..9339e8db9 --- /dev/null +++ b/templates/it/samba-export.tmpl @@ -0,0 +1,54 @@ + + +
+ + +

Esporta stampanti su Samba

+ +{error?

Impossibile esportare stampanti su Samba\:

+
{error}
+

Consulta il file error_log per ulteriori informazioni.

: +

Questa pagina ti consente di esportare stampanti su Samba in modo tale +che i client Windows possano accedere ad esse dall'icona Risorse di +rete sui rispettivi desktop. Occorre installare previamente il driver +di stampa Windows PostScript come descritto nella pagina di manuale cupsaddsmb(8).

} + + + + + + + + + + + + + + + + + + +
Stampanti: +
+ Esporta tutte le stampanti +
Nome utente Samba: (richiesto)
Password Samba: (richiesto)
+ +
diff --git a/templates/it/samba-exported.tmpl b/templates/it/samba-exported.tmpl new file mode 100644 index 000000000..78ee85e39 --- /dev/null +++ b/templates/it/samba-exported.tmpl @@ -0,0 +1 @@ +

Stampanti esportate su Samba con successo.

diff --git a/templates/it/search.tmpl b/templates/it/search.tmpl new file mode 100644 index 000000000..d69e9345d --- /dev/null +++ b/templates/it/search.tmpl @@ -0,0 +1,13 @@ +
+{WHICH_JOBS?:} +{ORDER?:} + +

Cerca in +{SEARCH_DEST?{SEARCH_DEST}:{SECTION=classes?Classi:{SECTION=jobs?Operazioni:Stampanti}}}: + +Pulisci

+ +
diff --git a/templates/it/set-printer-options-header.tmpl b/templates/it/set-printer-options-header.tmpl new file mode 100644 index 000000000..864f9f0ce --- /dev/null +++ b/templates/it/set-printer-options-header.tmpl @@ -0,0 +1,3 @@ +
+ + diff --git a/templates/it/set-printer-options-trailer.tmpl b/templates/it/set-printer-options-trailer.tmpl new file mode 100644 index 000000000..a3d1e1ffa --- /dev/null +++ b/templates/it/set-printer-options-trailer.tmpl @@ -0,0 +1 @@ +
diff --git a/templates/it/test-page.tmpl b/templates/it/test-page.tmpl new file mode 100644 index 000000000..a2718c8d2 --- /dev/null +++ b/templates/it/test-page.tmpl @@ -0,0 +1,2 @@ +

Pagina di prova inviata; l'ID dell'operazione è +{printer_name}-{job_id}.

diff --git a/templates/it/trailer.tmpl b/templates/it/trailer.tmpl new file mode 100644 index 000000000..b598b6fd2 --- /dev/null +++ b/templates/it/trailer.tmpl @@ -0,0 +1,21 @@ + +  + + + + + +

Common UNIX Printing System, CUPS, e il logo CUPS sono marchi +registrati da Easy Software +Products. CUPS è un copyright 1997-2006 di Easy Software Products, +Tutti i diritti sono riservati.

+ + + + + + + + diff --git a/templates/it/users.tmpl b/templates/it/users.tmpl new file mode 100644 index 000000000..3d5222f00 --- /dev/null +++ b/templates/it/users.tmpl @@ -0,0 +1,26 @@ +
+ + +{IS_CLASS?:} + +

Utenti autorizzati per {printer_name}

+ + + + + + + + + + +
Utenti: + +
+Consenti a questi utenti a stampare +Impedisci a questi utenti di stampare +
+ +
+ +
diff --git a/test/run-stp-tests.sh b/test/run-stp-tests.sh index fe169ecda..ae38459e9 100755 --- a/test/run-stp-tests.sh +++ b/test/run-stp-tests.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# "$Id: run-stp-tests.sh 5493 2006-05-05 16:33:57Z mike $" +# "$Id: run-stp-tests.sh 6113 2006-11-15 20:37:45Z mike $" # # Perform the complete set of IPP compliance tests specified in the # CUPS Software Test Plan. @@ -120,8 +120,8 @@ echo "certificate for testing; these tests currently require the OpenSSL" echo "tools:" echo "" echo "0 - Do not do SSL/TLS encryption tests" -echo "1 - Create a SSL/TLS certificate and key, but do not require encryption" -echo "2 - Create a SSL/TLS certificate and key and require encryption" +echo "1 - Test but do not require encryption" +echo "2 - Test and require encryption" echo "" echo $ac_n "Enter the number of the SSL/TLS tests to perform: [0] $ac_c" @@ -134,25 +134,14 @@ fi echo "" case "$ssltype" in - 1 | 2) - if test -f server.key; then - echo "Using existing SSL/TLS certificate and key..." - else - echo "Generating SSL/TLS certificate and key..." - openssl req -new -x509 -keyout server.key -out server.crt -days 3650 -nodes >/dev/null <