Comparar commits
1 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| 060f751517 |
@@ -1,27 +1,6 @@
|
||||
CHANGES.txt - 2006-11-16
|
||||
CHANGES.txt - 2006-11-02
|
||||
------------------------
|
||||
|
||||
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
|
||||
|
||||
@@ -29,9 +29,8 @@ 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.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
INSTALL - CUPS v1.2.7 - 2006-11-16
|
||||
INSTALL - CUPS v1.2.6 - 2006-11-06
|
||||
----------------------------------
|
||||
|
||||
This file describes how to compile and install CUPS from source
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
README - CUPS v1.2.7 - 2006-11-16
|
||||
README - CUPS v1.2.6 - 2006-11-06
|
||||
---------------------------------
|
||||
|
||||
Looking for compile instructions? Read the file "INSTALL.txt"
|
||||
|
||||
@@ -42,35 +42,31 @@
|
||||
* 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 file.
|
||||
* printFile() - Print from a file descriptor to an NBP specified printer.
|
||||
* papOpen() - Open a pap session to a printer.
|
||||
* papClose() - Close a pap session.
|
||||
* papClose() - Close a pap session after cleaning up pending transactions.
|
||||
* papWrite() - Write bytes to a printer.
|
||||
* papCloseResp() - Send a pap close response.
|
||||
* papCloseResp() - Send a pap close response in the rare case we receive a close connection request.
|
||||
* 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 - Remove percent escape sequences from a string.
|
||||
* removePercentEscapes - Returns a string with any percent escape sequences replaced with their equivalent.
|
||||
* 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 <config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
@@ -90,8 +86,7 @@
|
||||
#include <netat/nbp.h>
|
||||
#include <netat/pap.h>
|
||||
|
||||
#include <cups/cups.h>
|
||||
#include <cups/backend.h>
|
||||
#include <cups/http.h>
|
||||
|
||||
#include <libkern/OSByteOrder.h>
|
||||
|
||||
@@ -100,25 +95,19 @@
|
||||
#else
|
||||
/* These definitions come from at_proto.h... */
|
||||
# define ZIP_DEF_INTERFACE NULL
|
||||
enum { RUNNING, NOTLOADED, LOADED, OTHERERROR };
|
||||
enum { RUNNING, NOTLOADED, LOADED, OTHERERROR }; /* Appletalk Stack status Function. */
|
||||
|
||||
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 */
|
||||
|
||||
@@ -127,7 +116,7 @@ extern int zip_getmyzone(char *ifName, at_nvestr_t *zone);
|
||||
#include <CoreFoundation/CFPreferences.h>
|
||||
|
||||
/* Defines */
|
||||
#define MAX_PRINTERS 500 /* Max number of printers we can lookup */
|
||||
#define MAX_PRINTERS 500 /* Max number of printers we can lookup in listDevices */
|
||||
#define PAP_CONNID 0
|
||||
#define PAP_TYPE 1
|
||||
#define PAP_EOF 2
|
||||
@@ -137,35 +126,43 @@ 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" : \
|
||||
"<Unknown>"
|
||||
|
||||
#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 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 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 */
|
||||
int gDebug = 0; /* Option: causes us to 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 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 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);
|
||||
@@ -173,7 +170,6 @@ 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);
|
||||
|
||||
@@ -203,13 +199,10 @@ int main (int argc, const char * argv[])
|
||||
|
||||
if (argc == 1 || (argc == 2 && strcmp(argv[1], "-discover") == 0))
|
||||
{
|
||||
/* If listDevices() didn't find any devices or returns an error output a
|
||||
* legacy style announcement.
|
||||
*
|
||||
/* Ignore errors returned by listDevices - they may be transitory
|
||||
* and we don't want cupsd to think that pap is forever unusable.
|
||||
*/
|
||||
if (listDevices() <= 0)
|
||||
puts("network pap \"Unknown\" \"AppleTalk Printer Access Protocol (pap)\"");
|
||||
|
||||
listDevices();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -246,9 +239,9 @@ int main (int argc, const char * argv[])
|
||||
}
|
||||
|
||||
/* Extract the device name and options from the URI... */
|
||||
parseUri(cupsBackendDeviceURI((char **)argv), name, type, zone);
|
||||
parseUri(argv[0], name, type, zone);
|
||||
|
||||
err = printFile(name, type, zone, fileno(fp), STDOUT_FILENO, STDERR_FILENO, copies, argc);
|
||||
err = printFile(name, type, zone, fileno(fp), 3, STDERR_FILENO, copies, argc);
|
||||
|
||||
if (fp != stdin)
|
||||
fclose(fp);
|
||||
@@ -270,7 +263,7 @@ int main (int argc, const char * argv[])
|
||||
static int listDevices(void)
|
||||
{
|
||||
int err = noErr;
|
||||
int i;
|
||||
int ind;
|
||||
int numberFound;
|
||||
|
||||
at_nvestr_t at_zone;
|
||||
@@ -294,13 +287,10 @@ 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';
|
||||
|
||||
fprintf(stderr, "INFO: Using default AppleTalk zone \"%s\"\n", zone);
|
||||
|
||||
addPercentEscapes(zone, encodedZone, sizeof(encodedZone));
|
||||
err = addPercentEscapes(zone, encodedZone, sizeof(encodedZone));
|
||||
|
||||
/* Look up all the printers in our zone */
|
||||
nbp_make_entity(&entity, "=", "LaserWriter", zone);
|
||||
@@ -320,10 +310,10 @@ static int listDevices(void)
|
||||
/* Not required but sort them so they look nice */
|
||||
qsort(buf, numberFound, sizeof(at_nbptuple_t), nbptuple_compare);
|
||||
|
||||
for (i = 0; i < numberFound; i++)
|
||||
for (ind = 0; ind < numberFound; ind++)
|
||||
{
|
||||
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';
|
||||
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';
|
||||
|
||||
if (addPercentEscapes(name, encodedName, sizeof(encodedName)) == 0)
|
||||
{
|
||||
@@ -381,7 +371,7 @@ static int printFile(char* name, char* type, char* zone, int fdin, int fdout, in
|
||||
int err;
|
||||
int rc;
|
||||
int val;
|
||||
int len, i;
|
||||
int len, ind;
|
||||
|
||||
char fileBuffer[4096]; /* File buffer */
|
||||
int fileBufferNbytes;
|
||||
@@ -400,19 +390,20 @@ 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,
|
||||
nbp_failures = 0;
|
||||
int maxfdp1;
|
||||
struct timeval timeout, *timeoutPtr;
|
||||
u_char flowQuantum = 1;
|
||||
u_short recvSequence = 0;
|
||||
time_t now,
|
||||
start_time,
|
||||
connect_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 */
|
||||
@@ -429,60 +420,51 @@ static int printFile(char* name, char* type, char* zone, int fdin, int fdout, in
|
||||
* Remember when we started looking for the printer.
|
||||
*/
|
||||
|
||||
start_time = time(NULL);
|
||||
connect_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;
|
||||
if (recoverableErrShown)
|
||||
{
|
||||
fprintf(stderr, "INFO: recovered: \n");
|
||||
sleep(5);
|
||||
recoverableErrShown = false;
|
||||
}
|
||||
|
||||
/* 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(err));
|
||||
fprintf(stderr, "WARNING: Unable to open \"%s:%s\": %s\n", name, zone, strerror(errno));
|
||||
}
|
||||
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");
|
||||
fprintf(stderr, "WARNING: Printer not responding\n");
|
||||
}
|
||||
fprintf(stderr, "WARNING: recoverable: Printer not responding\n");
|
||||
recoverableErrShown = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "STATE: +apple-appletalk-disabled-warning\n");
|
||||
fprintf(stderr, "INFO: AppleTalk disabled in System Preferences.\n");
|
||||
fprintf(stderr, "WARNING: recoverable: AppleTalk disabled in System Preferences.\n");
|
||||
recoverableErrShown = true;
|
||||
}
|
||||
|
||||
elasped_time = time(NULL) - start_time;
|
||||
retry.retries = 3;
|
||||
elasped_time = time(NULL) - connect_time;
|
||||
|
||||
if (connect_timeout == -1)
|
||||
connect_timeout = connectTimeout();
|
||||
@@ -493,9 +475,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 * 60))
|
||||
else if (elasped_time < 30 /*(30 * 60)*/)
|
||||
sleep_time = 10; /* Waiting < 30 minutes */
|
||||
else if (elasped_time < (24 * 60 * 60))
|
||||
else if (elasped_time < 60 /*(24 * 60 * 60)*/)
|
||||
sleep_time = 30; /* Waiting < 24 hours */
|
||||
else
|
||||
sleep_time = 60; /* Waiting > 24 hours */
|
||||
@@ -504,8 +486,6 @@ 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
|
||||
@@ -556,6 +536,21 @@ 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;
|
||||
@@ -671,7 +666,7 @@ static int printFile(char* name, char* type, char* zone, int fdin, int fdout, in
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG: <- %s\n", packet_name(TYPE_OF(userdata)));
|
||||
fprintf(stderr, "DEBUG: <- %s\n", PAPPacketStr(TYPE_OF(userdata)));
|
||||
|
||||
switch (TYPE_OF(userdata))
|
||||
{
|
||||
@@ -712,10 +707,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, i=0; i < ATP_TRESP_MAX; i++)
|
||||
for (len=0, ind=0; ind < ATP_TRESP_MAX; ind++)
|
||||
{
|
||||
if (resp.bitmap & (1 << i))
|
||||
len += resp.resp[i].iov_len;
|
||||
if (resp.bitmap & (1 << ind))
|
||||
len += resp.resp[ind].iov_len;
|
||||
}
|
||||
|
||||
fprintf(stderr, "DEBUG: <- PAP_DATA %d bytes %s\n", len, IS_PAP_EOF(userdata) ? "with EOF" : "");
|
||||
@@ -727,7 +722,7 @@ static int printFile(char* name, char* type, char* zone, int fdin, int fdout, in
|
||||
char logstr[512];
|
||||
int logstrlen;
|
||||
|
||||
cupsBackChannelWrite(sockBuffer, len, 1.0);
|
||||
write(fdout, sockBuffer, len);
|
||||
|
||||
sockBuffer[len] = '\0'; /* We always reserve room for the nul so we can use strstr() below*/
|
||||
pLineBegin = sockBuffer;
|
||||
@@ -840,7 +835,7 @@ Exit:
|
||||
/*
|
||||
* Close the socket and return...
|
||||
*/
|
||||
papClose();
|
||||
papClose(false);
|
||||
|
||||
return err;
|
||||
}
|
||||
@@ -859,35 +854,37 @@ 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,
|
||||
open_result,
|
||||
userdata,
|
||||
atp_err;
|
||||
time_t tm,
|
||||
waitTime;
|
||||
char data[10],
|
||||
rdata[ATP_DATA_SIZE];
|
||||
u_char *puserdata;
|
||||
at_socket socketfd;
|
||||
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;
|
||||
at_resp_t resp;
|
||||
at_retry_t retry;
|
||||
|
||||
result = 0;
|
||||
socketfd = 0;
|
||||
puserdata = (u_char *)&userdata;
|
||||
if (tuple == NULL)
|
||||
{
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
fprintf(stderr, "INFO: Opening connection\n");
|
||||
|
||||
if ((*fd = atp_open(&socketfd)) < 0)
|
||||
errno = 0;
|
||||
result = 0;
|
||||
|
||||
*fd = atp_open(&sock);
|
||||
if (*fd < 0)
|
||||
return -1;
|
||||
|
||||
/*
|
||||
* Build the open connection request packet.
|
||||
/* Build the open connection request packet.
|
||||
*/
|
||||
|
||||
tm = time(NULL);
|
||||
srand(tm);
|
||||
|
||||
@@ -904,67 +901,64 @@ static int papOpen(at_nbptuple_t* tuple, u_char* connID, int* fd,
|
||||
resp.resp[0].iov_base = rdata;
|
||||
resp.resp[0].iov_len = sizeof(rdata);
|
||||
|
||||
data[0] = socketfd;
|
||||
data[0] = sock;
|
||||
data[1] = 8;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
waitTime = time(NULL) - tm;
|
||||
OSWriteBigInt16(&data[2], 0, (u_short)waitTime);
|
||||
waitTime = (u_short)(time(NULL) - tm);
|
||||
OSWriteBigInt16(&data[2], 0, waitTime);
|
||||
|
||||
fprintf(stderr, "DEBUG: -> %s\n", packet_name(AT_PAP_TYPE_OPEN_CONN));
|
||||
fprintf(stderr, "DEBUG: -> %s\n", PAPPacketStr(AT_PAP_TYPE_OPEN_CONN));
|
||||
|
||||
if ((atp_err = atp_sendreq(*fd, &tuple->enu_addr, data, 4, userdata, 1, 0,
|
||||
0, &resp, &retry, 0)) < 0)
|
||||
status = atp_sendreq(*fd, &tuple->enu_addr, data, 4, userdata, 1, 0, 0, &resp, &retry, 0);
|
||||
|
||||
if (status < 0)
|
||||
{
|
||||
statusUpdate("Destination unreachable", 23);
|
||||
result = EHOSTUNREACH;
|
||||
break;
|
||||
errno = EHOSTUNREACH;
|
||||
sleep(1);
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
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))
|
||||
else
|
||||
{
|
||||
result = EINVAL;
|
||||
break;
|
||||
puserdata = (u_char *)&resp.userdata[0];
|
||||
openResult = OSReadBigInt16(&rdata[2], 0);
|
||||
|
||||
fprintf(stderr, "DEBUG: <- %s, status %d\n", PAPPacketStr(puserdata[1]), openResult);
|
||||
|
||||
/* 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);
|
||||
|
||||
if (openResult == 0)
|
||||
break; /* Connection established okay, exit from the loop */
|
||||
}
|
||||
|
||||
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
|
||||
/* 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)
|
||||
{
|
||||
atp_close(*fd);
|
||||
*fd = 0;
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -976,9 +970,12 @@ static int papOpen(at_nbptuple_t* tuple, u_char* connID, int* fd,
|
||||
* @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()
|
||||
static int papClose(int abortflag)
|
||||
{
|
||||
int fd;
|
||||
u_short tmpID;
|
||||
@@ -1021,7 +1018,7 @@ static int papClose()
|
||||
if (gWaitEOF == false)
|
||||
sleep(2);
|
||||
|
||||
fprintf(stderr, "DEBUG: -> %s\n", packet_name(AT_PAP_TYPE_CLOSE_CONN));
|
||||
fprintf(stderr, "DEBUG: -> %s\n", PAPPacketStr(AT_PAP_TYPE_CLOSE_CONN));
|
||||
|
||||
puserdata[0] = gConnID;
|
||||
puserdata[1] = AT_PAP_TYPE_CLOSE_CONN;
|
||||
@@ -1061,7 +1058,7 @@ 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)
|
||||
{
|
||||
int result;
|
||||
int i;
|
||||
int ind;
|
||||
u_char* puserdata;
|
||||
at_resp_t resp;
|
||||
|
||||
@@ -1079,26 +1076,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 (i = 0; i < flowQuantum; i++)
|
||||
for (ind = 0; ind < flowQuantum; ind++)
|
||||
{
|
||||
resp.userdata[i] = 0;
|
||||
puserdata = (u_char *)&resp.userdata[i];
|
||||
resp.userdata[ind] = 0;
|
||||
puserdata = (u_char *)&resp.userdata[ind];
|
||||
|
||||
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;
|
||||
resp.resp[ind].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;
|
||||
resp.resp[ind].iov_len = MIN((int)len, (int)AT_PAP_DATA_SIZE);
|
||||
len -= resp.resp[ind].iov_len;
|
||||
if (len == 0)
|
||||
break;
|
||||
}
|
||||
resp.bitmap = (1 << (i + 1)) - 1;
|
||||
resp.bitmap = (1 << (ind + 1)) - 1;
|
||||
|
||||
/*
|
||||
* Write out the data as a PAP 'DATA' response
|
||||
@@ -1171,7 +1168,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", packet_name(function));
|
||||
fprintf(stderr, "DEBUG: -> %s\n", PAPPacketStr(function));
|
||||
|
||||
puserdata[0] = connID;
|
||||
puserdata[1] = function;
|
||||
@@ -1277,7 +1274,7 @@ void statusUpdate(char* status, u_char statusLen)
|
||||
*/
|
||||
static int parseUri(const char* argv0, char* name, char* type, char* zone)
|
||||
{
|
||||
char method[255], /* Method in URI */
|
||||
char scheme[255], /* Scheme in URI */
|
||||
hostname[1024], /* Hostname */
|
||||
username[255], /* Username info (not used) */
|
||||
resource[1024], /* Resource info (device and options) */
|
||||
@@ -1293,10 +1290,8 @@ 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, method, sizeof(method),
|
||||
httpSeparateURI(HTTP_URI_CODING_NONE, argv0, scheme, sizeof(scheme),
|
||||
username, sizeof(username),
|
||||
hostname, sizeof(hostname), &port,
|
||||
resource, sizeof(resource));
|
||||
@@ -1532,31 +1527,6 @@ 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 "<Unknown>";
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* @function connectTimeout
|
||||
* @abstract Returns the connect timeout preference value.
|
||||
@@ -1592,7 +1562,7 @@ static void signalHandler(int sigraised)
|
||||
{
|
||||
fprintf(stderr, "ERROR: There was a timeout error while sending data to the printer\n");
|
||||
|
||||
papClose();
|
||||
papClose(true);
|
||||
|
||||
_exit(1);
|
||||
}
|
||||
|
||||
@@ -1126,7 +1126,7 @@ asn1_set_packed(unsigned char **buffer, /* IO - Pointer in buffer */
|
||||
{
|
||||
if (integer > 0xfffffff)
|
||||
{
|
||||
**buffer = (integer >> 28) & 0x7f;
|
||||
**buffer = (integer >> 14) & 0x7f;
|
||||
(*buffer) ++;
|
||||
}
|
||||
|
||||
@@ -1752,7 +1752,7 @@ probe_device(snmp_cache_t *device) /* I - Device */
|
||||
alarm(0);
|
||||
}
|
||||
|
||||
if (http)
|
||||
if (http);
|
||||
{
|
||||
/*
|
||||
* IPP is supported...
|
||||
|
||||
@@ -198,13 +198,12 @@ 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, CFStringRef *driverBundlePath);
|
||||
static kern_return_t registry_open(printer_data_t *printer, CFStringRef *driverBundlePath);
|
||||
static kern_return_t load_printerdriver(printer_data_t *printer);
|
||||
static kern_return_t registry_open(printer_data_t *printer);
|
||||
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);
|
||||
@@ -256,7 +255,6 @@ 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);
|
||||
@@ -265,10 +263,9 @@ print_device(const char *uri, /* I - Device URI */
|
||||
resource++;
|
||||
|
||||
printer_data.uri = uri;
|
||||
|
||||
printer_data.make = cfstr_create_and_trim(hostname);
|
||||
printer_data.model = cfstr_create_and_trim(resource);
|
||||
printer_data.serial = cfstr_create_and_trim(serial);
|
||||
printer_data.make = CFStringCreateWithCString(NULL, hostname, kCFStringEncodingUTF8);
|
||||
printer_data.model = CFStringCreateWithCString(NULL, resource, kCFStringEncodingUTF8);
|
||||
printer_data.serial = CFStringCreateWithCString(NULL, serial, kCFStringEncodingUTF8);
|
||||
|
||||
fputs("STATE: +connecting-to-device\n", stderr);
|
||||
|
||||
@@ -284,9 +281,7 @@ print_device(const char *uri, /* I - Device URI */
|
||||
iterate_printers(find_device_callback, &printer_data);
|
||||
|
||||
fprintf(stderr, "INFO: Opening Connection\n");
|
||||
|
||||
driverBundlePath = NULL;
|
||||
status = registry_open(&printer_data, &driverBundlePath);
|
||||
status = registry_open(&printer_data);
|
||||
#if defined(__i386__)
|
||||
/*
|
||||
* If we were unable to load the class drivers for this printer it's probably because they're ppc-only.
|
||||
@@ -297,26 +292,6 @@ 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 );
|
||||
@@ -533,7 +508,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(serial, userData->serial, kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
|
||||
if (serial != NULL && CFStringCompare(model, userData->model, kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
|
||||
IOObjectRetain(obj);
|
||||
userData->printerObj = obj;
|
||||
keepLooking = false;
|
||||
@@ -753,11 +728,9 @@ 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, CFStringRef *driverBundlePath)
|
||||
static kern_return_t load_printerdriver(printer_data_t *printer)
|
||||
{
|
||||
IOCFPlugInInterface **iodev = NULL;
|
||||
SInt32 score;
|
||||
@@ -771,10 +744,11 @@ static kern_return_t load_printerdriver(printer_data_t *printer, CFStringRef *dr
|
||||
|
||||
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)
|
||||
@@ -790,9 +764,9 @@ static kern_return_t load_printerdriver(printer_data_t *printer, CFStringRef *dr
|
||||
* 'registry_open()' - Open a connection to the printer.
|
||||
*/
|
||||
|
||||
static kern_return_t registry_open(printer_data_t *printer, CFStringRef *driverBundlePath)
|
||||
static kern_return_t registry_open(printer_data_t *printer)
|
||||
{
|
||||
kern_return_t kr = load_printerdriver(printer, driverBundlePath);
|
||||
kern_return_t kr = load_printerdriver(printer);
|
||||
if (kr != kIOReturnSuccess) {
|
||||
kr = -2;
|
||||
}
|
||||
@@ -1001,27 +975,6 @@ 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.
|
||||
@@ -1391,6 +1344,7 @@ static void *read_thread(void *reference)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
|
||||
@@ -84,7 +84,8 @@ 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") && !strstr(hostname, "Minolta");
|
||||
use_bc = strcasecmp(hostname, "Canon") != 0 ||
|
||||
strstr(hostname, "Minolta") != NULL;
|
||||
|
||||
if ((device_fd = open_device(uri, &use_bc)) == -1)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-common.m4 6092 2006-11-14 16:36:36Z mike $"
|
||||
dnl "$Id: cups-common.m4 6052 2006-10-20 20:35:41Z mike $"
|
||||
dnl
|
||||
dnl Common configuration stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
@@ -28,9 +28,12 @@ AC_PREREQ(2.50)
|
||||
dnl Set the name of the config header file...
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
|
||||
dnl Version number information...
|
||||
CUPS_VERSION="1.2.7"
|
||||
dnl Versio number information...
|
||||
CUPS_VERSION="1.2.6"
|
||||
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)
|
||||
@@ -264,5 +267,5 @@ AC_SUBST(DEFAULT_IPP_PORT)
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-common.m4 6092 2006-11-14 16:36:36Z mike $".
|
||||
dnl End of "$Id: cups-common.m4 6052 2006-10-20 20:35:41Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-defaults.m4 6118 2006-11-16 13:34:44Z mike $"
|
||||
dnl "$Id: cups-defaults.m4 6003 2006-10-02 16:26:04Z 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 it ja pl sv")
|
||||
LANGUAGES="de es et 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 6118 2006-11-16 13:34:44Z mike $".
|
||||
dnl End of "$Id: cups-defaults.m4 6003 2006-10-02 16:26:04Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -61,10 +61,10 @@ extern "C" {
|
||||
* Constants...
|
||||
*/
|
||||
|
||||
# define CUPS_VERSION 1.0207
|
||||
# define CUPS_VERSION 1.0206
|
||||
# define CUPS_VERSION_MAJOR 1
|
||||
# define CUPS_VERSION_MINOR 2
|
||||
# define CUPS_VERSION_PATCH 7
|
||||
# define CUPS_VERSION_PATCH 6
|
||||
# define CUPS_DATE_ANY -1
|
||||
|
||||
|
||||
|
||||
@@ -70,8 +70,7 @@ typedef int socklen_t;
|
||||
# if defined HAVE_LIBSSL
|
||||
/*
|
||||
* The OpenSSL library provides its own SSL/TLS context structure for its
|
||||
* IO and protocol management. However, we need to provide our own BIO
|
||||
* (basic IO) implementation to do timeouts...
|
||||
* IO and protocol management...
|
||||
*/
|
||||
|
||||
# include <openssl/err.h>
|
||||
@@ -80,8 +79,6 @@ 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...
|
||||
@@ -94,11 +91,6 @@ 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
|
||||
@@ -113,6 +105,15 @@ 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,
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
*
|
||||
* 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.
|
||||
@@ -61,8 +60,7 @@
|
||||
* 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.
|
||||
* _httpReadCDSA() - Read function for CDSA decryption code.
|
||||
* httpReconnect() - Reconnect to a HTTP server...
|
||||
* httpSetCookie() - Set the cookie value(s)...
|
||||
* httpSetExpect() - Set the Expect: header in a request.
|
||||
@@ -73,14 +71,7 @@
|
||||
* 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.
|
||||
* _httpWriteCDSA() - Write function for CDSA encryption code.
|
||||
* 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
|
||||
@@ -127,7 +118,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, int usessl);
|
||||
static int http_wait(http_t *http, int msec);
|
||||
static int http_write(http_t *http, const char *buffer,
|
||||
int length);
|
||||
static int http_write_chunk(http_t *http, const char *buffer,
|
||||
@@ -177,45 +168,6 @@ 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.
|
||||
*/
|
||||
@@ -917,7 +869,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, 1))
|
||||
if (!http->blocking && !http_wait(http, 10000))
|
||||
{
|
||||
DEBUG_puts("httpGets: Timed out!");
|
||||
http->error = ETIMEDOUT;
|
||||
@@ -1439,7 +1391,7 @@ httpRead2(http_t *http, /* I - HTTP connection */
|
||||
|
||||
#if defined(HAVE_SSL) && defined(HAVE_CDSASSL)
|
||||
/*
|
||||
* '_httpReadCDSA()' - Read function for the CDSA library.
|
||||
* '_httpReadCDSA()' - Read function for CDSA decryption code.
|
||||
*/
|
||||
|
||||
OSStatus /* O - -1 on error, 0 on success */
|
||||
@@ -1448,36 +1400,19 @@ _httpReadCDSA(
|
||||
void *data, /* I - Data buffer */
|
||||
size_t *dataLength) /* IO - Number of bytes */
|
||||
{
|
||||
OSStatus result; /* Return value */
|
||||
ssize_t bytes; /* Number of bytes read */
|
||||
http_t *http; /* HTTP connection */
|
||||
OSStatus result; /* Return value */
|
||||
ssize_t bytes; /* Number of bytes read */
|
||||
cdsa_conn_ref_t u; /* Connection reference union */
|
||||
|
||||
|
||||
http = (http_t *)connection;
|
||||
|
||||
if (!http->blocking)
|
||||
{
|
||||
/*
|
||||
* Make sure we have data before we read...
|
||||
*/
|
||||
|
||||
if (!http_wait(http, 10000, 0))
|
||||
{
|
||||
http->error = ETIMEDOUT;
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
u.connection = connection;
|
||||
|
||||
do
|
||||
{
|
||||
bytes = recv(http->fd, data, *dataLength, 0);
|
||||
}
|
||||
bytes = recv(u.sock, data, *dataLength, 0);
|
||||
while (bytes == -1 && errno == EINTR);
|
||||
|
||||
if (bytes == *dataLength)
|
||||
{
|
||||
result = 0;
|
||||
}
|
||||
else if (bytes > 0)
|
||||
{
|
||||
*dataLength = bytes;
|
||||
@@ -1495,45 +1430,11 @@ _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.
|
||||
*/
|
||||
@@ -1929,7 +1830,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, 1));
|
||||
return (http_wait(http, msec));
|
||||
}
|
||||
|
||||
|
||||
@@ -2076,7 +1977,7 @@ httpWrite2(http_t *http, /* I - HTTP connection */
|
||||
|
||||
#if defined(HAVE_SSL) && defined(HAVE_CDSASSL)
|
||||
/*
|
||||
* '_httpWriteCDSA()' - Write function for the CDSA library.
|
||||
* '_httpWriteCDSA()' - Write function for CDSA encryption code.
|
||||
*/
|
||||
|
||||
OSStatus /* O - -1 on error, 0 on success */
|
||||
@@ -2085,23 +1986,19 @@ _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 */
|
||||
http_t *http; /* HTTP connection */
|
||||
OSStatus result; /* Return value */
|
||||
ssize_t bytes; /* Number of bytes read */
|
||||
cdsa_conn_ref_t u; /* Connection reference union */
|
||||
|
||||
|
||||
http = (http_t *)connection;
|
||||
u.connection = connection;
|
||||
|
||||
do
|
||||
{
|
||||
bytes = write(http->fd, data, *dataLength);
|
||||
}
|
||||
bytes = write(u.sock, data, *dataLength);
|
||||
while (bytes == -1 && errno == EINTR);
|
||||
|
||||
if (bytes == *dataLength)
|
||||
{
|
||||
result = 0;
|
||||
}
|
||||
else if (bytes >= 0)
|
||||
{
|
||||
*dataLength = bytes;
|
||||
@@ -2117,164 +2014,11 @@ _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.
|
||||
*/
|
||||
@@ -2503,7 +2247,6 @@ 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;
|
||||
@@ -2511,6 +2254,7 @@ 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 */
|
||||
|
||||
|
||||
@@ -2521,12 +2265,9 @@ 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
|
||||
@@ -2575,9 +2316,8 @@ 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)http);
|
||||
gnutls_transport_set_pull_function(conn->session, _httpReadGNUTLS);
|
||||
gnutls_transport_set_push_function(conn->session, _httpWriteGNUTLS);
|
||||
gnutls_transport_set_ptr(conn->session,
|
||||
(gnutls_transport_ptr)((long)http->fd));
|
||||
|
||||
if ((gnutls_handshake(conn->session)) != GNUTLS_E_SUCCESS)
|
||||
{
|
||||
@@ -2608,7 +2348,9 @@ http_setup_ssl(http_t *http) /* I - HTTP connection */
|
||||
* Use a union to resolve warnings about int/pointer size mismatches...
|
||||
*/
|
||||
|
||||
error = SSLSetConnection(conn->session, http);
|
||||
u.connection = NULL;
|
||||
u.sock = http->fd;
|
||||
error = SSLSetConnection(conn->session, u.connection);
|
||||
|
||||
if (!error)
|
||||
error = SSLSetIOFuncs(conn->session, _httpReadCDSA, _httpWriteCDSA);
|
||||
@@ -2802,8 +2544,7 @@ 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 usessl) /* I - Use SSL context? */
|
||||
int msec) /* I - Milliseconds to wait */
|
||||
{
|
||||
#ifndef WIN32
|
||||
struct rlimit limit; /* Runtime limit */
|
||||
@@ -2823,7 +2564,7 @@ http_wait(http_t *http, /* I - HTTP connection */
|
||||
*/
|
||||
|
||||
#ifdef HAVE_SSL
|
||||
if (http->tls && usessl)
|
||||
if (http->tls)
|
||||
{
|
||||
# ifdef HAVE_LIBSSL
|
||||
if (SSL_pending((SSL *)(http->tls)))
|
||||
|
||||
@@ -28,7 +28,6 @@ _cups_freeifaddrs
|
||||
_cups_strcpy
|
||||
_cups_strlcat
|
||||
_cups_strlcpy
|
||||
_httpBIOMethods
|
||||
_ippAddAttr
|
||||
_ippFreeAttr
|
||||
_ppdGetEncoding
|
||||
|
||||
@@ -295,38 +295,6 @@ 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...
|
||||
*/
|
||||
@@ -395,45 +363,6 @@ 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...
|
||||
*/
|
||||
|
||||
@@ -23,5 +23,3 @@ 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
|
||||
@@ -8,7 +8,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<!--
|
||||
"$Id: spec-ppd.html 6096 2006-11-14 17:06:28Z mike $"
|
||||
"$Id: spec-ppd.html 6025 2006-10-11 14:59:20Z mike $"
|
||||
|
||||
CUPS PPD extensions specification for the Common UNIX Printing System (CUPS).
|
||||
|
||||
@@ -95,14 +95,11 @@ for this printer driver.</p>
|
||||
<p>This boolean attribute notifies the RIP filters that the
|
||||
destination printer does not require the top and bottom margins
|
||||
of the <tt>ImageableArea</tt> swapped for the back page. The
|
||||
default is <tt>true</tt> when <tt>cupsFlipDuplex</tt> is <tt>true</tt> and <tt>false</tt> otherwise.</p>
|
||||
default value is <code>true</code>.</p>
|
||||
|
||||
<p>Example:</p>
|
||||
|
||||
<pre class='command'>
|
||||
<em>*% Flip the back side images</em>
|
||||
*cupsFlipDuplex: true
|
||||
|
||||
<em>*% Don't swap the top and bottom margins for the back side</em>
|
||||
*APDuplexRequiresFlippedMargin: false
|
||||
</pre>
|
||||
|
||||
|
Antes Largura: | Altura: | Tamanho: 667 B |
|
Antes Largura: | Altura: | Tamanho: 626 B |
|
Antes Largura: | Altura: | Tamanho: 699 B |
|
Antes Largura: | Altura: | Tamanho: 854 B |
|
Antes Largura: | Altura: | Tamanho: 682 B |
|
Antes Largura: | Altura: | Tamanho: 588 B |
|
Antes Largura: | Altura: | Tamanho: 658 B |
|
Antes Largura: | Altura: | Tamanho: 496 B |
|
Antes Largura: | Altura: | Tamanho: 346 B |
|
Antes Largura: | Altura: | Tamanho: 406 B |
|
Antes Largura: | Altura: | Tamanho: 520 B |
|
Antes Largura: | Altura: | Tamanho: 547 B |
|
Antes Largura: | Altura: | Tamanho: 778 B |
|
Antes Largura: | Altura: | Tamanho: 766 B |
|
Antes Largura: | Altura: | Tamanho: 354 B |
|
Antes Largura: | Altura: | Tamanho: 646 B |
|
Antes Largura: | Altura: | Tamanho: 558 B |
|
Antes Largura: | Altura: | Tamanho: 628 B |
|
Antes Largura: | Altura: | Tamanho: 624 B |
|
Antes Largura: | Altura: | Tamanho: 558 B |
|
Antes Largura: | Altura: | Tamanho: 558 B |
|
Antes Largura: | Altura: | Tamanho: 630 B |
|
Antes Largura: | Altura: | Tamanho: 623 B |
|
Antes Largura: | Altura: | Tamanho: 733 B |
|
Antes Largura: | Altura: | Tamanho: 826 B |
|
Antes Largura: | Altura: | Tamanho: 711 B |
|
Antes Largura: | Altura: | Tamanho: 628 B |
|
Antes Largura: | Altura: | Tamanho: 579 B |
|
Antes Largura: | Altura: | Tamanho: 613 B |
|
Antes Largura: | Altura: | Tamanho: 579 B |
|
Antes Largura: | Altura: | Tamanho: 583 B |
|
Antes Largura: | Altura: | Tamanho: 356 B |
|
Antes Largura: | Altura: | Tamanho: 697 B |
|
Antes Largura: | Altura: | Tamanho: 723 B |
|
Antes Largura: | Altura: | Tamanho: 734 B |
|
Antes Largura: | Altura: | Tamanho: 709 B |
|
Antes Largura: | Altura: | Tamanho: 714 B |
|
Antes Largura: | Altura: | Tamanho: 804 B |
|
Antes Largura: | Altura: | Tamanho: 613 B |
|
Antes Largura: | Altura: | Tamanho: 625 B |
|
Antes Largura: | Altura: | Tamanho: 564 B |
|
Antes Largura: | Altura: | Tamanho: 618 B |
|
Antes Largura: | Altura: | Tamanho: 515 B |
|
Antes Largura: | Altura: | Tamanho: 589 B |
|
Antes Largura: | Altura: | Tamanho: 490 B |
|
Antes Largura: | Altura: | Tamanho: 547 B |
|
Antes Largura: | Altura: | Tamanho: 729 B |
|
Antes Largura: | Altura: | Tamanho: 909 B |
|
Antes Largura: | Altura: | Tamanho: 697 B |
|
Antes Largura: | Altura: | Tamanho: 631 B |
|
Antes Largura: | Altura: | Tamanho: 694 B |
|
Antes Largura: | Altura: | Tamanho: 778 B |
@@ -1,138 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
|
||||
<TITLE>Home - CUPS @CUPS_VERSION@@CUPS_REVISION@</TITLE>
|
||||
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/cups.css">
|
||||
<LINK REL="SHORTCUT ICON" HREF="/favicon.ico" TYPE="image/x-icon">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<TABLE WIDTH="100%" STYLE="height: 100%;" BORDER="0" CELLSPACING="0" CELLPADDING="0" SUMMARY="Common UNIX Printing System @CUPS_VERSION@">
|
||||
<TR CLASS="header">
|
||||
<TD VALIGN="TOP" WIDTH="15" ROWSPAN="2"><IMG SRC="/images/top-left.gif" WIDTH="15" HEIGHT="80" ALT=""></TD>
|
||||
<TD VALIGN="TOP" WIDTH="55" ROWSPAN="2"><IMG SRC="/images/top-middle.gif" WIDTH="55" HEIGHT="80" ALT=""></TD>
|
||||
<TD WIDTH="100%" HEIGHT="60"><H1>Common UNIX Printing System @CUPS_VERSION@@CUPS_REVISION@</H1></TD>
|
||||
<TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="15" ROWSPAN="2"><IMG
|
||||
SRC="/images/top-right.gif" WIDTH="15" HEIGHT="15" ALT=""></TD>
|
||||
</TR>
|
||||
<TR CLASS="header"><TD WIDTH="100%" VALIGN="BOTTOM" NOWRAP>
|
||||
|
||||
<A CLASS="sel" HREF="/"><IMG SRC="/images/tab-left.gif" WIDTH="4"
|
||||
HEIGHT="4" ALIGN="TOP" BORDER="0"
|
||||
ALT=""> Principale <IMG
|
||||
SRC="/images/tab-right.gif" WIDTH="4" HEIGHT="4" ALIGN="TOP"
|
||||
BORDER="0" ALT=""></A>
|
||||
|
||||
<A CLASS="unsel" HREF="/admin/"><IMG SRC="/images/tab-left.gif" WIDTH="4"
|
||||
HEIGHT="4" ALIGN="TOP" BORDER="0"
|
||||
ALT=""> Amministrazione <IMG
|
||||
SRC="/images/tab-right.gif" WIDTH="4" HEIGHT="4" ALIGN="TOP"
|
||||
BORDER="0" ALT=""></A>
|
||||
|
||||
<A CLASS="unsel" HREF="/classes/"><IMG SRC="/images/tab-left.gif" WIDTH="4"
|
||||
HEIGHT="4" ALIGN="TOP" BORDER="0"
|
||||
ALT=""> Classi <IMG
|
||||
SRC="/images/tab-right.gif" WIDTH="4" HEIGHT="4" ALIGN="TOP"
|
||||
BORDER="0" ALT=""></A>
|
||||
|
||||
<A CLASS="unsel" HREF="/help/"><IMG SRC="/images/tab-left.gif" WIDTH="4"
|
||||
HEIGHT="4" ALIGN="TOP" BORDER="0"
|
||||
ALT=""> Documentazione/Guida <IMG
|
||||
SRC="/images/tab-right.gif" WIDTH="4" HEIGHT="4" ALIGN="TOP"
|
||||
BORDER="0" ALT=""></A>
|
||||
|
||||
<A CLASS="unsel" HREF="/jobs/"><IMG SRC="/images/tab-left.gif" WIDTH="4"
|
||||
HEIGHT="4" ALIGN="TOP" BORDER="0"
|
||||
ALT=""> Operazioni <IMG
|
||||
SRC="/images/tab-right.gif" WIDTH="4" HEIGHT="4" ALIGN="TOP"
|
||||
BORDER="0" ALT=""></A>
|
||||
|
||||
<A CLASS="unsel" HREF="/printers/"><IMG SRC="/images/tab-left.gif" WIDTH="4"
|
||||
HEIGHT="4" ALIGN="TOP" BORDER="0"
|
||||
ALT=""> Stampanti <IMG
|
||||
SRC="/images/tab-right.gif" WIDTH="4" HEIGHT="4" ALIGN="TOP"
|
||||
BORDER="0" ALT=""></A>
|
||||
|
||||
</TD></TR>
|
||||
<TR CLASS="page">
|
||||
<TD WIDTH="15"> </TD>
|
||||
<TD COLSPAN="2" WIDTH="100%" VALIGN="TOP" CLASS="page">
|
||||
|
||||
<H2 CLASS="title">Benvenuto!</H2>
|
||||
|
||||
<P>Queste pagine web ti consentono di controllare le stampanti e le operazioni di stampa nonché eseguire operazioni di amministrazione del sistema. Fai clic su ognuna delle schede in alto o sui pulsanti seguenti per effettuare un'operazione.</P>
|
||||
|
||||
<P>
|
||||
<A HREF="/help/"><IMG SRC="/images/button-help.gif" CLASS="button" ALT="Guida"></A>
|
||||
<A HREF="/admin?OP=add-class"><IMG SRC="/images/button-add-class.gif" CLASS="button" ALT="Aggiungi classe"></A>
|
||||
<A HREF="/admin?OP=add-printer"><IMG SRC="/images/button-add-printer.gif" CLASS="button" ALT="Aggiungi stampante"></A>
|
||||
<A HREF="/classes"><IMG SRC="/images/button-manage-classes.gif" CLASS="button" ALT="Gestione classi"></A>
|
||||
<A HREF="/jobs"><IMG SRC="/images/button-manage-jobs.gif" CLASS="button" ALT="Gestione operazioni"></A>
|
||||
<A HREF="/printers"><IMG SRC="/images/button-manage-printers.gif" CLASS="button" ALT="Gestione stampanti"></A>
|
||||
<A HREF="/admin"><IMG SRC="/images/button-manage-server.gif" CLASS="button" ALT="Gestione server"></A>
|
||||
</P>
|
||||
|
||||
<P><I>Se ti viene richiesto un nome utente o una password, inserisci il nome utente
|
||||
e la password di accesso o il nome utente e la password dell'utente "root".</I></P>
|
||||
|
||||
<H2 CLASS="title">Informazioni su CUPS</H2>
|
||||
|
||||
<P>
|
||||
<IMG SRC="/images/happy.gif" ALIGN="LEFT" WIDTH="196" HEIGHT="144"
|
||||
STYLE="padding-right: 10px;" ALT="Computer felice e stampante">
|
||||
|
||||
<A HREF="http://www.easysw.com/"><IMG SRC="/images/esp-logo.gif"
|
||||
ALIGN="RIGHT" WIDTH="110" HEIGHT="68" BORDER="0"
|
||||
STYLE="padding-left: 10px; padding-bottom: 10px;"
|
||||
ALT="Easy Software Products"></A>
|
||||
|
||||
CUPS fornisce un sottosistema di stampa portabile per
|
||||
i sistemi operativi basati su UNIX<SUP>®</SUP>. Sviluppato e
|
||||
gestito da <A HREF="http://www.easysw.com">Easy Software
|
||||
Products</a> per promuovere una soluzione di stampa standard. CUPS è il
|
||||
sistema di stampa standard utilizzato su MacOS<SUP>®</SUP> X e sulla
|
||||
maggior parte delle distribuzioni Linux<SUP>®</SUP>.</P>
|
||||
|
||||
<P>CUPS utilizza l'<A HREF="http://www.pwg.org/ipp/"
|
||||
TARGET="_blank">Internet Printing Protocol ("IPP")</A> come base per la
|
||||
gestione delle operazioni di stampa e delle code e aggiunge la navigazione delle
|
||||
stampanti di rete e opzioni di stampa basate su PostScript Printer
|
||||
Description ("PPD") per supportare tutte le necessità di stampa.<BR CLEAR="ALL"></P>
|
||||
|
||||
<H2 CLASS="title">Driver di stampa e assistenza</H2>
|
||||
|
||||
<P>Visita il sito ufficiale di CUPS per i driver di stampa e assistenza:</P>
|
||||
|
||||
<PRE>
|
||||
<A HREF="http://www.cups.org/" TARGET="_blank">www.cups.org</A>
|
||||
</PRE>
|
||||
|
||||
<P>Supporto commerciale e una versione migliorata di CUPS chiamata <A
|
||||
HREF="http://www.easysw.com/printpro/">ESP Print Pro</A>
|
||||
disponibili presso:</P>
|
||||
|
||||
<PRE>
|
||||
<A HREF="http://www.easysw.com/" TARGET="_blank">www.easysw.com</A>
|
||||
</PRE>
|
||||
|
||||
</TD>
|
||||
<TD WIDTH="15"> </TD>
|
||||
</TR>
|
||||
<TR CLASS="header">
|
||||
<TD VALIGN="BOTTOM" WIDTH="15"><IMG SRC="/images/bottom-left.gif"
|
||||
WIDTH="15" HEIGHT="15" ALT=""></TD>
|
||||
<TD COLSPAN="2" WIDTH="100%" STYLE="padding: 5;">
|
||||
|
||||
<P><SMALL>Common UNIX Printing System, CUPS, e il logo CUPS sono
|
||||
marchi registrati da <A HREF="http://www.easysw.com">Easy Software
|
||||
Products</A>. CUPS è un copyright 1997-2006 di Easy Software Products,
|
||||
Tutti i diritti sono riservati.</SMALL></P>
|
||||
|
||||
</TD>
|
||||
|
||||
<TD ALIGN="RIGHT" VALIGN="BOTTOM" WIDTH="15"><IMG SRC="/images/bottom-right.gif"
|
||||
WIDTH="15" HEIGHT="15" ALT=""></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -949,7 +949,7 @@ copy_dsc(cups_file_t *fp, /* I - File to read from */
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("%%%%Page: %s %d\n", pageinfo->label, number);
|
||||
printf("%%%%Page: %s %d\n", pageinfo->label, number);
|
||||
printf("%%%%PageBoundingBox: %d %d %d %d\n",
|
||||
pageinfo->bounding_box[0], pageinfo->bounding_box[1],
|
||||
pageinfo->bounding_box[2], pageinfo->bounding_box[3]);
|
||||
@@ -1263,44 +1263,6 @@ copy_page(cups_file_t *fp, /* I - File to read from */
|
||||
memcpy(bounding_box, doc->bounding_box,
|
||||
sizeof(bounding_box));
|
||||
}
|
||||
else if (doc->number_up == 1 && !doc->fitplot)
|
||||
{
|
||||
int temp_bbox[4]; /* Temporary bounding box */
|
||||
|
||||
|
||||
switch (Orientation)
|
||||
{
|
||||
case 0 : /* Portrait */
|
||||
break;
|
||||
|
||||
case 1 : /* Landscape */
|
||||
temp_bbox[0] = PageWidth - bounding_box[3];
|
||||
temp_bbox[1] = bounding_box[0];
|
||||
temp_bbox[2] = PageWidth - bounding_box[1];
|
||||
temp_bbox[3] = bounding_box[2];
|
||||
|
||||
memcpy(bounding_box, temp_bbox, sizeof(bounding_box));
|
||||
break;
|
||||
|
||||
case 2 : /* Reverse Portrait */
|
||||
temp_bbox[0] = PageWidth - bounding_box[0];
|
||||
temp_bbox[1] = PageLength - bounding_box[1];
|
||||
temp_bbox[2] = PageWidth - bounding_box[2];
|
||||
temp_bbox[3] = PageLength - bounding_box[3];
|
||||
|
||||
memcpy(bounding_box, temp_bbox, sizeof(bounding_box));
|
||||
break;
|
||||
|
||||
case 3 : /* Reverse Landscape */
|
||||
temp_bbox[0] = bounding_box[1];
|
||||
temp_bbox[1] = PageLength - bounding_box[2];
|
||||
temp_bbox[2] = bounding_box[3];
|
||||
temp_bbox[3] = PageLength - bounding_box[0];
|
||||
|
||||
memcpy(bounding_box, temp_bbox, sizeof(bounding_box));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
else if (!strncmp(line, "%%PageCustomColors:", 19) ||
|
||||
|
||||
@@ -113,9 +113,6 @@
|
||||
%subpackage et
|
||||
%description Estonian support
|
||||
|
||||
%subpackage it
|
||||
%description Italian support
|
||||
|
||||
%subpackage ja
|
||||
%description Japanese support
|
||||
|
||||
@@ -361,8 +358,6 @@ f 0644 root sys $LOCALEDIR/de/cups_de.po locale/cups_de.po
|
||||
f 0644 root sys $LOCALEDIR/es/cups_es.po locale/cups_es.po
|
||||
%subpackage et
|
||||
f 0644 root sys $LOCALEDIR/et/cups_et.po locale/cups_et.po
|
||||
%subpackage it
|
||||
f 0644 root sys $LOCALEDIR/it/cups_it.po locale/cups_it.po
|
||||
%subpackage ja
|
||||
f 0644 root sys $LOCALEDIR/ja/cups_ja.po locale/cups_ja.po
|
||||
%subpackage pl
|
||||
@@ -435,9 +430,6 @@ f 0644 root sys $DATADIR/templates/es templates/es/*.tmpl
|
||||
%subpackage et
|
||||
d 0755 root sys $DATADIR/templates/et
|
||||
f 0644 root sys $DATADIR/templates/et templates/et/*.tmpl
|
||||
%subpackage it
|
||||
d 0755 root sys $DATADIR/templates/it
|
||||
f 0644 root sys $DATADIR/templates/it templates/it/*.tmpl
|
||||
%subpackage ja
|
||||
d 0755 root sys $DATADIR/templates/ja
|
||||
f 0644 root sys $DATADIR/templates/ja templates/ja/*.tmpl
|
||||
@@ -533,11 +525,6 @@ d 0755 root sys $DOCDIR/et
|
||||
f 0644 root sys $DOCDIR/et doc/et/*.html
|
||||
d 0755 root sys $DOCDIR/et/images -
|
||||
f 0644 root sys $DOCDIR/et/images doc/et/images/*.gif
|
||||
%subpackage it
|
||||
d 0755 root sys $DOCDIR/it
|
||||
f 0644 root sys $DOCDIR/it doc/it/*.html
|
||||
d 0755 root sys $DOCDIR/it/images -
|
||||
f 0644 root sys $DOCDIR/it/images doc/it/images/*.gif
|
||||
%subpackage ja
|
||||
d 0755 root sys $DOCDIR/ja
|
||||
f 0644 root sys $DOCDIR/ja doc/ja/*.html
|
||||
|
||||
@@ -91,11 +91,6 @@ Summary: Common UNIX Printing System - Estonian support
|
||||
Group: System Environment/Daemons
|
||||
Requires: %{name} = %{epoch}:%{version}
|
||||
|
||||
%package it
|
||||
Summary: Common UNIX Printing System - Italian support
|
||||
Group: System Environment/Daemons
|
||||
Requires: %{name} = %{epoch}:%{version}
|
||||
|
||||
%package ja
|
||||
Summary: Common UNIX Printing System - Japanese support
|
||||
Group: System Environment/Daemons
|
||||
@@ -149,10 +144,6 @@ UNIX
|
||||
The Common UNIX Printing System provides a portable printing layer for
|
||||
UNIX® operating systems. This package provides Estonian support.
|
||||
|
||||
%description it
|
||||
The Common UNIX Printing System provides a portable printing layer for
|
||||
UNIX® operating systems. This package provides Italian support.
|
||||
|
||||
%description ja
|
||||
The Common UNIX Printing System provides a portable printing layer for
|
||||
UNIX® operating systems. This package provides Japanese support.
|
||||
@@ -430,16 +421,6 @@ rm -rf $RPM_BUILD_ROOT
|
||||
/usr/share/cups/templates/et/*
|
||||
/usr/share/locale/et/cups_et.po
|
||||
|
||||
%files it
|
||||
%defattr(-,root,root)
|
||||
%dir /usr/share/doc/cups/it
|
||||
/usr/share/doc/cups/it/index.html
|
||||
%dir /usr/share/doc/cups/it/images
|
||||
/usr/share/doc/cups/it/images/*
|
||||
%dir /usr/share/cups/templates/it
|
||||
/usr/share/cups/templates/it/*
|
||||
/usr/share/locale/it/cups_it.po
|
||||
|
||||
%files ja
|
||||
%defattr(-,root,root)
|
||||
%dir /usr/share/doc/cups/ja
|
||||
|
||||
@@ -426,8 +426,7 @@ cupsdAcceptClient(cupsd_listener_t *lis)/* I - Listener socket */
|
||||
|
||||
con->http.encryption = HTTP_ENCRYPT_ALWAYS;
|
||||
|
||||
if (!encrypt_client(con))
|
||||
cupsdCloseClient(con);
|
||||
encrypt_client(con);
|
||||
}
|
||||
else
|
||||
con->auto_ssl = 1;
|
||||
@@ -746,9 +745,7 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */
|
||||
"cupsdReadClient: Saw first byte %02X, auto-negotiating SSL/TLS session...",
|
||||
buf[0] & 255);
|
||||
|
||||
if (!encrypt_client(con))
|
||||
return (cupsdCloseClient(con));
|
||||
|
||||
encrypt_client(con);
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
@@ -1059,8 +1056,7 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */
|
||||
if (cupsdFlushHeader(con) < 0)
|
||||
return (cupsdCloseClient(con));
|
||||
|
||||
if (!encrypt_client(con))
|
||||
return (cupsdCloseClient(con));
|
||||
encrypt_client(con);
|
||||
#else
|
||||
if (!cupsdSendError(con, HTTP_NOT_IMPLEMENTED))
|
||||
return (cupsdCloseClient(con));
|
||||
@@ -1107,8 +1103,7 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */
|
||||
if (cupsdFlushHeader(con) < 0)
|
||||
return (cupsdCloseClient(con));
|
||||
|
||||
if (!encrypt_client(con))
|
||||
return (cupsdCloseClient(con));
|
||||
encrypt_client(con);
|
||||
#else
|
||||
if (!cupsdSendError(con, HTTP_NOT_IMPLEMENTED))
|
||||
return (cupsdCloseClient(con));
|
||||
@@ -2592,7 +2587,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 */
|
||||
|
||||
|
||||
@@ -2620,12 +2614,9 @@ encrypt_client(cupsd_client_t *con) /* I - Client to encrypt */
|
||||
SSL_CTX_use_PrivateKey_file(context, ServerKey, SSL_FILETYPE_PEM);
|
||||
SSL_CTX_use_certificate_file(context, ServerCertificate, SSL_FILETYPE_PEM);
|
||||
|
||||
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);
|
||||
|
||||
SSL_set_fd(conn, con->http.fd);
|
||||
if (SSL_accept(conn) != 1)
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
@@ -2698,9 +2689,8 @@ encrypt_client(cupsd_client_t *con) /* I - Client to encrypt */
|
||||
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_transport_set_ptr(conn->session,
|
||||
(gnutls_transport_ptr)((long)con->http.fd));
|
||||
|
||||
error = gnutls_handshake(conn->session);
|
||||
|
||||
@@ -2730,6 +2720,7 @@ encrypt_client(cupsd_client_t *con) /* I - Client to encrypt */
|
||||
# elif defined(HAVE_CDSASSL)
|
||||
OSStatus error; /* Error code */
|
||||
http_tls_t *conn; /* CDSA connection information */
|
||||
cdsa_conn_ref_t u; /* Connection reference union */
|
||||
|
||||
|
||||
if ((conn = (http_tls_t *)malloc(sizeof(http_tls_t))) == NULL)
|
||||
@@ -2752,7 +2743,7 @@ encrypt_client(cupsd_client_t *con) /* I - Client to encrypt */
|
||||
if (!conn->certsArray)
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
"encrypt_client: Could not find signing key in keychain "
|
||||
"EncryptClient: Could not find signing key in keychain "
|
||||
"\"%s\"", ServerCertificate);
|
||||
error = errSSLBadCert; /* errSSLBadConfiguration is a better choice, but not available on 10.2.x */
|
||||
}
|
||||
@@ -2767,7 +2758,15 @@ encrypt_client(cupsd_client_t *con) /* I - Client to encrypt */
|
||||
error = SSLSetProtocolVersionEnabled(conn->session, kSSLProtocol2, false);
|
||||
|
||||
if (!error)
|
||||
error = SSLSetConnection(conn->session, HTTP(con));
|
||||
{
|
||||
/*
|
||||
* Use a union to resolve warnings about int/pointer size mismatches...
|
||||
*/
|
||||
|
||||
u.connection = NULL;
|
||||
u.sock = con->http.fd;
|
||||
error = SSLSetConnection(conn->session, u.connection);
|
||||
}
|
||||
|
||||
if (!error)
|
||||
error = SSLSetAllowsExpiredCerts(conn->session, true);
|
||||
|
||||
@@ -159,17 +159,6 @@ cupsdLoadRemoteCache(void)
|
||||
time_t now; /* Current time */
|
||||
|
||||
|
||||
/*
|
||||
* Don't load the cache if the CUPS remote protocol is disabled...
|
||||
*/
|
||||
|
||||
if (!(BrowseRemoteProtocols & BROWSE_CUPS))
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG,
|
||||
"cupsdLoadRemoteCache: Not loading remote cache.");
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Open the remote.cache file...
|
||||
*/
|
||||
|
||||
@@ -32,11 +32,9 @@
|
||||
* cupsdSetStringf() - Set a formatted string value.
|
||||
* launchd_checkin() - Check-in with launchd and collect the
|
||||
* listening fds.
|
||||
* launchd_create_dict() - Create a dictionary representing the launchd
|
||||
* config file org.cups.cupsd.plist.
|
||||
* launchd_reload() - Tell launchd to reload the configuration
|
||||
* file to pick up the new listening directives.
|
||||
* launchd_sync_conf() - Re-write the launchd config file
|
||||
* launchd_sync_conf() - Re-write the launchd(8) config file
|
||||
* org.cups.cupsd.plist based on cupsd.conf.
|
||||
* parent_handler() - Catch USR1/CHLD signals...
|
||||
* process_children() - Process all dead children...
|
||||
@@ -77,41 +75,31 @@
|
||||
*/
|
||||
|
||||
#ifdef HAVE_LAUNCHD
|
||||
static void launchd_checkin(void);
|
||||
static CFDictionaryRef launchd_create_dict(void);
|
||||
static void launchd_reload(void);
|
||||
static int launchd_sync_conf(void);
|
||||
static void launchd_checkin(void);
|
||||
static void launchd_reload(void);
|
||||
static int launchd_sync_conf(void);
|
||||
#endif /* HAVE_LAUNCHD */
|
||||
static void parent_handler(int sig);
|
||||
static void process_children(void);
|
||||
static void sigchld_handler(int sig);
|
||||
static void sighup_handler(int sig);
|
||||
static void sigterm_handler(int sig);
|
||||
static long select_timeout(int fds);
|
||||
static void usage(int status);
|
||||
|
||||
static void parent_handler(int sig);
|
||||
static void process_children(void);
|
||||
static void sigchld_handler(int sig);
|
||||
static void sighup_handler(int sig);
|
||||
static void sigterm_handler(int sig);
|
||||
static long select_timeout(int fds);
|
||||
static void usage(int status);
|
||||
|
||||
|
||||
/*
|
||||
* Local globals...
|
||||
*/
|
||||
|
||||
static int parent_signal = 0;
|
||||
/* Set to signal number from child */
|
||||
static int holdcount = 0; /* Number of times "hold" was called */
|
||||
static int parent_signal = 0; /* Set to signal number from child */
|
||||
static int holdcount = 0; /* Number of times "hold" was called */
|
||||
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
|
||||
static sigset_t holdmask; /* Old POSIX signal mask */
|
||||
static sigset_t holdmask; /* Old POSIX signal mask */
|
||||
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
|
||||
static int dead_children = 0;
|
||||
/* Dead children? */
|
||||
static int stop_scheduler = 0;
|
||||
/* Should the scheduler stop? */
|
||||
|
||||
#ifdef HAVE_LAUNCHD
|
||||
static CFURLRef launchd_conf_url = NULL;
|
||||
/* org.cups.cupsd.plist url */
|
||||
static CFDictionaryRef launchd_conf_dict = NULL;
|
||||
/* org.cups.cupsd.plist dict */
|
||||
#endif /* HAVE_LAUNCHD */
|
||||
static int dead_children = 0; /* Dead children? */
|
||||
static int stop_scheduler = 0; /* Should the scheduler stop? */
|
||||
|
||||
|
||||
/*
|
||||
@@ -135,11 +123,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
activity, /* Client activity timer */
|
||||
browse_time, /* Next browse send time */
|
||||
senddoc_time, /* Send-Document time */
|
||||
expire_time, /* Subscription expire time */
|
||||
#ifndef __APPLE__
|
||||
netif_time, /* Network interface poll time */
|
||||
#endif /* !__APPLE__ */
|
||||
mallinfo_time; /* Malloc information time */
|
||||
expire_time; /* Subscription expire time */
|
||||
time_t mallinfo_time; /* Malloc information time */
|
||||
size_t string_count, /* String count */
|
||||
alloc_bytes, /* Allocated string bytes */
|
||||
total_bytes; /* Total string bytes */
|
||||
@@ -551,9 +536,6 @@ main(int argc, /* I - Number of command-line args */
|
||||
senddoc_time = time(NULL);
|
||||
expire_time = time(NULL);
|
||||
fds = 1;
|
||||
#ifndef __APPLE__
|
||||
netif_time = 0;
|
||||
#endif /* !__APPLE__ */
|
||||
|
||||
while (!stop_scheduler)
|
||||
{
|
||||
@@ -674,7 +656,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
#if HAVE_LAUNCHD
|
||||
/*
|
||||
* If no other work is scheduled and we're being controlled by
|
||||
* launchd then timeout after 'LaunchdTimeout' seconds of
|
||||
* launchd(8) then timeout after 'LaunchdTimeout' seconds of
|
||||
* inactivity...
|
||||
*/
|
||||
|
||||
@@ -779,7 +761,7 @@ main(int argc, /* I - Number of command-line args */
|
||||
|
||||
#if HAVE_LAUNCHD
|
||||
/*
|
||||
* If no other work was scheduled and we're being controlled by launchd
|
||||
* If no other work was scheduled and we're being controlled by launchd(8)
|
||||
* then timeout after 'LaunchdTimeout' seconds of inactivity...
|
||||
*/
|
||||
|
||||
@@ -828,23 +810,8 @@ main(int argc, /* I - Number of command-line args */
|
||||
*/
|
||||
|
||||
#ifdef __APPLE__
|
||||
/*
|
||||
* Mac OS X provides the SystemConfiguration framework for system
|
||||
* configuration change events...
|
||||
*/
|
||||
|
||||
if (SysEventPipes[0] >= 0 && FD_ISSET(SysEventPipes[0], input))
|
||||
cupsdUpdateSystemMonitor();
|
||||
#else
|
||||
/*
|
||||
* All other operating systems need to poll for changes...
|
||||
*/
|
||||
|
||||
if ((current_time - netif_time) >= 60)
|
||||
{
|
||||
NetIFUpdate = 1;
|
||||
netif_time = current_time;
|
||||
}
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
/*
|
||||
@@ -1115,12 +1082,6 @@ main(int argc, /* I - Number of command-line args */
|
||||
*/
|
||||
|
||||
launchd_sync_conf();
|
||||
|
||||
if (launchd_conf_url)
|
||||
CFRelease(launchd_conf_url);
|
||||
|
||||
if (launchd_conf_dict)
|
||||
CFRelease(launchd_conf_dict);
|
||||
#endif /* HAVE_LAUNCHD */
|
||||
|
||||
#ifdef __sgi
|
||||
@@ -1488,7 +1449,7 @@ launchd_checkin(void)
|
||||
{
|
||||
if (BrowseSocket != -1)
|
||||
close(BrowseSocket);
|
||||
|
||||
|
||||
BrowseSocket = launch_data_get_fd(tmp);
|
||||
}
|
||||
else
|
||||
@@ -1511,222 +1472,6 @@ launchd_checkin(void)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'launchd_create_dict()' - Create a dictionary representing the launchd
|
||||
* config file org.cups.cupsd.plist.
|
||||
*/
|
||||
|
||||
static CFDictionaryRef /* O - CFDictionary */
|
||||
launchd_create_dict(void)
|
||||
{
|
||||
int portnum; /* Port number */
|
||||
bool runatload; /* Run at load? */
|
||||
CFMutableDictionaryRef cupsd_dict, /* org.cups.cupsd.plist dictionary */
|
||||
sockets, /* Sockets dictionary */
|
||||
listener; /* Listener dictionary */
|
||||
CFMutableArrayRef array; /* Array */
|
||||
CFNumberRef socket_mode; /* Domain socket mode bits */
|
||||
CFStringRef socket_path; /* Domain socket path */
|
||||
CFTypeRef value; /* CF values */
|
||||
cupsd_listener_t *lis; /* Current listening socket */
|
||||
struct servent *service; /* Services data base entry */
|
||||
char temp[1024]; /* Temporary buffer for value */
|
||||
|
||||
|
||||
if ((cupsd_dict = CFDictionaryCreateMutable(kCFAllocatorDefault, 0,
|
||||
&kCFTypeDictionaryKeyCallBacks,
|
||||
&kCFTypeDictionaryValueCallBacks)) == NULL)
|
||||
return NULL;
|
||||
|
||||
CFDictionaryAddValue(cupsd_dict, CFSTR(LAUNCH_JOBKEY_LABEL),
|
||||
CFSTR("org.cups.cupsd"));
|
||||
CFDictionaryAddValue(cupsd_dict, CFSTR(LAUNCH_JOBKEY_ONDEMAND),
|
||||
kCFBooleanTrue);
|
||||
|
||||
/*
|
||||
* Run-at-load if there are active jobs, polling or shared printers
|
||||
* to advertise...
|
||||
*/
|
||||
|
||||
runatload = (cupsArrayCount(ActiveJobs) || NumPolled ||
|
||||
(Browsing && BrowseLocalProtocols &&
|
||||
NumBrowsers && cupsArrayCount(Printers))) ? true : false;
|
||||
|
||||
CFDictionaryAddValue(cupsd_dict, CFSTR(LAUNCH_JOBKEY_RUNATLOAD),
|
||||
runatload ? kCFBooleanTrue : kCFBooleanFalse);
|
||||
# ifdef LAUNCH_JOBKEY_SERVICEIPC
|
||||
CFDictionaryAddValue(cupsd_dict, CFSTR(LAUNCH_JOBKEY_SERVICEIPC),
|
||||
kCFBooleanTrue);
|
||||
# endif /* LAUNCH_JOBKEY_SERVICEIPC */
|
||||
|
||||
if ((array = CFArrayCreateMutable(kCFAllocatorDefault, 2,
|
||||
&kCFTypeArrayCallBacks)) != NULL)
|
||||
{
|
||||
CFDictionaryAddValue(cupsd_dict, CFSTR(LAUNCH_JOBKEY_PROGRAMARGUMENTS),
|
||||
array);
|
||||
CFArrayAppendValue(array, CFSTR("/usr/sbin/cupsd"));
|
||||
CFArrayAppendValue(array, CFSTR("-l"));
|
||||
CFRelease(array);
|
||||
}
|
||||
|
||||
/*
|
||||
* Add a sockets dictionary...
|
||||
*/
|
||||
|
||||
if ((sockets = (CFMutableDictionaryRef)CFDictionaryCreateMutable(
|
||||
kCFAllocatorDefault, 0,
|
||||
&kCFTypeDictionaryKeyCallBacks,
|
||||
&kCFTypeDictionaryValueCallBacks)) != NULL)
|
||||
{
|
||||
CFDictionaryAddValue(cupsd_dict, CFSTR(LAUNCH_JOBKEY_SOCKETS), sockets);
|
||||
|
||||
/*
|
||||
* Add a Listeners array to the sockets dictionary...
|
||||
*/
|
||||
|
||||
if ((array = CFArrayCreateMutable(kCFAllocatorDefault, 0,
|
||||
&kCFTypeArrayCallBacks)) != NULL)
|
||||
{
|
||||
CFDictionaryAddValue(sockets, CFSTR("Listeners"), array);
|
||||
|
||||
/*
|
||||
* For each listener add a dictionary to the listeners array...
|
||||
*/
|
||||
|
||||
for (lis = (cupsd_listener_t *)cupsArrayFirst(Listeners);
|
||||
lis;
|
||||
lis = (cupsd_listener_t *)cupsArrayNext(Listeners))
|
||||
{
|
||||
if ((listener = CFDictionaryCreateMutable(kCFAllocatorDefault, 0,
|
||||
&kCFTypeDictionaryKeyCallBacks,
|
||||
&kCFTypeDictionaryValueCallBacks)) != NULL)
|
||||
{
|
||||
CFArrayAppendValue(array, listener);
|
||||
|
||||
# ifdef AF_LOCAL
|
||||
if (lis->address.addr.sa_family == AF_LOCAL)
|
||||
{
|
||||
if ((socket_path = CFStringCreateWithCString(kCFAllocatorDefault,
|
||||
lis->address.un.sun_path,
|
||||
kCFStringEncodingUTF8)))
|
||||
{
|
||||
CFDictionaryAddValue(listener,
|
||||
CFSTR(LAUNCH_JOBSOCKETKEY_PATHNAME),
|
||||
socket_path);
|
||||
CFRelease(socket_path);
|
||||
}
|
||||
portnum = 0140777; /* (S_IFSOCK|S_IRWXU|S_IRWXG|S_IRWXO) or *
|
||||
* 49663d decimal */
|
||||
if ((socket_mode = CFNumberCreate(kCFAllocatorDefault,
|
||||
kCFNumberIntType, &portnum)))
|
||||
{
|
||||
CFDictionaryAddValue(listener, CFSTR("SockPathMode"),
|
||||
socket_mode);
|
||||
CFRelease(socket_mode);
|
||||
}
|
||||
}
|
||||
else
|
||||
# endif /* AF_LOCAL */
|
||||
{
|
||||
# ifdef AF_INET6
|
||||
if (lis->address.addr.sa_family == AF_INET6)
|
||||
{
|
||||
CFDictionaryAddValue(listener,
|
||||
CFSTR(LAUNCH_JOBSOCKETKEY_FAMILY),
|
||||
CFSTR("IPv6"));
|
||||
portnum = lis->address.ipv6.sin6_port;
|
||||
}
|
||||
else
|
||||
# endif /* AF_INET6 */
|
||||
{
|
||||
CFDictionaryAddValue(listener,
|
||||
CFSTR(LAUNCH_JOBSOCKETKEY_FAMILY),
|
||||
CFSTR("IPv4"));
|
||||
portnum = lis->address.ipv4.sin_port;
|
||||
}
|
||||
|
||||
if ((service = getservbyport(portnum, NULL)))
|
||||
value = CFStringCreateWithCString(kCFAllocatorDefault,
|
||||
service->s_name,
|
||||
kCFStringEncodingUTF8);
|
||||
else
|
||||
value = CFNumberCreate(kCFAllocatorDefault,
|
||||
kCFNumberIntType, &portnum);
|
||||
|
||||
if (value)
|
||||
{
|
||||
CFDictionaryAddValue(listener,
|
||||
CFSTR(LAUNCH_JOBSOCKETKEY_SERVICENAME),
|
||||
value);
|
||||
CFRelease(value);
|
||||
}
|
||||
|
||||
httpAddrString(&lis->address, temp, sizeof(temp));
|
||||
if ((value = CFStringCreateWithCString(kCFAllocatorDefault, temp,
|
||||
kCFStringEncodingUTF8)))
|
||||
{
|
||||
CFDictionaryAddValue(listener,
|
||||
CFSTR(LAUNCH_JOBSOCKETKEY_NODENAME),
|
||||
value);
|
||||
CFRelease(value);
|
||||
}
|
||||
}
|
||||
|
||||
CFRelease(listener);
|
||||
}
|
||||
}
|
||||
|
||||
CFRelease(array);
|
||||
}
|
||||
|
||||
/*
|
||||
* Add the BrowseSocket to the sockets dictionary...
|
||||
*/
|
||||
|
||||
if (Browsing && (BrowseRemoteProtocols & BROWSE_CUPS))
|
||||
{
|
||||
if ((array = CFArrayCreateMutable(kCFAllocatorDefault, 0,
|
||||
&kCFTypeArrayCallBacks)) != NULL)
|
||||
{
|
||||
CFDictionaryAddValue(sockets, CFSTR("BrowseSockets"), array);
|
||||
|
||||
if ((listener = CFDictionaryCreateMutable(kCFAllocatorDefault, 0,
|
||||
&kCFTypeDictionaryKeyCallBacks,
|
||||
&kCFTypeDictionaryValueCallBacks)) != NULL)
|
||||
{
|
||||
CFArrayAppendValue(array, listener);
|
||||
|
||||
CFDictionaryAddValue(listener, CFSTR(LAUNCH_JOBSOCKETKEY_FAMILY),
|
||||
CFSTR("IPv4"));
|
||||
CFDictionaryAddValue(listener, CFSTR(LAUNCH_JOBSOCKETKEY_TYPE),
|
||||
CFSTR("dgram"));
|
||||
|
||||
if ((service = getservbyport(BrowsePort, NULL)))
|
||||
value = CFStringCreateWithCString(kCFAllocatorDefault,
|
||||
service->s_name,
|
||||
kCFStringEncodingUTF8);
|
||||
else
|
||||
value = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType,
|
||||
&BrowsePort);
|
||||
|
||||
CFDictionaryAddValue(listener,
|
||||
CFSTR(LAUNCH_JOBSOCKETKEY_SERVICENAME), value);
|
||||
CFRelease(value);
|
||||
|
||||
CFRelease(listener);
|
||||
}
|
||||
|
||||
CFRelease(array);
|
||||
}
|
||||
}
|
||||
|
||||
CFRelease(sockets);
|
||||
}
|
||||
|
||||
return (cupsd_dict);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'launchd_reload()' - Tell launchd to reload the configuration file to pick
|
||||
* up the new listening directives.
|
||||
@@ -1828,104 +1573,272 @@ launchd_reload(void)
|
||||
|
||||
|
||||
/*
|
||||
* 'launchd_sync_conf()' - Rewrite the launchd config file
|
||||
* 'launchd_sync_conf()' - Re-write the launchd(8) config file
|
||||
* org.cups.cupsd.plist based on cupsd.conf.
|
||||
*/
|
||||
|
||||
static int /* O - 1 if the file was updated */
|
||||
launchd_sync_conf(void)
|
||||
{
|
||||
SInt32 errorCode; /* Error code */
|
||||
CFDataRef resourceData; /* XML property list */
|
||||
CFDictionaryRef cupsd_dict; /* New org.cups.cupsd.plist dict */
|
||||
int portnum; /* Port number */
|
||||
CFMutableDictionaryRef cupsd_dict, /* org.cups.cupsd.plist dictionary */
|
||||
sockets, /* Sockets dictionary */
|
||||
listener; /* Listener dictionary */
|
||||
CFDataRef resourceData; /* XML property list */
|
||||
CFMutableArrayRef array; /* Array */
|
||||
CFNumberRef socket_mode; /* Domain socket mode bits */
|
||||
CFStringRef socket_path; /* Domain socket path */
|
||||
CFTypeRef value; /* CF value */
|
||||
CFURLRef fileURL; /* File URL */
|
||||
SInt32 errorCode; /* Error code */
|
||||
cupsd_listener_t *lis; /* Current listening socket */
|
||||
struct servent *service; /* Services data base entry */
|
||||
char temp[1024]; /* Temporary buffer for value */
|
||||
struct stat cupsd_sb, /* File info for cupsd.conf */
|
||||
launchd_sb; /* File info for org.cups.cupsd.plist */
|
||||
|
||||
|
||||
/*
|
||||
* If needed reconstitute the existing org.cups.cupsd.plist...
|
||||
* If the launchd conf file modification time is newer than the cupsd.conf
|
||||
* time then there's nothing to do...
|
||||
*/
|
||||
|
||||
if (!launchd_conf_url &&
|
||||
!(launchd_conf_url = CFURLCreateFromFileSystemRepresentation(
|
||||
kCFAllocatorDefault,
|
||||
(const unsigned char *)LaunchdConf,
|
||||
strlen(LaunchdConf), false)))
|
||||
if (!stat(ConfigurationFile, &cupsd_sb) &&
|
||||
!stat(LaunchdConf, &launchd_sb) &&
|
||||
launchd_sb.st_mtimespec.tv_sec >= cupsd_sb.st_mtimespec.tv_sec)
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR, "launchd_sync_conf: "
|
||||
"Unable to create file URL for \"%s\"\n", LaunchdConf);
|
||||
return (0);
|
||||
}
|
||||
|
||||
if (!launchd_conf_dict)
|
||||
{
|
||||
if (CFURLCreateDataAndPropertiesFromResource(NULL, launchd_conf_url,
|
||||
&resourceData, NULL, NULL, &errorCode))
|
||||
{
|
||||
launchd_conf_dict = CFPropertyListCreateFromXMLData(NULL, resourceData,
|
||||
kCFPropertyListImmutable, NULL);
|
||||
CFRelease(resourceData);
|
||||
}
|
||||
|
||||
if (!launchd_conf_dict)
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR, "launchd_sync_conf: "
|
||||
"Unable to create dictionary for \"%s\"\n", LaunchdConf);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Create a new org.cups.cupsd.plist dictionary...
|
||||
*/
|
||||
|
||||
if ((cupsd_dict = launchd_create_dict()) == NULL)
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR, "launchd_sync_conf: "
|
||||
"Unable to create file URL for \"%s\"\n", LaunchdConf);
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG,
|
||||
"launchd_sync_conf: Nothing to do, pid=%d.",
|
||||
(int)getpid());
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* If the dictionaries are different write a new org.cups.cupsd.plist...
|
||||
* Time to write a new 'org.cups.cupsd.plist' file.
|
||||
* Create the new dictionary and populate it with values...
|
||||
*/
|
||||
|
||||
if (!CFEqual(cupsd_dict, launchd_conf_dict))
|
||||
if ((cupsd_dict = CFDictionaryCreateMutable(kCFAllocatorDefault, 0,
|
||||
&kCFTypeDictionaryKeyCallBacks,
|
||||
&kCFTypeDictionaryValueCallBacks)) != NULL)
|
||||
{
|
||||
if ((resourceData = CFPropertyListCreateXMLData(kCFAllocatorDefault,
|
||||
cupsd_dict)))
|
||||
CFDictionaryAddValue(cupsd_dict, CFSTR(LAUNCH_JOBKEY_LABEL),
|
||||
CFSTR("org.cups.cupsd"));
|
||||
CFDictionaryAddValue(cupsd_dict, CFSTR(LAUNCH_JOBKEY_ONDEMAND),
|
||||
kCFBooleanTrue);
|
||||
|
||||
if ((Browsing && BrowseLocalProtocols && cupsArrayCount(Printers)) ||
|
||||
cupsArrayCount(ActiveJobs) || NumPolled)
|
||||
CFDictionaryAddValue(cupsd_dict, CFSTR(LAUNCH_JOBKEY_RUNATLOAD),
|
||||
kCFBooleanTrue);
|
||||
else
|
||||
CFDictionaryAddValue(cupsd_dict, CFSTR(LAUNCH_JOBKEY_RUNATLOAD),
|
||||
kCFBooleanFalse);
|
||||
|
||||
#ifdef LAUNCH_JOBKEY_SERVICEIPC
|
||||
CFDictionaryAddValue(cupsd_dict, CFSTR(LAUNCH_JOBKEY_SERVICEIPC),
|
||||
kCFBooleanTrue);
|
||||
#endif /* LAUNCH_JOBKEY_SERVICEIPC */
|
||||
|
||||
if ((array = CFArrayCreateMutable(kCFAllocatorDefault, 2,
|
||||
&kCFTypeArrayCallBacks)) != NULL)
|
||||
{
|
||||
if (CFURLWriteDataAndPropertiesToResource(launchd_conf_url, resourceData,
|
||||
NULL, &errorCode))
|
||||
{
|
||||
/*
|
||||
* The new cupsd dictionary becomes the on-disk launchd dictionary...
|
||||
*/
|
||||
|
||||
if (launchd_conf_dict)
|
||||
CFRelease(launchd_conf_dict);
|
||||
|
||||
launchd_conf_dict = cupsd_dict;
|
||||
}
|
||||
else
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_WARN,
|
||||
"launchd_sync_conf: "
|
||||
"CFURLWriteDataAndPropertiesToResource(\"%s\") "
|
||||
"failed: %d\n",
|
||||
LaunchdConf, (int)errorCode);
|
||||
|
||||
CFRelease(cupsd_dict);
|
||||
}
|
||||
|
||||
CFRelease(resourceData);
|
||||
CFDictionaryAddValue(cupsd_dict, CFSTR(LAUNCH_JOBKEY_PROGRAMARGUMENTS),
|
||||
array);
|
||||
CFArrayAppendValue(array, CFSTR("/usr/sbin/cupsd"));
|
||||
CFArrayAppendValue(array, CFSTR("-l"));
|
||||
CFRelease(array);
|
||||
}
|
||||
|
||||
/*
|
||||
* Let the caller know we updated the file...
|
||||
* Add a sockets dictionary...
|
||||
*/
|
||||
|
||||
return (1);
|
||||
if ((sockets = (CFMutableDictionaryRef)CFDictionaryCreateMutable(
|
||||
kCFAllocatorDefault, 0,
|
||||
&kCFTypeDictionaryKeyCallBacks,
|
||||
&kCFTypeDictionaryValueCallBacks)) != NULL)
|
||||
{
|
||||
CFDictionaryAddValue(cupsd_dict, CFSTR(LAUNCH_JOBKEY_SOCKETS), sockets);
|
||||
|
||||
/*
|
||||
* Add a Listeners array to the sockets dictionary...
|
||||
*/
|
||||
|
||||
if ((array = CFArrayCreateMutable(kCFAllocatorDefault, 0,
|
||||
&kCFTypeArrayCallBacks)) != NULL)
|
||||
{
|
||||
CFDictionaryAddValue(sockets, CFSTR("Listeners"), array);
|
||||
|
||||
/*
|
||||
* For each listener add a dictionary to the listeners array...
|
||||
*/
|
||||
|
||||
for (lis = (cupsd_listener_t *)cupsArrayFirst(Listeners);
|
||||
lis;
|
||||
lis = (cupsd_listener_t *)cupsArrayNext(Listeners))
|
||||
{
|
||||
if ((listener = CFDictionaryCreateMutable(kCFAllocatorDefault, 0,
|
||||
&kCFTypeDictionaryKeyCallBacks,
|
||||
&kCFTypeDictionaryValueCallBacks)) != NULL)
|
||||
{
|
||||
CFArrayAppendValue(array, listener);
|
||||
|
||||
# ifdef AF_LOCAL
|
||||
if (lis->address.addr.sa_family == AF_LOCAL)
|
||||
{
|
||||
if ((socket_path = CFStringCreateWithCString(kCFAllocatorDefault,
|
||||
lis->address.un.sun_path,
|
||||
kCFStringEncodingUTF8)))
|
||||
{
|
||||
CFDictionaryAddValue(listener,
|
||||
CFSTR(LAUNCH_JOBSOCKETKEY_PATHNAME),
|
||||
socket_path);
|
||||
CFRelease(socket_path);
|
||||
}
|
||||
portnum = 0140777; /* (S_IFSOCK|S_IRWXU|S_IRWXG|S_IRWXO) or *
|
||||
* 49663d decimal */
|
||||
if ((socket_mode = CFNumberCreate(kCFAllocatorDefault,
|
||||
kCFNumberIntType, &portnum)))
|
||||
{
|
||||
CFDictionaryAddValue(listener, CFSTR("SockPathMode"),
|
||||
socket_mode);
|
||||
CFRelease(socket_mode);
|
||||
}
|
||||
}
|
||||
else
|
||||
# endif /* AF_LOCAL */
|
||||
{
|
||||
# ifdef AF_INET6
|
||||
if (lis->address.addr.sa_family == AF_INET6)
|
||||
{
|
||||
CFDictionaryAddValue(listener,
|
||||
CFSTR(LAUNCH_JOBSOCKETKEY_FAMILY),
|
||||
CFSTR("IPv6"));
|
||||
portnum = lis->address.ipv6.sin6_port;
|
||||
}
|
||||
else
|
||||
# endif /* AF_INET6 */
|
||||
{
|
||||
CFDictionaryAddValue(listener,
|
||||
CFSTR(LAUNCH_JOBSOCKETKEY_FAMILY),
|
||||
CFSTR("IPv4"));
|
||||
portnum = lis->address.ipv4.sin_port;
|
||||
}
|
||||
|
||||
if ((service = getservbyport(portnum, NULL)))
|
||||
value = CFStringCreateWithCString(kCFAllocatorDefault,
|
||||
service->s_name,
|
||||
kCFStringEncodingUTF8);
|
||||
else
|
||||
value = CFNumberCreate(kCFAllocatorDefault,
|
||||
kCFNumberIntType, &portnum);
|
||||
|
||||
if (value)
|
||||
{
|
||||
CFDictionaryAddValue(listener,
|
||||
CFSTR(LAUNCH_JOBSOCKETKEY_SERVICENAME),
|
||||
value);
|
||||
CFRelease(value);
|
||||
}
|
||||
|
||||
httpAddrString(&lis->address, temp, sizeof(temp));
|
||||
if ((value = CFStringCreateWithCString(kCFAllocatorDefault, temp,
|
||||
kCFStringEncodingUTF8)))
|
||||
{
|
||||
CFDictionaryAddValue(listener,
|
||||
CFSTR(LAUNCH_JOBSOCKETKEY_NODENAME),
|
||||
value);
|
||||
CFRelease(value);
|
||||
}
|
||||
}
|
||||
|
||||
CFRelease(listener);
|
||||
}
|
||||
}
|
||||
|
||||
CFRelease(array);
|
||||
}
|
||||
|
||||
/*
|
||||
* Add the BrowseSocket to the sockets dictionary...
|
||||
*/
|
||||
|
||||
if (Browsing && (BrowseRemoteProtocols & BROWSE_CUPS))
|
||||
{
|
||||
if ((array = CFArrayCreateMutable(kCFAllocatorDefault, 0,
|
||||
&kCFTypeArrayCallBacks)) != NULL)
|
||||
{
|
||||
CFDictionaryAddValue(sockets, CFSTR("BrowseSockets"), array);
|
||||
|
||||
if ((listener = CFDictionaryCreateMutable(kCFAllocatorDefault, 0,
|
||||
&kCFTypeDictionaryKeyCallBacks,
|
||||
&kCFTypeDictionaryValueCallBacks)) != NULL)
|
||||
{
|
||||
CFArrayAppendValue(array, listener);
|
||||
|
||||
CFDictionaryAddValue(listener, CFSTR(LAUNCH_JOBSOCKETKEY_FAMILY),
|
||||
CFSTR("IPv4"));
|
||||
CFDictionaryAddValue(listener, CFSTR(LAUNCH_JOBSOCKETKEY_TYPE),
|
||||
CFSTR("dgram"));
|
||||
|
||||
if ((service = getservbyport(BrowsePort, NULL)))
|
||||
value = CFStringCreateWithCString(kCFAllocatorDefault,
|
||||
service->s_name,
|
||||
kCFStringEncodingUTF8);
|
||||
else
|
||||
value = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType,
|
||||
&BrowsePort);
|
||||
|
||||
CFDictionaryAddValue(listener,
|
||||
CFSTR(LAUNCH_JOBSOCKETKEY_SERVICENAME), value);
|
||||
CFRelease(value);
|
||||
|
||||
CFRelease(listener);
|
||||
}
|
||||
|
||||
CFRelease(array);
|
||||
}
|
||||
}
|
||||
|
||||
CFRelease(sockets);
|
||||
}
|
||||
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG,
|
||||
"launchd_sync_conf: Updating \"%s\", pid=%d\n",
|
||||
LaunchdConf, (int)getpid());
|
||||
|
||||
if ((fileURL = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault,
|
||||
(const unsigned char *)LaunchdConf,
|
||||
strlen(LaunchdConf), false)))
|
||||
{
|
||||
if ((resourceData = CFPropertyListCreateXMLData(kCFAllocatorDefault,
|
||||
cupsd_dict)))
|
||||
{
|
||||
if (!CFURLWriteDataAndPropertiesToResource(fileURL, resourceData,
|
||||
NULL, &errorCode))
|
||||
{
|
||||
cupsdLogMessage(CUPSD_LOG_WARN,
|
||||
"launchd_sync_conf: "
|
||||
"CFURLWriteDataAndPropertiesToResource(\"%s\") "
|
||||
"failed: %d\n",
|
||||
LaunchdConf, (int)errorCode);
|
||||
}
|
||||
|
||||
CFRelease(resourceData);
|
||||
}
|
||||
|
||||
CFRelease(fileURL);
|
||||
}
|
||||
|
||||
CFRelease(cupsd_dict);
|
||||
}
|
||||
|
||||
return (0);
|
||||
/*
|
||||
* Let the caller know we updated the file...
|
||||
*/
|
||||
|
||||
return (1);
|
||||
}
|
||||
#endif /* HAVE_LAUNCHD */
|
||||
|
||||
|
||||
@@ -60,8 +60,7 @@ cupsdNetIFFind(const char *name) /* I - Name of interface */
|
||||
* Update the interface list as needed...
|
||||
*/
|
||||
|
||||
if (NetIFUpdate)
|
||||
cupsdNetIFUpdate();
|
||||
cupsdNetIFUpdate();
|
||||
|
||||
/*
|
||||
* Search for the named interface...
|
||||
@@ -114,13 +113,14 @@ cupsdNetIFUpdate(void)
|
||||
|
||||
|
||||
/*
|
||||
* Only update the list if we need to...
|
||||
* Update the network interface list no more often than once a
|
||||
* minute...
|
||||
*/
|
||||
|
||||
if (!NetIFUpdate)
|
||||
if ((time(NULL) - NetIFTime) < 60)
|
||||
return;
|
||||
|
||||
NetIFUpdate = 0;
|
||||
NetIFTime = time(NULL);
|
||||
|
||||
/*
|
||||
* Free the old interfaces...
|
||||
|
||||
@@ -43,8 +43,8 @@ typedef struct cupsd_netif_s /**** Network interface data ****/
|
||||
* Globals...
|
||||
*/
|
||||
|
||||
VAR int NetIFUpdate VALUE(1);
|
||||
/* Network interface list needs updating */
|
||||
VAR time_t NetIFTime VALUE(0);
|
||||
/* Network interface list time */
|
||||
VAR cups_array_t *NetIFList VALUE(NULL);
|
||||
/* Array of network interfaces */
|
||||
|
||||
|
||||
@@ -115,17 +115,11 @@ static CFRunLoopRef SysEventRunloop = NULL;
|
||||
/* The runloop. Access must be protected! */
|
||||
static CFStringRef ComputerNameKey = NULL,
|
||||
/* Computer name key */
|
||||
NetworkGlobalKeyIPv4 = NULL,
|
||||
/* Network global IPv4 key */
|
||||
NetworkGlobalKeyIPv6 = NULL,
|
||||
/* Network global IPv6 key */
|
||||
NetworkGlobalKeyDNS = NULL,
|
||||
/* Network global DNS key */
|
||||
NetworkGlobalKey = NULL,
|
||||
/* Network global key */
|
||||
HostNamesKey = NULL,
|
||||
/* Host name key */
|
||||
NetworkInterfaceKeyIPv4 = NULL,
|
||||
/* Netowrk interface key */
|
||||
NetworkInterfaceKeyIPv6 = NULL;
|
||||
NetworkInterfaceKey = NULL;
|
||||
/* Netowrk interface key */
|
||||
|
||||
|
||||
@@ -312,6 +306,7 @@ cupsdUpdateSystemMonitor(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
/* TODO: Possibly update when MDNS support is added? */
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG,
|
||||
"Deregistering local printer \"%s\"", p->name);
|
||||
cupsdSendBrowseDelete(p);
|
||||
@@ -338,6 +333,12 @@ cupsdUpdateSystemMonitor(void)
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG,
|
||||
"System network configuration changed");
|
||||
|
||||
/*
|
||||
* Force an update of the list of network interfaces in 2 seconds.
|
||||
*/
|
||||
|
||||
NetIFTime = time(NULL) - 58;
|
||||
|
||||
/*
|
||||
* Resetting browse_time before calling cupsdSendBrowseList causes
|
||||
* browse packets to be sent for local shared printers.
|
||||
@@ -406,8 +407,8 @@ sysEventThreadEntry(void)
|
||||
SCDynamicStoreRef store = NULL;/* System Config dynamic store */
|
||||
CFRunLoopSourceRef powerRLS = NULL,/* Power runloop source */
|
||||
storeRLS = NULL;/* System Config runloop source */
|
||||
CFStringRef key[5], /* System Config keys */
|
||||
pattern[2]; /* System Config patterns */
|
||||
CFStringRef key[3], /* System Config keys */
|
||||
pattern[1]; /* System Config patterns */
|
||||
CFArrayRef keys = NULL, /* System Config key array*/
|
||||
patterns = NULL;/* System Config pattern array */
|
||||
SCDynamicStoreContext storeContext; /* Dynamic store context */
|
||||
@@ -448,58 +449,33 @@ sysEventThreadEntry(void)
|
||||
if (!ComputerNameKey)
|
||||
ComputerNameKey = SCDynamicStoreKeyCreateComputerName(NULL);
|
||||
|
||||
if (!NetworkGlobalKeyIPv4)
|
||||
NetworkGlobalKeyIPv4 =
|
||||
if (!NetworkGlobalKey)
|
||||
NetworkGlobalKey =
|
||||
SCDynamicStoreKeyCreateNetworkGlobalEntity(NULL,
|
||||
kSCDynamicStoreDomainState,
|
||||
kSCEntNetIPv4);
|
||||
|
||||
if (!NetworkGlobalKeyIPv6)
|
||||
NetworkGlobalKeyIPv6 =
|
||||
SCDynamicStoreKeyCreateNetworkGlobalEntity(NULL,
|
||||
kSCDynamicStoreDomainState,
|
||||
kSCEntNetIPv6);
|
||||
|
||||
if (!NetworkGlobalKeyDNS)
|
||||
NetworkGlobalKeyDNS =
|
||||
SCDynamicStoreKeyCreateNetworkGlobalEntity(NULL,
|
||||
kSCDynamicStoreDomainState,
|
||||
kSCEntNetDNS);
|
||||
|
||||
if (!HostNamesKey)
|
||||
HostNamesKey = SCDynamicStoreKeyCreateHostNames(NULL);
|
||||
|
||||
if (!NetworkInterfaceKeyIPv4)
|
||||
NetworkInterfaceKeyIPv4 =
|
||||
if (!NetworkInterfaceKey)
|
||||
NetworkInterfaceKey =
|
||||
SCDynamicStoreKeyCreateNetworkInterfaceEntity(NULL,
|
||||
kSCDynamicStoreDomainState,
|
||||
kSCCompAnyRegex,
|
||||
kSCEntNetIPv4);
|
||||
|
||||
if (!NetworkInterfaceKeyIPv6)
|
||||
NetworkInterfaceKeyIPv6 =
|
||||
SCDynamicStoreKeyCreateNetworkInterfaceEntity(NULL,
|
||||
kSCDynamicStoreDomainState,
|
||||
kSCCompAnyRegex,
|
||||
kSCEntNetIPv6);
|
||||
|
||||
if (store && ComputerNameKey && HostNamesKey &&
|
||||
NetworkGlobalKeyIPv4 && NetworkGlobalKeyIPv6 && NetworkGlobalKeyDNS &&
|
||||
NetworkInterfaceKeyIPv4 && NetworkInterfaceKeyIPv6)
|
||||
if (store && ComputerNameKey && NetworkGlobalKey && HostNamesKey &&
|
||||
NetworkInterfaceKey)
|
||||
{
|
||||
key[0] = ComputerNameKey;
|
||||
key[1] = NetworkGlobalKeyIPv4;
|
||||
key[2] = NetworkGlobalKeyIPv6;
|
||||
key[3] = NetworkGlobalKeyDNS;
|
||||
key[4] = HostNamesKey;
|
||||
|
||||
pattern[0] = NetworkInterfaceKeyIPv4;
|
||||
pattern[1] = NetworkInterfaceKeyIPv6;
|
||||
key[1] = NetworkGlobalKey;
|
||||
key[2] = HostNamesKey;
|
||||
pattern[0] = NetworkInterfaceKey;
|
||||
|
||||
keys = CFArrayCreate(NULL, (const void **)key,
|
||||
sizeof(key) / sizeof(key[0]),
|
||||
&kCFTypeArrayCallBacks);
|
||||
|
||||
patterns = CFArrayCreate(NULL, (const void **)pattern,
|
||||
sizeof(pattern) / sizeof(pattern[0]),
|
||||
&kCFTypeArrayCallBacks);
|
||||
@@ -706,17 +682,12 @@ sysEventConfigurationNotifier(
|
||||
|
||||
if (CFArrayContainsValue(changedKeys, range, ComputerNameKey))
|
||||
threadData->sysevent.event |= SYSEVENT_NAMECHANGED;
|
||||
else
|
||||
{
|
||||
|
||||
if (CFArrayContainsValue(changedKeys, range, NetworkGlobalKey) ||
|
||||
CFArrayContainsValue(changedKeys, range, HostNamesKey) ||
|
||||
CFArrayContainsValue(changedKeys, range, NetworkInterfaceKey))
|
||||
threadData->sysevent.event |= SYSEVENT_NETCHANGED;
|
||||
|
||||
/*
|
||||
* Indicate the network interface list needs updating...
|
||||
*/
|
||||
|
||||
NetIFUpdate = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Because we registered for several different kinds of change notifications
|
||||
* this callback usually gets called several times in a row. We use a timer to
|
||||
@@ -724,7 +695,7 @@ sysEventConfigurationNotifier(
|
||||
*/
|
||||
|
||||
CFRunLoopTimerSetNextFireDate(threadData->timerRef,
|
||||
CFAbsoluteTimeGetCurrent() + 5);
|
||||
CFAbsoluteTimeGetCurrent() + 2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2038,7 +2038,7 @@ show_printers(http_t *http, /* I - HTTP connection to server */
|
||||
if (reasons)
|
||||
{
|
||||
_cupsLangPuts(stdout, _("\tAlerts:"));
|
||||
for (j = 0; j < reasons->num_values; j ++)
|
||||
for (j = 0; j < reasons->num_values; i ++)
|
||||
_cupsLangPrintf(stdout, " %s",
|
||||
reasons->values[j].string.text);
|
||||
_cupsLangPuts(stdout, "\n");
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
<FORM METHOD="POST" ACTION="/admin">
|
||||
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
|
||||
|
||||
<H2 CLASS="title">Aggiungi classe</H2>
|
||||
|
||||
<TABLE>
|
||||
<TR>
|
||||
<TH CLASS="label">Nome:</TH>
|
||||
<TD><INPUT TYPE="TEXT" NAME="PRINTER_NAME" SIZE="40" MAXLENGTH="127"></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">Posizione:</TH>
|
||||
<TD><INPUT TYPE="TEXT" NAME="PRINTER_LOCATION" SIZE="40" MAXLENGTH="127"></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">Descrizione:</TH>
|
||||
<TD><INPUT TYPE="TEXT" NAME="PRINTER_INFO" SIZE="40" MAXLENGTH="127"></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">Membri:</TH>
|
||||
<TD>
|
||||
<SELECT NAME="MEMBER_URIS" SIZE="10" MULTIPLE>
|
||||
{[member_uris]<OPTION VALUE="{member_uris}" {?member_selected}>{member_names}}
|
||||
</SELECT>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD></TD>
|
||||
<TD><INPUT TYPE="IMAGE" SRC="/images/button-add-class.gif" ALT="Aggiungi classe"></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
</FORM>
|
||||
@@ -1,28 +0,0 @@
|
||||
<FORM METHOD="POST" ACTION="/admin">
|
||||
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
|
||||
|
||||
<H2 CLASS="title">Add New Printer</H2>
|
||||
|
||||
<TABLE>
|
||||
<TR>
|
||||
<TH CLASS="label">Name:</TH>
|
||||
<TD><INPUT TYPE="TEXT" NAME="PRINTER_NAME" SIZE="40" MAXLENGTH="127"><BR>
|
||||
<SMALL>(May contain any printable characters except "/", "#", and space)</SMALL></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">Location:</TH>
|
||||
<TD><INPUT TYPE="TEXT" NAME="PRINTER_LOCATION" SIZE="40" MAXLENGTH="127"><BR>
|
||||
<SMALL>(Human-readable location such as "Lab 1")</SMALL></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">Description:</TH>
|
||||
<TD><INPUT TYPE="TEXT" NAME="PRINTER_INFO" SIZE="40" MAXLENGTH="127"><BR>
|
||||
<SMALL>(Human-readable description such as "HP LaserJet with Duplexer")</SMALL></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD></TD>
|
||||
<TD><INPUT TYPE="IMAGE" SRC="/images/button-continue.gif" ALT="Continue"></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
</FORM>
|
||||
@@ -1,77 +0,0 @@
|
||||
<TABLE CELLPADDING="0" CELLSPACING="0" WIDTH="100%" SUMMARY="Administration Tasks">
|
||||
<TR><TD VALIGN="TOP" NOWRAP>
|
||||
|
||||
<H2 CLASS="title">Stampanti</H2>
|
||||
|
||||
<P>
|
||||
<A HREF="/admin?op=add-printer"><IMG
|
||||
SRC="/images/button-add-printer.gif" ALT="Aggiungi stampante" CLASS="button"></A>
|
||||
<A HREF="/printers/"><IMG SRC="/images/button-manage-printers.gif"
|
||||
ALT="Gestione stampanti" CLASS="button"></A>
|
||||
{have_samba?<A HREF="/admin/?op=export-samba"><IMG
|
||||
SRC="/images/button-export-samba.gif" ALT="Esporta stampanti su Samba"
|
||||
CLASS="button"></A>:}
|
||||
</P>
|
||||
|
||||
{#device_uri=0?:<P><B>Nuove stampanti trovate:</B></P><UL>{[device_uri]
|
||||
<LI><A HREF="/admin?op=add-printer&{device_options}"><IMG
|
||||
SRC="/images/button-add-this-printer.gif" ALT="Aggiungi questa stampante" CLASS="button"
|
||||
ALIGN="MIDDLE"></A>
|
||||
{device_make_and_model} ({device_info})</LI>
|
||||
}</UL>}
|
||||
|
||||
<H2 CLASS="title">Classi</H2>
|
||||
|
||||
<P>
|
||||
<A HREF="/admin?op=add-class"><IMG SRC="/images/button-add-class.gif"
|
||||
ALT="Aggiungi classe" CLASS="button"></A>
|
||||
<A HREF="/classes/"><IMG SRC="/images/button-manage-classes.gif"
|
||||
ALT="Gestione classi" CLASS="button"></A>
|
||||
</P>
|
||||
|
||||
<H2 CLASS="title">Operazioni</H2>
|
||||
|
||||
<P>
|
||||
<A HREF="/jobs/"><IMG SRC="/images/button-manage-jobs.gif" ALT="Gestione
|
||||
operazioni" CLASS="button"></A>
|
||||
</P>
|
||||
|
||||
</TD><TD> </TD><TD VALIGN="TOP">
|
||||
|
||||
<H2 CLASS="title">Server</H2>
|
||||
|
||||
<P>
|
||||
<A HREF="/admin?op=config-server"><IMG
|
||||
SRC="/images/button-edit-configuration-file.gif" ALT="Modifica file di configurazione"
|
||||
CLASS="button"></A>
|
||||
<A HREF="/admin/log/access_log" TARGET="_blank"><IMG
|
||||
SRC="/images/button-view-access-log.gif" ALT="Mostra registro degli accessi"
|
||||
CLASS="button"></A>
|
||||
<A HREF="/admin/log/error_log" TARGET="_blank"><IMG
|
||||
SRC="/images/button-view-error-log.gif" ALT="Mostra registro degli errori"
|
||||
CLASS="button"></A>
|
||||
<A HREF="/admin/log/page_log" TARGET="_blank"><IMG
|
||||
SRC="/images/button-view-page-log.gif" ALT="Mostra registro delle pagine"
|
||||
CLASS="button"></A>
|
||||
</P>
|
||||
|
||||
{SETTINGS_ERROR?<P>{SETTINGS_MESSAGE}</P>
|
||||
<BLOCKQUOTE>{SETTINGS_ERROR}</BLOCKQUOTE>:
|
||||
|
||||
<FORM METHOD="POST" ACTION="/admin">
|
||||
|
||||
<P><B>Impostazioni di base del server:</B></P>
|
||||
|
||||
<P><INPUT TYPE="HIDDEN" NAME="OP" VALUE="config-server">
|
||||
<INPUT TYPE="CHECKBOX" NAME="REMOTE_PRINTERS" {?remote_printers}> Mostra stampanti condivise da altri sistemi<BR>
|
||||
<INPUT TYPE="CHECKBOX" NAME="SHARE_PRINTERS" {?share_printers}> Condividi le stampanti pubblicate connesse a questo sistema<BR>
|
||||
<INPUT TYPE="CHECKBOX" NAME="REMOTE_ADMIN" {?remote_admin}> Consenti amministrazione remota<BR>
|
||||
<INPUT TYPE="CHECKBOX" NAME="USER_CANCEL_ANY" {?user_cancel_any}> Consenti agli utenti di annullare qualunque operazione (non solo le proprie)<BR>
|
||||
<INPUT TYPE="CHECKBOX" NAME="DEBUG_LOGGING" {?debug_logging}> Salva le informazioni di debug per la risoluzione di problemi</P>
|
||||
|
||||
<P><INPUT TYPE="IMAGE" SRC="/images/button-change-settings.gif" ALT="Modifica impostazioni"></P>
|
||||
|
||||
</FORM>}
|
||||
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
@@ -1,26 +0,0 @@
|
||||
<FORM METHOD="POST" ACTION="/admin">
|
||||
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PRINTER_NAME" VALUE="{printer_name}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PRINTER_LOCATION" VALUE="{?printer_location}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PRINTER_INFO" VALUE="{?printer_info}">
|
||||
<INPUT TYPE="HIDDEN" NAME="CURRENT_MAKE_AND_MODEL" VALUE="{?current_make_and_model}">
|
||||
|
||||
<H2 CLASS="title">Dispositivo per {printer_name}</H2>
|
||||
|
||||
<TABLE>
|
||||
<TR>
|
||||
<TH CLASS="label">Dispositivo:</TH>
|
||||
<TD>
|
||||
<SELECT NAME="DEVICE_URI">
|
||||
{[device_uri]<OPTION VALUE="{device_uri}{?device_make_and_model!Unknown?|{device_make_and_model}:}" {?current_device_uri={device_uri}?SELECTED:{current_device_scheme={device_uri}?SELECTED:}}>
|
||||
{device_info} {?device_make_and_model!Unknown?({device_make_and_model}):}</OPTION>
|
||||
}</SELECT>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD></TD>
|
||||
<TD><INPUT TYPE="IMAGE" SRC="/images/button-continue.gif" ALT="Continua"></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
</FORM>
|
||||
@@ -1,42 +0,0 @@
|
||||
<FORM METHOD="POST" ACTION="/admin" ENCTYPE="multipart/form-data">
|
||||
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PRINTER_NAME" VALUE="{printer_name}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PRINTER_LOCATION" VALUE="{?printer_location}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PRINTER_INFO" VALUE="{?printer_info}">
|
||||
<INPUT TYPE="HIDDEN" NAME="DEVICE_URI" VALUE="{device_uri}">
|
||||
<INPUT TYPE="HIDDEN" NAME="BAUDRATE" VALUE="{?baudrate}">
|
||||
<INPUT TYPE="HIDDEN" NAME="BITS" VALUE="{?bits}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PARITY" VALUE="{?parity}">
|
||||
<INPUT TYPE="HIDDEN" NAME="FLOW" VALUE="{?flow}">
|
||||
|
||||
<H2 CLASS="title">Marca/Produttore per {printer_name}</H2>
|
||||
|
||||
<TABLE>
|
||||
<TR>
|
||||
<TH CLASS="label">Marca:</TH>
|
||||
<TD>
|
||||
<SELECT NAME="PPD_MAKE" SIZE="10">
|
||||
{[ppd_make]<OPTION VALUE="{ppd_make}" {?current_make={ppd_make}?SELECTED:}>{ppd_make}}
|
||||
</SELECT>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD></TD>
|
||||
<TD><INPUT TYPE="IMAGE" SRC="/images/button-continue.gif" ALT="Continua"></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD></TD>
|
||||
<TD> </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">O fornisci un file PPD:</TH>
|
||||
<TD><INPUT TYPE="HIDDEN" NAME="MAX_FILE_SIZE" VALUE="262144"><INPUT
|
||||
TYPE="FILE" NAME="PPD_FILE"></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD></TD>
|
||||
<TD><INPUT TYPE="IMAGE" SRC="/images/button-{op}.gif" ALT="{op=add-printer?Aggiungi stampante:Modifica stampante}"></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
</FORM>
|
||||
@@ -1,34 +0,0 @@
|
||||
<FORM METHOD="POST" ACTION="/admin" ENCTYPE="multipart/form-data">
|
||||
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PRINTER_NAME" VALUE="{printer_name}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PRINTER_LOCATION" VALUE="{?printer_location}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PRINTER_INFO" VALUE="{?printer_info}">
|
||||
<INPUT TYPE="HIDDEN" NAME="DEVICE_URI" VALUE="{device_uri}">
|
||||
<INPUT TYPE="HIDDEN" NAME="BAUDRATE" VALUE="{?baudrate}">
|
||||
<INPUT TYPE="HIDDEN" NAME="BITS" VALUE="{?bits}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PARITY" VALUE="{?parity}">
|
||||
<INPUT TYPE="HIDDEN" NAME="FLOW" VALUE="{?flow}">
|
||||
|
||||
<H2 CLASS="title">Modello/Driver per {printer_name}</H2>
|
||||
|
||||
<TABLE>
|
||||
<TR>
|
||||
<TH CLASS="label">Modello:</TH>
|
||||
<TD>
|
||||
<SELECT NAME="PPD_NAME" SIZE="10">
|
||||
{[ppd_name]<OPTION VALUE="{ppd_name}" {?current_make_and_model={ppd_make_and_model}?SELECTED:}>{ppd_make_and_model} ({ppd_natural_language})
|
||||
}</SELECT>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">O fornisci un file PPD:</TH>
|
||||
<TD><INPUT TYPE="HIDDEN" NAME="MAX_FILE_SIZE" VALUE="262144"><INPUT
|
||||
TYPE="FILE" NAME="PPD_FILE"></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD></TD>
|
||||
<TD><INPUT TYPE="IMAGE" SRC="/images/button-{op}.gif" ALT="{op=add-printer?Aggiungi stampante:Modifica stampante}"></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
</FORM>
|
||||
@@ -1,47 +0,0 @@
|
||||
<FORM METHOD="POST" ACTION="/admin">
|
||||
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PRINTER_NAME" VALUE="{printer_name}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PRINTER_LOCATION" VALUE="{?printer_location}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PRINTER_INFO" VALUE="{?printer_info}">
|
||||
<INPUT TYPE="HIDDEN" NAME="DEVICE_URI" VALUE="{device_uri}">
|
||||
|
||||
<H2 CLASS="title">Impostazioni porta seriale per {printer_name}</H2>
|
||||
|
||||
<TABLE>
|
||||
<TR>
|
||||
<TH CLASS="label">Velocità di trasmissione:</TH>
|
||||
<TD><SELECT NAME="BAUDRATE">
|
||||
{[baudrates]<OPTION {?baudrate={baudrates}?SELECTED:}>{baudrates}}
|
||||
</SELECT></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">Parità:</TH>
|
||||
<TD><SELECT NAME="PARITY">
|
||||
<OPTION VALUE="none" {?parity=none?SELECTED:}>Nessuna
|
||||
<OPTION VALUE="even" {?parity=even?SELECTED:}>Pari
|
||||
<OPTION VALUE="odd" {?parity=odd?SELECTED:}>Dispary
|
||||
</SELECT></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">Bit dati:</TH>
|
||||
<TD><SELECT NAME="BITS">
|
||||
<OPTION {?bits=8?SELECTED:}>8
|
||||
<OPTION {?bits=7?SELECTED:}>7
|
||||
</SELECT></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH CLASS="label">Controllo di flusso:</TH>
|
||||
<TD><SELECT NAME="FLOW">
|
||||
<OPTION VALUE="none" {?flow=none?SELECTED:}>Nessuno
|
||||
<OPTION VALUE="soft" {?flow=soft?SELECTED:}>XON/XOFF (Software)
|
||||
<OPTION VALUE="hard" {?flow=hard?SELECTED:}>RTS/CTS (Hardware)
|
||||
<OPTION VALUE="dtrdsr" {?flow=dtrdsr?SELECTED:}>DTR/DSR (Hardware)
|
||||
</SELECT></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD></TD>
|
||||
<TD><INPUT TYPE="IMAGE" SRC="/images/button-continue.gif" ALT="Continua"></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
</FORM>
|
||||
@@ -1,42 +0,0 @@
|
||||
<FORM METHOD="POST" ACTION="/admin">
|
||||
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="{op}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PRINTER_NAME" VALUE="{printer_name}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PRINTER_LOCATION" VALUE="{?printer_location}">
|
||||
<INPUT TYPE="HIDDEN" NAME="PRINTER_INFO" VALUE="{?printer_info}">
|
||||
<INPUT TYPE="HIDDEN" NAME="CURRENT_MAKE_AND_MODEL" VALUE="{?current_make_and_model}">
|
||||
|
||||
<H2 CLASS="title">URI del dispositivo per {printer_name}</H2>
|
||||
|
||||
<TABLE>
|
||||
<TR>
|
||||
<TH CLASS="label">URI del dispositivo:</TH>
|
||||
<TD><INPUT TYPE="TEXT" SIZE="60" MAXLENGTH="1024" NAME="DEVICE_URI" VALUE="{device_uri}"></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD></TD>
|
||||
<TD>Esempi:
|
||||
<PRE>
|
||||
http://hostname:631/ipp/
|
||||
http://hostname:631/ipp/port1
|
||||
|
||||
ipp://hostname/ipp/
|
||||
ipp://hostname/ipp/port1
|
||||
|
||||
lpd://hostname/queue
|
||||
|
||||
socket://hostname
|
||||
socket://hostname:9100
|
||||
</PRE>
|
||||
|
||||
<P>Vedi <A HREF="/help/network.html" TARGET="_blank">"Stampanti di
|
||||
rete"</A> per il corretto URI da utilizzare con la tua stampante.</P>
|
||||
|
||||
</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD></TD>
|
||||
<TD><INPUT TYPE="IMAGE" SRC="/images/button-continue.gif" ALT="Continua"></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
</FORM>
|
||||
@@ -1,2 +0,0 @@
|
||||
<P>La classe <A HREF="/classes/{printer_name}">{printer_name}</A> è stata aggiunta
|
||||
con successo.
|
||||
@@ -1,7 +0,0 @@
|
||||
<P><B>Attenzione:</B> Sei sicuro di voler eliminare la classe
|
||||
{printer_name}?</P>
|
||||
|
||||
<P ALIGN="CENTER"><A
|
||||
HREF="/admin?op=delete-class&printer_name={printer_name}&confirm=yes"><IMG
|
||||
SRC="/images/button-delete-class.gif" ALT="Elimina classe"
|
||||
CLASS="button"></A></P>
|
||||
@@ -1 +0,0 @@
|
||||
<P>La classe {printer_name} è stata eliminata con successo.
|
||||
@@ -1 +0,0 @@
|
||||
<H3 CLASS="title">Operazioni</H3>
|
||||
@@ -1,2 +0,0 @@
|
||||
<P>La classe <A HREF="/classes/{printer_name}">{printer_name}</A> è stata
|
||||
modificata con successo.
|
||||
@@ -1 +0,0 @@
|
||||
<P ALIGN="CENTER">{total=0?Nessuna classe:Mostrat{total=1?a:e} {#printer_name} di {total} class{total=1?e:i}}.</P>
|
||||
@@ -1,54 +0,0 @@
|
||||
{#printer_name=0?:
|
||||
{[printer_name]
|
||||
<H2 CLASS="title"><A HREF="{printer_uri_supported}">{printer_name}</A>{default_name={printer_name}? (Stampante predefinita):}
|
||||
{?printer_state_message=?:<SPAN CLASS="message">"{printer_state_message}"</SPAN>}</H2>
|
||||
|
||||
<TABLE WIDTH="100%" CLASS="button" CELLSPACING="0" CELLPADDING="0" SUMMARY="{printer_name}">
|
||||
<TR>
|
||||
<TD VALIGN=TOP><A HREF="{printer_uri_supported}">
|
||||
<IMG SRC="/images/classes.gif" CLASS="button" ALT=""></A></TD>
|
||||
<TD VALIGN=TOP><B>Descrizione:</B> {printer_info}<BR>
|
||||
<B>Posizione:</B> {printer_location}<BR>
|
||||
<B>Stato della classe:</B> {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.
|
||||
{?member_uris=?:<BR>Membri: {member_uris}}
|
||||
|
||||
<P>
|
||||
<A HREF="{printer_uri_supported}?op=print-test-page">
|
||||
<IMG SRC="/images/button-print-test-page.gif" ALT="Stampa pagina di prova" CLASS="button"></A>
|
||||
{printer_state=5?
|
||||
<A HREF="{admin_uri}?op=start-class&printer_name={%printer_name}&is_class=Y">
|
||||
<IMG SRC="/images/button-start-class.gif" ALT="Avvia classe" CLASS="button"></A>
|
||||
:
|
||||
<A HREF="{admin_uri}?op=stop-class&printer_name={%printer_name}&is_class=Y">
|
||||
<IMG SRC="/images/button-stop-class.gif" ALT="Ferma classe" CLASS="button"></A>
|
||||
}
|
||||
{printer_is_accepting_jobs=0?
|
||||
<A HREF="{admin_uri}?op=accept-jobs&printer_name={%printer_name}&is_class=Y">
|
||||
<IMG SRC="/images/button-accept-jobs.gif" ALT="Accetta operazioni" CLASS="button"></A>
|
||||
:
|
||||
<A HREF="{admin_uri}?op=reject-jobs&printer_name={%printer_name}&is_class=Y">
|
||||
<IMG SRC="/images/button-reject-jobs.gif" ALT="Scarta operazioni" CLASS="button"></A>
|
||||
}
|
||||
<A HREF="{admin_uri}?op=purge-jobs&printer_name={%printer_name}&is_class=Y">
|
||||
<IMG SRC="/images/button-cancel-all-jobs.gif" ALT="Annulla tutte le operazioni" CLASS="button"></A>
|
||||
{printer_is_shared=0?
|
||||
<A HREF="{admin_uri}?op=set-sharing&printer_name={%printer_name}&shared=1&is_class=Y">
|
||||
<IMG SRC="/images/button-publish-printer.gif" ALT="Pubblica la stampante" CLASS="button"></A>
|
||||
:
|
||||
<A HREF="{admin_uri}?op=set-sharing&printer_name={%printer_name}&shared=0&is_class=Y">
|
||||
<IMG SRC="/images/button-unpublish-printer.gif" ALT="Non pubblicare la stampante" CLASS="button"></A>
|
||||
}
|
||||
<A HREF="{admin_uri}?op=modify-class&printer_name={%printer_name}">
|
||||
<IMG SRC="/images/button-modify-class.gif" ALT="Modifica classe" CLASS="button"></A>
|
||||
<A HREF="{admin_uri}?op=delete-class&printer_name={%printer_name}">
|
||||
<IMG SRC="/images/button-delete-class.gif" ALT="Elimina classe" CLASS="button"></A>
|
||||
<A HREF="{admin_uri}?op=set-as-default&printer_name={%printer_name}&is_class=Y">
|
||||
<IMG SRC="/images/button-set-as-default.gif" ALT="Imposta come predefinita" CLASS="button"></A>
|
||||
<A HREF="{admin_uri}?op=set-allowed-users&printer_name={%printer_name}&is_class=Y">
|
||||
<IMG SRC="/images/button-set-allowed-users.gif" ALT="Imposta utenti autorizzati" CLASS="button"></A>
|
||||
</P>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
}}
|
||||
@@ -1,91 +0,0 @@
|
||||
<SCRIPT TYPE="text/javascript">
|
||||
function reset_config()
|
||||
{
|
||||
document.cups.CUPSDCONF.value =
|
||||
"# Log general information in error_log - change \\"info\\" to \\"debug\\" for\\n" +
|
||||
"# troubleshooting...\\n" +
|
||||
"LogLevel info\\n" +
|
||||
"\\n" +
|
||||
"\\n" +
|
||||
"# Administrator user group...\\n" +
|
||||
"SystemGroup @CUPS_SYSTEM_GROUPS@\\n" +
|
||||
"\\n" +
|
||||
"\\n" +
|
||||
"# Only listen for connections from the local machine.\\n" +
|
||||
"Listen 127.0.0.1:@DEFAULT_IPP_PORT@\\n" +
|
||||
"@CUPS_LISTEN_DOMAINSOCKET@\\n" +
|
||||
"\\n" +
|
||||
"\\n" +
|
||||
"# Show shared printers on the local network.\\n" +
|
||||
"Browsing On\\n" +
|
||||
"BrowseOrder allow,deny\\n" +
|
||||
"BrowseAllow @LOCAL\\n" +
|
||||
"\\n" +
|
||||
"\\n" +
|
||||
"# Authenticate against system accounts by default...\\n" +
|
||||
"DefaultAuthType Basic\\n" +
|
||||
"\\n" +
|
||||
"# Restrict access to the server...\\n" +
|
||||
"<Location />\\n" +
|
||||
" Order allow,deny\\n" +
|
||||
" Allow localhost\\n" +
|
||||
"</Location>\\n" +
|
||||
"\\n" +
|
||||
"# Restrict access to the admin pages...\\n" +
|
||||
"<Location /admin>\\n" +
|
||||
"@ENCRYPTION_REQUIRED@\\n" +
|
||||
" Order allow,deny\\n" +
|
||||
" Allow localhost\\n" +
|
||||
"</Location>\\n" +
|
||||
"\\n" +
|
||||
"# Restrict access to configuration files...\\n" +
|
||||
"<Location /admin/conf>\\n" +
|
||||
" AuthType Basic\\n" +
|
||||
" Require user @SYSTEM\\n" +
|
||||
" Order allow,deny\\n" +
|
||||
" Allow localhost\\n" +
|
||||
"</Location>\\n" +
|
||||
"\\n" +
|
||||
"# Set the default printer/job policies...\\n" +
|
||||
"<Policy default>\\n" +
|
||||
" # Job-related operations must be done by the owner or an adminstrator...\\n" +
|
||||
" <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job>\\n" +
|
||||
" Require user @OWNER @SYSTEM\\n" +
|
||||
" Order deny,allow\\n" +
|
||||
" </Limit>\\n" +
|
||||
"\\n" +
|
||||
" # All administration operations require an adminstrator to authenticate...\\n" +
|
||||
" <Limit Pause-Printer Resume-Printer Set-Printer-Attributes Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Add-Printer CUPS-Delete-Printer CUPS-Add-Class CUPS-Delete-Class CUPS-Accept-Jobs CUPS-Reject-Jobs CUPS-Set-Default>\\n" +
|
||||
" AuthType Basic\\n" +
|
||||
" Require user @SYSTEM\\n" +
|
||||
" Order deny,allow\\n" +
|
||||
" </Limit>\\n" +
|
||||
"\\n" +
|
||||
" # Only the owner or an administrator can cancel or authenticate a job...\\n" +
|
||||
" <Limit Cancel-Job CUPS-Authenticate-Job>\\n" +
|
||||
" Require user @OWNER @SYSTEM\\n" +
|
||||
" Order deny,allow\\n" +
|
||||
" </Limit>\\n" +
|
||||
"\\n" +
|
||||
" <Limit All>\\n" +
|
||||
" Order deny,allow\\n" +
|
||||
" </Limit>\\n" +
|
||||
"</Policy>\\n";
|
||||
}
|
||||
</SCRIPT>
|
||||
|
||||
<H2 CLASS="title">File di configurazione del server</H2>
|
||||
|
||||
<FORM NAME="cups" METHOD="POST" ACTION="/admin/">
|
||||
|
||||
<INPUT TYPE="HIDDEN" NAME="OP" VALUE="config-server">
|
||||
|
||||
<TEXTAREA NAME="CUPSDCONF" COLS="80" ROWS="25">{CUPSDCONF}</TEXTAREA>
|
||||
|
||||
<P><INPUT TYPE="IMAGE" SRC="/images/button-save-changes.gif"
|
||||
ALT="Salva le modifiche"> <A
|
||||
HREF="javascript:reset_config();"><IMG
|
||||
SRC="/images/button-use-default-config.gif" CLASS="button"
|
||||
ALT="Usa il file di configurazione predefinito"></A></P>
|
||||
|
||||
</FORM>
|
||||
@@ -1,3 +0,0 @@
|
||||
<P>Errore:</P>
|
||||
|
||||
<BLOCKQUOTE>Operazione "{op}" sconosciuta!</BLOCKQUOTE>
|
||||
@@ -1,3 +0,0 @@
|
||||
<P>{?message?{message}:Errore:}</P>
|
||||
|
||||
<BLOCKQUOTE>{error}</BLOCKQUOTE>
|
||||
@@ -1,63 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
|
||||
<TITLE>{title} - CUPS @CUPS_VERSION@@CUPS_REVISION@</TITLE>
|
||||
<!-- Prevent caching of CGI content -->
|
||||
<META HTTP-EQUIV="Expires" CONTENT="now">
|
||||
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
|
||||
{refresh_page?<META HTTP-EQUIV="Refresh" CONTENT="{refresh_page}">:}
|
||||
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/cups.css">
|
||||
<LINK REL="SHORTCUT ICON" HREF="/favicon.ico" TYPE="image/x-icon">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<TABLE WIDTH="100%" STYLE="height: 100%;" BORDER="0" CELLSPACING="0" CELLPADDING="0" SUMMARY="{title}">
|
||||
<TR CLASS="HEADER">
|
||||
<TD VALIGN="TOP" WIDTH="15" ROWSPAN="2"><IMG SRC="/images/top-left.gif" WIDTH="15" HEIGHT="80" ALT=""></TD>
|
||||
<TD VALIGN="TOP" WIDTH="55" ROWSPAN="2"><IMG SRC="/images/top-middle.gif" WIDTH="55" HEIGHT="80" ALT=""></TD>
|
||||
<TD WIDTH="100%" HEIGHT="60"><H1>{title}</H1></TD>
|
||||
<TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="15" ROWSPAN="2"><IMG
|
||||
SRC="/images/top-right.gif" WIDTH="15" HEIGHT="15" ALT=""></TD>
|
||||
</TR>
|
||||
<TR CLASS="HEADER"><TD WIDTH="100%" VALIGN="BOTTOM" NOWRAP>
|
||||
|
||||
<A CLASS="unsel" HREF="/"><IMG SRC="/images/tab-left.gif"
|
||||
WIDTH="4" HEIGHT="4" ALIGN="TOP" BORDER="0"
|
||||
ALT=""> Home <IMG
|
||||
SRC="/images/tab-right.gif" WIDTH="4" HEIGHT="4" ALIGN="TOP"
|
||||
BORDER="0" ALT=""></A>
|
||||
|
||||
<A CLASS="{SECTION=admin?:un}sel" HREF="/admin"><IMG
|
||||
SRC="/images/tab-left.gif" WIDTH="4" HEIGHT="4" ALIGN="TOP"
|
||||
BORDER="0" ALT=""> Amministrazione <IMG
|
||||
SRC="/images/tab-right.gif" WIDTH="4" HEIGHT="4" ALIGN="TOP"
|
||||
BORDER="0" ALT=""></A>
|
||||
|
||||
<A CLASS="{SECTION=classes?:un}sel" HREF="/classes/"><IMG
|
||||
SRC="/images/tab-left.gif" WIDTH="4" HEIGHT="4" ALIGN="TOP"
|
||||
BORDER="0" ALT=""> Classi <IMG
|
||||
SRC="/images/tab-right.gif" WIDTH="4" HEIGHT="4" ALIGN="TOP"
|
||||
BORDER="0" ALT=""></A>
|
||||
|
||||
<A CLASS="{SECTION=help?:un}sel" HREF="/help/"><IMG
|
||||
SRC="/images/tab-left.gif" WIDTH="4" HEIGHT="4" ALIGN="TOP"
|
||||
BORDER="0" ALT=""> Documentazione/Aiuto <IMG
|
||||
SRC="/images/tab-right.gif" WIDTH="4" HEIGHT="4" ALIGN="TOP"
|
||||
BORDER="0" ALT=""></A>
|
||||
|
||||
<A CLASS="{SECTION=jobs?:un}sel" HREF="/jobs/"><IMG
|
||||
SRC="/images/tab-left.gif" WIDTH="4" HEIGHT="4" ALIGN="TOP"
|
||||
BORDER="0" ALT=""> Operazioni <IMG
|
||||
SRC="/images/tab-right.gif" WIDTH="4" HEIGHT="4" ALIGN="TOP"
|
||||
BORDER="0" ALT=""></A>
|
||||
|
||||
<A CLASS="{SECTION=printers?:un}sel" HREF="/printers/"><IMG
|
||||
SRC="/images/tab-left.gif" WIDTH="4" HEIGHT="4" ALIGN="TOP"
|
||||
BORDER="0" ALT=""> Stampanti <IMG
|
||||
SRC="/images/tab-right.gif" WIDTH="4" HEIGHT="4" ALIGN="TOP"
|
||||
BORDER="0" ALT=""></A>
|
||||
|
||||
</TD></TR>
|
||||
<TR CLASS="page">
|
||||
<TD WIDTH="15"> </TD>
|
||||
<TD COLSPAN="2" WIDTH="100%" STYLE="height: 100%;" VALIGN="TOP" CLASS="page">
|
||||