diff options
Diffstat (limited to 'scheduler')
-rw-r--r-- | scheduler/Makefile | 4 | ||||
-rw-r--r-- | scheduler/auth.c | 4 | ||||
-rw-r--r-- | scheduler/classes.c | 4 | ||||
-rw-r--r-- | scheduler/client.c | 18 | ||||
-rw-r--r-- | scheduler/client.h | 5 | ||||
-rw-r--r-- | scheduler/conf.c | 26 | ||||
-rw-r--r-- | scheduler/conf.h | 14 | ||||
-rw-r--r-- | scheduler/cups-deviced.c | 4 | ||||
-rw-r--r-- | scheduler/cups-lpd.c | 4 | ||||
-rw-r--r-- | scheduler/cupsd.h | 4 | ||||
-rw-r--r-- | scheduler/cupsfilter.c | 210 | ||||
-rw-r--r-- | scheduler/dirsvc.c | 43 | ||||
-rw-r--r-- | scheduler/dirsvc.h | 6 | ||||
-rw-r--r-- | scheduler/ipp.c | 10 | ||||
-rw-r--r-- | scheduler/job.c | 4 | ||||
-rw-r--r-- | scheduler/job.h | 4 | ||||
-rw-r--r-- | scheduler/listen.c | 4 | ||||
-rw-r--r-- | scheduler/log.c | 4 | ||||
-rw-r--r-- | scheduler/main.c | 4 | ||||
-rw-r--r-- | scheduler/network.c | 4 | ||||
-rw-r--r-- | scheduler/printers.c | 4 | ||||
-rw-r--r-- | scheduler/removefile.c | 4 | ||||
-rw-r--r-- | scheduler/select.c | 4 | ||||
-rw-r--r-- | scheduler/server.c | 4 | ||||
-rw-r--r-- | scheduler/subscriptions.c | 4 | ||||
-rw-r--r-- | scheduler/subscriptions.h | 4 | ||||
-rw-r--r-- | scheduler/sysman.c | 4 | ||||
-rw-r--r-- | scheduler/sysman.h | 4 | ||||
-rw-r--r-- | scheduler/testspeed.c | 4 | ||||
-rw-r--r-- | scheduler/type.c | 4 | ||||
-rw-r--r-- | scheduler/util.h | 4 |
31 files changed, 320 insertions, 104 deletions
diff --git a/scheduler/Makefile b/scheduler/Makefile index e38238f9f..32918149e 100644 --- a/scheduler/Makefile +++ b/scheduler/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile 7558 2008-05-12 23:46:44Z mike $" +# "$Id: Makefile 7875 2008-08-27 22:53:31Z mike $" # # Scheduler Makefile for the Common UNIX Printing System (CUPS). # @@ -543,5 +543,5 @@ include Dependencies # -# End of "$Id: Makefile 7558 2008-05-12 23:46:44Z mike $". +# End of "$Id: Makefile 7875 2008-08-27 22:53:31Z mike $". # diff --git a/scheduler/auth.c b/scheduler/auth.c index 2391b78ee..5d839283c 100644 --- a/scheduler/auth.c +++ b/scheduler/auth.c @@ -1,5 +1,5 @@ /* - * "$Id: auth.c 7673 2008-06-18 22:31:26Z mike $" + * "$Id: auth.c 7830 2008-08-04 20:38:50Z mike $" * * Authorization routines for the Common UNIX Printing System (CUPS). * @@ -2764,5 +2764,5 @@ to64(char *s, /* O - Output string */ /* - * End of "$Id: auth.c 7673 2008-06-18 22:31:26Z mike $". + * End of "$Id: auth.c 7830 2008-08-04 20:38:50Z mike $". */ diff --git a/scheduler/classes.c b/scheduler/classes.c index da828ce74..1d5ecf096 100644 --- a/scheduler/classes.c +++ b/scheduler/classes.c @@ -1,5 +1,5 @@ /* - * "$Id: classes.c 7608 2008-05-21 01:37:21Z mike $" + * "$Id: classes.c 7724 2008-07-14 06:06:06Z mike $" * * Printer class routines for the Common UNIX Printing System (CUPS). * @@ -957,5 +957,5 @@ cupsdUpdateImplicitClasses(void) /* - * End of "$Id: classes.c 7608 2008-05-21 01:37:21Z mike $". + * End of "$Id: classes.c 7724 2008-07-14 06:06:06Z mike $". */ diff --git a/scheduler/client.c b/scheduler/client.c index 3e3845e05..8e9d84bbe 100644 --- a/scheduler/client.c +++ b/scheduler/client.c @@ -1,5 +1,5 @@ /* - * "$Id: client.c 7673 2008-06-18 22:31:26Z mike $" + * "$Id: client.c 7950 2008-09-17 00:21:59Z mike $" * * Client routines for the Common UNIX Printing System (CUPS) scheduler. * @@ -437,14 +437,22 @@ cupsdAcceptClient(cupsd_listener_t *lis)/* I - Listener socket */ #ifdef AF_INET6 if (temp.addr.sa_family == AF_INET6) { - httpAddrLookup(&temp, con->servername, sizeof(con->servername)); + if (HostNameLookups) + httpAddrLookup(&temp, con->servername, sizeof(con->servername)); + else + httpAddrString(&temp, con->servername, sizeof(con->servername)); + con->serverport = ntohs(lis->address.ipv6.sin6_port); } else #endif /* AF_INET6 */ if (temp.addr.sa_family == AF_INET) { - httpAddrLookup(&temp, con->servername, sizeof(con->servername)); + if (HostNameLookups) + httpAddrLookup(&temp, con->servername, sizeof(con->servername)); + else + httpAddrString(&temp, con->servername, sizeof(con->servername)); + con->serverport = ntohs(lis->address.ipv4.sin_port); } else @@ -3080,6 +3088,8 @@ encrypt_client(cupsd_client_t *con) /* I - Client to encrypt */ context = SSL_CTX_new(SSLv23_server_method()); SSL_CTX_set_options(context, SSL_OP_NO_SSLv2); /* Only use SSLv3 or TLS */ + if (SSLOptions & CUPSD_SSL_NOEMPTY) + SSL_CTX_set_options(context, SSL_OP_DONTS_INSERT_EMPTY_FRAGMENTS); SSL_CTX_use_PrivateKey_file(context, ServerKey, SSL_FILETYPE_PEM); SSL_CTX_use_certificate_chain_file(context, ServerCertificate, SSL_FILETYPE_PEM); @@ -4968,5 +4978,5 @@ write_pipe(cupsd_client_t *con) /* I - Client connection */ /* - * End of "$Id: client.c 7673 2008-06-18 22:31:26Z mike $". + * End of "$Id: client.c 7950 2008-09-17 00:21:59Z mike $". */ diff --git a/scheduler/client.h b/scheduler/client.h index c817e7cce..6ea720889 100644 --- a/scheduler/client.h +++ b/scheduler/client.h @@ -1,5 +1,5 @@ /* - * "$Id: client.h 7470 2008-04-18 23:24:24Z mike $" + * "$Id: client.h 7935 2008-09-11 01:54:11Z mike $" * * Client definitions for the Common UNIX Printing System (CUPS) scheduler. * @@ -17,6 +17,7 @@ # include <Security/Authorization.h> #endif /* HAVE_AUTHORIZATION_H */ + /* * HTTP client structure... */ @@ -134,5 +135,5 @@ extern void cupsdWriteClient(cupsd_client_t *con); /* - * End of "$Id: client.h 7470 2008-04-18 23:24:24Z mike $". + * End of "$Id: client.h 7935 2008-09-11 01:54:11Z mike $". */ diff --git a/scheduler/conf.c b/scheduler/conf.c index 1269555a7..e640a2101 100644 --- a/scheduler/conf.c +++ b/scheduler/conf.c @@ -1,5 +1,5 @@ /* - * "$Id: conf.c 7694 2008-06-26 00:23:20Z mike $" + * "$Id: conf.c 7952 2008-09-17 00:56:20Z mike $" * * Configuration routines for the Common UNIX Printing System (CUPS). * @@ -95,6 +95,7 @@ static const cupsd_var_t variables[] = { "BrowseRemoteOptions", &BrowseRemoteOptions, CUPSD_VARTYPE_STRING }, { "BrowseShortNames", &BrowseShortNames, CUPSD_VARTYPE_BOOLEAN }, { "BrowseTimeout", &BrowseTimeout, CUPSD_VARTYPE_INTEGER }, + { "BrowseWebIF", &BrowseWebIF, CUPSD_VARTYPE_BOOLEAN }, { "Browsing", &Browsing, CUPSD_VARTYPE_BOOLEAN }, { "CacheDir", &CacheDir, CUPSD_VARTYPE_STRING }, { "Classification", &Classification, CUPSD_VARTYPE_STRING }, @@ -548,6 +549,7 @@ cupsdReadConfiguration(void) DefaultAuthType = CUPSD_AUTH_BASIC; #ifdef HAVE_SSL DefaultEncryption = HTTP_ENCRYPT_REQUIRED; + SSLOptions = CUPSD_SSL_NONE; #endif /* HAVE_SSL */ DirtyCleanInterval = DEFAULT_KEEPALIVE; JobRetryLimit = 5; @@ -581,6 +583,7 @@ cupsdReadConfiguration(void) BrowseRemoteProtocols = parse_protocols(CUPS_DEFAULT_BROWSE_REMOTE_PROTOCOLS); BrowseShortNames = CUPS_DEFAULT_BROWSE_SHORT_NAMES; BrowseTimeout = DEFAULT_TIMEOUT; + BrowseWebIF = FALSE; Browsing = CUPS_DEFAULT_BROWSING; DefaultShared = CUPS_DEFAULT_DEFAULT_SHARED; @@ -3198,6 +3201,21 @@ read_configuration(cups_file_t *fp) /* I - File to read from */ "Missing value for SetEnv directive on line %d.", linenum); } + else if (!strcasecmp(line, "SSLOptions")) + { + /* + * SSLOptions options + */ + + if (!value || !strcasecmp(value, "none")) + SSLOptions = CUPSD_SSL_NONE; + else if (!strcasecmp(value, "noemptyfragments")) + SSLOptions = CUPSD_SSL_NOEMPTY; + else + cupsdLogMessage(CUPSD_LOG_ERROR, + "Unknown value \"%s\" for SSLOptions directive on " + "line %d.", value, linenum); + } else { /* @@ -3354,6 +3372,8 @@ read_location(cups_file_t *fp, /* I - Configuration file */ cupsdLogMessage(CUPSD_LOG_ERROR, "Syntax error on line %d.", linenum); if (FatalErrors & CUPSD_FATAL_CONFIG) return (0); + else + continue; } if ((loc = cupsdCopyLocation(&parent)) == NULL) @@ -3494,6 +3514,8 @@ read_policy(cups_file_t *fp, /* I - Configuration file */ cupsdLogMessage(CUPSD_LOG_ERROR, "Syntax error on line %d.", linenum); if (FatalErrors & CUPSD_FATAL_CONFIG) return (0); + else + continue; } /* @@ -3595,5 +3617,5 @@ read_policy(cups_file_t *fp, /* I - Configuration file */ /* - * End of "$Id: conf.c 7694 2008-06-26 00:23:20Z mike $". + * End of "$Id: conf.c 7952 2008-09-17 00:56:20Z mike $". */ diff --git a/scheduler/conf.h b/scheduler/conf.h index e80a24ea9..e53f13f44 100644 --- a/scheduler/conf.h +++ b/scheduler/conf.h @@ -1,5 +1,5 @@ /* - * "$Id: conf.h 7674 2008-06-18 23:18:32Z mike $" + * "$Id: conf.h 7935 2008-09-11 01:54:11Z mike $" * * Configuration file definitions for the Common UNIX Printing System (CUPS) * scheduler. @@ -67,6 +67,14 @@ typedef enum /* + * SSL options (bits)... + */ + +#define CUPSD_SSL_NONE 0 /* No special options */ +#define CUPSD_SSL_NOEMPTY 1 /* Do not insert empty fragments */ + + +/* * Globals... */ @@ -217,6 +225,8 @@ VAR char *ServerCertificate VALUE(NULL); VAR char *ServerKey VALUE(NULL); /* Server key file */ # endif /* HAVE_LIBSSL || HAVE_GNUTLS */ +VAR int SSLOptions VALUE(CUPSD_SSL_NONE); + /* SSL/TLS options */ #endif /* HAVE_SSL */ #ifdef HAVE_LAUNCHD @@ -268,5 +278,5 @@ extern int cupsdWriteErrorLog(int level, const char *message); /* - * End of "$Id: conf.h 7674 2008-06-18 23:18:32Z mike $". + * End of "$Id: conf.h 7935 2008-09-11 01:54:11Z mike $". */ diff --git a/scheduler/cups-deviced.c b/scheduler/cups-deviced.c index 8b634a27c..d35940c07 100644 --- a/scheduler/cups-deviced.c +++ b/scheduler/cups-deviced.c @@ -1,5 +1,5 @@ /* - * "$Id: cups-deviced.c 7624 2008-06-09 15:55:04Z mike $" + * "$Id: cups-deviced.c 7816 2008-07-30 20:53:31Z mike $" * * Device scanning mini-daemon for the Common UNIX Printing System (CUPS). * @@ -828,5 +828,5 @@ start_backend(const char *name, /* I - Backend to run */ /* - * End of "$Id: cups-deviced.c 7624 2008-06-09 15:55:04Z mike $". + * End of "$Id: cups-deviced.c 7816 2008-07-30 20:53:31Z mike $". */ diff --git a/scheduler/cups-lpd.c b/scheduler/cups-lpd.c index d79c69202..756d8fedb 100644 --- a/scheduler/cups-lpd.c +++ b/scheduler/cups-lpd.c @@ -1,5 +1,5 @@ /* - * "$Id: cups-lpd.c 7221 2008-01-16 22:20:08Z mike $" + * "$Id: cups-lpd.c 7899 2008-09-03 12:57:17Z mike $" * * Line Printer Daemon interface for the Common UNIX Printing System (CUPS). * @@ -1731,5 +1731,5 @@ smart_gets(char *s, /* I - Pointer to line buffer */ /* - * End of "$Id: cups-lpd.c 7221 2008-01-16 22:20:08Z mike $". + * End of "$Id: cups-lpd.c 7899 2008-09-03 12:57:17Z mike $". */ diff --git a/scheduler/cupsd.h b/scheduler/cupsd.h index 5b1a4d645..4c26cd8d9 100644 --- a/scheduler/cupsd.h +++ b/scheduler/cupsd.h @@ -1,5 +1,5 @@ /* - * "$Id: cupsd.h 7317 2008-02-15 22:29:27Z mike $" + * "$Id: cupsd.h 7928 2008-09-10 22:14:22Z mike $" * * Main header file for the Common UNIX Printing System (CUPS) scheduler. * @@ -234,5 +234,5 @@ extern void cupsdStopSelect(void); extern int cupsdRemoveFile(const char *filename); /* - * End of "$Id: cupsd.h 7317 2008-02-15 22:29:27Z mike $". + * End of "$Id: cupsd.h 7928 2008-09-10 22:14:22Z mike $". */ diff --git a/scheduler/cupsfilter.c b/scheduler/cupsfilter.c index d387ecf7c..6974e47c6 100644 --- a/scheduler/cupsfilter.c +++ b/scheduler/cupsfilter.c @@ -1,5 +1,5 @@ /* - * "$Id: cupsfilter.c 7694 2008-06-26 00:23:20Z mike $" + * "$Id: cupsfilter.c 7952 2008-09-17 00:56:20Z mike $" * * CUPS filtering program for the Common UNIX Printing System (CUPS). * @@ -75,21 +75,28 @@ static char TempFile[1024] = ""; * Local functions... */ -static int compare_pids(mime_filter_t *a, mime_filter_t *b); -static char *escape_options(int num_options, cups_option_t *options); -static int exec_filter(const char *filter, char **argv, char **envp, - int infd, int outfd); -static int exec_filters(cups_array_t *filters, const char *infile, - const char *outfile, const char *ppdfile, - const char *printer, const char *user, - const char *title, int num_options, - cups_option_t *options); -static void get_job_file(const char *job); -static int open_pipe(int *fds); -static int read_cupsd_conf(const char *filename); -static void set_string(char **s, const char *val); -static void sighandler(int sig); -static void usage(const char *command, const char *opt); +static void add_printer_filter(const char *command, mime_t *mime, + mime_type_t *printer_type, + const char *filter); +static mime_type_t *add_printer_filters(const char *command, + mime_t *mime, const char *printer, + const char *ppdfile, + mime_type_t **prefilter_type); +static int compare_pids(mime_filter_t *a, mime_filter_t *b); +static char *escape_options(int num_options, cups_option_t *options); +static int exec_filter(const char *filter, char **argv, + char **envp, int infd, int outfd); +static int exec_filters(cups_array_t *filters, const char *infile, + const char *outfile, const char *ppdfile, + const char *printer, const char *user, + const char *title, int num_options, + cups_option_t *options); +static void get_job_file(const char *job); +static int open_pipe(int *fds); +static int read_cupsd_conf(const char *filename); +static void set_string(char **s, const char *val); +static void sighandler(int sig); +static void usage(const char *command, const char *opt); /* @@ -102,7 +109,10 @@ main(int argc, /* I - Number of command-line args */ { int i; /* Looping vars */ const char *command, /* Command name */ - *opt; /* Current option */ + *opt, /* Current option */ + *printer; /* Printer name */ + mime_type_t *printer_type, /* Printer MIME type */ + *prefilter_type; /* Printer prefilter MIME type */ char *srctype, /* Source type */ *dsttype, /* Destination type */ super[MIME_MAX_SUPER], /* Super-type name */ @@ -137,6 +147,7 @@ main(int argc, /* I - Number of command-line args */ else command = argv[0]; + printer = !strcmp(command, "convert") ? "tofile" : "cupsfilter"; mime = NULL; srctype = NULL; compression = 0; @@ -369,6 +380,9 @@ main(int argc, /* I - Number of command-line args */ return (1); } + printer_type = add_printer_filters(command, mime, printer, ppdfile, + &prefilter_type); + /* * Get the source and destination types... */ @@ -393,7 +407,9 @@ main(int argc, /* I - Number of command-line args */ } sscanf(dsttype, "%15[^/]/%255s", super, type); - if ((dst = mimeType(mime, super, type)) == NULL) + if (!strcasecmp(super, "printer")) + dst = printer_type; + else if ((dst = mimeType(mime, super, type)) == NULL) { _cupsLangPrintf(stderr, _("%s: Unknown destination MIME type %s/%s!\n"), @@ -424,13 +440,38 @@ main(int argc, /* I - Number of command-line args */ else if (compression) cupsArrayInsert(filters, &GZIPFilter); + if (prefilter_type) + { + /* + * Add pre-filters... + */ + + mime_filter_t *filter, /* Current filter */ + *prefilter; /* Current pre-filter */ + cups_array_t *prefilters = cupsArrayNew(NULL, NULL); + /* New filters array */ + + + for (filter = (mime_filter_t *)cupsArrayFirst(filters); + filter; + filter = (mime_filter_t *)cupsArrayNext(filters)) + { + if ((prefilter = mimeFilterLookup(mime, filter->src, prefilter_type))) + cupsArrayAdd(prefilters, prefilter); + + cupsArrayAdd(prefilters, filter); + } + + cupsArrayDelete(filters); + filters = prefilters; + } + /* * Do it! */ - status = exec_filters(filters, infile, outfile, ppdfile, - !strcmp(command, "convert") ? "tofile" : "cupsfilter", - user, title, num_options, options); + status = exec_filters(filters, infile, outfile, ppdfile, printer, user, + title, num_options, options); /* * Remove files as needed, then exit... @@ -450,6 +491,131 @@ main(int argc, /* I - Number of command-line args */ /* + * 'add_printer_filter()' - Add a single filters from a PPD file. + */ + +static void +add_printer_filter( + const char *command, /* I - Command name */ + mime_t *mime, /* I - MIME database */ + mime_type_t *filtertype, /* I - Printer or prefilter MIME type */ + const char *filter) /* I - Filter to add */ +{ + char super[MIME_MAX_SUPER], /* Super-type for filter */ + type[MIME_MAX_TYPE], /* Type for filter */ + program[1024]; /* Program/filter name */ + int cost; /* Cost of filter */ + mime_type_t *temptype; /* MIME type looping var */ + char filename[1024]; /* Full filter filename */ + + + /* + * Parse the filter string; it should be in the following format: + * + * super/type cost program + */ + + if (sscanf(filter, "%15[^/]/%31s%d%*[ \t]%1023[^\n]", super, type, &cost, + program) != 4) + { + _cupsLangPrintf(stderr, _("%s: Invalid filter string \"%s\"\n"), command, + filter); + return; + } + + /* + * See if the filter program exists; if not, stop the printer and flag + * the error! + */ + + if (strcmp(program, "-")) + { + if (program[0] == '/') + strlcpy(filename, program, sizeof(filename)); + else + snprintf(filename, sizeof(filename), "%s/filter/%s", ServerBin, program); + + if (access(filename, X_OK)) + { + _cupsLangPrintf(stderr, _("%s: Filter \"%s\" not available: %s\n"), + command, program, strerror(errno)); + return; + } + } + + /* + * Add the filter to the MIME database, supporting wildcards as needed... + */ + + for (temptype = mimeFirstType(mime); + temptype; + temptype = mimeNextType(mime)) + if (((super[0] == '*' && strcasecmp(temptype->super, "printer")) || + !strcasecmp(temptype->super, super)) && + (type[0] == '*' || !strcasecmp(temptype->type, type))) + mimeAddFilter(mime, temptype, filtertype, cost, program); +} + + +/* + * 'add_printer_filters()' - Add filters from a PPD file. + */ + +static mime_type_t * /* O - Printer type or NULL on error */ +add_printer_filters( + const char *command, /* I - Command name */ + mime_t *mime, /* I - MIME database */ + const char *printer, /* I - Printer name */ + const char *ppdfile, /* I - PPD file */ + mime_type_t **prefilter_type) /* O - Prefilter type */ +{ + int i; /* Looping var */ + mime_type_t *printer_type; /* Printer MIME type */ + ppd_file_t *ppd; /* PPD file data */ + ppd_attr_t *ppdattr; /* Current prefilter */ + + + if ((ppd = ppdOpenFile(ppdfile)) == NULL) + { + ppd_status_t status; /* PPD load status */ + + status = ppdLastError(&i); + _cupsLangPrintf(stderr, _("%s: Unable to open PPD file: %s on line %d\n"), + command, ppdErrorString(status), i); + return (NULL); + } + + printer_type = mimeAddType(mime, "printer", printer); + + if (ppd->num_filters > 0) + { + for (i = 0; i < ppd->num_filters; i ++) + add_printer_filter(command, mime, printer_type, ppd->filters[i]); + } + else + { + add_printer_filter(command, mime, printer_type, + "application/vnd.cups-command 0 commandtops"); + add_printer_filter(command, mime, printer_type, + "application/vnd.cups-postscript 0 -"); + } + + if ((ppdattr = ppdFindAttr(ppd, "cupsPreFilter", NULL)) != NULL) + { + *prefilter_type = mimeAddType(mime, "prefilter", printer); + + for (; ppdattr; ppdattr = ppdFindNextAttr(ppd, "cupsPreFilter", NULL)) + if (ppdattr->value) + add_printer_filter(command, mime, *prefilter_type, ppdattr->value); + } + else + *prefilter_type = NULL; + + return (printer_type); +} + + +/* * 'compare_pids()' - Compare two filter PIDs... */ @@ -1144,5 +1310,5 @@ usage(const char *command, /* I - Command name */ /* - * End of "$Id: cupsfilter.c 7694 2008-06-26 00:23:20Z mike $". + * End of "$Id: cupsfilter.c 7952 2008-09-17 00:56:20Z mike $". */ diff --git a/scheduler/dirsvc.c b/scheduler/dirsvc.c index 82ed30515..172df5778 100644 --- a/scheduler/dirsvc.c +++ b/scheduler/dirsvc.c @@ -1,5 +1,5 @@ /* - * "$Id: dirsvc.c 7676 2008-06-18 23:42:37Z mike $" + * "$Id: dirsvc.c 7933 2008-09-11 00:44:58Z mike $" * * Directory services routines for the Common UNIX Printing System (CUPS). * @@ -1945,26 +1945,29 @@ cupsdUpdateDNSSDName(void) #endif /* HAVE_COREFOUNDATION_H */ /* - * Then (re)register the web interface... + * Then (re)register the web interface if enabled... */ - if (DNSSDName) - snprintf(webif, sizeof(webif), "CUPS @ %s", DNSSDName); - else - strlcpy(webif, "CUPS Web Interface", sizeof(webif)); - - if (WebIFRef) - DNSServiceRefDeallocate(WebIFRef); - - WebIFRef = DNSSDRef; - if ((error = DNSServiceRegister(&WebIFRef, - kDNSServiceFlagsShareConnection, - 0, webif, "_http._tcp", NULL, - NULL, htons(DNSSDPort), 7, - "\006path=/", dnssdRegisterCallback, - NULL)) != kDNSServiceErr_NoError) - cupsdLogMessage(CUPSD_LOG_ERROR, - "DNS-SD web interface registration failed: %d", error); + if (BrowseWebIF) + { + if (DNSSDName) + snprintf(webif, sizeof(webif), "CUPS @ %s", DNSSDName); + else + strlcpy(webif, "CUPS Web Interface", sizeof(webif)); + + if (WebIFRef) + DNSServiceRefDeallocate(WebIFRef); + + WebIFRef = DNSSDRef; + if ((error = DNSServiceRegister(&WebIFRef, + kDNSServiceFlagsShareConnection, + 0, webif, "_http._tcp", NULL, + NULL, htons(DNSSDPort), 7, + "\006path=/", dnssdRegisterCallback, + NULL)) != kDNSServiceErr_NoError) + cupsdLogMessage(CUPSD_LOG_ERROR, + "DNS-SD web interface registration failed: %d", error); + } } #endif /* HAVE_DNSSD */ @@ -5268,5 +5271,5 @@ update_smb(int onoff) /* I - 1 = turn on, 0 = turn off */ /* - * End of "$Id: dirsvc.c 7676 2008-06-18 23:42:37Z mike $". + * End of "$Id: dirsvc.c 7933 2008-09-11 00:44:58Z mike $". */ diff --git a/scheduler/dirsvc.h b/scheduler/dirsvc.h index 143a1ebac..8dfc2d585 100644 --- a/scheduler/dirsvc.h +++ b/scheduler/dirsvc.h @@ -1,5 +1,5 @@ /* - * "$Id: dirsvc.h 7676 2008-06-18 23:42:37Z mike $" + * "$Id: dirsvc.h 7933 2008-09-11 00:44:58Z mike $" * * Directory services definitions for the Common UNIX Printing System * (CUPS) scheduler. @@ -85,6 +85,8 @@ typedef struct VAR int Browsing VALUE(TRUE), /* Whether or not browsing is enabled */ + BrowseWebIF VALUE(FALSE), + /* Whether the web interface is advertised */ BrowseLocalProtocols VALUE(BROWSE_ALL), /* Protocols to support for local printers */ @@ -202,5 +204,5 @@ extern void cupsdUpdateSLPBrowse(void); /* - * End of "$Id: dirsvc.h 7676 2008-06-18 23:42:37Z mike $". + * End of "$Id: dirsvc.h 7933 2008-09-11 00:44:58Z mike $". */ diff --git a/scheduler/ipp.c b/scheduler/ipp.c index 075ee2407..936a43d1f 100644 --- a/scheduler/ipp.c +++ b/scheduler/ipp.c @@ -1,5 +1,5 @@ /* - * "$Id: ipp.c 7682 2008-06-21 00:06:02Z mike $" + * "$Id: ipp.c 7944 2008-09-16 22:32:42Z mike $" * * IPP routines for the Common UNIX Printing System (CUPS) scheduler. * @@ -7476,8 +7476,8 @@ get_printers(cupsd_client_t *con, /* I - Client connection */ { if ((!type || (printer->type & CUPS_PRINTER_CLASS) == type) && (printer->type & printer_mask) == printer_type && - (!location || !printer->location || - !strcasecmp(printer->location, location))) + (!location || + (printer->location && !strcasecmp(printer->location, location)))) { /* * If HideImplicitMembers is enabled, see if this printer or class @@ -8460,6 +8460,8 @@ print_job(cupsd_client_t *con, /* I - Client connection */ "File of type %s/%s queued by \"%s\".", filetype->super, filetype->type, job->username); cupsdLogJob(job, CUPSD_LOG_DEBUG, "hold_until=%d", (int)job->hold_until); + cupsdLogJob(job, CUPSD_LOG_INFO, "Queued on \"%s\" by \"%s\".", + job->dest, job->username); /* * Start the job if possible... @@ -11017,5 +11019,5 @@ validate_user(cupsd_job_t *job, /* I - Job */ /* - * End of "$Id: ipp.c 7682 2008-06-21 00:06:02Z mike $". + * End of "$Id: ipp.c 7944 2008-09-16 22:32:42Z mike $". */ diff --git a/scheduler/job.c b/scheduler/job.c index 1fa6352aa..8f453d980 100644 --- a/scheduler/job.c +++ b/scheduler/job.c @@ -1,5 +1,5 @@ /* - * "$Id: job.c 7682 2008-06-21 00:06:02Z mike $" + * "$Id: job.c 7902 2008-09-03 14:20:17Z mike $" * * Job management routines for the Common UNIX Printing System (CUPS). * @@ -3964,5 +3964,5 @@ update_job_attrs(cupsd_job_t *job, /* I - Job to update */ /* - * End of "$Id: job.c 7682 2008-06-21 00:06:02Z mike $". + * End of "$Id: job.c 7902 2008-09-03 14:20:17Z mike $". */ diff --git a/scheduler/job.h b/scheduler/job.h index d382f6b2f..931667879 100644 --- a/scheduler/job.h +++ b/scheduler/job.h @@ -1,5 +1,5 @@ /* - * "$Id: job.h 7468 2008-04-18 18:31:59Z mike $" + * "$Id: job.h 7883 2008-08-28 20:38:13Z mike $" * * Print job definitions for the Common UNIX Printing System (CUPS) scheduler. * @@ -132,5 +132,5 @@ extern void cupsdUnloadCompletedJobs(void); /* - * End of "$Id: job.h 7468 2008-04-18 18:31:59Z mike $". + * End of "$Id: job.h 7883 2008-08-28 20:38:13Z mike $". */ diff --git a/scheduler/listen.c b/scheduler/listen.c index 69fb7fc3c..2ab8798d8 100644 --- a/scheduler/listen.c +++ b/scheduler/listen.c @@ -1,5 +1,5 @@ /* - * "$Id: listen.c 7673 2008-06-18 22:31:26Z mike $" + * "$Id: listen.c 7918 2008-09-08 22:03:01Z mike $" * * Server listening routines for the Common UNIX Printing System (CUPS) * scheduler. @@ -455,5 +455,5 @@ cupsdStopListening(void) /* - * End of "$Id: listen.c 7673 2008-06-18 22:31:26Z mike $". + * End of "$Id: listen.c 7918 2008-09-08 22:03:01Z mike $". */ diff --git a/scheduler/log.c b/scheduler/log.c index a0123bf8a..19cb0cc86 100644 --- a/scheduler/log.c +++ b/scheduler/log.c @@ -1,5 +1,5 @@ /* - * "$Id: log.c 7699 2008-06-27 20:44:23Z mike $" + * "$Id: log.c 7918 2008-09-08 22:03:01Z mike $" * * Log file routines for the Common UNIX Printing System (CUPS). * @@ -956,5 +956,5 @@ format_log_line(const char *message, /* I - Printf-style format string */ /* - * End of "$Id: log.c 7699 2008-06-27 20:44:23Z mike $". + * End of "$Id: log.c 7918 2008-09-08 22:03:01Z mike $". */ diff --git a/scheduler/main.c b/scheduler/main.c index be77cb0ab..d38045e49 100644 --- a/scheduler/main.c +++ b/scheduler/main.c @@ -1,5 +1,5 @@ /* - * "$Id: main.c 7681 2008-06-20 21:06:02Z mike $" + * "$Id: main.c 7925 2008-09-10 17:47:26Z mike $" * * Scheduler main loop for the Common UNIX Printing System (CUPS). * @@ -2055,5 +2055,5 @@ usage(int status) /* O - Exit status */ /* - * End of "$Id: main.c 7681 2008-06-20 21:06:02Z mike $". + * End of "$Id: main.c 7925 2008-09-10 17:47:26Z mike $". */ diff --git a/scheduler/network.c b/scheduler/network.c index f93330b55..6e15655af 100644 --- a/scheduler/network.c +++ b/scheduler/network.c @@ -1,5 +1,5 @@ /* - * "$Id: network.c 6649 2007-07-11 21:46:42Z mike $" + * "$Id: network.c 7861 2008-08-26 03:15:14Z mike $" * * Network interface functions for the Common UNIX Printing System * (CUPS) scheduler. @@ -310,5 +310,5 @@ compare_netif(cupsd_netif_t *a, /* I - First network interface */ /* - * End of "$Id: network.c 6649 2007-07-11 21:46:42Z mike $". + * End of "$Id: network.c 7861 2008-08-26 03:15:14Z mike $". */ diff --git a/scheduler/printers.c b/scheduler/printers.c index 618defd99..25d820f8a 100644 --- a/scheduler/printers.c +++ b/scheduler/printers.c @@ -1,5 +1,5 @@ /* - * "$Id: printers.c 7677 2008-06-19 23:22:19Z mike $" + * "$Id: printers.c 7879 2008-08-28 00:08:56Z mike $" * * Printer routines for the Common UNIX Printing System (CUPS). * @@ -4367,5 +4367,5 @@ write_irix_state(cupsd_printer_t *p) /* I - Printer to update */ /* - * End of "$Id: printers.c 7677 2008-06-19 23:22:19Z mike $". + * End of "$Id: printers.c 7879 2008-08-28 00:08:56Z mike $". */ diff --git a/scheduler/removefile.c b/scheduler/removefile.c index 5cf16bfda..213d795ea 100644 --- a/scheduler/removefile.c +++ b/scheduler/removefile.c @@ -1,5 +1,5 @@ /* - * "$Id$" + * "$Id: removefile.c 7720 2008-07-11 22:46:21Z mike $" * * "Secure" file removal function for the Common UNIX Printing System (CUPS). * @@ -224,5 +224,5 @@ testmain(void) /* - * End of "$Id$". + * End of "$Id: removefile.c 7720 2008-07-11 22:46:21Z mike $". */ diff --git a/scheduler/select.c b/scheduler/select.c index 20c9547fd..05512ca71 100644 --- a/scheduler/select.c +++ b/scheduler/select.c @@ -1,5 +1,5 @@ /* - * "$Id: select.c 7093 2007-11-30 19:09:36Z mike $" + * "$Id: select.c 7720 2008-07-11 22:46:21Z mike $" * * Select abstraction functions for the Common UNIX Printing System (CUPS). * @@ -1024,5 +1024,5 @@ find_fd(int fd) /* I - File descriptor */ /* - * End of "$Id: select.c 7093 2007-11-30 19:09:36Z mike $". + * End of "$Id: select.c 7720 2008-07-11 22:46:21Z mike $". */ diff --git a/scheduler/server.c b/scheduler/server.c index 650b3b16d..a8b851b28 100644 --- a/scheduler/server.c +++ b/scheduler/server.c @@ -1,5 +1,5 @@ /* - * "$Id: server.c 7468 2008-04-18 18:31:59Z mike $" + * "$Id: server.c 7927 2008-09-10 22:05:29Z mike $" * * Server start/stop routines for the Common UNIX Printing System (CUPS). * @@ -215,5 +215,5 @@ cupsdStopServer(void) /* - * End of "$Id: server.c 7468 2008-04-18 18:31:59Z mike $". + * End of "$Id: server.c 7927 2008-09-10 22:05:29Z mike $". */ diff --git a/scheduler/subscriptions.c b/scheduler/subscriptions.c index a0e2dc602..fa7fb4891 100644 --- a/scheduler/subscriptions.c +++ b/scheduler/subscriptions.c @@ -1,5 +1,5 @@ /* - * "$Id: subscriptions.c 7673 2008-06-18 22:31:26Z mike $" + * "$Id: subscriptions.c 7824 2008-08-01 21:11:55Z mike $" * * Subscription routines for the Common UNIX Printing System (CUPS) scheduler. * @@ -1623,5 +1623,5 @@ cupsd_update_notifier(void) /* - * End of "$Id: subscriptions.c 7673 2008-06-18 22:31:26Z mike $". + * End of "$Id: subscriptions.c 7824 2008-08-01 21:11:55Z mike $". */ diff --git a/scheduler/subscriptions.h b/scheduler/subscriptions.h index 15e11a445..b807ac215 100644 --- a/scheduler/subscriptions.h +++ b/scheduler/subscriptions.h @@ -1,5 +1,5 @@ /* - * "$Id: subscriptions.h 7253 2008-01-23 22:18:15Z mike $" + * "$Id: subscriptions.h 7824 2008-08-01 21:11:55Z mike $" * * Subscription definitions for the Common UNIX Printing System (CUPS) scheduler. * @@ -163,5 +163,5 @@ extern void cupsdStopAllNotifiers(void); /* - * End of "$Id: subscriptions.h 7253 2008-01-23 22:18:15Z mike $". + * End of "$Id: subscriptions.h 7824 2008-08-01 21:11:55Z mike $". */ diff --git a/scheduler/sysman.c b/scheduler/sysman.c index 8933d083e..25ffc6f3f 100644 --- a/scheduler/sysman.c +++ b/scheduler/sysman.c @@ -1,5 +1,5 @@ /* - * "$Id: sysman.c 7676 2008-06-18 23:42:37Z mike $" + * "$Id: sysman.c 7928 2008-09-10 22:14:22Z mike $" * * System management definitions for the Common UNIX Printing System (CUPS). * @@ -858,5 +858,5 @@ sysUpdate(void) /* - * End of "$Id: sysman.c 7676 2008-06-18 23:42:37Z mike $". + * End of "$Id: sysman.c 7928 2008-09-10 22:14:22Z mike $". */ diff --git a/scheduler/sysman.h b/scheduler/sysman.h index 97b9dd2c3..517d143cb 100644 --- a/scheduler/sysman.h +++ b/scheduler/sysman.h @@ -1,5 +1,5 @@ /* - * "$Id: sysman.h 7676 2008-06-18 23:42:37Z mike $" + * "$Id: sysman.h 7928 2008-09-10 22:14:22Z mike $" * * System management definitions for the Common UNIX Printing System (CUPS). * @@ -56,5 +56,5 @@ extern void cupsdStopSystemMonitor(void); /* - * End of "$Id: sysman.h 7676 2008-06-18 23:42:37Z mike $". + * End of "$Id: sysman.h 7928 2008-09-10 22:14:22Z mike $". */ diff --git a/scheduler/testspeed.c b/scheduler/testspeed.c index c9fe4ed68..0bf0300ed 100644 --- a/scheduler/testspeed.c +++ b/scheduler/testspeed.c @@ -1,5 +1,5 @@ /* - * "$Id: testspeed.c 7688 2008-06-24 04:34:52Z mike $" + * "$Id: testspeed.c 7727 2008-07-14 18:02:21Z mike $" * * Scheduler speed test for the Common UNIX Printing System (CUPS). * @@ -362,5 +362,5 @@ usage(void) /* - * End of "$Id: testspeed.c 7688 2008-06-24 04:34:52Z mike $". + * End of "$Id: testspeed.c 7727 2008-07-14 18:02:21Z mike $". */ diff --git a/scheduler/type.c b/scheduler/type.c index e93720d07..23c1e5b29 100644 --- a/scheduler/type.c +++ b/scheduler/type.c @@ -1,5 +1,5 @@ /* - * "$Id: type.c 7694 2008-06-26 00:23:20Z mike $" + * "$Id: type.c 7720 2008-07-11 22:46:21Z mike $" * * MIME typing routines for the Common UNIX Printing System (CUPS). * @@ -1160,5 +1160,5 @@ patmatch(const char *s, /* I - String to match against */ /* - * End of "$Id: type.c 7694 2008-06-26 00:23:20Z mike $". + * End of "$Id: type.c 7720 2008-07-11 22:46:21Z mike $". */ diff --git a/scheduler/util.h b/scheduler/util.h index 071ffddf3..ae7ba7bb2 100644 --- a/scheduler/util.h +++ b/scheduler/util.h @@ -1,5 +1,5 @@ /* - * "$Id: util.h 7621 2008-06-06 18:55:35Z mike $" + * "$Id: util.h 7711 2008-07-02 04:39:27Z mike $" * * Mini-daemon utility definitions for the Common UNIX Printing System (CUPS). * @@ -70,5 +70,5 @@ extern void cupsdSendIPPTrailer(void); #endif /* !_CUPSD_UTIL_H_ */ /* - * End of "$Id: util.h 7621 2008-06-06 18:55:35Z mike $". + * End of "$Id: util.h 7711 2008-07-02 04:39:27Z mike $". */ |