Comparar commits
1 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| d63b19a5da |
+1
-210
@@ -1,215 +1,6 @@
|
||||
CHANGES.txt - 10/16/2003
|
||||
CHANGES.txt - 05/27/2003
|
||||
------------------------
|
||||
|
||||
CHANGES IN CUPS V1.1.20rc4
|
||||
|
||||
- The scheduler did not move the incoming job attributes
|
||||
in the operation group to the job group (STR #335)
|
||||
- The cupsDoFileRequest() function did not check for an
|
||||
early HTTP response while sending the file (STR #314)
|
||||
- The web interfaces did not quote #, ?, or . in printer
|
||||
names, which caused some problems with the generated
|
||||
URLs (STR #320)
|
||||
- CUPS couldn't be completely compiled with the -dDEBUG
|
||||
option (STR #331)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.1.20rc3
|
||||
|
||||
- More SLP changes (STR #259)
|
||||
- Revamped the child signal handling code to completely
|
||||
avoid deadlock issues on Solaris (STR #325)
|
||||
- The lpadmin command displayed an incorrect error
|
||||
message when the "-u" option was provided with no
|
||||
arguments (STR #313)
|
||||
- The web admin interface did not display an error
|
||||
message if the PPD file could not be loaded (STR #308)
|
||||
- The ppdEmit() functions did not use the correct
|
||||
orientation value position for custom page sizes (STR
|
||||
#292)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.1.20rc2
|
||||
|
||||
- The serial backend set the IXANY option on the port
|
||||
for XON/XOFF flow control; this caused problems with
|
||||
printers that returned status info but were not ready
|
||||
for more print data (STR #287)
|
||||
- The scheduler didn't support scripted index files
|
||||
(index.php, index.pl, etc. - STR #290)
|
||||
- The scheduler did not correctly localize script files
|
||||
with "GET" variables (STR #268)
|
||||
- Changes in job classification are now logged (STR
|
||||
#289)
|
||||
- Fixed a few more SLP-related bugs (STR #259)
|
||||
- Updated the user/group configure checks for MacOS X
|
||||
10.3 (STR #270)
|
||||
- Fixed an offset bug in the PDF filter (STR #284)
|
||||
- The cupsDoRequest() and cupsDoFileRequest() functions
|
||||
did not map several HTTP status codes to their IPP
|
||||
counterparts. This made detecting certain conditions
|
||||
very difficult (STR #277)
|
||||
- Config, spool, and status files are now owned by the
|
||||
scheduler user (usually root) with read permission for
|
||||
the filter group (STR #283)
|
||||
- The HP-GL/2 filter did not support the SI command,
|
||||
some values for the AD and SD commands, and did not
|
||||
rotate labels properly via the DI command (STR #282)
|
||||
- The fax support did not update/set the job-hold-until
|
||||
attribute when a fax job fails (STR #269)
|
||||
- The cupsLangGet() function didn't support locales of
|
||||
the form "ll.charset" (STR #271)
|
||||
- The scheduler did not use the charset when getting the
|
||||
language localization for a request; this caused extra
|
||||
disk IO for every request (STR #271)
|
||||
- The scheduler did not support requests with more than
|
||||
one language specified (STR #267)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.1.20rc1
|
||||
|
||||
- The scheduler now waits up to 60 seconds before
|
||||
restarting to allow active jobs to complete printing
|
||||
and pending requests to be processed (STR #226)
|
||||
- The web interface did not work on systems where time_t
|
||||
is 64 bits (STR #262)
|
||||
- Added backend tweeks and content-length check from Red
|
||||
Hat (STR #253)
|
||||
- The USB backend now uses the 8255 constants instead of
|
||||
the standard constants when reporting printer status
|
||||
bits on Linux (STR #254)
|
||||
- Added new cupsDoAuthentication(), cupsGetFd(),
|
||||
cupsGetFile(), cupsPutFd(), and cupsPutFile() functions
|
||||
to the CUPS API (STR #112)
|
||||
- The PDF filter always scaled and offset pages; this
|
||||
caused problems under MacOS X, so now the "fitplot"
|
||||
option controls whether PDF files are scaled to fit
|
||||
within the printable area of the page (STR #250)
|
||||
- The LPD backend did not support the port number in a
|
||||
URI (STR #247)
|
||||
- Some filters didn't properly support boolean options
|
||||
(STR #249)
|
||||
- Landscape PDF files were not always offset by the
|
||||
correct amount when rotating (STR #243)
|
||||
- The scheduler could hang in a call to localtime() when
|
||||
logging messages from the signal handler (STR #242)
|
||||
- The PDF filter no longer prints form widgets; this
|
||||
duplicates the behavior of Acrobat Reader (STR #241)
|
||||
- cupsGetPPD() didn't handle a late termination of a
|
||||
HTTP connection with the server (STR #220)
|
||||
- ppdOpen() did not correctly check for "*PPD-Adobe-4."
|
||||
on the first line of a PPD file. This caused incorrect
|
||||
PASS results for some PPD files (STR #233)
|
||||
- cupsEncodeOptions() did not allow boolean options to
|
||||
use "yes" and "on" for true values (STR #227)
|
||||
- The pstops filter only sent the TBCP exit sequence if
|
||||
it was defined in the JCLEnd attribute in the PPD file
|
||||
(STR #224)
|
||||
- Support for more than 1024 files was broken on Solaris
|
||||
9 (STR #217)
|
||||
- The setgroups() calls now pass in 1 group (the
|
||||
configured group) instead of 0 for compatibility with
|
||||
BSD and Darwin (STR #213)
|
||||
- The scheduler's built-in broadcast throttling was
|
||||
ineffective since incoming packets would cause the
|
||||
next group of outgoing packets to be sent immediately
|
||||
rather than waiting for the next time slot (STR #211)
|
||||
- Added a new ppdSetConformance() function to set the
|
||||
conformance requirements for PPD files. Currently only
|
||||
two levels are defined, PPD_CONFORM_RELAXED and
|
||||
PPD_CONFORM_STRICT, and the default is the relaxed
|
||||
level (STR #212)
|
||||
- The IPP backend did not correctly execute the
|
||||
pictwpstops filter on OSX (STR #210)
|
||||
- The LPD backend did not set the banner class when the
|
||||
"banner=yes" option was specified in the device URI
|
||||
(STR #209)
|
||||
- The imagetoraster filter did not support all of the
|
||||
page device attributes (STR #208)
|
||||
- The pdftops filter incorrectly auto-rotated pages when
|
||||
the user already had specified the proper orientation
|
||||
(STR #207)
|
||||
- Fixed AIX shared library support (STR #201)
|
||||
- Added support for live testing with Valgrind (STR
|
||||
#193)
|
||||
- The CGI programs now collect the list of needed
|
||||
attributes for the class, job, and printer template
|
||||
files (STR #192)
|
||||
- The scheduler now passes the first port that is bound
|
||||
to the local loopback or "any" addresses to the CGI
|
||||
programs rather than the port that the browser
|
||||
connected to (STR #103)
|
||||
- The cupstestppd program now checks for bad
|
||||
JobPatchFile attributes and incorrect versions of the
|
||||
Manufacturer attribute for HP printers (STR #155)
|
||||
- The filter makefile incorrectly installed
|
||||
libcupsimage.a in the filter directory (STR #180)
|
||||
- The scheduler did not verify that the job history
|
||||
files define the job-priority and
|
||||
job-originating-user-name attributes (STR #178)
|
||||
- The pstops filter didn't handle poorly-formed binary
|
||||
PostScript files that had CTRL-D's in them (STR #156)
|
||||
- The ppdOpen*() and cupsLangGet() functions did not
|
||||
make a copy of the old locale strings when using the
|
||||
POSIX locale when reading files, which apparently
|
||||
caused problems with some implementations of the
|
||||
standard C library. (STR #159)
|
||||
- The pdftops filter did not work properly with some
|
||||
embedded Type1C fonts (STR #177)
|
||||
- Updated the pdftops filter to be based upon Xpdf
|
||||
2.02pl1 (STR #191)
|
||||
- The scheduler did not reset the group list when
|
||||
running CGI and filter processes (STR #185)
|
||||
- The scheduler no longer calls malloc and free from the
|
||||
signal handlers (STR #190)
|
||||
- The USB backend now uses the manufacturer and model
|
||||
strings if the description string is not available
|
||||
(STR #174)
|
||||
- The ppdOpen functions still supported the
|
||||
VariablePaperSize attribute, which was removed in v4.0
|
||||
of the PPD spec. This caused problems with PPD files
|
||||
that relocated the PageSize option to a non-standard
|
||||
group (STR #158)
|
||||
- The cups.list file referenced MAN1EXT, MAN3EXT, and
|
||||
MAN5EXT, but none of those were actually defined (STR
|
||||
#147)
|
||||
- Chunked requests could cause a Denial of Service if
|
||||
the connection is terminated before the first byte of
|
||||
chunk data is sent/received (STR #143)
|
||||
- Printers with special characters in their names were
|
||||
not accessible from the web interface (STR #120)
|
||||
- The lpstat command now shows the correct interface
|
||||
script or PPD file, if any, for a print queue (STR #89)
|
||||
- The lpstat command now shows the printer-state-message
|
||||
and printer-state-reasons attributes whenever they are
|
||||
not blank (STR #152)
|
||||
- The French and German option-conflict.tmpl template
|
||||
files did not get installed (STR #148)
|
||||
- The cups.list.in file did not work when compiling
|
||||
without shared libraries (STR #149)
|
||||
- The DSOFLAGS included the LDFLAGS, which causes
|
||||
problems on at least HP-UX (STR #150)
|
||||
- The fax printer support did not keep track of the fax
|
||||
capability bit (STR #144)
|
||||
- The appleLangDefault() function could leak a small
|
||||
amount of memory (STR #145)
|
||||
- The ppdOpen() functions now mirror all normal
|
||||
attributes to the attribute list; previously only
|
||||
certain unassigned attributes would be added (STR
|
||||
#139)
|
||||
- The ppdEmitJCL() function wrote JCL commands to stdout
|
||||
instead of the passed file pointer (STR #142)
|
||||
- The httpGets() function could, in certain states,
|
||||
block waiting for data (STR #132)
|
||||
- The cupsEmitJCL() function not outputs an empty @PJL
|
||||
command after the PJL language escape to work around
|
||||
bugs in certain PJL implementations (STR #131)
|
||||
- The cupsEmit*() functions didn't set the orientation
|
||||
value properly (STR #127)
|
||||
- The cups.spec file didn't list the rc2.d init
|
||||
directory or the cupstestppd file (STR #134)
|
||||
|
||||
|
||||
CHANGES IN CUPS V1.1.19
|
||||
|
||||
- The GNU TLS code incorrectly used
|
||||
|
||||
+2
-3
@@ -85,11 +85,11 @@ LIBZ = @LIBZ@
|
||||
|
||||
ARFLAGS = @ARFLAGS@
|
||||
BACKLIBS = @BACKLIBS@
|
||||
CFLAGS = $(RC_CFLAGS) $(SSLFLAGS) @CPPFLAGS@ @CFLAGS@ -I.. $(OPTIONS)
|
||||
CFLAGS = $(RC_CFLAGS) @CPPFLAGS@ @CFLAGS@ -I.. $(OPTIONS)
|
||||
COMMONLIBS = @COMMONLIBS@
|
||||
CXXFLAGS = $(RC_CFLAGS) @CPPFLAGS@ @CXXFLAGS@ -I.. $(OPTIONS)
|
||||
CXXLIBS = @CXXLIBS@
|
||||
DSOFLAGS = @DSOFLAGS@
|
||||
DSOFLAGS = @LDFLAGS@ @DSOFLAGS@
|
||||
DSOLIBS = @DSOLIBS@ $(COMMONLIBS)
|
||||
IMGLIBS = @IMGLIBS@ -lm
|
||||
LDFLAGS = -L../cups -L../filter $(RC_CFLAGS) @LDFLAGS@ $(OPTIM)
|
||||
@@ -100,7 +100,6 @@ NETLIBS = @NETLIBS@
|
||||
OPTIM = @OPTIM@
|
||||
OPTIONS =
|
||||
PAMLIBS = @PAMLIBS@
|
||||
SSLFLAGS = @SSLFLAGS@
|
||||
SSLLIBS = @SSLLIBS@
|
||||
|
||||
#
|
||||
|
||||
+43
-36
@@ -43,7 +43,6 @@
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <cups/http-private.h>
|
||||
#include <cups/cups.h>
|
||||
#include <cups/language.h>
|
||||
#include <cups/string.h>
|
||||
@@ -56,9 +55,39 @@
|
||||
*/
|
||||
|
||||
static char tmpfilename[1024] = ""; /* Temporary spool file name */
|
||||
#ifdef __APPLE__
|
||||
static char pstmpname[1024] = ""; /* Temporary PostScript file name */
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
|
||||
/*
|
||||
* Some OS's don't have hstrerror(), most notably Solaris...
|
||||
*/
|
||||
|
||||
#ifndef HAVE_HSTRERROR
|
||||
# define hstrerror cups_hstrerror
|
||||
|
||||
const char * /* O - Error string */
|
||||
cups_hstrerror(int error) /* I - Error number */
|
||||
{
|
||||
static const char * const errors[] =
|
||||
{
|
||||
"OK",
|
||||
"Host not found.",
|
||||
"Try again.",
|
||||
"Unrecoverable lookup error.",
|
||||
"No data associated with name."
|
||||
};
|
||||
|
||||
|
||||
if (error < 0 || error > 4)
|
||||
return ("Unknown hostname lookup error.");
|
||||
else
|
||||
return (errors[error]);
|
||||
}
|
||||
#elif defined(_AIX)
|
||||
/*
|
||||
* AIX doesn't provide a prototype but does provide the function...
|
||||
*/
|
||||
extern const char *hstrerror(int);
|
||||
#endif /* !HAVE_HSTRERROR */
|
||||
|
||||
|
||||
/*
|
||||
@@ -69,7 +98,7 @@ const char *password_cb(const char *);
|
||||
int report_printer_state(ipp_t *ipp);
|
||||
|
||||
#ifdef __APPLE__
|
||||
int run_pictwps_filter(char **argv, const char *filename);
|
||||
int run_pictwps_filter(char **argv, char *filename, int length);
|
||||
#endif /* __APPLE__ */
|
||||
static void sigterm_handler(int sig);
|
||||
|
||||
@@ -604,11 +633,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
* so convert the document to PostScript...
|
||||
*/
|
||||
|
||||
if (run_pictwps_filter(argv, filename))
|
||||
if (run_pictwps_filter(argv, filename, sizeof(filename)))
|
||||
return (1);
|
||||
|
||||
filename = pstmpname;
|
||||
|
||||
/*
|
||||
* Change the MIME type to application/postscript...
|
||||
*/
|
||||
@@ -865,17 +892,12 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
ippDelete(supported);
|
||||
|
||||
/*
|
||||
* Remove the temporary file(s) if necessary...
|
||||
* Remove the temporary file if necessary...
|
||||
*/
|
||||
|
||||
if (tmpfilename[0])
|
||||
unlink(tmpfilename);
|
||||
|
||||
#ifdef __APPLE__
|
||||
if (pstmpname[0])
|
||||
unlink(pstmpname);
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
/*
|
||||
* Return the queue status...
|
||||
*/
|
||||
@@ -1023,8 +1045,9 @@ report_printer_state(ipp_t *ipp) /* I - IPP response */
|
||||
*/
|
||||
|
||||
int /* O - Exit status of filter */
|
||||
run_pictwps_filter(char **argv, /* I - Command-line arguments */
|
||||
const char *filename) /* I - Filename */
|
||||
run_pictwps_filter(char **argv, /* I - Command-line arguments */
|
||||
char *filename, /* I - Filename buffer */
|
||||
int length) /* I - Size of filename buffer */
|
||||
{
|
||||
struct stat fileinfo; /* Print file information */
|
||||
const char *ppdfile; /* PPD file for destination printer */
|
||||
@@ -1062,7 +1085,7 @@ run_pictwps_filter(char **argv, /* I - Command-line arguments */
|
||||
* Then create a temporary file for printing...
|
||||
*/
|
||||
|
||||
if ((fd = cupsTempFd(pstmpname, sizeof(pstmpname))) < 0)
|
||||
if ((fd = cupsTempFd(filename, length)) < 0)
|
||||
{
|
||||
fprintf(stderr, "ERROR: Unable to create temporary file - %s.\n",
|
||||
strerror(errno));
|
||||
@@ -1076,18 +1099,7 @@ run_pictwps_filter(char **argv, /* I - Command-line arguments */
|
||||
* as...
|
||||
*/
|
||||
|
||||
if (argv[6])
|
||||
stat(argv[6], &fileinfo);
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Use the OSX defaults, as an up-stream filter created the PICT
|
||||
* file...
|
||||
*/
|
||||
|
||||
fileinfo.st_uid = 1;
|
||||
fileinfo.st_gid = 80;
|
||||
}
|
||||
stat(argv[6], &fileinfo);
|
||||
|
||||
if (ppdfile)
|
||||
chown(ppdfile, fileinfo.st_uid, fileinfo.st_gid);
|
||||
@@ -1120,7 +1132,7 @@ run_pictwps_filter(char **argv, /* I - Command-line arguments */
|
||||
}
|
||||
|
||||
execlp("pictwpstops", printer, argv[1], argv[2], argv[3], argv[4], argv[5],
|
||||
filename, NULL);
|
||||
argv[6], NULL);
|
||||
perror("ERROR: Unable to exec pictwpstops");
|
||||
return (errno);
|
||||
}
|
||||
@@ -1191,17 +1203,12 @@ sigterm_handler(int sig) /* I - Signal */
|
||||
(void)sig; /* remove compiler warnings... */
|
||||
|
||||
/*
|
||||
* Remove the temporary file(s) if necessary...
|
||||
* Remove the temporary file if necessary...
|
||||
*/
|
||||
|
||||
if (tmpfilename[0])
|
||||
unlink(tmpfilename);
|
||||
|
||||
#ifdef __APPLE__
|
||||
if (pstmpname[0])
|
||||
unlink(pstmpname);
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
+58
-32
@@ -43,7 +43,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <ctype.h>
|
||||
#include <cups/http-private.h>
|
||||
#include <cups/string.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
@@ -67,6 +66,39 @@
|
||||
static char tmpfilename[1024] = ""; /* Temporary spool file name */
|
||||
|
||||
|
||||
/*
|
||||
* Some OS's don't have hstrerror(), most notably Solaris...
|
||||
*/
|
||||
|
||||
#ifndef HAVE_HSTRERROR
|
||||
# define hstrerror cups_hstrerror
|
||||
|
||||
const char * /* O - Error string */
|
||||
cups_hstrerror(int error) /* I - Error number */
|
||||
{
|
||||
static const char * const errors[] =
|
||||
{
|
||||
"OK",
|
||||
"Host not found.",
|
||||
"Try again.",
|
||||
"Unrecoverable lookup error.",
|
||||
"No data associated with name."
|
||||
};
|
||||
|
||||
|
||||
if (error < 0 || error > 4)
|
||||
return ("Unknown hostname lookup error.");
|
||||
else
|
||||
return (errors[error]);
|
||||
}
|
||||
#elif defined(_AIX)
|
||||
/*
|
||||
* AIX doesn't provide a prototype but does provide the function...
|
||||
*/
|
||||
extern const char *hstrerror(int);
|
||||
#endif /* !HAVE_HSTRERROR */
|
||||
|
||||
|
||||
/*
|
||||
* The order for control and data files in LPD requests...
|
||||
*/
|
||||
@@ -87,9 +119,8 @@ extern int rresvport(int *port);
|
||||
*/
|
||||
|
||||
static int lpd_command(int lpd_fd, int timeout, char *format, ...);
|
||||
static int lpd_queue(const char *hostname, int port, const char *printer,
|
||||
const char *filename,
|
||||
const char *user, const char *title, int copies,
|
||||
static int lpd_queue(char *hostname, char *printer, char *filename,
|
||||
char *user, char *title, int copies,
|
||||
int banner, int format, int order, int reserve,
|
||||
int manual_copies, int timeout);
|
||||
static void lpd_timeout(int sig);
|
||||
@@ -393,7 +424,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
copies = atoi(argv[4]);
|
||||
}
|
||||
|
||||
status = lpd_queue(hostname, port, resource + 1, filename,
|
||||
status = lpd_queue(hostname, resource + 1, filename,
|
||||
argv[2] /* user */, title, copies,
|
||||
banner, format, order, reserve, manual_copies, timeout);
|
||||
|
||||
@@ -401,7 +432,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
fprintf(stderr, "PAGE: 1 %d\n", atoi(argv[4]));
|
||||
}
|
||||
else
|
||||
status = lpd_queue(hostname, port, resource + 1, filename,
|
||||
status = lpd_queue(hostname, resource + 1, filename,
|
||||
argv[2] /* user */, title, 1,
|
||||
banner, format, order, reserve, 1, timeout);
|
||||
|
||||
@@ -486,25 +517,24 @@ lpd_command(int fd, /* I - Socket connection to LPD host */
|
||||
*/
|
||||
|
||||
static int /* O - Zero on success, non-zero on failure */
|
||||
lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
int port, /* I - Port to connect on */
|
||||
const char *printer, /* I - Printer/queue name */
|
||||
const char *filename, /* I - File to print */
|
||||
const char *user, /* I - Requesting user */
|
||||
const char *title, /* I - Job title */
|
||||
int copies, /* I - Number of copies */
|
||||
int banner, /* I - Print LPD banner? */
|
||||
int format, /* I - Format specifier */
|
||||
int order, /* I - Order of data/control files */
|
||||
int reserve, /* I - Reserve ports? */
|
||||
int manual_copies, /* I - Do copies by hand... */
|
||||
int timeout) /* I - Timeout... */
|
||||
lpd_queue(char *hostname, /* I - Host to connect to */
|
||||
char *printer, /* I - Printer/queue name */
|
||||
char *filename, /* I - File to print */
|
||||
char *user, /* I - Requesting user */
|
||||
char *title, /* I - Job title */
|
||||
int copies, /* I - Number of copies */
|
||||
int banner, /* I - Print LPD banner? */
|
||||
int format, /* I - Format specifier */
|
||||
int order, /* I - Order of data/control files */
|
||||
int reserve, /* I - Reserve ports? */
|
||||
int manual_copies, /* I - Do copies by hand... */
|
||||
int timeout) /* I - Timeout... */
|
||||
{
|
||||
FILE *fp; /* Job file */
|
||||
char localhost[255]; /* Local host name */
|
||||
int error; /* Error number */
|
||||
struct stat filestats; /* File statistics */
|
||||
int lport; /* LPD connection local port */
|
||||
int port; /* LPD connection port */
|
||||
int fd; /* LPD socket */
|
||||
char control[10240], /* LPD control 'file' */
|
||||
*cptr; /* Pointer into control file string */
|
||||
@@ -559,9 +589,9 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
memset(&addr, 0, sizeof(addr));
|
||||
memcpy(&(addr.sin_addr), hostaddr->h_addr, hostaddr->h_length);
|
||||
addr.sin_family = hostaddr->h_addrtype;
|
||||
addr.sin_port = htons(port);
|
||||
addr.sin_port = htons(515); /* LPD/printer service */
|
||||
|
||||
for (lport = 732;;)
|
||||
for (port = 732;;)
|
||||
{
|
||||
if (getuid() || !reserve)
|
||||
{
|
||||
@@ -575,16 +605,16 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
return (1);
|
||||
}
|
||||
|
||||
lport = 0;
|
||||
port = 515;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* We're running as root and want to comply with RFC 1179. Reserve a
|
||||
* priviledged lport between 721 and 732...
|
||||
* priviledged port between 721 and 732...
|
||||
*/
|
||||
|
||||
if ((fd = rresvport(&lport)) < 0)
|
||||
if ((fd = rresvport(&port)) < 0)
|
||||
{
|
||||
perror("ERROR: Unable to reserve port");
|
||||
sleep(30);
|
||||
@@ -621,9 +651,7 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
break;
|
||||
}
|
||||
|
||||
fprintf(stderr, "INFO: Connected to %s...\n", hostname);
|
||||
fprintf(stderr, "DEBUG: Connected on ports %d (local %d)...\n", port,
|
||||
lport);
|
||||
fprintf(stderr, "INFO: Connected from port %d...\n", port);
|
||||
|
||||
/*
|
||||
* Next, open the print file and figure out its size...
|
||||
@@ -655,14 +683,12 @@ lpd_queue(const char *hostname, /* I - Host to connect to */
|
||||
gethostname(localhost, sizeof(localhost));
|
||||
localhost[31] = '\0'; /* RFC 1179, Section 7.2 - host name < 32 chars */
|
||||
|
||||
snprintf(control, sizeof(control), "H%s\nP%s\nJ%s\n", localhost, user,
|
||||
title);
|
||||
snprintf(control, sizeof(control), "H%s\nP%s\nJ%s\n", localhost, user, title);
|
||||
cptr = control + strlen(control);
|
||||
|
||||
if (banner)
|
||||
{
|
||||
snprintf(cptr, sizeof(control) - (cptr - control), "L%s\nC%s\n", user,
|
||||
localhost);
|
||||
snprintf(cptr, sizeof(control) - (cptr - control), "L%s\n", user);
|
||||
cptr += strlen(cptr);
|
||||
}
|
||||
|
||||
|
||||
@@ -281,9 +281,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
bufptr += wbytes;
|
||||
}
|
||||
|
||||
if (wbytes < 0)
|
||||
break;
|
||||
|
||||
if (argc > 6)
|
||||
fprintf(stderr, "INFO: Sending print file, %lu bytes...\n",
|
||||
(unsigned long)tbytes);
|
||||
|
||||
+4
-7
@@ -386,23 +386,23 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
|
||||
if (strcasecmp(value, "none") == 0)
|
||||
{
|
||||
opts.c_iflag &= ~(IXON | IXOFF);
|
||||
opts.c_iflag &= ~(IXON | IXOFF | IXANY);
|
||||
opts.c_cflag &= ~CRTSCTS;
|
||||
}
|
||||
else if (strcasecmp(value, "soft") == 0)
|
||||
{
|
||||
opts.c_iflag |= IXON | IXOFF;
|
||||
opts.c_iflag |= IXON | IXOFF | IXANY;
|
||||
opts.c_cflag &= ~CRTSCTS;
|
||||
}
|
||||
else if (strcasecmp(value, "hard") == 0 ||
|
||||
strcasecmp(value, "rtscts") == 0)
|
||||
{
|
||||
opts.c_iflag &= ~(IXON | IXOFF);
|
||||
opts.c_iflag &= ~(IXON | IXOFF | IXANY);
|
||||
opts.c_cflag |= CRTSCTS;
|
||||
}
|
||||
else if (strcasecmp(value, "dtrdsr") == 0)
|
||||
{
|
||||
opts.c_iflag &= ~(IXON | IXOFF);
|
||||
opts.c_iflag &= ~(IXON | IXOFF | IXANY);
|
||||
opts.c_cflag &= ~CRTSCTS;
|
||||
|
||||
dtrdsr = 1;
|
||||
@@ -508,9 +508,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
bufptr += wbytes;
|
||||
}
|
||||
|
||||
if (wbytes < 0)
|
||||
break;
|
||||
|
||||
if (argc > 6)
|
||||
fprintf(stderr, "INFO: Sending print file, %lu bytes...\n",
|
||||
(unsigned long)tbytes);
|
||||
|
||||
+33
-4
@@ -36,7 +36,6 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <cups/http-private.h>
|
||||
#include <cups/string.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
@@ -55,6 +54,39 @@
|
||||
#endif /* WIN32 */
|
||||
|
||||
|
||||
/*
|
||||
* Some OS's don't have hstrerror(), most notably Solaris...
|
||||
*/
|
||||
|
||||
#ifndef HAVE_HSTRERROR
|
||||
# define hstrerror cups_hstrerror
|
||||
|
||||
const char * /* O - Error string */
|
||||
cups_hstrerror(int error) /* I - Error number */
|
||||
{
|
||||
static const char * const errors[] =
|
||||
{
|
||||
"OK",
|
||||
"Host not found.",
|
||||
"Try again.",
|
||||
"Unrecoverable lookup error.",
|
||||
"No data associated with name."
|
||||
};
|
||||
|
||||
|
||||
if (error < 0 || error > 4)
|
||||
return ("Unknown hostname lookup error.");
|
||||
else
|
||||
return (errors[error]);
|
||||
}
|
||||
#elif defined(_AIX)
|
||||
/*
|
||||
* AIX doesn't provide a prototype but does provide the function...
|
||||
*/
|
||||
extern const char *hstrerror(int);
|
||||
#endif /* !HAVE_HSTRERROR */
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
@@ -281,9 +313,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
bufptr += wbytes;
|
||||
}
|
||||
|
||||
if (wbytes < 0)
|
||||
break;
|
||||
|
||||
/*
|
||||
* Check for possible data coming back from the printer...
|
||||
*/
|
||||
|
||||
+8
-58
@@ -230,30 +230,26 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
#endif /* HAVE_SIGSET */
|
||||
}
|
||||
|
||||
#if defined(__linux) && defined(LP_POUTPA)
|
||||
#ifdef __linux
|
||||
/*
|
||||
* Show the printer status before we send the file; normally, we'd
|
||||
* do this while we write data to the printer, however at least some
|
||||
* Linux kernels have buggy USB drivers which don't like to be
|
||||
* queried while sending data to the printer...
|
||||
*
|
||||
* Also, we're using the 8255 constants instead of the ones that are
|
||||
* supposed to be used, as it appears that the USB driver also doesn't
|
||||
* follow standards...
|
||||
*/
|
||||
|
||||
if (ioctl(fd, LPGETSTATUS, &status) == 0)
|
||||
{
|
||||
fprintf(stderr, "DEBUG: LPGETSTATUS returned a port status of %02X...\n", status);
|
||||
|
||||
if (!(status & LP_POUTPA))
|
||||
if (status & LP_NOPA)
|
||||
fputs("WARNING: Media tray empty!\n", stderr);
|
||||
else if (!(status & LP_PERRORP))
|
||||
else if (status & LP_ERR)
|
||||
fputs("WARNING: Printer fault!\n", stderr);
|
||||
else if (!(status & LP_PSELECD))
|
||||
else if (status & LP_OFFL)
|
||||
fputs("WARNING: Printer off-line.\n", stderr);
|
||||
}
|
||||
#endif /* __linux && LP_POUTPA */
|
||||
#endif /* __linux */
|
||||
|
||||
/*
|
||||
* Finally, send the print file...
|
||||
@@ -296,9 +292,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
|
||||
bufptr += wbytes;
|
||||
}
|
||||
|
||||
if (wbytes < 0)
|
||||
break;
|
||||
|
||||
if (argc > 6)
|
||||
fprintf(stderr, "INFO: Sending print file, %lu bytes...\n",
|
||||
(unsigned long)tbytes);
|
||||
@@ -334,8 +327,6 @@ decode_device_id(int port, /* I - Port number */
|
||||
char *attr, /* 1284 attribute */
|
||||
*delim, /* 1284 delimiter */
|
||||
*uriptr, /* Pointer into URI */
|
||||
*mfg, /* Manufacturer string */
|
||||
*mdl, /* Model string */
|
||||
serial_number[1024]; /* Serial number string */
|
||||
|
||||
|
||||
@@ -348,16 +339,6 @@ decode_device_id(int port, /* I - Port number */
|
||||
else if ((attr = strstr(device_id, "DESCRIPTION:")) != NULL)
|
||||
attr += 12;
|
||||
|
||||
if ((mfg = strstr(device_id, "MANUFACTURER:")) != NULL)
|
||||
mfg += 13;
|
||||
else if ((mfg = strstr(device_id, "MFG:")) != NULL)
|
||||
mfg += 4;
|
||||
|
||||
if ((mdl = strstr(device_id, "MODEL:")) != NULL)
|
||||
mdl += 6;
|
||||
else if ((mdl = strstr(device_id, "MDL:")) != NULL)
|
||||
mdl += 4;
|
||||
|
||||
if (attr)
|
||||
{
|
||||
if (strncasecmp(attr, "Hewlett-Packard ", 16) == 0)
|
||||
@@ -373,31 +354,8 @@ decode_device_id(int port, /* I - Port number */
|
||||
if ((delim = strchr(make_model, ';')) != NULL)
|
||||
*delim = '\0';
|
||||
}
|
||||
else if (mfg && mdl)
|
||||
{
|
||||
/*
|
||||
* Build a make-model string from the manufacturer and model attributes...
|
||||
*/
|
||||
|
||||
strlcpy(make_model, mfg, mmsize);
|
||||
|
||||
if ((delim = strchr(make_model, ';')) != NULL)
|
||||
*delim = '\0';
|
||||
|
||||
strlcat(make_model, " ", mmsize);
|
||||
strlcat(make_model, mdl, mmsize);
|
||||
|
||||
if ((delim = strchr(make_model, ';')) != NULL)
|
||||
*delim = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Use "Unknown" as the printer make and model...
|
||||
*/
|
||||
|
||||
strlcpy(make_model, "Unknown", mmsize);
|
||||
}
|
||||
|
||||
/*
|
||||
* Look for the serial number field...
|
||||
@@ -516,7 +474,7 @@ list_devices(void)
|
||||
if (length > (sizeof(device_id) - 2))
|
||||
length = sizeof(device_id) - 2;
|
||||
|
||||
memmove(device_id, device_id + 2, length);
|
||||
memcpy(device_id, device_id + 2, length);
|
||||
device_id[length] = '\0';
|
||||
}
|
||||
else
|
||||
@@ -675,7 +633,7 @@ open_device(const char *uri) /* I - Device URI */
|
||||
{
|
||||
length = (((unsigned)device_id[0] & 255) << 8) +
|
||||
((unsigned)device_id[1] & 255);
|
||||
memmove(device_id, device_id + 2, length);
|
||||
memcpy(device_id, device_id + 2, length);
|
||||
device_id[length] = '\0';
|
||||
}
|
||||
else
|
||||
@@ -694,15 +652,7 @@ open_device(const char *uri) /* I - Device URI */
|
||||
device_uri, sizeof(device_uri));
|
||||
|
||||
if (strcmp(uri, device_uri) == 0)
|
||||
{
|
||||
/*
|
||||
* Yes, return this file descriptor...
|
||||
*/
|
||||
|
||||
fprintf(stderr, "DEBUG: Printer using device file \"%s\"...\n", device);
|
||||
|
||||
return (fd);
|
||||
}
|
||||
return (fd); /* Yes, return this file descriptor... */
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -100,7 +100,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
*/
|
||||
|
||||
while (isspace(line[0]))
|
||||
cups_strcpy(line, line + 1);
|
||||
strcpy(line, line + 1);
|
||||
|
||||
for (params = line; *params != '\0'; params ++)
|
||||
if (isspace(*params))
|
||||
|
||||
+1
-6
@@ -961,12 +961,7 @@ do_config_printer(http_t *http, /* I - HTTP connection */
|
||||
return;
|
||||
}
|
||||
|
||||
if ((ppd = ppdOpenFile(filename)) == NULL)
|
||||
{
|
||||
cgiSetVariable("ERROR", ippErrorString(IPP_DEVICE_ERROR));
|
||||
cgiCopyTemplateLang(stdout, TEMPLATES, "error.tmpl", getenv("LANG"));
|
||||
return;
|
||||
}
|
||||
ppd = ppdOpenFile(filename);
|
||||
|
||||
if (cgiGetVariable("job_sheets_start") != NULL ||
|
||||
cgiGetVariable("job_sheets_end") != NULL)
|
||||
|
||||
+16
-25
@@ -37,25 +37,21 @@
|
||||
* 'main()' - Main entry for CGI.
|
||||
*/
|
||||
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
cups_lang_t *language; /* Language information */
|
||||
char *pclass; /* Printer class name */
|
||||
http_t *http; /* Connection to the server */
|
||||
ipp_t *request, /* IPP request */
|
||||
*response; /* IPP response */
|
||||
ipp_attribute_t *attr; /* IPP attribute */
|
||||
ipp_status_t status; /* Operation status... */
|
||||
char uri[HTTP_MAX_URI]; /* Printer URI */
|
||||
const char *which_jobs; /* Which jobs to show */
|
||||
const char *op; /* Operation to perform, if any */
|
||||
static const char *def_attrs[] = /* Attributes for default printer */
|
||||
{
|
||||
"printer-name",
|
||||
"printer-uri-supported"
|
||||
};
|
||||
cups_lang_t *language; /* Language information */
|
||||
char *pclass; /* Printer class name */
|
||||
http_t *http; /* Connection to the server */
|
||||
ipp_t *request, /* IPP request */
|
||||
*response; /* IPP response */
|
||||
ipp_attribute_t *attr; /* IPP attribute */
|
||||
ipp_status_t status; /* Operation status... */
|
||||
char uri[HTTP_MAX_URI];
|
||||
/* Printer URI */
|
||||
const char *which_jobs; /* Which jobs to show */
|
||||
const char *op; /* Operation to perform, if any */
|
||||
|
||||
|
||||
/*
|
||||
@@ -117,10 +113,6 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
|
||||
"attributes-natural-language", NULL, language->language);
|
||||
|
||||
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
|
||||
"requested-attributes",
|
||||
sizeof(def_attrs) / sizeof(def_attrs[0]), NULL, def_attrs);
|
||||
|
||||
if ((response = cupsDoRequest(http, request, "/")) != NULL)
|
||||
{
|
||||
if ((attr = ippFindAttribute(response, "printer-name", IPP_TAG_NAME)) != NULL)
|
||||
@@ -210,7 +202,8 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
uri);
|
||||
}
|
||||
|
||||
ippGetAttributes(request, TEMPLATES, "classes.tmpl", getenv("LANG"));
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
|
||||
"requested-attributes", NULL, "all");
|
||||
|
||||
/*
|
||||
* Do the request and get back a response...
|
||||
@@ -263,8 +256,6 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "which-jobs",
|
||||
NULL, which_jobs);
|
||||
|
||||
ippGetAttributes(request, TEMPLATES, "jobs.tmpl", getenv("LANG"));
|
||||
|
||||
/*
|
||||
* Do the request and get back a response...
|
||||
*/
|
||||
|
||||
+4
-163
@@ -23,8 +23,6 @@
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* ippGetAttributes() - Get the list of attributes that are needed
|
||||
* by the template file.
|
||||
* ippGetTemplateDir() - Get the templates directory...
|
||||
* ippSetServerVersion() - Set the server name and CUPS version...
|
||||
* ippSetCGIVars() - Set CGI variables from an IPP response.
|
||||
@@ -37,127 +35,6 @@
|
||||
#include "ipp-var.h"
|
||||
|
||||
|
||||
/*
|
||||
* 'ippGetAttributes()' - Get the list of attributes that are needed
|
||||
* by the template file.
|
||||
*/
|
||||
|
||||
void
|
||||
ippGetAttributes(ipp_t *request, /* I - IPP request */
|
||||
const char *directory, /* I - Directory */
|
||||
const char *tmpl, /* I - Base filename */
|
||||
const char *lang) /* I - Language */
|
||||
{
|
||||
int num_attrs; /* Number of attributes */
|
||||
char *attrs[1000]; /* Attributes */
|
||||
int i; /* Looping var */
|
||||
char filename[1024], /* Filename */
|
||||
locale[16]; /* Locale name */
|
||||
FILE *in; /* Input file */
|
||||
int ch; /* Character from file */
|
||||
char name[255], /* Name of variable */
|
||||
*nameptr; /* Pointer into name */
|
||||
|
||||
|
||||
/*
|
||||
* Convert the language to a locale name...
|
||||
*/
|
||||
|
||||
if (lang != NULL)
|
||||
{
|
||||
for (i = 0; lang[i] && i < 15; i ++)
|
||||
if (isalnum(lang[i]))
|
||||
locale[i] = tolower(lang[i]);
|
||||
else
|
||||
locale[i] = '_';
|
||||
|
||||
locale[i] = '\0';
|
||||
}
|
||||
else
|
||||
locale[0] = '\0';
|
||||
|
||||
/*
|
||||
* See if we have a template file for this language...
|
||||
*/
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/%s/%s", directory, locale, tmpl);
|
||||
if (access(filename, 0))
|
||||
{
|
||||
locale[2] = '\0';
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/%s/%s", directory, locale, tmpl);
|
||||
if (access(filename, 0))
|
||||
snprintf(filename, sizeof(filename), "%s/%s", directory, tmpl);
|
||||
}
|
||||
|
||||
/*
|
||||
* Open the template file...
|
||||
*/
|
||||
|
||||
if ((in = fopen(filename, "r")) == NULL)
|
||||
return;
|
||||
|
||||
/*
|
||||
* Loop through the file adding attribute names as needed...
|
||||
*/
|
||||
|
||||
num_attrs = 0;
|
||||
|
||||
while ((ch = getc(in)) != EOF)
|
||||
if (ch == '\\')
|
||||
getc(in);
|
||||
else if (ch == '{' && num_attrs < (sizeof(attrs) / sizeof(attrs[0])))
|
||||
{
|
||||
/*
|
||||
* Grab the name...
|
||||
*/
|
||||
|
||||
for (nameptr = name; (ch = getc(in)) != EOF;)
|
||||
if (strchr("}]<>=! \t\n", ch))
|
||||
break;
|
||||
else if (nameptr > name && ch == '?')
|
||||
break;
|
||||
else if (nameptr < (name + sizeof(name) - 1))
|
||||
{
|
||||
if (ch == '_')
|
||||
*nameptr++ = '-';
|
||||
else
|
||||
*nameptr++ = ch;
|
||||
}
|
||||
|
||||
*nameptr = '\0';
|
||||
|
||||
/*
|
||||
* Possibly add it to the list of attributes...
|
||||
*/
|
||||
|
||||
for (i = 0; i < num_attrs; i ++)
|
||||
if (!strcmp(attrs[i], name))
|
||||
break;
|
||||
|
||||
if (i >= num_attrs)
|
||||
{
|
||||
attrs[num_attrs] = strdup(name);
|
||||
num_attrs ++;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If we have attributes, add a requested-attributes attribute to the
|
||||
* request...
|
||||
*/
|
||||
|
||||
if (num_attrs > 0)
|
||||
{
|
||||
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
|
||||
"requested-attributes", num_attrs, NULL, (const char **)attrs);
|
||||
|
||||
for (i = 0; i < num_attrs; i ++)
|
||||
free(attrs[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'ippGetTemplateDir()' - Get the templates directory...
|
||||
*/
|
||||
@@ -224,19 +101,13 @@ ippSetCGIVars(ipp_t *response, /* I - Response data to be copied... */
|
||||
char method[HTTP_MAX_URI],
|
||||
username[HTTP_MAX_URI],
|
||||
hostname[HTTP_MAX_URI],
|
||||
rawresource[HTTP_MAX_URI],
|
||||
resource[HTTP_MAX_URI],
|
||||
uri[HTTP_MAX_URI],
|
||||
*rawptr, /* Pointer into rawresource */
|
||||
*resptr; /* Pointer into resource */
|
||||
uri[HTTP_MAX_URI];
|
||||
int port; /* URI data */
|
||||
int ishttps; /* Using encryption? */
|
||||
const char *server; /* Name of server */
|
||||
char servername[1024];
|
||||
/* Locale server name */
|
||||
char servername[1024];/* Locale server name */
|
||||
struct tm *date; /* Date information */
|
||||
static const char hexchars[] = "0123456789ABCDEF";
|
||||
/* Hexadecimal conversion characters */
|
||||
|
||||
|
||||
DEBUG_printf(("<P>ippSetCGIVars(response=%p, filter_name=\"%s\", filter_value=\"%s\", prefix=\"%s\")\n",
|
||||
@@ -364,11 +235,7 @@ ippSetCGIVars(ipp_t *response, /* I - Response data to be copied... */
|
||||
case IPP_TAG_ENUM :
|
||||
if (strncmp(name, "time_at_", 8) == 0)
|
||||
{
|
||||
time_t t; /* Temporary time value */
|
||||
|
||||
t = (time_t)attr->values[i].integer;
|
||||
date = localtime(&t);
|
||||
|
||||
date = localtime((time_t *)&(attr->values[i].integer));
|
||||
strftime(valptr, sizeof(value) - (valptr - value),
|
||||
CUPS_STRFTIME_FORMAT, date);
|
||||
}
|
||||
@@ -403,38 +270,12 @@ ippSetCGIVars(ipp_t *response, /* I - Response data to be copied... */
|
||||
case IPP_TAG_URI :
|
||||
if (strchr(attr->values[i].string.text, ':') != NULL)
|
||||
{
|
||||
/*
|
||||
* Rewrite URIs...
|
||||
*/
|
||||
|
||||
httpSeparate(attr->values[i].string.text, method, username,
|
||||
hostname, &port, rawresource);
|
||||
hostname, &port, resource);
|
||||
|
||||
if (strcmp(method, "ipp") == 0 ||
|
||||
strcmp(method, "http") == 0)
|
||||
{
|
||||
/*
|
||||
* Rewrite the resource string so it doesn't contain any
|
||||
* illegal chars...
|
||||
*/
|
||||
|
||||
for (rawptr = rawresource, resptr = resource; *rawptr;)
|
||||
if ((*rawptr & 128) || *rawptr == '%' || *rawptr == ' ' ||
|
||||
*rawptr == '#' || *rawptr == '?' ||
|
||||
*rawptr == '.') /* For MSIE */
|
||||
{
|
||||
if (resptr < (resource + sizeof(resource) - 3))
|
||||
{
|
||||
*resptr++ = '%';
|
||||
*resptr++ = hexchars[(*rawptr >> 4) & 15];
|
||||
*resptr++ = hexchars[*rawptr & 15];
|
||||
}
|
||||
}
|
||||
else if (resptr < (resource + sizeof(resource) - 1))
|
||||
*resptr++ = *rawptr++;
|
||||
|
||||
*resptr = '\0';
|
||||
|
||||
/*
|
||||
* Map local access to a local URI...
|
||||
*/
|
||||
|
||||
@@ -44,8 +44,6 @@
|
||||
* Prototype...
|
||||
*/
|
||||
|
||||
extern void ippGetAttributes(ipp_t *request, const char *directory,
|
||||
const char *tmpl, const char *lang);
|
||||
extern char *ippGetTemplateDir(void);
|
||||
extern void ippSetServerVersion(void);
|
||||
extern void ippSetCGIVars(ipp_t *, const char *, const char *,
|
||||
|
||||
+9
-11
@@ -45,16 +45,16 @@ static void do_job_op(http_t *http, cups_lang_t *language, ipp_op_t op);
|
||||
* 'main()' - Main entry for CGI.
|
||||
*/
|
||||
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
cups_lang_t *language; /* Language information */
|
||||
http_t *http; /* Connection to the server */
|
||||
const char *which_jobs; /* Which jobs to show */
|
||||
ipp_t *request, /* IPP request */
|
||||
*response; /* IPP response */
|
||||
const char *op; /* Operation name */
|
||||
cups_lang_t *language; /* Language information */
|
||||
http_t *http; /* Connection to the server */
|
||||
const char *which_jobs; /* Which jobs to show */
|
||||
ipp_t *request, /* IPP request */
|
||||
*response; /* IPP response */
|
||||
const char *op; /* Operation name */
|
||||
|
||||
|
||||
/*
|
||||
@@ -139,8 +139,6 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "which-jobs",
|
||||
NULL, which_jobs);
|
||||
|
||||
ippGetAttributes(request, TEMPLATES, "jobs.tmpl", getenv("LANG"));
|
||||
|
||||
/*
|
||||
* Do the request and get back a response...
|
||||
*/
|
||||
|
||||
+18
-25
@@ -37,26 +37,24 @@
|
||||
* 'main()' - Main entry for CGI.
|
||||
*/
|
||||
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
int /* O - Exit status */
|
||||
main(int argc, /* I - Number of command-line arguments */
|
||||
char *argv[]) /* I - Command-line arguments */
|
||||
{
|
||||
cups_lang_t *language; /* Language information */
|
||||
char *printer; /* Printer name */
|
||||
http_t *http; /* Connection to the server */
|
||||
ipp_t *request, /* IPP request */
|
||||
*response; /* IPP response */
|
||||
ipp_attribute_t *attr; /* IPP attribute */
|
||||
ipp_status_t status; /* Operation status... */
|
||||
char uri[HTTP_MAX_URI]; /* Printer URI */
|
||||
const char *which_jobs; /* Which jobs to show */
|
||||
const char *op; /* Operation to perform, if any */
|
||||
static const char *def_attrs[] = /* Attributes for default printer */
|
||||
{
|
||||
"printer-name",
|
||||
"printer-uri-supported"
|
||||
};
|
||||
cups_lang_t *language; /* Language information */
|
||||
char *printer; /* Printer name */
|
||||
http_t *http; /* Connection to the server */
|
||||
ipp_t *request, /* IPP request */
|
||||
*response; /* IPP response */
|
||||
ipp_attribute_t *attr; /* IPP attribute */
|
||||
ipp_status_t status; /* Operation status... */
|
||||
char uri[HTTP_MAX_URI];
|
||||
/* Printer URI */
|
||||
const char *which_jobs; /* Which jobs to show */
|
||||
const char *op; /* Operation to perform, if any */
|
||||
|
||||
|
||||
setbuf(stdout, NULL);
|
||||
|
||||
/*
|
||||
* Get any form variables...
|
||||
@@ -118,10 +116,6 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
|
||||
"attributes-natural-language", NULL, language->language);
|
||||
|
||||
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
|
||||
"requested-attributes",
|
||||
sizeof(def_attrs) / sizeof(def_attrs[0]), NULL, def_attrs);
|
||||
|
||||
if ((response = cupsDoRequest(http, request, "/")) != NULL)
|
||||
{
|
||||
if ((attr = ippFindAttribute(response, "printer-name", IPP_TAG_NAME)) != NULL)
|
||||
@@ -211,7 +205,8 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
uri);
|
||||
}
|
||||
|
||||
ippGetAttributes(request, TEMPLATES, "printers.tmpl", getenv("LANG"));
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
|
||||
"requested-attributes", NULL, "all");
|
||||
|
||||
/*
|
||||
* Do the request and get back a response...
|
||||
@@ -270,8 +265,6 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "which-jobs",
|
||||
NULL, which_jobs);
|
||||
|
||||
ippGetAttributes(request, TEMPLATES, "jobs.tmpl", getenv("LANG"));
|
||||
|
||||
/*
|
||||
* Do the request and get back a response...
|
||||
*/
|
||||
|
||||
@@ -222,7 +222,7 @@ cgi_copy(FILE *out, /* I - Output file */
|
||||
outptr = outval;
|
||||
}
|
||||
}
|
||||
else if ((value = cgiGetArray(name + 1, element)) != NULL)
|
||||
if ((value = cgiGetArray(name + 1, element)) != NULL)
|
||||
outptr = value;
|
||||
else
|
||||
{
|
||||
@@ -332,7 +332,7 @@ cgi_copy(FILE *out, /* I - Output file */
|
||||
* Test for existance...
|
||||
*/
|
||||
|
||||
result = cgiGetArray(name, element) != NULL && outptr[0];
|
||||
result = cgiGetArray(name, element) != NULL && outval[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-common.m4 3959 2003-10-16 19:13:41Z mike $"
|
||||
dnl "$Id: cups-common.m4 3724 2003-05-14 18:24:38Z mike $"
|
||||
dnl
|
||||
dnl Common configuration stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
@@ -29,7 +29,7 @@ dnl Set the name of the config header file...
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
|
||||
dnl Version number information...
|
||||
CUPS_VERSION="1.1.20rc4"
|
||||
CUPS_VERSION="1.1.19"
|
||||
AC_SUBST(CUPS_VERSION)
|
||||
AC_DEFINE_UNQUOTED(CUPS_SVERSION, "CUPS v$CUPS_VERSION")
|
||||
|
||||
@@ -202,5 +202,5 @@ AC_SUBST(BACKLIBS)
|
||||
AC_SUBST(COMMONLIBS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-common.m4 3959 2003-10-16 19:13:41Z mike $".
|
||||
dnl End of "$Id: cups-common.m4 3724 2003-05-14 18:24:38Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-compiler.m4 3874 2003-08-20 18:27:48Z mike $"
|
||||
dnl "$Id: cups-compiler.m4 3520 2003-03-25 16:25:55Z mike $"
|
||||
dnl
|
||||
dnl Common configuration stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
@@ -133,16 +133,7 @@ else
|
||||
fi
|
||||
|
||||
if test "x$with_optim" = x; then
|
||||
# Show most warnings, but suppress the
|
||||
# ones about arguments not being used,
|
||||
# string constants assigned to const
|
||||
# char *'s, etc. We only set the warning
|
||||
# options on IRIX 6.2 and higher because
|
||||
# of limitations in the older SGI compiler
|
||||
# tools.
|
||||
if test $uversion -ge 62; then
|
||||
OPTIM="-fullwarn -woff 1183,1209,1349,3201 $OPTIM"
|
||||
fi
|
||||
OPTIM="-fullwarn $OPTIM"
|
||||
fi
|
||||
;;
|
||||
SunOS*)
|
||||
@@ -156,9 +147,7 @@ else
|
||||
fi
|
||||
|
||||
if test "x$with_optim" = x; then
|
||||
# Specify "generic" SPARC output and suppress
|
||||
# all of Sun's questionable warning messages...
|
||||
OPTIM="-w $OPTIM -xarch=generic"
|
||||
OPTIM="$OPTIM -xarch=generic"
|
||||
fi
|
||||
|
||||
if test $PICFLAG = 1; then
|
||||
@@ -202,5 +191,5 @@ if test $uname = HP-UX; then
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-compiler.m4 3874 2003-08-20 18:27:48Z mike $".
|
||||
dnl End of "$Id: cups-compiler.m4 3520 2003-03-25 16:25:55Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-network.m4 3888 2003-08-28 15:16:08Z mike $"
|
||||
dnl "$Id: cups-network.m4 3349 2003-02-12 19:31:12Z mike $"
|
||||
dnl
|
||||
dnl Networking stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
@@ -36,24 +36,13 @@ AC_CHECK_HEADER(sys/sockio.h,AC_DEFINE(HAVE_SYS_SOCKIO_H))
|
||||
|
||||
AC_SUBST(NETLIBS)
|
||||
|
||||
if test "$uname" = "SunOS"; then
|
||||
case "$uversion" in
|
||||
55* | 56*)
|
||||
maxfiles=1024
|
||||
;;
|
||||
*)
|
||||
maxfiles=4096
|
||||
;;
|
||||
esac
|
||||
else
|
||||
maxfiles=4096
|
||||
fi
|
||||
maxfiles=4096
|
||||
|
||||
AC_ARG_WITH(maxfiles, [ --with-maxfiles=N set maximum number of file descriptors for scheduler ],
|
||||
AC_ARG_WITH(maxfiles, [ --with-maxfiles=N set maximum number of file descriptors for CUPS. ],
|
||||
maxfiles=$withval)
|
||||
|
||||
AC_DEFINE_UNQUOTED(CUPS_MAX_FDS, $maxfiles)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-network.m4 3888 2003-08-28 15:16:08Z mike $".
|
||||
dnl End of "$Id: cups-network.m4 3349 2003-02-12 19:31:12Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-openssl.m4 3940 2003-09-17 19:35:22Z mike $"
|
||||
dnl "$Id: cups-openssl.m4 3250 2003-01-28 13:35:56Z mike $"
|
||||
dnl
|
||||
dnl OpenSSL/GNUTLS stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
@@ -34,7 +34,6 @@ AC_ARG_WITH(openssl-includes, [ --with-openssl-includes set directory for OpenS
|
||||
CXXFLAGS="-I$withval $CXXFLAGS"
|
||||
CPPFLAGS="-I$withval $CPPFLAGS",)
|
||||
|
||||
SSLFLAGS=""
|
||||
SSLLIBS=""
|
||||
|
||||
if test x$enable_ssl != xno; then
|
||||
@@ -58,8 +57,7 @@ if test x$enable_ssl != xno; then
|
||||
"-lcrypto -lRSAglue -lrsaref"
|
||||
do
|
||||
AC_CHECK_LIB(ssl,SSL_new,
|
||||
[SSLFLAGS="-DOPENSSL_DISABLE_OLD_DES_SUPPORT"
|
||||
SSLLIBS="-lssl $libcrypto"
|
||||
[SSLLIBS="-lssl $libcrypto"
|
||||
AC_DEFINE(HAVE_SSL)
|
||||
AC_DEFINE(HAVE_LIBSSL)],,
|
||||
$libcrypto)
|
||||
@@ -100,7 +98,6 @@ if test x$enable_ssl != xno; then
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST(SSLFLAGS)
|
||||
AC_SUBST(SSLLIBS)
|
||||
|
||||
EXPORT_SSLLIBS="$SSLLIBS"
|
||||
@@ -108,5 +105,5 @@ AC_SUBST(EXPORT_SSLLIBS)
|
||||
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-openssl.m4 3940 2003-09-17 19:35:22Z mike $".
|
||||
dnl End of "$Id: cups-openssl.m4 3250 2003-01-28 13:35:56Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-opsys.m4 3929 2003-09-15 20:32:12Z mike $"
|
||||
dnl "$Id: cups-opsys.m4 3041 2002-12-17 19:00:27Z swdev $"
|
||||
dnl
|
||||
dnl Operating system stuff for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
@@ -55,29 +55,28 @@ AC_ARG_WITH(cups-user, [ --with-cups-user set default user for CUPS],
|
||||
AC_ARG_WITH(cups-group, [ --with-cups-group set default group for CUPS],
|
||||
CUPS_GROUP="$withval",
|
||||
AC_MSG_CHECKING(for default print group)
|
||||
if test -f /etc/group; then
|
||||
if test x$uname = xDarwin; then
|
||||
GROUP_LIST="lp admin"
|
||||
else
|
||||
GROUP_LIST="sys system root"
|
||||
fi
|
||||
|
||||
CUPS_GROUP=""
|
||||
for group in $GROUP_LIST; do
|
||||
if test "`grep \^${group}: /etc/group`" != ""; then
|
||||
CUPS_GROUP="$group"
|
||||
AC_MSG_RESULT($group)
|
||||
break;
|
||||
fi
|
||||
done
|
||||
|
||||
if test x$CUPS_GROUP = x; then
|
||||
CUPS_GROUP="${GROUP:=nobody}"
|
||||
AC_MSG_RESULT(not found, using "$CUPS_GROUP")
|
||||
fi
|
||||
if test x$uname = xDarwin; then
|
||||
CUPS_GROUP="admin"
|
||||
AC_MSG_RESULT(Darwin, using "$CUPS_GROUP")
|
||||
else
|
||||
CUPS_GROUP="${GROUP:=nobody}"
|
||||
AC_MSG_RESULT(no group file, using "$CUPS_GROUP")
|
||||
if test -f /etc/group; then
|
||||
CUPS_GROUP=""
|
||||
for group in sys system root; do
|
||||
if test "`grep \^${group}: /etc/group`" != ""; then
|
||||
CUPS_GROUP="$group"
|
||||
AC_MSG_RESULT($group)
|
||||
break;
|
||||
fi
|
||||
done
|
||||
|
||||
if test x$CUPS_GROUP = x; then
|
||||
CUPS_GROUP="${GROUP:=nobody}"
|
||||
AC_MSG_RESULT(not found, using "$CUPS_GROUP")
|
||||
fi
|
||||
else
|
||||
CUPS_GROUP="${GROUP:=nobody}"
|
||||
AC_MSG_RESULT(no group file, using "$CUPS_GROUP")
|
||||
fi
|
||||
fi)
|
||||
|
||||
AC_SUBST(CUPS_USER)
|
||||
@@ -87,5 +86,5 @@ AC_DEFINE_UNQUOTED(CUPS_DEFAULT_USER, "$CUPS_USER")
|
||||
AC_DEFINE_UNQUOTED(CUPS_DEFAULT_GROUP, "$CUPS_GROUP")
|
||||
|
||||
dnl
|
||||
dnl "$Id: cups-opsys.m4 3929 2003-09-15 20:32:12Z mike $"
|
||||
dnl "$Id: cups-opsys.m4 3041 2002-12-17 19:00:27Z swdev $"
|
||||
dnl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
dnl
|
||||
dnl "$Id: cups-sharedlibs.m4 3826 2003-07-23 20:07:35Z mike $"
|
||||
dnl "$Id: cups-sharedlibs.m4 3737 2003-05-16 19:07:15Z mike $"
|
||||
dnl
|
||||
dnl Shared library support for the Common UNIX Printing System (CUPS).
|
||||
dnl
|
||||
@@ -63,7 +63,7 @@ if test x$enable_shared != xno; then
|
||||
LIBCUPS="libcups_s.a"
|
||||
LIBCUPSIMAGE="libcupsimage_s.a"
|
||||
DSO="\$(CC)"
|
||||
DSOFLAGS="$DSOFLAGS -Wl,-bexpall,-bM:SRE,-bnoentry,-blibpath:\$(libdir)"
|
||||
DSOFLAGS="$DSOFLAGS -Wl,-bexpall,-bM:SRE,-bnoentry"
|
||||
;;
|
||||
*)
|
||||
echo "Warning: shared libraries may not be supported. Trying -shared"
|
||||
@@ -152,5 +152,5 @@ AC_SUBST(IMGLIBS)
|
||||
AC_SUBST(EXPORT_LDFLAGS)
|
||||
|
||||
dnl
|
||||
dnl End of "$Id: cups-sharedlibs.m4 3826 2003-07-23 20:07:35Z mike $".
|
||||
dnl End of "$Id: cups-sharedlibs.m4 3737 2003-05-16 19:07:15Z mike $".
|
||||
dnl
|
||||
|
||||
@@ -24,9 +24,6 @@
|
||||
* WWW: http://www.cups.org
|
||||
*/
|
||||
|
||||
#ifndef _CUPS_CONFIG_H_
|
||||
#define _CUPS_CONFIG_H_
|
||||
|
||||
/*
|
||||
* Version of software...
|
||||
*/
|
||||
@@ -276,8 +273,6 @@
|
||||
#define CUPS_PYTHON "/usr/bin/python"
|
||||
|
||||
|
||||
#endif /* !_CUPS_CONFIG_H_ */
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ cups_serverroot=@CUPS_SERVERROOT@
|
||||
# flags for C++ compiler:
|
||||
CFLAGS=""
|
||||
LDFLAGS="@EXPORT_LDFLAGS@"
|
||||
LIBS="@EXPORT_SSLLIBS@ @NETLIBS@ @COMMONLIBS@"
|
||||
LIBS="@EXPORT_SSLLIBS@ @NETLIBS@"
|
||||
IMGLIBS="@EXPORT_LIBTIFF@ @EXPORT_LIBJPEG@ @EXPORT_LIBPNG@ @EXPORT_LIBZ@"
|
||||
|
||||
if test $includedir != /usr/include; then
|
||||
|
||||
+35
-39
@@ -46,8 +46,8 @@
|
||||
%provides libcupsys2-dev
|
||||
|
||||
%format rpm deb portable
|
||||
%provides @LIBCUPS@
|
||||
%provides @LIBCUPSIMAGE@
|
||||
%provides libcups.so.2
|
||||
%provides libcupsimage.so.2
|
||||
%format all
|
||||
|
||||
#
|
||||
@@ -103,8 +103,6 @@ $CAT8EXT=@CAT8EXT@
|
||||
$MAN8EXT=@MAN8EXT@
|
||||
$MAN8DIR=@MAN8DIR@
|
||||
|
||||
$DSOLIBS=@DSOLIBS@
|
||||
|
||||
# Make sure the MD5 password file is now owned by CUPS_USER...
|
||||
%postinstall if test -f $SERVERROOT/passwd.md5; then
|
||||
%postinstall chown $CUPS_USER $SERVERROOT/passwd.md5
|
||||
@@ -186,7 +184,6 @@ l 0555 root sys /usr/bsd/lprm $BINDIR/lprm
|
||||
%system all
|
||||
|
||||
# DSOs
|
||||
%if DSOLIBS
|
||||
%system hpux
|
||||
f 0555 root sys $LIBDIR/libcups.sl.2 cups/libcups.sl.2
|
||||
l 0555 root sys $LIBDIR/libcups.sl libcups.sl.2
|
||||
@@ -206,7 +203,6 @@ l 0555 root sys $LIBDIR/libcups.so libcups.so.2
|
||||
f 0555 root sys $LIBDIR/libcupsimage.so.2 filter/libcupsimage.so.2
|
||||
l 0555 root sys $LIBDIR/libcupsimage.so libcupsimage.so.2
|
||||
%system all
|
||||
%endif
|
||||
|
||||
# Directories
|
||||
d 0755 root sys $LOGDIR -
|
||||
@@ -388,25 +384,25 @@ f 0444 root sys $AMANDIR/cat$MAN8DIR/lpc.$CAT8EXT man/lpc.$CAT8EXT
|
||||
f 0444 root sys $AMANDIR/cat$MAN8DIR/lpinfo.$CAT8EXT man/lpinfo.$CAT8EXT
|
||||
f 0444 root sys $AMANDIR/cat$MAN8DIR/lpmove.$CAT8EXT man/lpmove.$CAT8EXT
|
||||
|
||||
f 0444 root sys $MANDIR/man1/backend.1 man/backend.man
|
||||
f 0444 root sys $MANDIR/man1/cupstestppd.1 man/cupstestppd.man
|
||||
f 0444 root sys $MANDIR/man1/filter.1 man/filter.man
|
||||
f 0444 root sys $MANDIR/man1/lpoptions.1 man/lpoptions.man
|
||||
f 0444 root sys $MANDIR/man1/lppasswd.1 man/lppasswd.man
|
||||
f 0444 root sys $MANDIR/man1/lpq.1 man/lpq.man
|
||||
f 0444 root sys $MANDIR/man1/lprm.1 man/lprm.man
|
||||
f 0444 root sys $MANDIR/man1/lpr.1 man/lpr.man
|
||||
f 0444 root sys $MANDIR/man1/lpstat.1 man/lpstat.man
|
||||
f 0444 root sys $MANDIR/man1/lp.1 man/lp.man
|
||||
l 0444 root sys $MANDIR/man1/cancel.1 lp.1
|
||||
f 0444 root sys $MANDIR/man1/backend.$MAN1EXT man/backend.man
|
||||
f 0444 root sys $MANDIR/man1/cupstestppd.$MAN1EXT man/cupstestppd.man
|
||||
f 0444 root sys $MANDIR/man1/filter.$MAN1EXT man/filter.man
|
||||
f 0444 root sys $MANDIR/man1/lpoptions.$MAN1EXT man/lpoptions.man
|
||||
f 0444 root sys $MANDIR/man1/lppasswd.$MAN1EXT man/lppasswd.man
|
||||
f 0444 root sys $MANDIR/man1/lpq.$MAN1EXT man/lpq.man
|
||||
f 0444 root sys $MANDIR/man1/lprm.$MAN1EXT man/lprm.man
|
||||
f 0444 root sys $MANDIR/man1/lpr.$MAN1EXT man/lpr.man
|
||||
f 0444 root sys $MANDIR/man1/lpstat.$MAN1EXT man/lpstat.man
|
||||
f 0444 root sys $MANDIR/man1/lp.$MAN1EXT man/lp.man
|
||||
l 0444 root sys $MANDIR/man1/cancel.$MAN1EXT lp.$MAN1EXT
|
||||
|
||||
f 0444 root sys $PMANDIR/man3/cups-config.3 man/cups-config.man
|
||||
f 0444 root sys $PMANDIR/man3/cups-config.$MAN3EXT man/cups-config.man
|
||||
|
||||
f 0444 root sys $MANDIR/man5/classes.conf.5 man/classes.conf.man
|
||||
f 0444 root sys $MANDIR/man5/cupsd.conf.5 man/cupsd.conf.man
|
||||
f 0444 root sys $MANDIR/man5/mime.convs.5 man/mime.convs.man
|
||||
f 0444 root sys $MANDIR/man5/mime.types.5 man/mime.types.man
|
||||
f 0444 root sys $MANDIR/man5/printers.conf.5 man/printers.conf.man
|
||||
f 0444 root sys $MANDIR/man5/classes.conf.$MAN5EXT man/classes.conf.man
|
||||
f 0444 root sys $MANDIR/man5/cupsd.conf.$MAN5EXT man/cupsd.conf.man
|
||||
f 0444 root sys $MANDIR/man5/mime.convs.$MAN5EXT man/mime.convs.man
|
||||
f 0444 root sys $MANDIR/man5/mime.types.$MAN5EXT man/mime.types.man
|
||||
f 0444 root sys $MANDIR/man5/printers.conf.$MAN5EXT man/printers.conf.man
|
||||
|
||||
f 0444 root sys $AMANDIR/man$MAN8DIR/accept.$MAN8EXT man/accept.man
|
||||
l 0444 root sys $AMANDIR/man$MAN8DIR/reject.$MAN8EXT accept.$MAN8EXT
|
||||
@@ -465,24 +461,24 @@ f 0444 root sys $AMANDIR/fr/cat$MAN8DIR/lpc.$CAT8EXT man/lpc.$CAT8EXT
|
||||
f 0444 root sys $AMANDIR/fr/cat$MAN8DIR/lpinfo.$CAT8EXT man/lpinfo.$CAT8EXT
|
||||
f 0444 root sys $AMANDIR/fr/cat$MAN8DIR/lpmove.$CAT8EXT man/lpmove.$CAT8EXT
|
||||
|
||||
f 0444 root sys $MANDIR/fr/man1/backend.1 man/backend.man
|
||||
f 0444 root sys $MANDIR/fr/man1/filter.1 man/filter.man
|
||||
f 0444 root sys $MANDIR/fr/man1/lpoptions.1 man/lpoptions.man
|
||||
f 0444 root sys $MANDIR/fr/man1/lppasswd.1 man/lppasswd.man
|
||||
f 0444 root sys $MANDIR/fr/man1/lpq.1 man/lpq.man
|
||||
f 0444 root sys $MANDIR/fr/man1/lprm.1 man/lprm.man
|
||||
f 0444 root sys $MANDIR/fr/man1/lpr.1 man/lpr.man
|
||||
f 0444 root sys $MANDIR/fr/man1/lpstat.1 man/lpstat.man
|
||||
f 0444 root sys $MANDIR/fr/man1/lp.1 man/lp.man
|
||||
l 0444 root sys $MANDIR/fr/man1/cancel.1 lp.1
|
||||
f 0444 root sys $MANDIR/fr/man1/backend.$MAN1EXT man/backend.man
|
||||
f 0444 root sys $MANDIR/fr/man1/filter.$MAN1EXT man/filter.man
|
||||
f 0444 root sys $MANDIR/fr/man1/lpoptions.$MAN1EXT man/lpoptions.man
|
||||
f 0444 root sys $MANDIR/fr/man1/lppasswd.$MAN1EXT man/lppasswd.man
|
||||
f 0444 root sys $MANDIR/fr/man1/lpq.$MAN1EXT man/lpq.man
|
||||
f 0444 root sys $MANDIR/fr/man1/lprm.$MAN1EXT man/lprm.man
|
||||
f 0444 root sys $MANDIR/fr/man1/lpr.$MAN1EXT man/lpr.man
|
||||
f 0444 root sys $MANDIR/fr/man1/lpstat.$MAN1EXT man/lpstat.man
|
||||
f 0444 root sys $MANDIR/fr/man1/lp.$MAN1EXT man/lp.man
|
||||
l 0444 root sys $MANDIR/fr/man1/cancel.$MAN1EXT lp.$MAN1EXT
|
||||
|
||||
f 0444 root sys $PMANDIR/fr/man3/cups-config.3 man/cups-config.man
|
||||
f 0444 root sys $PMANDIR/fr/man3/cups-config.$MAN3EXT man/cups-config.man
|
||||
|
||||
f 0444 root sys $MANDIR/fr/man5/classes.conf.5 man/classes.conf.man
|
||||
f 0444 root sys $MANDIR/fr/man5/cupsd.conf.5 man/cupsd.conf.man
|
||||
f 0444 root sys $MANDIR/fr/man5/mime.convs.5 man/mime.convs.man
|
||||
f 0444 root sys $MANDIR/fr/man5/mime.types.5 man/mime.types.man
|
||||
f 0444 root sys $MANDIR/fr/man5/printers.conf.5 man/printers.conf.man
|
||||
f 0444 root sys $MANDIR/fr/man5/classes.conf.$MAN5EXT man/classes.conf.man
|
||||
f 0444 root sys $MANDIR/fr/man5/cupsd.conf.$MAN5EXT man/cupsd.conf.man
|
||||
f 0444 root sys $MANDIR/fr/man5/mime.convs.$MAN5EXT man/mime.convs.man
|
||||
f 0444 root sys $MANDIR/fr/man5/mime.types.$MAN5EXT man/mime.types.man
|
||||
f 0444 root sys $MANDIR/fr/man5/printers.conf.$MAN5EXT man/printers.conf.man
|
||||
|
||||
f 0444 root sys $AMANDIR/fr/man$MAN8DIR/accept.$MAN8EXT man/accept.man
|
||||
l 0444 root sys $AMANDIR/fr/man$MAN8DIR/reject.$MAN8EXT accept.$MAN8EXT
|
||||
|
||||
+3
-7
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# "$Id: cups.spec 3961 2003-10-16 19:50:14Z mike $"
|
||||
# "$Id: cups.spec 3724 2003-05-14 18:24:38Z mike $"
|
||||
#
|
||||
# RPM "spec" file for the Common UNIX Printing System (CUPS).
|
||||
#
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
Summary: Common Unix Printing System
|
||||
Name: cups
|
||||
Version: 1.1.20rc4
|
||||
Version: 1.1.19
|
||||
Release: 1
|
||||
Copyright: GPL
|
||||
Group: System Environment/Daemons
|
||||
@@ -138,25 +138,21 @@ rm -rf $RPM_BUILD_ROOT
|
||||
# OLD RedHat/Mandrake
|
||||
/etc/rc.d/init.d/*
|
||||
/etc/rc.d/rc0.d/*
|
||||
/etc/rc.d/rc2.d/*
|
||||
/etc/rc.d/rc3.d/*
|
||||
/etc/rc.d/rc5.d/*
|
||||
|
||||
#/sbin/rc.d/*
|
||||
#/sbin/rc.d/rc0.d/*
|
||||
#/sbin/rc.d/rc2.d/*
|
||||
#/sbin/rc.d/rc3.d/*
|
||||
#/sbin/rc.d/rc5.d/*
|
||||
|
||||
# NEW RedHat/Mandrake
|
||||
#/etc/init.d/*
|
||||
#/etc/rc0.d/*
|
||||
#/etc/rc2.d/*
|
||||
#/etc/rc3.d/*
|
||||
#/etc/rc5.d/*
|
||||
|
||||
/usr/bin/cancel
|
||||
/usr/bin/cupstestppd
|
||||
/usr/bin/disable
|
||||
/usr/bin/enable
|
||||
/usr/bin/lp*
|
||||
@@ -219,5 +215,5 @@ rm -rf $RPM_BUILD_ROOT
|
||||
/usr/lib/*.so*
|
||||
|
||||
#
|
||||
# End of "$Id: cups.spec 3961 2003-10-16 19:50:14Z mike $".
|
||||
# End of "$Id: cups.spec 3724 2003-05-14 18:24:38Z mike $".
|
||||
#
|
||||
|
||||
+3
-8
@@ -1,19 +1,15 @@
|
||||
# DO NOT DELETE
|
||||
|
||||
attr.o: ppd.h debug.h string.h ../config.h
|
||||
auth.o: cups.h ipp.h http.h string.h ../config.h md5.h ppd.h language.h
|
||||
auth.o: debug.h
|
||||
dest.o: cups.h ipp.h http.h string.h ../config.h md5.h ppd.h language.h
|
||||
emit.o: ppd.h string.h ../config.h
|
||||
encode.o: cups.h ipp.h http.h string.h ../config.h md5.h ppd.h debug.h
|
||||
getputfile.o: cups.h ipp.h http.h string.h ../config.h md5.h ppd.h language.h
|
||||
getputfile.o: debug.h
|
||||
http.o: http-private.h ../config.h http.h string.h md5.h debug.h
|
||||
http.o: string.h ../config.h http.h md5.h http-private.h debug.h
|
||||
http-addr.o: string.h ../config.h http.h md5.h
|
||||
http-support.o: string.h ../config.h http.h md5.h ipp.h
|
||||
ipp.o: string.h ../config.h ipp.h http.h md5.h debug.h
|
||||
ipp.o: string.h ../config.h language.h ipp.h http.h md5.h debug.h
|
||||
ipp-support.o: string.h ../config.h language.h ipp.h http.h md5.h debug.h
|
||||
language.o: string.h ../config.h language.h debug.h cups_C.h
|
||||
language.o: string.h ../config.h language.h cups_C.h
|
||||
mark.o: ppd.h string.h ../config.h debug.h
|
||||
md5.o: md5.h string.h ../config.h
|
||||
md5passwd.o: http.h string.h ../config.h md5.h
|
||||
@@ -27,5 +23,4 @@ usersys.o: cups.h ipp.h http.h string.h ../config.h md5.h ppd.h
|
||||
util.o: cups.h ipp.h http.h string.h ../config.h md5.h ppd.h language.h
|
||||
util.o: debug.h
|
||||
testhttp.o: http.h string.h ../config.h md5.h
|
||||
testipp.o: ../cups/string.h ../config.h string.h ipp.h http.h md5.h
|
||||
testlang.o: language.h
|
||||
|
||||
+4
-4
@@ -30,10 +30,10 @@ include ../Makedefs
|
||||
# Object files...
|
||||
#
|
||||
|
||||
LIBOBJS = attr.o auth.o dest.o emit.o encode.o getputfile.o \
|
||||
http.o http-addr.o http-support.o ipp.o ipp-support.o \
|
||||
language.o mark.o md5.o md5passwd.o options.o page.o \
|
||||
ppd.o snprintf.o string.o tempfile.o usersys.o util.o
|
||||
LIBOBJS = attr.o dest.o emit.o encode.o http.o http-addr.o \
|
||||
http-support.o ipp.o ipp-support.o language.o mark.o \
|
||||
md5.o md5passwd.o options.o page.o ppd.o snprintf.o \
|
||||
string.o tempfile.o usersys.o util.o
|
||||
OBJS = $(LIBOBJS) testhttp.o testipp.o testlang.o
|
||||
|
||||
|
||||
|
||||
-238
@@ -1,238 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Authentication functions for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 1997-2003 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE.txt" which should have been included with this file. If this
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636-3111 USA
|
||||
*
|
||||
* Voice: (301) 373-9603
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* cupsDoAuthentication() - Authenticate a request...
|
||||
* cups_local_auth() - Get the local authorization certificate if
|
||||
* available/applicable...
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include "cups.h"
|
||||
#include "ipp.h"
|
||||
#include "language.h"
|
||||
#include "string.h"
|
||||
#include "debug.h"
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#if defined(WIN32) || defined(__EMX__)
|
||||
# include <io.h>
|
||||
#else
|
||||
# include <unistd.h>
|
||||
#endif /* WIN32 || __EMX__ */
|
||||
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
|
||||
static int cups_local_auth(http_t *http);
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsDoAuthentication()' - Authenticate a request...
|
||||
*/
|
||||
|
||||
int /* O - 0 on success, -1 on error */
|
||||
cupsDoAuthentication(http_t *http, /* I - HTTP connection to server */
|
||||
const char *method,/* I - Request method (GET, POST, PUT) */
|
||||
const char *resource)
|
||||
/* I - Resource path */
|
||||
{
|
||||
const char *password; /* Password string */
|
||||
char prompt[1024], /* Prompt for user */
|
||||
realm[HTTP_MAX_VALUE], /* realm="xyz" string */
|
||||
nonce[HTTP_MAX_VALUE], /* nonce="xyz" string */
|
||||
encode[512]; /* Encoded username:password */
|
||||
|
||||
|
||||
/*
|
||||
* Clear the current authentication string...
|
||||
*/
|
||||
|
||||
http->authstring[0] = '\0';
|
||||
|
||||
/*
|
||||
* See if we can do local authentication...
|
||||
*/
|
||||
|
||||
if (!cups_local_auth(http))
|
||||
return (0);
|
||||
|
||||
/*
|
||||
* Nope, see if we should retry the current digest password...
|
||||
*/
|
||||
|
||||
if (strncmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE], "Basic", 5) == 0 ||
|
||||
http->digest_tries > 1 || !http->userpass[0])
|
||||
{
|
||||
/*
|
||||
* Nope - get a new password from the user...
|
||||
*/
|
||||
|
||||
snprintf(prompt, sizeof(prompt), "Password for %s on %s? ", cupsUser(),
|
||||
http->hostname);
|
||||
|
||||
http->digest_tries = 0;
|
||||
http->userpass[0] = '\0';
|
||||
|
||||
if ((password = cupsGetPassword(prompt)) == NULL)
|
||||
return (-1);
|
||||
|
||||
if (!password[0])
|
||||
return (-1);
|
||||
|
||||
snprintf(http->userpass, sizeof(http->userpass), "%s:%s", cupsUser(),
|
||||
password);
|
||||
}
|
||||
else
|
||||
http->digest_tries ++;
|
||||
|
||||
/*
|
||||
* Got a password; encode it for the server...
|
||||
*/
|
||||
|
||||
if (strncmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE], "Basic", 5) == 0)
|
||||
{
|
||||
/*
|
||||
* Basic authentication...
|
||||
*/
|
||||
|
||||
httpEncode64(encode, http->userpass);
|
||||
snprintf(http->authstring, sizeof(http->authstring), "Basic %s", encode);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Digest authentication...
|
||||
*/
|
||||
|
||||
httpGetSubField(http, HTTP_FIELD_WWW_AUTHENTICATE, "realm", realm);
|
||||
httpGetSubField(http, HTTP_FIELD_WWW_AUTHENTICATE, "nonce", nonce);
|
||||
|
||||
httpMD5(cupsUser(), realm, strchr(http->userpass, ':') + 1, encode);
|
||||
httpMD5Final(nonce, "POST", resource, encode);
|
||||
snprintf(http->authstring, sizeof(http->authstring),
|
||||
"Digest username=\"%s\", realm=\"%s\", nonce=\"%s\", "
|
||||
"response=\"%s\"", cupsUser(), realm, nonce, encode);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cups_local_auth()' - Get the local authorization certificate if
|
||||
* available/applicable...
|
||||
*/
|
||||
|
||||
static int /* O - 0 if available, -1 if not */
|
||||
cups_local_auth(http_t *http) /* I - HTTP connection to server */
|
||||
{
|
||||
#if defined(WIN32) || defined(__EMX__)
|
||||
/*
|
||||
* Currently WIN32 and OS-2 do not support the CUPS server...
|
||||
*/
|
||||
|
||||
return (-1);
|
||||
#else
|
||||
int pid; /* Current process ID */
|
||||
FILE *fp; /* Certificate file */
|
||||
char filename[1024], /* Certificate filename */
|
||||
certificate[33]; /* Certificate string */
|
||||
const char *root; /* Server root directory */
|
||||
|
||||
|
||||
DEBUG_printf(("cups_local_auth(http=%p) hostaddr=%08x, hostname=\"%s\"\n",
|
||||
http, ntohl(http->hostaddr.sin_addr.s_addr), http->hostname));
|
||||
|
||||
/*
|
||||
* See if we are accessing localhost...
|
||||
*/
|
||||
|
||||
if (ntohl(http->hostaddr.sin_addr.s_addr) != 0x7f000001 &&
|
||||
strcasecmp(http->hostname, "localhost") != 0)
|
||||
{
|
||||
DEBUG_puts("cups_local_auth: Not a local connection!");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Try opening a certificate file for this PID. If that fails,
|
||||
* try the root certificate...
|
||||
*/
|
||||
|
||||
if ((root = getenv("CUPS_SERVERROOT")) == NULL)
|
||||
root = CUPS_SERVERROOT;
|
||||
|
||||
pid = getpid();
|
||||
snprintf(filename, sizeof(filename), "%s/certs/%d", root, pid);
|
||||
if ((fp = fopen(filename, "r")) == NULL && pid > 0)
|
||||
{
|
||||
DEBUG_printf(("cups_local_auth: Unable to open file %s: %s\n",
|
||||
filename, strerror(errno)));
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/certs/0", root);
|
||||
fp = fopen(filename, "r");
|
||||
}
|
||||
|
||||
if (fp == NULL)
|
||||
{
|
||||
DEBUG_printf(("cups_local_auth: Unable to open file %s: %s\n",
|
||||
filename, strerror(errno)));
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Read the certificate from the file...
|
||||
*/
|
||||
|
||||
fgets(certificate, sizeof(certificate), fp);
|
||||
fclose(fp);
|
||||
|
||||
/*
|
||||
* Set the authorization string and return...
|
||||
*/
|
||||
|
||||
snprintf(http->authstring, sizeof(http->authstring), "Local %s", certificate);
|
||||
|
||||
DEBUG_printf(("cups_local_auth: Returning authstring = \"%s\"\n",
|
||||
http->authstring));
|
||||
|
||||
return (0);
|
||||
#endif /* WIN32 || __EMX__ */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
+3
-14
@@ -48,10 +48,10 @@ extern "C" {
|
||||
* Constants...
|
||||
*/
|
||||
|
||||
# define CUPS_VERSION 1.0120
|
||||
# define CUPS_VERSION 1.0119
|
||||
# define CUPS_VERSION_MAJOR 1
|
||||
# define CUPS_VERSION_MINOR 1
|
||||
# define CUPS_VERSION_PATCH 20
|
||||
# define CUPS_VERSION_PATCH 19
|
||||
# define CUPS_DATE_ANY -1
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ enum /* Not a typedef'd enum so we can OR */
|
||||
CUPS_PRINTER_IMPLICIT = 0x10000, /* Implicit class */
|
||||
CUPS_PRINTER_DEFAULT = 0x20000, /* Default printer on network */
|
||||
CUPS_PRINTER_FAX = 0x40000, /* Fax queue */
|
||||
CUPS_PRINTER_OPTIONS = 0x6fffc /* ~(CLASS | REMOTE | IMPLICIT) */
|
||||
CUPS_PRINTER_OPTIONS = 0xfffc /* ~(CLASS | REMOTE | IMPLICIT) */
|
||||
};
|
||||
|
||||
typedef struct /**** Printer Options ****/
|
||||
@@ -170,17 +170,6 @@ extern void cupsSetServer(const char *server);
|
||||
extern void cupsSetUser(const char *user);
|
||||
extern const char *cupsUser(void);
|
||||
|
||||
/**** New in CUPS 1.1.20 ****/
|
||||
extern int cupsDoAuthentication(http_t *http, const char *method,
|
||||
const char *resource);
|
||||
extern http_status_t cupsGetFile(http_t *http, const char *resource,
|
||||
const char *filename);
|
||||
extern http_status_t cupsGetFd(http_t *http, const char *resource, int fd);
|
||||
extern http_status_t cupsPutFile(http_t *http, const char *resource,
|
||||
const char *filename);
|
||||
extern http_status_t cupsPutFd(http_t *http, const char *resource, int fd);
|
||||
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif /* __cplusplus */
|
||||
|
||||
+9
-91
@@ -207,8 +207,7 @@ ppdEmit(ppd_file_t *ppd, /* I - PPD file record */
|
||||
|
||||
ppd_attr_t *attr; /* PPD attribute */
|
||||
int pos, /* Position of custom value */
|
||||
values[5], /* Values for custom command */
|
||||
orientation; /* Orientation to use */
|
||||
values[5]; /* Values for custom command */
|
||||
|
||||
|
||||
fputs("%%BeginFeature: *CustomPageSize True\n", fp);
|
||||
@@ -241,38 +240,6 @@ ppdEmit(ppd_file_t *ppd, /* I - PPD file record */
|
||||
|
||||
values[pos] = (int)size->length;
|
||||
|
||||
if (size->width < size->length)
|
||||
orientation = 1;
|
||||
else
|
||||
orientation = 0;
|
||||
|
||||
if ((attr = ppdFindAttr(ppd, "ParamCustomPageSize",
|
||||
"Orientation")) != NULL)
|
||||
{
|
||||
int min_orient, max_orient; /* Minimum and maximum orientations */
|
||||
|
||||
|
||||
if (sscanf(attr->value, "%d%*s%d%d", &pos, &min_orient,
|
||||
&max_orient) != 3)
|
||||
pos = 4;
|
||||
else
|
||||
{
|
||||
pos --;
|
||||
|
||||
if (pos < 0 || pos > 4)
|
||||
pos = 4;
|
||||
|
||||
if (orientation > max_orient)
|
||||
orientation = max_orient;
|
||||
else if (orientation < min_orient)
|
||||
orientation = min_orient;
|
||||
}
|
||||
}
|
||||
else
|
||||
pos = 4;
|
||||
|
||||
values[pos] = orientation;
|
||||
|
||||
fprintf(fp, "%d %d %d %d %d\n", values[0], values[1],
|
||||
values[2], values[3], values[4]);
|
||||
|
||||
@@ -410,8 +377,7 @@ ppdEmitFd(ppd_file_t *ppd, /* I - PPD file record */
|
||||
|
||||
ppd_attr_t *attr; /* PPD attribute */
|
||||
int pos, /* Position of custom value */
|
||||
values[5], /* Values for custom command */
|
||||
orientation; /* Orientation to use */
|
||||
values[5]; /* Values for custom command */
|
||||
|
||||
|
||||
size = ppdPageSize(ppd, "Custom");
|
||||
@@ -442,38 +408,6 @@ ppdEmitFd(ppd_file_t *ppd, /* I - PPD file record */
|
||||
|
||||
values[pos] = (int)size->length;
|
||||
|
||||
if (size->width < size->length)
|
||||
orientation = 1;
|
||||
else
|
||||
orientation = 0;
|
||||
|
||||
if ((attr = ppdFindAttr(ppd, "ParamCustomPageSize",
|
||||
"Orientation")) != NULL)
|
||||
{
|
||||
int min_orient, max_orient; /* Minimum and maximum orientations */
|
||||
|
||||
|
||||
if (sscanf(attr->value, "%d%*s%d%d", &pos, &min_orient,
|
||||
&max_orient) != 3)
|
||||
pos = 4;
|
||||
else
|
||||
{
|
||||
pos --;
|
||||
|
||||
if (pos < 0 || pos > 4)
|
||||
pos = 4;
|
||||
|
||||
if (orientation > max_orient)
|
||||
orientation = max_orient;
|
||||
else if (orientation < min_orient)
|
||||
orientation = min_orient;
|
||||
}
|
||||
}
|
||||
else
|
||||
pos = 4;
|
||||
|
||||
values[pos] = orientation;
|
||||
|
||||
snprintf(buf, sizeof(buf), "%d %d %d %d %d\n", values[0], values[1],
|
||||
values[2], values[3], values[4]);
|
||||
|
||||
@@ -542,8 +476,7 @@ ppdEmitJCL(ppd_file_t *ppd, /* I - PPD file record */
|
||||
const char *user, /* I - Username */
|
||||
const char *title) /* I - Title */
|
||||
{
|
||||
char *ptr; /* Pointer into JCL string */
|
||||
char temp[81]; /* Local title string */
|
||||
const char *ptr; /* Pointer into JCL string */
|
||||
|
||||
|
||||
/*
|
||||
@@ -562,13 +495,9 @@ ppdEmitJCL(ppd_file_t *ppd, /* I - PPD file record */
|
||||
/*
|
||||
* This printer uses HP PJL commands for output; filter the output
|
||||
* so that we only have a single "@PJL JOB" command in the header...
|
||||
*
|
||||
* To avoid bugs in the PJL implementation of certain vendors' products
|
||||
* (Xerox in particular), we add a dummy "@PJL" command at the beginning
|
||||
* of the PJL commands to initialize PJL processing.
|
||||
*/
|
||||
|
||||
fputs("\033%-12345X@PJL\n", fp);
|
||||
fputs("\033%-12345X", fp);
|
||||
for (ptr = ppd->jcl_begin + 9; *ptr;)
|
||||
if (strncmp(ptr, "@PJL JOB", 8) == 0)
|
||||
{
|
||||
@@ -607,29 +536,18 @@ ppdEmitJCL(ppd_file_t *ppd, /* I - PPD file record */
|
||||
if ((ptr = strrchr(title, '/')) != NULL)
|
||||
title = ptr + 1;
|
||||
|
||||
/*
|
||||
* Replace double quotes with single quotes so that the title
|
||||
* does not cause a PJL syntax error.
|
||||
*/
|
||||
|
||||
strlcpy(temp, title, sizeof(temp));
|
||||
|
||||
for (ptr = temp; *ptr; ptr ++)
|
||||
if (*ptr == '\"')
|
||||
*ptr = '\'';
|
||||
|
||||
/*
|
||||
* Send PJL JOB command before we enter PostScript mode...
|
||||
*/
|
||||
|
||||
fprintf(fp, "@PJL JOB NAME = \"%s\" DISPLAY = \"%d %s %s\"\n", temp,
|
||||
job_id, user, temp);
|
||||
fprintf(fp, "@PJL JOB NAME = \"%s\" DISPLAY = \"%d %s %s\"\n", title,
|
||||
job_id, user, title);
|
||||
}
|
||||
else
|
||||
fputs(ppd->jcl_begin, fp);
|
||||
fputs(ppd->jcl_begin, stdout);
|
||||
|
||||
ppdEmit(ppd, fp, PPD_ORDER_JCL);
|
||||
fputs(ppd->jcl_ps, fp);
|
||||
ppdEmit(ppd, stdout, PPD_ORDER_JCL);
|
||||
fputs(ppd->jcl_ps, stdout);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
+1
-3
@@ -290,9 +290,7 @@ cupsEncodeOptions(ipp_t *ipp, /* I - Request to add to */
|
||||
break;
|
||||
|
||||
case IPP_TAG_BOOLEAN :
|
||||
if (!strcasecmp(val, "true") ||
|
||||
!strcasecmp(val, "on") ||
|
||||
!strcasecmp(val, "yes"))
|
||||
if (strcasecmp(val, "true") == 0)
|
||||
{
|
||||
/*
|
||||
* Boolean value - true...
|
||||
|
||||
@@ -1,435 +0,0 @@
|
||||
/*
|
||||
* "$Id$"
|
||||
*
|
||||
* Get/put file functions for the Common UNIX Printing System (CUPS).
|
||||
*
|
||||
* Copyright 1997-2003 by Easy Software Products.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Easy Software Products and are protected by Federal
|
||||
* copyright law. Distribution and use rights are outlined in the file
|
||||
* "LICENSE.txt" which should have been included with this file. If this
|
||||
* file is missing or damaged please contact Easy Software Products
|
||||
* at:
|
||||
*
|
||||
* Attn: CUPS Licensing Information
|
||||
* Easy Software Products
|
||||
* 44141 Airport View Drive, Suite 204
|
||||
* Hollywood, Maryland 20636-3111 USA
|
||||
*
|
||||
* Voice: (301) 373-9603
|
||||
* EMail: cups-info@cups.org
|
||||
* WWW: http://www.cups.org
|
||||
*
|
||||
* This file is subject to the Apple OS-Developed Software exception.
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* cupsGetFd() - Get a file from the server.
|
||||
* cupsGetFile() - Get a file from the server.
|
||||
* cupsPutFd() - Put a file on the server.
|
||||
* cupsPutFile() - Put a file on the server.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include "cups.h"
|
||||
#include "ipp.h"
|
||||
#include "language.h"
|
||||
#include "string.h"
|
||||
#include "debug.h"
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#if defined(WIN32) || defined(__EMX__)
|
||||
# include <io.h>
|
||||
#else
|
||||
# include <unistd.h>
|
||||
#endif /* WIN32 || __EMX__ */
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsGetFd()' - Get a file from the server.
|
||||
*/
|
||||
|
||||
http_status_t /* O - Status */
|
||||
cupsGetFd(http_t *http, /* I - HTTP connection to server */
|
||||
const char *resource, /* I - Resource name */
|
||||
int fd) /* I - File descriptor */
|
||||
{
|
||||
int bytes; /* Number of bytes read */
|
||||
char buffer[8192]; /* Buffer for file */
|
||||
http_status_t status; /* HTTP status from server */
|
||||
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
if (!http || !resource || fd < 0)
|
||||
{
|
||||
if (http)
|
||||
http->error = EINVAL;
|
||||
|
||||
return (HTTP_ERROR);
|
||||
}
|
||||
|
||||
/*
|
||||
* Then send GET requests to the HTTP server...
|
||||
*/
|
||||
|
||||
do
|
||||
{
|
||||
httpClearFields(http);
|
||||
httpSetField(http, HTTP_FIELD_AUTHORIZATION, http->authstring);
|
||||
|
||||
if (httpGet(http, resource))
|
||||
{
|
||||
if (httpReconnect(http))
|
||||
{
|
||||
status = HTTP_ERROR;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
status = HTTP_UNAUTHORIZED;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
while ((status = httpUpdate(http)) == HTTP_CONTINUE);
|
||||
|
||||
if (status == HTTP_UNAUTHORIZED)
|
||||
{
|
||||
/*
|
||||
* Flush any error message...
|
||||
*/
|
||||
|
||||
httpFlush(http);
|
||||
|
||||
/*
|
||||
* See if we can do authentication...
|
||||
*/
|
||||
|
||||
if (cupsDoAuthentication(http, "GET", resource))
|
||||
break;
|
||||
|
||||
httpReconnect(http);
|
||||
|
||||
continue;
|
||||
}
|
||||
else if (status == HTTP_ERROR)
|
||||
{
|
||||
#ifdef WIN32
|
||||
if (http->error != WSAENETDOWN && http->error != WSAENETUNREACH)
|
||||
#else
|
||||
if (http->error != ENETDOWN && http->error != ENETUNREACH)
|
||||
#endif /* WIN32 */
|
||||
continue;
|
||||
else
|
||||
break;
|
||||
}
|
||||
#ifdef HAVE_LIBSSL
|
||||
else if (status == HTTP_UPGRADE_REQUIRED)
|
||||
{
|
||||
/*
|
||||
* Flush any error message...
|
||||
*/
|
||||
|
||||
httpFlush(http);
|
||||
|
||||
/*
|
||||
* Upgrade with encryption...
|
||||
*/
|
||||
|
||||
httpEncryption(http, HTTP_ENCRYPT_REQUIRED);
|
||||
|
||||
/*
|
||||
* Try again, this time with encryption enabled...
|
||||
*/
|
||||
|
||||
continue;
|
||||
}
|
||||
#endif /* HAVE_LIBSSL */
|
||||
}
|
||||
while (status == HTTP_UNAUTHORIZED || status == HTTP_UPGRADE_REQUIRED ||
|
||||
status == HTTP_ERROR);
|
||||
|
||||
/*
|
||||
* See if we actually got the file or an error...
|
||||
*/
|
||||
|
||||
if (status == HTTP_OK)
|
||||
{
|
||||
/*
|
||||
* Yes, copy the file...
|
||||
*/
|
||||
|
||||
while ((bytes = httpRead(http, buffer, sizeof(buffer))) > 0)
|
||||
write(fd, buffer, bytes);
|
||||
}
|
||||
else
|
||||
httpFlush(http);
|
||||
|
||||
/*
|
||||
* Return the request status...
|
||||
*/
|
||||
|
||||
return (status);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsGetFile()' - Get a file from the server.
|
||||
*/
|
||||
|
||||
http_status_t /* O - Status */
|
||||
cupsGetFile(http_t *http, /* I - HTTP connection to server */
|
||||
const char *resource, /* I - Resource name */
|
||||
const char *filename) /* I - Filename */
|
||||
{
|
||||
int fd; /* File descriptor */
|
||||
http_status_t status; /* Status */
|
||||
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
if (!http || !resource || !filename)
|
||||
{
|
||||
if (http)
|
||||
http->error = EINVAL;
|
||||
|
||||
return (HTTP_ERROR);
|
||||
}
|
||||
|
||||
/*
|
||||
* Create the file...
|
||||
*/
|
||||
|
||||
if ((fd = open(filename, O_WRONLY | O_EXCL | O_TRUNC)) < 0)
|
||||
{
|
||||
/*
|
||||
* Couldn't open the file!
|
||||
*/
|
||||
|
||||
http->error = errno;
|
||||
|
||||
return (HTTP_ERROR);
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the file...
|
||||
*/
|
||||
|
||||
status = cupsGetFd(http, resource, fd);
|
||||
|
||||
/*
|
||||
* If the file couldn't be gotten, then remove the file...
|
||||
*/
|
||||
|
||||
close(fd);
|
||||
|
||||
if (status != HTTP_OK)
|
||||
unlink(filename);
|
||||
|
||||
/*
|
||||
* Return the HTTP status code...
|
||||
*/
|
||||
|
||||
return (status);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsPutFd()' - Put a file on the server.
|
||||
*/
|
||||
|
||||
http_status_t /* O - Status */
|
||||
cupsPutFd(http_t *http, /* I - HTTP connection to server */
|
||||
const char *resource, /* I - Resource name */
|
||||
int fd) /* I - File descriptor */
|
||||
{
|
||||
int bytes; /* Number of bytes read */
|
||||
char buffer[8192]; /* Buffer for file */
|
||||
http_status_t status; /* HTTP status from server */
|
||||
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
if (!http || !resource || fd < 0)
|
||||
{
|
||||
if (http)
|
||||
http->error = EINVAL;
|
||||
|
||||
return (HTTP_ERROR);
|
||||
}
|
||||
|
||||
/*
|
||||
* Then send PUT requests to the HTTP server...
|
||||
*/
|
||||
|
||||
do
|
||||
{
|
||||
httpClearFields(http);
|
||||
httpSetField(http, HTTP_FIELD_AUTHORIZATION, http->authstring);
|
||||
httpSetField(http, HTTP_FIELD_TRANSFER_ENCODING, "chunked");
|
||||
|
||||
if (httpPut(http, resource))
|
||||
{
|
||||
if (httpReconnect(http))
|
||||
{
|
||||
status = HTTP_ERROR;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
status = HTTP_UNAUTHORIZED;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Copy the file...
|
||||
*/
|
||||
|
||||
lseek(fd, 0, SEEK_SET);
|
||||
|
||||
status = HTTP_CONTINUE;
|
||||
|
||||
while ((bytes = read(fd, buffer, sizeof(buffer))) > 0)
|
||||
if (httpCheck(http))
|
||||
{
|
||||
if ((status = httpUpdate(http)) != HTTP_CONTINUE)
|
||||
break;
|
||||
}
|
||||
else
|
||||
httpWrite(http, buffer, bytes);
|
||||
|
||||
if (status == HTTP_CONTINUE)
|
||||
{
|
||||
httpWrite(http, buffer, 0);
|
||||
|
||||
while ((status = httpUpdate(http)) == HTTP_CONTINUE);
|
||||
}
|
||||
|
||||
if (status == HTTP_UNAUTHORIZED)
|
||||
{
|
||||
/*
|
||||
* Flush any error message...
|
||||
*/
|
||||
|
||||
httpFlush(http);
|
||||
|
||||
/*
|
||||
* See if we can do authentication...
|
||||
*/
|
||||
|
||||
if (cupsDoAuthentication(http, "PUT", resource))
|
||||
break;
|
||||
|
||||
httpReconnect(http);
|
||||
|
||||
continue;
|
||||
}
|
||||
else if (status == HTTP_ERROR)
|
||||
{
|
||||
#ifdef WIN32
|
||||
if (http->error != WSAENETDOWN && http->error != WSAENETUNREACH)
|
||||
#else
|
||||
if (http->error != ENETDOWN && http->error != ENETUNREACH)
|
||||
#endif /* WIN32 */
|
||||
continue;
|
||||
else
|
||||
break;
|
||||
}
|
||||
#ifdef HAVE_LIBSSL
|
||||
else if (status == HTTP_UPGRADE_REQUIRED)
|
||||
{
|
||||
/* Flush any error message... */
|
||||
httpFlush(http);
|
||||
|
||||
/* Upgrade with encryption... */
|
||||
httpEncryption(http, HTTP_ENCRYPT_REQUIRED);
|
||||
|
||||
/* Try again, this time with encryption enabled... */
|
||||
continue;
|
||||
}
|
||||
#endif /* HAVE_LIBSSL */
|
||||
}
|
||||
while (status == HTTP_UNAUTHORIZED || status == HTTP_UPGRADE_REQUIRED ||
|
||||
status == HTTP_ERROR);
|
||||
|
||||
/*
|
||||
* See if we actually put the file or an error...
|
||||
*/
|
||||
|
||||
if (status != HTTP_CREATED)
|
||||
httpFlush(http);
|
||||
|
||||
return (status);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsPutFile()' - Put a file on the server.
|
||||
*/
|
||||
|
||||
http_status_t /* O - Status */
|
||||
cupsPutFile(http_t *http, /* I - HTTP connection to server */
|
||||
const char *resource, /* I - Resource name */
|
||||
const char *filename) /* I - Filename */
|
||||
{
|
||||
int fd; /* File descriptor */
|
||||
http_status_t status; /* Status */
|
||||
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
if (!http || !resource || !filename)
|
||||
{
|
||||
if (http)
|
||||
http->error = EINVAL;
|
||||
|
||||
return (HTTP_ERROR);
|
||||
}
|
||||
|
||||
/*
|
||||
* Open the local file...
|
||||
*/
|
||||
|
||||
if ((fd = open(filename, O_RDONLY)) < 0)
|
||||
{
|
||||
/*
|
||||
* Couldn't open the file!
|
||||
*/
|
||||
|
||||
http->error = errno;
|
||||
|
||||
return (HTTP_ERROR);
|
||||
}
|
||||
|
||||
/*
|
||||
* Put the file...
|
||||
*/
|
||||
|
||||
status = cupsPutFd(http, resource, fd);
|
||||
|
||||
close(fd);
|
||||
|
||||
return (status);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
+2
-27
@@ -31,19 +31,8 @@
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
# include "config.h"
|
||||
|
||||
# ifdef __sun
|
||||
/*
|
||||
* Define FD_SETSIZE to CUPS_MAX_FDS on Solaris to get the correct version of
|
||||
* select() for large numbers of file descriptors.
|
||||
*/
|
||||
|
||||
# define FD_SETSIZE CUPS_MAX_FDS
|
||||
# include <sys/select.h>
|
||||
# endif /* __sun */
|
||||
|
||||
# include "http.h"
|
||||
# include "config.h"
|
||||
|
||||
# if defined HAVE_LIBSSL
|
||||
/*
|
||||
@@ -80,21 +69,7 @@ typedef struct
|
||||
typedef SSLConnectionRef http_tls_t;
|
||||
|
||||
# endif /* HAVE_LIBSSL */
|
||||
|
||||
/*
|
||||
* Some OS's don't have hstrerror(), most notably Solaris...
|
||||
*/
|
||||
|
||||
# ifndef HAVE_HSTRERROR
|
||||
extern const char *cups_hstrerror(int error);
|
||||
# define hstrerror cups_hstrerror
|
||||
# elif defined(_AIX)
|
||||
/*
|
||||
* AIX doesn't provide a prototype but does provide the function...
|
||||
*/
|
||||
extern const char *hstrerror(int error);
|
||||
# endif /* !HAVE_HSTRERROR */
|
||||
|
||||
|
||||
#endif /* !_CUPS_HTTP_PRIVATE_H_ */
|
||||
|
||||
/*
|
||||
|
||||
+3
-32
@@ -25,10 +25,9 @@
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* httpSeparate() - Separate a Universal Resource Identifier into its
|
||||
* components.
|
||||
* httpStatus() - Return a short string describing a HTTP status code.
|
||||
* cups_hstrerror() - hstrerror() emulation function for Solaris and others...
|
||||
* httpSeparate() - Separate a Universal Resource Identifier into its
|
||||
* components.
|
||||
* httpStatus() - Return a short string describing a HTTP status code.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -226,8 +225,6 @@ httpSeparate(const char *uri, /* I - Universal Resource Identifier */
|
||||
*port = 443;
|
||||
else if (strcasecmp(method, "ipp") == 0)
|
||||
*port = ippPort();
|
||||
else if (strcasecmp(method, "lpd") == 0)
|
||||
*port = 515;
|
||||
else if (strcasecmp(method, "socket") == 0) /* Not registered yet... */
|
||||
*port = 9100;
|
||||
else
|
||||
@@ -314,32 +311,6 @@ httpStatus(http_status_t status) /* I - HTTP status code */
|
||||
}
|
||||
|
||||
|
||||
#ifndef HAVE_HSTRERROR
|
||||
/*
|
||||
* 'cups_hstrerror()' - hstrerror() emulation function for Solaris and others...
|
||||
*/
|
||||
|
||||
const char * /* O - Error string */
|
||||
cups_hstrerror(int error) /* I - Error number */
|
||||
{
|
||||
static const char * const errors[] = /* Error strings */
|
||||
{
|
||||
"OK",
|
||||
"Host not found.",
|
||||
"Try again.",
|
||||
"Unrecoverable lookup error.",
|
||||
"No data associated with name."
|
||||
};
|
||||
|
||||
|
||||
if (error < 0 || error > 4)
|
||||
return ("Unknown hostname lookup error.");
|
||||
else
|
||||
return (errors[error]);
|
||||
}
|
||||
#endif /* !HAVE_HSTRERROR */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
|
||||
+72
-98
@@ -61,7 +61,6 @@
|
||||
* http_field() - Return the field index for a field name.
|
||||
* http_send() - Send a request with all fields and the trailing
|
||||
* blank line.
|
||||
* http_wait() - Wait for data available on a connection.
|
||||
* http_upgrade() - Force upgrade to TLS encryption.
|
||||
* http_setup_ssl() - Set up SSL/TLS on a connection.
|
||||
* http_shutdown_ssl() - Shut down SSL/TLS on a connection.
|
||||
@@ -75,8 +74,6 @@
|
||||
* Include necessary headers...
|
||||
*/
|
||||
|
||||
#include "http-private.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
@@ -86,6 +83,7 @@
|
||||
#include <errno.h>
|
||||
|
||||
#include "http.h"
|
||||
#include "http-private.h"
|
||||
#include "debug.h"
|
||||
|
||||
#ifndef WIN32
|
||||
@@ -112,7 +110,6 @@
|
||||
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);
|
||||
#ifdef HAVE_SSL
|
||||
static int http_upgrade(http_t *http);
|
||||
static int http_setup_ssl(http_t *http);
|
||||
@@ -1065,8 +1062,8 @@ httpRead(http_t *http, /* I - HTTP data */
|
||||
*/
|
||||
|
||||
void
|
||||
httpSetCookie(http_t *http, /* I - Connection */
|
||||
const char *cookie) /* I - Cookie string */
|
||||
httpSetCookie(http_t *http, /* I - Connection */
|
||||
const char *cookie) /* I - Cookie string */
|
||||
{
|
||||
if (!http)
|
||||
return;
|
||||
@@ -1089,6 +1086,13 @@ int /* O - 1 if data is available, 0 otherwise */
|
||||
httpWait(http_t *http, /* I - HTTP data */
|
||||
int msec) /* I - Milliseconds to wait */
|
||||
{
|
||||
#ifndef WIN32
|
||||
struct rlimit limit; /* Runtime limit */
|
||||
#endif /* !WIN32 */
|
||||
struct timeval timeout; /* Timeout */
|
||||
int nfds; /* Result from select() */
|
||||
|
||||
|
||||
/*
|
||||
* First see if there is data in the buffer...
|
||||
*/
|
||||
@@ -1099,11 +1103,68 @@ httpWait(http_t *http, /* I - HTTP data */
|
||||
if (http->used)
|
||||
return (1);
|
||||
|
||||
#ifdef HAVE_SSL
|
||||
if (http->tls)
|
||||
{
|
||||
# ifdef HAVE_LIBSSL
|
||||
if (SSL_pending((SSL *)(http->tls)))
|
||||
return (1);
|
||||
# elif defined(HAVE_GNUTLS)
|
||||
if (gnutls_record_check_pending(((http_tls_t *)(http->tls))->session))
|
||||
return (1);
|
||||
# elif defined(HAVE_CDSASSL)
|
||||
size_t bytes; /* Bytes that are available */
|
||||
|
||||
if (!SSLGetBufferedReadSize((SSLContextRef)http->tls, &bytes) && bytes > 0)
|
||||
return;
|
||||
# endif /* HAVE_LIBSSL */
|
||||
}
|
||||
#endif /* HAVE_SSL */
|
||||
|
||||
/*
|
||||
* If not, check the SSL/TLS buffers and do a select() on the connection...
|
||||
* Then try doing a select() to poll the socket...
|
||||
*/
|
||||
|
||||
return (http_wait(http, msec));
|
||||
if (!http->input_set)
|
||||
{
|
||||
#ifdef WIN32
|
||||
/*
|
||||
* Windows has a fixed-size select() structure, different (surprise,
|
||||
* surprise!) from all UNIX implementations. Just allocate this
|
||||
* fixed structure...
|
||||
*/
|
||||
|
||||
http->input_set = calloc(1, sizeof(fd_set));
|
||||
#else
|
||||
/*
|
||||
* Allocate the select() input set based upon the max number of file
|
||||
* descriptors available for this process...
|
||||
*/
|
||||
|
||||
getrlimit(RLIMIT_NOFILE, &limit);
|
||||
|
||||
http->input_set = calloc(1, (limit.rlim_cur + 7) / 8);
|
||||
#endif /* WIN32 */
|
||||
|
||||
if (!http->input_set)
|
||||
return (0);
|
||||
}
|
||||
|
||||
FD_SET(http->fd, http->input_set);
|
||||
|
||||
if (msec >= 0)
|
||||
{
|
||||
timeout.tv_sec = msec / 1000;
|
||||
timeout.tv_usec = (msec % 1000) * 1000;
|
||||
|
||||
nfds = select(http->fd + 1, http->input_set, NULL, NULL, &timeout);
|
||||
}
|
||||
else
|
||||
nfds = select(http->fd + 1, http->input_set, NULL, NULL, NULL);
|
||||
|
||||
FD_CLR(http->fd, http->input_set);
|
||||
|
||||
return (nfds > 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -1134,7 +1195,7 @@ httpWrite(http_t *http, /* I - HTTP data */
|
||||
{
|
||||
/*
|
||||
* A zero-length chunk ends a transfer; unless we are sending POST
|
||||
* or PUT data, go idle...
|
||||
* data, go idle...
|
||||
*/
|
||||
|
||||
DEBUG_puts("httpWrite: changing states...");
|
||||
@@ -1201,16 +1262,13 @@ httpWrite(http_t *http, /* I - HTTP data */
|
||||
if (http->data_remaining == 0 && http->data_encoding == HTTP_ENCODE_LENGTH)
|
||||
{
|
||||
/*
|
||||
* Finished with the transfer; unless we are sending POST or PUT
|
||||
* data, go idle...
|
||||
* Finished with the transfer; unless we are sending POST data, go idle...
|
||||
*/
|
||||
|
||||
DEBUG_puts("httpWrite: changing states...");
|
||||
|
||||
if (http->state == HTTP_POST_RECV)
|
||||
http->state ++;
|
||||
else if (http->state == HTTP_PUT_RECV)
|
||||
http->state = HTTP_STATUS;
|
||||
else
|
||||
http->state = HTTP_WAITING;
|
||||
}
|
||||
@@ -1297,7 +1355,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, 1000))
|
||||
if (!http->blocking && !httpWait(http, 1000))
|
||||
return (NULL);
|
||||
|
||||
#ifdef HAVE_SSL
|
||||
@@ -1963,90 +2021,6 @@ http_send(http_t *http, /* I - HTTP data */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'http_wait()' - Wait for data available on a connection.
|
||||
*/
|
||||
|
||||
static int /* O - 1 if data is available, 0 otherwise */
|
||||
http_wait(http_t *http, /* I - HTTP data */
|
||||
int msec) /* I - Milliseconds to wait */
|
||||
{
|
||||
#ifndef WIN32
|
||||
struct rlimit limit; /* Runtime limit */
|
||||
#endif /* !WIN32 */
|
||||
struct timeval timeout; /* Timeout */
|
||||
int nfds; /* Result from select() */
|
||||
|
||||
|
||||
/*
|
||||
* Check the SSL/TLS buffers for data first...
|
||||
*/
|
||||
|
||||
#ifdef HAVE_SSL
|
||||
if (http->tls)
|
||||
{
|
||||
# ifdef HAVE_LIBSSL
|
||||
if (SSL_pending((SSL *)(http->tls)))
|
||||
return (1);
|
||||
# elif defined(HAVE_GNUTLS)
|
||||
if (gnutls_record_check_pending(((http_tls_t *)(http->tls))->session))
|
||||
return (1);
|
||||
# elif defined(HAVE_CDSASSL)
|
||||
size_t bytes; /* Bytes that are available */
|
||||
|
||||
if (!SSLGetBufferedReadSize((SSLContextRef)http->tls, &bytes) && bytes > 0)
|
||||
return;
|
||||
# endif /* HAVE_LIBSSL */
|
||||
}
|
||||
#endif /* HAVE_SSL */
|
||||
|
||||
/*
|
||||
* Then try doing a select() to poll the socket...
|
||||
*/
|
||||
|
||||
if (!http->input_set)
|
||||
{
|
||||
#ifdef WIN32
|
||||
/*
|
||||
* Windows has a fixed-size select() structure, different (surprise,
|
||||
* surprise!) from all UNIX implementations. Just allocate this
|
||||
* fixed structure...
|
||||
*/
|
||||
|
||||
http->input_set = calloc(1, sizeof(fd_set));
|
||||
#else
|
||||
/*
|
||||
* Allocate the select() input set based upon the max number of file
|
||||
* descriptors available for this process...
|
||||
*/
|
||||
|
||||
getrlimit(RLIMIT_NOFILE, &limit);
|
||||
|
||||
http->input_set = calloc(1, (limit.rlim_cur + 31) / 8);
|
||||
#endif /* WIN32 */
|
||||
|
||||
if (!http->input_set)
|
||||
return (0);
|
||||
}
|
||||
|
||||
FD_SET(http->fd, http->input_set);
|
||||
|
||||
if (msec >= 0)
|
||||
{
|
||||
timeout.tv_sec = msec / 1000;
|
||||
timeout.tv_usec = (msec % 1000) * 1000;
|
||||
|
||||
nfds = select(http->fd + 1, http->input_set, NULL, NULL, &timeout);
|
||||
}
|
||||
else
|
||||
nfds = select(http->fd + 1, http->input_set, NULL, NULL, NULL);
|
||||
|
||||
FD_CLR(http->fd, http->input_set);
|
||||
|
||||
return (nfds > 0);
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_SSL
|
||||
/*
|
||||
* 'http_upgrade()' - Force upgrade to TLS encryption.
|
||||
|
||||
@@ -285,12 +285,6 @@ typedef struct
|
||||
fd_set *input_set; /* select() set for httpWait() */
|
||||
http_status_t expect; /* Expect: header */
|
||||
char *cookie; /* Cookie value(s) */
|
||||
/**** New in CUPS 1.1.20 ****/
|
||||
char authstring[HTTP_MAX_VALUE],
|
||||
/* Current Authentication value */
|
||||
userpass[HTTP_MAX_VALUE];
|
||||
/* Username:password string */
|
||||
int digest_tries; /* Number of tries for digest auth */
|
||||
} http_t;
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -2500,7 +2500,7 @@ ipp_read_http(http_t *http, /* I - Client connection */
|
||||
bytes = -1;
|
||||
break;
|
||||
}
|
||||
else if ((bytes = httpRead(http, (char *)buffer, length - tbytes)) <= 0)
|
||||
else if ((bytes = httpRead(http, (char *)buffer, length - tbytes)) < 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+76
-254
@@ -25,15 +25,13 @@
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* cupsLangEncoding() - Return the character encoding (us-ascii, etc.)
|
||||
* for the given language.
|
||||
* cupsLangFlush() - Flush all language data out of the cache.
|
||||
* cupsLangFree() - Free language data.
|
||||
* cupsLangGet() - Get a language.
|
||||
* _cupsRestoreLocale() - Restore the original locale...
|
||||
* _cupsSaveLocale() - Set the locale and save a copy of the old locale...
|
||||
* appleLangDefault() - Get the default locale string.
|
||||
* cups_cache_lookup() - Lookup a language in the cache...
|
||||
* cupsLangEncoding() - Return the character encoding (us-ascii, etc.)
|
||||
* for the given language.
|
||||
* cupsLangFlush() - Flush all language data out of the cache.
|
||||
* cupsLangFree() - Free language data.
|
||||
* cupsLangGet() - Get a language.
|
||||
* appleLangDefault() - Get the default locale string.
|
||||
* cups_cache_lookup() - Lookup a language in the cache...
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -50,7 +48,6 @@
|
||||
#endif /* WIN32 */
|
||||
#include "string.h"
|
||||
#include "language.h"
|
||||
#include "debug.h"
|
||||
|
||||
|
||||
/*
|
||||
@@ -199,7 +196,7 @@ cupsLangGet(const char *language) /* I - Language or locale */
|
||||
cups_msg_t msg; /* Message number */
|
||||
char *text; /* Message text */
|
||||
cups_lang_t *lang; /* Current language... */
|
||||
char *oldlocale; /* Old locale name */
|
||||
const char *oldlocale; /* Old locale name */
|
||||
static const char * const locale_encodings[] =
|
||||
{ /* Locale charset names */
|
||||
"ASCII",
|
||||
@@ -239,33 +236,16 @@ cupsLangGet(const char *language) /* I - Language or locale */
|
||||
*/
|
||||
|
||||
if (language == NULL)
|
||||
{
|
||||
language = appleLangDefault();
|
||||
setlocale(LC_ALL, language);
|
||||
}
|
||||
#elif defined(LC_MESSAGES)
|
||||
if (language == NULL)
|
||||
{
|
||||
/*
|
||||
* First see if the locale has been set; if it is still "C" or
|
||||
* "POSIX", set the locale to the default...
|
||||
*/
|
||||
|
||||
language = setlocale(LC_MESSAGES, NULL);
|
||||
|
||||
if (!strcmp(language, "C") || !strcmp(language, "POSIX"))
|
||||
language = setlocale(LC_MESSAGES, "");
|
||||
}
|
||||
language = setlocale(LC_MESSAGES, "");
|
||||
#else
|
||||
if (language == NULL)
|
||||
{
|
||||
/*
|
||||
* First see if the locale has been set; if it is still "C" or
|
||||
* "POSIX", set the locale to the default...
|
||||
*/
|
||||
|
||||
language = setlocale(LC_ALL, NULL);
|
||||
|
||||
if (!strcmp(language, "C") || !strcmp(language, "POSIX"))
|
||||
language = setlocale(LC_ALL, "");
|
||||
}
|
||||
language = setlocale(LC_ALL, "");
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
/*
|
||||
@@ -274,13 +254,11 @@ cupsLangGet(const char *language) /* I - Language or locale */
|
||||
* chars...
|
||||
*/
|
||||
|
||||
#if defined(__APPLE__)
|
||||
/* The ctype bug isn't in Apple's libc */
|
||||
#elif !defined(LC_CTYPE)
|
||||
oldlocale = _cupsSaveLocale(LC_ALL, "C");
|
||||
#if defined(__APPLE__) || !defined(LC_CTYPE)
|
||||
oldlocale = setlocale(LC_ALL, "C");
|
||||
#else
|
||||
oldlocale = _cupsSaveLocale(LC_CTYPE, "C");
|
||||
#endif /* __APPLE__ */
|
||||
oldlocale = setlocale(LC_CTYPE, "C");
|
||||
#endif /* __APPLE__ || !LC_CTYPE */
|
||||
|
||||
/*
|
||||
* Parse the language string passed in to a locale string. "C" is the
|
||||
@@ -304,40 +282,32 @@ cupsLangGet(const char *language) /* I - Language or locale */
|
||||
*/
|
||||
|
||||
for (ptr = langname; *language; language ++)
|
||||
if (*language == '_' || *language == '-' || *language == '.')
|
||||
if (*language == '_' || *language == '-')
|
||||
{
|
||||
language ++;
|
||||
break;
|
||||
}
|
||||
else if (ptr < (langname + sizeof(langname) - 1))
|
||||
*ptr++ = tolower(*language);
|
||||
|
||||
*ptr = '\0';
|
||||
|
||||
if (*language == '_' || *language == '-')
|
||||
{
|
||||
/*
|
||||
* Copy the country code...
|
||||
*/
|
||||
for (ptr = country; *language; language ++)
|
||||
if (*language == '.')
|
||||
{
|
||||
language ++;
|
||||
break;
|
||||
}
|
||||
else if (ptr < (country + sizeof(country) - 1))
|
||||
*ptr++ = toupper(*language);
|
||||
|
||||
for (language ++, ptr = country; *language; language ++)
|
||||
if (*language == '.')
|
||||
break;
|
||||
else if (ptr < (country + sizeof(country) - 1))
|
||||
*ptr++ = toupper(*language);
|
||||
*ptr = '\0';
|
||||
|
||||
*ptr = '\0';
|
||||
}
|
||||
for (ptr = charset; *language; language ++)
|
||||
if (ptr < (charset + sizeof(charset) - 1))
|
||||
*ptr++ = toupper(*language);
|
||||
|
||||
if (*language == '.')
|
||||
{
|
||||
/*
|
||||
* Copy the encoding...
|
||||
*/
|
||||
|
||||
for (language ++, ptr = charset; *language; language ++)
|
||||
if (ptr < (charset + sizeof(charset) - 1))
|
||||
*ptr++ = toupper(*language);
|
||||
|
||||
*ptr = '\0';
|
||||
}
|
||||
*ptr = '\0';
|
||||
|
||||
/*
|
||||
* Force a POSIX locale for an invalid language name...
|
||||
@@ -355,13 +325,11 @@ cupsLangGet(const char *language) /* I - Language or locale */
|
||||
* Restore the locale...
|
||||
*/
|
||||
|
||||
#if defined(__APPLE__)
|
||||
/* The ctype bug isn't in Apple's libc */
|
||||
#elif !defined(LC_CTYPE)
|
||||
_cupsRestoreLocale(LC_ALL, oldlocale);
|
||||
#if defined(__APPLE__) || !defined(LC_CTYPE)
|
||||
setlocale(LC_ALL, oldlocale);
|
||||
#else
|
||||
_cupsRestoreLocale(LC_CTYPE, oldlocale);
|
||||
#endif /* __APPLE__ */
|
||||
setlocale(LC_CTYPE, oldlocale);
|
||||
#endif /* __APPLE__ || !LC_CTYPE */
|
||||
|
||||
/*
|
||||
* Figure out the desired encoding...
|
||||
@@ -369,15 +337,12 @@ cupsLangGet(const char *language) /* I - Language or locale */
|
||||
|
||||
encoding = CUPS_US_ASCII;
|
||||
|
||||
if (charset[0])
|
||||
{
|
||||
for (i = 0; i < (int)(sizeof(locale_encodings) / sizeof(locale_encodings[0])); i ++)
|
||||
if (!strcasecmp(charset, locale_encodings[i]))
|
||||
{
|
||||
encoding = (cups_encoding_t)i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < (int)(sizeof(locale_encodings) / sizeof(locale_encodings[0])); i ++)
|
||||
if (!strcmp(charset, locale_encodings[i]))
|
||||
{
|
||||
encoding = (cups_encoding_t)i;
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Now find the message catalog for this locale...
|
||||
@@ -397,7 +362,7 @@ cupsLangGet(const char *language) /* I - Language or locale */
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/%s/cups_%s", localedir, real, real);
|
||||
|
||||
if (!country[0] || access(filename, 0))
|
||||
if (access(filename, 0))
|
||||
{
|
||||
/*
|
||||
* Country localization not available, look for generic localization...
|
||||
@@ -585,154 +550,19 @@ cupsLangGet(const char *language) /* I - Language or locale */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* '_cupsRestoreLocale()' - Restore the original locale...
|
||||
*/
|
||||
|
||||
void
|
||||
_cupsRestoreLocale(int category, /* I - Category */
|
||||
char *oldlocale) /* I - Old locale or NULL */
|
||||
{
|
||||
DEBUG_printf(("_cupsRestoreLocale(category=%d, oldlocale=\"%s\")\n",
|
||||
category, oldlocale));
|
||||
|
||||
if (oldlocale)
|
||||
{
|
||||
/*
|
||||
* Reset the locale and free the locale string...
|
||||
*/
|
||||
|
||||
setlocale(category, oldlocale);
|
||||
free(oldlocale);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* '_cupsSaveLocale()' - Set the locale and save a copy of the old locale...
|
||||
*/
|
||||
|
||||
char * /* O - Old locale or NULL */
|
||||
_cupsSaveLocale(int category, /* I - Category */
|
||||
const char *locale) /* I - New locale or NULL */
|
||||
{
|
||||
char *oldlocale; /* Old locale */
|
||||
|
||||
|
||||
DEBUG_printf(("_cupsSaveLocale(category=%d, locale=\"%s\")\n",
|
||||
category, locale));
|
||||
|
||||
/*
|
||||
* Get the old locale and copy it...
|
||||
*/
|
||||
|
||||
if ((oldlocale = setlocale(category, NULL)) != NULL)
|
||||
oldlocale = strdup(oldlocale);
|
||||
|
||||
DEBUG_printf((" oldlocale=\"%s\"\n", oldlocale ? oldlocale : "(null)"));
|
||||
|
||||
/*
|
||||
* Set the new locale...
|
||||
*/
|
||||
|
||||
setlocale(category, locale);
|
||||
|
||||
/*
|
||||
* Return a copy of the old locale...
|
||||
*/
|
||||
|
||||
return (oldlocale);
|
||||
}
|
||||
|
||||
|
||||
#ifdef __APPLE__
|
||||
/*
|
||||
* Code & data to translate OSX's language names to their ISO 639-1 locale.
|
||||
*
|
||||
* The first version uses the new CoreFoundation API added in 10.3 (Panther),
|
||||
* the second is for 10.2 (Jaguar).
|
||||
*/
|
||||
|
||||
# ifdef HAVE_CF_LOCALE_ID
|
||||
/*
|
||||
* 'appleLangDefault()' - Get the default locale string.
|
||||
*/
|
||||
|
||||
static const char * /* O - Locale string */
|
||||
appleLangDefault(void)
|
||||
{
|
||||
CFPropertyListRef localizationList;
|
||||
/* List of localization data */
|
||||
CFStringRef languageName; /* Current name */
|
||||
CFStringRef localeName; /* Canonical from of name */
|
||||
static char language[32] = "";
|
||||
/* Cached language */
|
||||
|
||||
|
||||
/*
|
||||
* Only do the lookup and translation the first time.
|
||||
*/
|
||||
|
||||
if (!language[0])
|
||||
{
|
||||
localizationList =
|
||||
CFPreferencesCopyAppValue(CFSTR("AppleLanguages"),
|
||||
kCFPreferencesCurrentApplication);
|
||||
|
||||
if (localizationList != NULL)
|
||||
{
|
||||
if (CFGetTypeID(localizationList) == CFArrayGetTypeID() &&
|
||||
CFArrayGetCount(localizationList) > 0)
|
||||
{
|
||||
languageName = CFArrayGetValueAtIndex(localizationList, 0);
|
||||
|
||||
if (languageName != NULL &&
|
||||
CFGetTypeID(languageName) == CFStringGetTypeID())
|
||||
{
|
||||
localeName = CFLocaleCreateCanonicalLocaleIdentifierFromString(
|
||||
kCFAllocatorDefault, languageName);
|
||||
|
||||
if (localeName != NULL)
|
||||
{
|
||||
CFStringGetCString(localeName, language, sizeof(language),
|
||||
kCFStringEncodingASCII);
|
||||
CFRelease(localeName);
|
||||
|
||||
if (!strcmp(language, "en"))
|
||||
strlcpy(language, "en_US.UTF-8", sizeof(language));
|
||||
else if (strchr(language, '.') == NULL)
|
||||
strlcat(language, ".UTF-8", sizeof(language));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CFRelease(localizationList);
|
||||
}
|
||||
|
||||
/*
|
||||
* If we didn't find the language, default to en_US...
|
||||
*/
|
||||
|
||||
if (!language[0])
|
||||
strlcpy(language, "en_US.UTF-8", sizeof(language));
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the cached locale...
|
||||
*/
|
||||
|
||||
return (language);
|
||||
}
|
||||
# else
|
||||
/*
|
||||
* Code & data to translate OSX 10.2's language names to their ISO 639-1
|
||||
* locale.
|
||||
* In Radar bug #2563420 there's a request to have CoreFoundation export a
|
||||
* function to do this mapping. If this function gets implemented we should
|
||||
* use it.
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const char * const name; /* Language name */
|
||||
const char * const locale; /* Locale name */
|
||||
const char * const name; /* Language name */
|
||||
const char * const locale; /* Locale name */
|
||||
} apple_name_locale_t;
|
||||
|
||||
static const apple_name_locale_t apple_name_locale[] =
|
||||
@@ -783,7 +613,7 @@ static const apple_name_locale_t apple_name_locale[] =
|
||||
{ "Tigrinya" , "ti.UTF-8" }, { "Oromo" , "om.UTF-8" },
|
||||
{ "Somali" , "so.UTF-8" }, { "Swahili" , "sw.UTF-8" },
|
||||
{ "Kinyarwanda" , "rw.UTF-8" }, { "Rundi" , "rn.UTF-8" },
|
||||
{ "Nyanja" , "" }, { "Malagasy" , "mg.UTF-8" },
|
||||
{ "Nyanja" , "" }, { "Malagasy" , "mg.UTF-8" },
|
||||
{ "Esperanto" , "eo.UTF-8" }, { "Welsh" , "cy.UTF-8" },
|
||||
{ "Basque" , "eu.UTF-8" }, { "Catalan" , "ca.UTF-8" },
|
||||
{ "Latin" , "la.UTF-8" }, { "Quechua" , "qu.UTF-8" },
|
||||
@@ -803,17 +633,14 @@ static const apple_name_locale_t apple_name_locale[] =
|
||||
* 'appleLangDefault()' - Get the default locale string.
|
||||
*/
|
||||
|
||||
static const char * /* O - Locale string */
|
||||
static const char * /* O - Locale string */
|
||||
appleLangDefault(void)
|
||||
{
|
||||
int i; /* Looping var */
|
||||
CFPropertyListRef localizationList;
|
||||
/* List of localization data */
|
||||
CFStringRef localizationName;
|
||||
/* Current name */
|
||||
char buff[256]; /* Temporary buffer */
|
||||
static const char *language = NULL;
|
||||
/* Cached language */
|
||||
int i; /* Looping var */
|
||||
CFPropertyListRef localizationList; /* List of localization data */
|
||||
CFStringRef localizationName; /* Current name */
|
||||
char buff[256]; /* Temporary buffer */
|
||||
static const char *language = NULL; /* Cached language */
|
||||
|
||||
|
||||
/*
|
||||
@@ -822,37 +649,33 @@ appleLangDefault(void)
|
||||
|
||||
if (language == NULL)
|
||||
{
|
||||
localizationList =
|
||||
CFPreferencesCopyAppValue(CFSTR("AppleLanguages"),
|
||||
kCFPreferencesCurrentApplication);
|
||||
localizationList = CFPreferencesCopyAppValue(CFSTR("AppleLanguages"),
|
||||
kCFPreferencesCurrentApplication);
|
||||
|
||||
if (localizationList != NULL)
|
||||
if (localizationList != NULL &&
|
||||
CFGetTypeID(localizationList) == CFArrayGetTypeID() &&
|
||||
CFArrayGetCount(localizationList) > 0)
|
||||
{
|
||||
if (CFGetTypeID(localizationList) == CFArrayGetTypeID() &&
|
||||
CFArrayGetCount(localizationList) > 0)
|
||||
localizationName = CFArrayGetValueAtIndex(localizationList, 0);
|
||||
|
||||
if (localizationName != NULL &&
|
||||
CFGetTypeID(localizationName) == CFStringGetTypeID())
|
||||
{
|
||||
localizationName = CFArrayGetValueAtIndex(localizationList, 0);
|
||||
CFIndex length = CFStringGetLength(localizationName);
|
||||
|
||||
if (localizationName != NULL &&
|
||||
CFGetTypeID(localizationName) == CFStringGetTypeID())
|
||||
if (length <= sizeof(buff) &&
|
||||
CFStringGetCString(localizationName, buff, sizeof(buff), kCFStringEncodingASCII))
|
||||
{
|
||||
CFIndex length = CFStringGetLength(localizationName);
|
||||
buff[sizeof(buff) - 1] = '\0';
|
||||
|
||||
if (length <= sizeof(buff) &&
|
||||
CFStringGetCString(localizationName, buff, sizeof(buff),
|
||||
kCFStringEncodingASCII))
|
||||
for (i = 0;
|
||||
i < sizeof(apple_name_locale) / sizeof(apple_name_locale[0]);
|
||||
i++)
|
||||
{
|
||||
buff[sizeof(buff) - 1] = '\0';
|
||||
|
||||
for (i = 0;
|
||||
i < sizeof(apple_name_locale) / sizeof(apple_name_locale[0]);
|
||||
i++)
|
||||
if (strcasecmp(buff, apple_name_locale[i].name) == 0)
|
||||
{
|
||||
if (strcasecmp(buff, apple_name_locale[i].name) == 0)
|
||||
{
|
||||
language = apple_name_locale[i].locale;
|
||||
break;
|
||||
}
|
||||
language = apple_name_locale[i].locale;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -875,7 +698,6 @@ appleLangDefault(void)
|
||||
|
||||
return (language);
|
||||
}
|
||||
# endif /* HAVE_CF_LOCALE_ID */
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
|
||||
|
||||
@@ -212,10 +212,6 @@ extern void cupsLangFree(cups_lang_t *lang);
|
||||
extern cups_lang_t *cupsLangGet(const char *language);
|
||||
# define cupsLangString(lang,msg) (lang)->messages[(msg)]
|
||||
|
||||
/**** New in CUPS 1.1.20 ****/
|
||||
extern void _cupsRestoreLocale(int category, char *oldlocale);
|
||||
extern char *_cupsSaveLocale(int category, const char *locale);
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif /* __cplusplus */
|
||||
|
||||
+4
-4
@@ -244,7 +244,7 @@ cupsParseOptions(const char *arg, /* I - Argument to parse */
|
||||
while (*ptr != '\'' && *ptr != '\0')
|
||||
{
|
||||
if (*ptr == '\\')
|
||||
cups_strcpy(ptr, ptr + 1);
|
||||
strcpy(ptr, ptr + 1);
|
||||
|
||||
ptr ++;
|
||||
}
|
||||
@@ -264,7 +264,7 @@ cupsParseOptions(const char *arg, /* I - Argument to parse */
|
||||
while (*ptr != '\"' && *ptr != '\0')
|
||||
{
|
||||
if (*ptr == '\\')
|
||||
cups_strcpy(ptr, ptr + 1);
|
||||
strcpy(ptr, ptr + 1);
|
||||
|
||||
ptr ++;
|
||||
}
|
||||
@@ -297,7 +297,7 @@ cupsParseOptions(const char *arg, /* I - Argument to parse */
|
||||
}
|
||||
}
|
||||
else if (*ptr == '\\')
|
||||
cups_strcpy(ptr, ptr + 1);
|
||||
strcpy(ptr, ptr + 1);
|
||||
|
||||
if (*ptr != '\0')
|
||||
*ptr++ = '\0';
|
||||
@@ -313,7 +313,7 @@ cupsParseOptions(const char *arg, /* I - Argument to parse */
|
||||
while (!isspace(*ptr) && *ptr != '\0')
|
||||
{
|
||||
if (*ptr == '\\')
|
||||
cups_strcpy(ptr, ptr + 1);
|
||||
strcpy(ptr, ptr + 1);
|
||||
|
||||
ptr ++;
|
||||
}
|
||||
|
||||
+641
-292
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+1
-11
@@ -120,16 +120,9 @@ typedef enum /**** Status Codes ****/
|
||||
PPD_ILLEGAL_CHARACTER, /* Illegal control character */
|
||||
PPD_ILLEGAL_MAIN_KEYWORD, /* Illegal main keyword string */
|
||||
PPD_ILLEGAL_OPTION_KEYWORD, /* Illegal option keyword string */
|
||||
PPD_ILLEGAL_TRANSLATION, /* Illegal translation string */
|
||||
PPD_ILLEGAL_WHITESPACE /* Illegal whitespace character */
|
||||
PPD_ILLEGAL_TRANSLATION /* Illegal translation string */
|
||||
} ppd_status_t;
|
||||
|
||||
typedef enum /**** Conformance Levels ****/
|
||||
{
|
||||
PPD_CONFORM_RELAXED, /* Relax whitespace and control char */
|
||||
PPD_CONFORM_STRICT /* Require strict conformance */
|
||||
} ppd_conform_t;
|
||||
|
||||
typedef struct /**** PPD Attribute Structure ****/
|
||||
{
|
||||
char name[PPD_MAX_NAME],
|
||||
@@ -320,9 +313,6 @@ extern ppd_attr_t *ppdFindNextAttr(ppd_file_t *ppd, const char *name,
|
||||
const char *spec);
|
||||
extern ppd_status_t ppdLastError(int *line);
|
||||
|
||||
/**** New in CUPS 1.1.20 ****/
|
||||
extern void ppdSetConformance(ppd_conform_t c);
|
||||
|
||||
|
||||
/*
|
||||
* C++ magic...
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* cups_strcpy() - Copy a string allowing for overlapping strings.
|
||||
* cups_strdup() - Duplicate a string.
|
||||
* cups_strcasecmp() - Do a case-insensitive comparison.
|
||||
* cups_strncasecmp() - Do a case-insensitive comparison on up to N chars.
|
||||
@@ -40,21 +39,6 @@
|
||||
#include "string.h"
|
||||
|
||||
|
||||
/*
|
||||
* 'cups_strcpy()' - Copy a string allowing for overlapping strings.
|
||||
*/
|
||||
|
||||
void
|
||||
cups_strcpy(char *dst, /* I - Destination string */
|
||||
const char *src) /* I - Source string */
|
||||
{
|
||||
while (*src)
|
||||
*dst++ = *src++;
|
||||
|
||||
*dst = '\0';
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cups_strdup()' - Duplicate a string.
|
||||
*/
|
||||
|
||||
@@ -73,8 +73,6 @@ extern "C" {
|
||||
* Prototypes...
|
||||
*/
|
||||
|
||||
extern void cups_strcpy(char *dst, const char *src);
|
||||
|
||||
# ifndef HAVE_STRDUP
|
||||
extern char *cups_strdup(const char *);
|
||||
# define strdup cups_strdup
|
||||
|
||||
+339
-92
@@ -37,6 +37,8 @@
|
||||
* cupsPrintFile() - Print a file to a printer or class.
|
||||
* cupsPrintFiles() - Print one or more files to a printer or class.
|
||||
* cups_connect() - Connect to the specified host...
|
||||
* cups_local_auth() - Get the local authorization certificate if
|
||||
* available/applicable...
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -44,6 +46,7 @@
|
||||
*/
|
||||
|
||||
#include "cups.h"
|
||||
#include "ipp.h"
|
||||
#include "language.h"
|
||||
#include "string.h"
|
||||
#include "debug.h"
|
||||
@@ -65,6 +68,9 @@
|
||||
|
||||
static http_t *cups_server = NULL; /* Current server connection */
|
||||
static ipp_status_t last_error = IPP_OK; /* Last IPP error */
|
||||
static char authstring[HTTP_MAX_VALUE] = "";
|
||||
/* Authorization string */
|
||||
static char pwdstring[33] = ""; /* Last password string */
|
||||
|
||||
|
||||
/*
|
||||
@@ -72,15 +78,16 @@ static ipp_status_t last_error = IPP_OK; /* Last IPP error */
|
||||
*/
|
||||
|
||||
static char *cups_connect(const char *name, char *printer, char *hostname);
|
||||
static int cups_local_auth(http_t *http);
|
||||
|
||||
|
||||
/*
|
||||
* 'cupsCancelJob()' - Cancel a print job.
|
||||
*/
|
||||
|
||||
int /* O - 1 on success, 0 on failure */
|
||||
cupsCancelJob(const char *name, /* I - Name of printer or class */
|
||||
int job) /* I - Job ID */
|
||||
int /* O - 1 on success, 0 on failure */
|
||||
cupsCancelJob(const char *name, /* I - Name of printer or class */
|
||||
int job) /* I - Job ID */
|
||||
{
|
||||
char printer[HTTP_MAX_URI], /* Printer name */
|
||||
hostname[HTTP_MAX_URI], /* Hostname */
|
||||
@@ -171,6 +178,13 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
|
||||
struct stat fileinfo; /* File information */
|
||||
int bytes; /* Number of bytes read/written */
|
||||
char buffer[32768]; /* Output buffer */
|
||||
const char *password; /* Password string */
|
||||
char realm[HTTP_MAX_VALUE], /* realm="xyz" string */
|
||||
nonce[HTTP_MAX_VALUE], /* nonce="xyz" string */
|
||||
plain[255], /* Plaintext username:password */
|
||||
encode[512]; /* Encoded username:password */
|
||||
char prompt[1024]; /* Prompt string */
|
||||
int digest_tries; /* Number of tries with Digest */
|
||||
|
||||
|
||||
DEBUG_printf(("cupsDoFileRequest(%p, %p, \'%s\', \'%s\')\n",
|
||||
@@ -236,8 +250,9 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
|
||||
* Loop until we can send the request without authorization problems.
|
||||
*/
|
||||
|
||||
response = NULL;
|
||||
status = HTTP_ERROR;
|
||||
response = NULL;
|
||||
status = HTTP_ERROR;
|
||||
digest_tries = 0;
|
||||
|
||||
while (response == NULL)
|
||||
{
|
||||
@@ -256,9 +271,9 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
|
||||
httpClearFields(http);
|
||||
httpSetField(http, HTTP_FIELD_CONTENT_LENGTH, length);
|
||||
httpSetField(http, HTTP_FIELD_CONTENT_TYPE, "application/ipp");
|
||||
httpSetField(http, HTTP_FIELD_AUTHORIZATION, http->authstring);
|
||||
httpSetField(http, HTTP_FIELD_AUTHORIZATION, authstring);
|
||||
|
||||
DEBUG_printf(("cupsDoFileRequest: authstring=\"%s\"\n", http->authstring));
|
||||
DEBUG_printf(("cupsDoFileRequest: authstring=\"%s\"\n", authstring));
|
||||
|
||||
/*
|
||||
* Try the request...
|
||||
@@ -296,13 +311,8 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
|
||||
rewind(file);
|
||||
|
||||
while ((bytes = fread(buffer, 1, sizeof(buffer), file)) > 0)
|
||||
{
|
||||
if (httpCheck(http))
|
||||
break;
|
||||
|
||||
if (httpWrite(http, buffer, bytes) < bytes)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -324,15 +334,70 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
|
||||
*/
|
||||
|
||||
httpFlush(http);
|
||||
httpReconnect(http);
|
||||
|
||||
/*
|
||||
* See if we can do authentication...
|
||||
* See if we can do local authentication...
|
||||
*/
|
||||
|
||||
if (cupsDoAuthentication(http, "POST", resource))
|
||||
break;
|
||||
if (cups_local_auth(http))
|
||||
continue;
|
||||
|
||||
httpReconnect(http);
|
||||
/*
|
||||
* See if we should retry the current digest password...
|
||||
*/
|
||||
|
||||
if (strncmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE], "Basic", 5) == 0 ||
|
||||
digest_tries > 1 || !pwdstring[0])
|
||||
{
|
||||
/*
|
||||
* Nope - get a password from the user...
|
||||
*/
|
||||
|
||||
snprintf(prompt, sizeof(prompt), "Password for %s on %s? ", cupsUser(),
|
||||
http->hostname);
|
||||
|
||||
if ((password = cupsGetPassword(prompt)) == NULL)
|
||||
break;
|
||||
if (!password[0])
|
||||
break;
|
||||
|
||||
strlcpy(pwdstring, password, sizeof(pwdstring));
|
||||
|
||||
digest_tries = 0;
|
||||
}
|
||||
else
|
||||
digest_tries ++;
|
||||
|
||||
/*
|
||||
* Got a password; encode it for the server...
|
||||
*/
|
||||
|
||||
if (strncmp(http->fields[HTTP_FIELD_WWW_AUTHENTICATE], "Basic", 5) == 0)
|
||||
{
|
||||
/*
|
||||
* Basic authentication...
|
||||
*/
|
||||
|
||||
snprintf(plain, sizeof(plain), "%s:%s", cupsUser(), pwdstring);
|
||||
httpEncode64(encode, plain);
|
||||
snprintf(authstring, sizeof(authstring), "Basic %s", encode);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Digest authentication...
|
||||
*/
|
||||
|
||||
httpGetSubField(http, HTTP_FIELD_WWW_AUTHENTICATE, "realm", realm);
|
||||
httpGetSubField(http, HTTP_FIELD_WWW_AUTHENTICATE, "nonce", nonce);
|
||||
|
||||
httpMD5(cupsUser(), realm, pwdstring, encode);
|
||||
httpMD5Final(nonce, "POST", resource, encode);
|
||||
snprintf(authstring, sizeof(authstring),
|
||||
"Digest username=\"%s\", realm=\"%s\", nonce=\"%s\", "
|
||||
"response=\"%s\"", cupsUser(), realm, nonce, encode);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -427,44 +492,15 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
|
||||
|
||||
if (response)
|
||||
last_error = response->request.status.status_code;
|
||||
else if (status == HTTP_NOT_FOUND)
|
||||
last_error = IPP_NOT_FOUND;
|
||||
else if (status == HTTP_UNAUTHORIZED)
|
||||
last_error = IPP_NOT_AUTHORIZED;
|
||||
else if (status != HTTP_OK)
|
||||
{
|
||||
switch (status)
|
||||
{
|
||||
case HTTP_NOT_FOUND :
|
||||
last_error = IPP_NOT_FOUND;
|
||||
break;
|
||||
|
||||
case HTTP_UNAUTHORIZED :
|
||||
last_error = IPP_NOT_AUTHORIZED;
|
||||
break;
|
||||
|
||||
case HTTP_FORBIDDEN :
|
||||
last_error = IPP_FORBIDDEN;
|
||||
break;
|
||||
|
||||
case HTTP_BAD_REQUEST :
|
||||
last_error = IPP_BAD_REQUEST;
|
||||
break;
|
||||
|
||||
case HTTP_REQUEST_TOO_LARGE :
|
||||
last_error = IPP_REQUEST_VALUE;
|
||||
break;
|
||||
|
||||
case HTTP_NOT_IMPLEMENTED :
|
||||
last_error = IPP_OPERATION_NOT_SUPPORTED;
|
||||
break;
|
||||
|
||||
case HTTP_NOT_SUPPORTED :
|
||||
last_error = IPP_VERSION_NOT_SUPPORTED;
|
||||
break;
|
||||
|
||||
default :
|
||||
DEBUG_printf(("HTTP error %d mapped to IPP_SERVICE_UNAVAILABLE!\n",
|
||||
status));
|
||||
last_error = IPP_SERVICE_UNAVAILABLE;
|
||||
break;
|
||||
}
|
||||
DEBUG_printf(("HTTP error %d mapped to IPP_SERVICE_UNAVAILABLE!\n",
|
||||
status));
|
||||
last_error = IPP_SERVICE_UNAVAILABLE;
|
||||
}
|
||||
|
||||
return (response);
|
||||
@@ -476,10 +512,10 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
|
||||
*/
|
||||
|
||||
void
|
||||
cupsFreeJobs(int num_jobs, /* I - Number of jobs */
|
||||
cups_job_t *jobs) /* I - Jobs */
|
||||
cupsFreeJobs(int num_jobs,/* I - Number of jobs */
|
||||
cups_job_t *jobs) /* I - Jobs */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
int i; /* Looping var */
|
||||
|
||||
|
||||
if (num_jobs <= 0 || jobs == NULL)
|
||||
@@ -501,15 +537,15 @@ cupsFreeJobs(int num_jobs, /* I - Number of jobs */
|
||||
* 'cupsGetClasses()' - Get a list of printer classes.
|
||||
*/
|
||||
|
||||
int /* O - Number of classes */
|
||||
cupsGetClasses(char ***classes) /* O - Classes */
|
||||
int /* O - Number of classes */
|
||||
cupsGetClasses(char ***classes) /* O - Classes */
|
||||
{
|
||||
int n; /* Number of classes */
|
||||
ipp_t *request, /* IPP Request */
|
||||
*response; /* IPP Response */
|
||||
ipp_attribute_t *attr; /* Current attribute */
|
||||
cups_lang_t *language; /* Default language */
|
||||
char **temp; /* Temporary pointer */
|
||||
int n; /* Number of classes */
|
||||
ipp_t *request, /* IPP Request */
|
||||
*response; /* IPP Response */
|
||||
ipp_attribute_t *attr; /* Current attribute */
|
||||
cups_lang_t *language; /* Default language */
|
||||
char **temp; /* Temporary pointer */
|
||||
|
||||
|
||||
if (classes == NULL)
|
||||
@@ -610,15 +646,15 @@ cupsGetClasses(char ***classes) /* O - Classes */
|
||||
* 'cupsGetDefault()' - Get the default printer or class.
|
||||
*/
|
||||
|
||||
const char * /* O - Default printer or NULL */
|
||||
const char * /* O - Default printer or NULL */
|
||||
cupsGetDefault(void)
|
||||
{
|
||||
ipp_t *request, /* IPP Request */
|
||||
*response; /* IPP Response */
|
||||
ipp_attribute_t *attr; /* Current attribute */
|
||||
cups_lang_t *language; /* Default language */
|
||||
const char *var; /* Environment variable */
|
||||
static char def_printer[256]; /* Default printer */
|
||||
ipp_t *request, /* IPP Request */
|
||||
*response; /* IPP Response */
|
||||
ipp_attribute_t *attr; /* Current attribute */
|
||||
cups_lang_t *language; /* Default language */
|
||||
const char *var; /* Environment variable */
|
||||
static char def_printer[256];/* Default printer */
|
||||
|
||||
|
||||
/*
|
||||
@@ -960,14 +996,22 @@ cupsGetPPD(const char *name) /* I - Printer name */
|
||||
ipp_attribute_t *attr; /* Current attribute */
|
||||
cups_lang_t *language; /* Local language */
|
||||
int fd; /* PPD file */
|
||||
char uri[HTTP_MAX_URI], /* Printer URI */
|
||||
printer[HTTP_MAX_URI], /* Printer name */
|
||||
int bytes; /* Number of bytes read */
|
||||
char buffer[8192]; /* Buffer for file */
|
||||
char printer[HTTP_MAX_URI], /* Printer name */
|
||||
method[HTTP_MAX_URI], /* Method/scheme name */
|
||||
username[HTTP_MAX_URI], /* Username:password */
|
||||
hostname[HTTP_MAX_URI], /* Hostname */
|
||||
resource[HTTP_MAX_URI]; /* Resource name */
|
||||
int port; /* Port number */
|
||||
const char *password; /* Password string */
|
||||
char realm[HTTP_MAX_VALUE], /* realm="xyz" string */
|
||||
nonce[HTTP_MAX_VALUE], /* nonce="xyz" string */
|
||||
plain[255], /* Plaintext username:password */
|
||||
encode[512]; /* Encoded username:password */
|
||||
http_status_t status; /* HTTP status from server */
|
||||
char prompt[1024]; /* Prompt string */
|
||||
int digest_tries; /* Number of tries with Digest */
|
||||
static char filename[HTTP_MAX_URI]; /* Local filename */
|
||||
static const char * const requested_attrs[] =
|
||||
{ /* Requested attributes */
|
||||
@@ -977,10 +1021,6 @@ cupsGetPPD(const char *name) /* I - Printer name */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Range check input...
|
||||
*/
|
||||
|
||||
if (name == NULL)
|
||||
{
|
||||
last_error = IPP_INTERNAL_ERROR;
|
||||
@@ -1021,9 +1061,9 @@ cupsGetPPD(const char *name) /* I - Printer name */
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
|
||||
"attributes-natural-language", NULL, language->language);
|
||||
|
||||
snprintf(uri, sizeof(uri), "ipp://localhost/printers/%s", printer);
|
||||
snprintf(buffer, sizeof(buffer), "ipp://localhost/printers/%s", printer);
|
||||
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
|
||||
"printer-uri", NULL, uri);
|
||||
"printer-uri", NULL, buffer);
|
||||
|
||||
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
|
||||
"requested-attributes",
|
||||
@@ -1079,9 +1119,9 @@ cupsGetPPD(const char *name) /* I - Printer name */
|
||||
* Remap local hostname to localhost...
|
||||
*/
|
||||
|
||||
gethostname(uri, sizeof(uri));
|
||||
gethostname(buffer, sizeof(buffer));
|
||||
|
||||
if (strcasecmp(uri, hostname) == 0)
|
||||
if (strcasecmp(buffer, hostname) == 0)
|
||||
strcpy(hostname, "localhost");
|
||||
}
|
||||
|
||||
@@ -1133,9 +1173,129 @@ cupsGetPPD(const char *name) /* I - Printer name */
|
||||
|
||||
snprintf(resource, sizeof(resource), "/printers/%s.ppd", printer);
|
||||
|
||||
status = cupsGetFd(cups_server, resource, fd);
|
||||
digest_tries = 0;
|
||||
|
||||
close(fd);
|
||||
do
|
||||
{
|
||||
httpClearFields(cups_server);
|
||||
httpSetField(cups_server, HTTP_FIELD_HOST, hostname);
|
||||
httpSetField(cups_server, HTTP_FIELD_AUTHORIZATION, authstring);
|
||||
|
||||
if (httpGet(cups_server, resource))
|
||||
{
|
||||
if (httpReconnect(cups_server))
|
||||
{
|
||||
status = HTTP_ERROR;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
status = HTTP_UNAUTHORIZED;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
while ((status = httpUpdate(cups_server)) == HTTP_CONTINUE);
|
||||
|
||||
if (status == HTTP_UNAUTHORIZED)
|
||||
{
|
||||
DEBUG_puts("cupsGetPPD: unauthorized...");
|
||||
|
||||
/*
|
||||
* Flush any error message...
|
||||
*/
|
||||
|
||||
httpFlush(cups_server);
|
||||
|
||||
/*
|
||||
* See if we can do local authentication...
|
||||
*/
|
||||
|
||||
if (cups_local_auth(cups_server))
|
||||
continue;
|
||||
|
||||
/*
|
||||
* See if we should retry the current digest password...
|
||||
*/
|
||||
|
||||
if (strncmp(cups_server->fields[HTTP_FIELD_WWW_AUTHENTICATE], "Basic", 5) == 0 ||
|
||||
digest_tries > 1 || !pwdstring[0])
|
||||
{
|
||||
/*
|
||||
* Nope - get a password from the user...
|
||||
*/
|
||||
|
||||
snprintf(prompt, sizeof(prompt), "Password for %s on %s? ", cupsUser(),
|
||||
cups_server->hostname);
|
||||
|
||||
if ((password = cupsGetPassword(prompt)) == NULL)
|
||||
break;
|
||||
if (!password[0])
|
||||
break;
|
||||
|
||||
strlcpy(pwdstring, password, sizeof(pwdstring));
|
||||
|
||||
digest_tries = 0;
|
||||
}
|
||||
else
|
||||
digest_tries ++;
|
||||
|
||||
/*
|
||||
* Got a password; encode it for the server...
|
||||
*/
|
||||
|
||||
if (strncmp(cups_server->fields[HTTP_FIELD_WWW_AUTHENTICATE], "Basic", 5) == 0)
|
||||
{
|
||||
/*
|
||||
* Basic authentication...
|
||||
*/
|
||||
|
||||
snprintf(plain, sizeof(plain), "%s:%s", cupsUser(), pwdstring);
|
||||
httpEncode64(encode, plain);
|
||||
snprintf(authstring, sizeof(authstring), "Basic %s", encode);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Digest authentication...
|
||||
*/
|
||||
|
||||
httpGetSubField(cups_server, HTTP_FIELD_WWW_AUTHENTICATE, "realm", realm);
|
||||
httpGetSubField(cups_server, HTTP_FIELD_WWW_AUTHENTICATE, "nonce", nonce);
|
||||
|
||||
httpMD5(cupsUser(), realm, pwdstring, encode);
|
||||
httpMD5Final(nonce, "GET", resource, encode);
|
||||
snprintf(authstring, sizeof(authstring),
|
||||
"Digest username=\"%s\", realm=\"%s\", nonce=\"%s\", "
|
||||
"response=\"%s\"", cupsUser(), realm, nonce, encode);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
#ifdef HAVE_SSL
|
||||
else if (status == HTTP_UPGRADE_REQUIRED)
|
||||
{
|
||||
/*
|
||||
* Flush any error message...
|
||||
*/
|
||||
|
||||
httpFlush(cups_server);
|
||||
|
||||
/*
|
||||
* Upgrade with encryption...
|
||||
*/
|
||||
|
||||
httpEncryption(cups_server, HTTP_ENCRYPT_REQUIRED);
|
||||
|
||||
/*
|
||||
* Try again, this time with encryption enabled...
|
||||
*/
|
||||
|
||||
continue;
|
||||
}
|
||||
#endif /* HAVE_SSL */
|
||||
}
|
||||
while (status == HTTP_UNAUTHORIZED || status == HTTP_UPGRADE_REQUIRED);
|
||||
|
||||
/*
|
||||
* See if we actually got the file or an error...
|
||||
@@ -1168,9 +1328,14 @@ cupsGetPPD(const char *name) /* I - Printer name */
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the PPD file...
|
||||
* OK, we need to copy the file...
|
||||
*/
|
||||
|
||||
while ((bytes = httpRead(cups_server, buffer, sizeof(buffer))) > 0)
|
||||
write(fd, buffer, bytes);
|
||||
|
||||
close(fd);
|
||||
|
||||
return (filename);
|
||||
}
|
||||
|
||||
@@ -1182,12 +1347,12 @@ cupsGetPPD(const char *name) /* I - Printer name */
|
||||
int /* O - Number of printers */
|
||||
cupsGetPrinters(char ***printers) /* O - Printers */
|
||||
{
|
||||
int n; /* Number of printers */
|
||||
ipp_t *request, /* IPP Request */
|
||||
*response; /* IPP Response */
|
||||
ipp_attribute_t *attr; /* Current attribute */
|
||||
cups_lang_t *language; /* Default language */
|
||||
char **temp; /* Temporary pointer */
|
||||
int n; /* Number of printers */
|
||||
ipp_t *request, /* IPP Request */
|
||||
*response; /* IPP Response */
|
||||
ipp_attribute_t *attr; /* Current attribute */
|
||||
cups_lang_t *language; /* Default language */
|
||||
char **temp; /* Temporary pointer */
|
||||
|
||||
|
||||
if (printers == NULL)
|
||||
@@ -1288,7 +1453,7 @@ cupsGetPrinters(char ***printers) /* O - Printers */
|
||||
* 'cupsLastError()' - Return the last IPP error that occurred.
|
||||
*/
|
||||
|
||||
ipp_status_t /* O - IPP error code */
|
||||
ipp_status_t /* O - IPP error code */
|
||||
cupsLastError(void)
|
||||
{
|
||||
return (last_error);
|
||||
@@ -1322,8 +1487,7 @@ cupsPrintFiles(const char *name, /* I - Printer or class name */
|
||||
int num_files, /* I - Number of files */
|
||||
const char **files, /* I - File(s) to print */
|
||||
const char *title, /* I - Title of job */
|
||||
int num_options,
|
||||
/* I - Number of options */
|
||||
int num_options,/* I - Number of options */
|
||||
cups_option_t *options) /* I - Options */
|
||||
{
|
||||
int i; /* Looping var */
|
||||
@@ -1555,6 +1719,89 @@ cups_connect(const char *name, /* I - Destination (printer[@host]) */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'cups_local_auth()' - Get the local authorization certificate if
|
||||
* available/applicable...
|
||||
*/
|
||||
|
||||
static int /* O - 1 if available, 0 if not */
|
||||
cups_local_auth(http_t *http) /* I - Connection */
|
||||
{
|
||||
#if defined(WIN32) || defined(__EMX__)
|
||||
/*
|
||||
* Currently WIN32 and OS-2 do not support the CUPS server...
|
||||
*/
|
||||
|
||||
return (0);
|
||||
#else
|
||||
int pid; /* Current process ID */
|
||||
FILE *fp; /* Certificate file */
|
||||
char filename[1024], /* Certificate filename */
|
||||
certificate[33];/* Certificate string */
|
||||
const char *root; /* Server root directory */
|
||||
|
||||
|
||||
DEBUG_printf(("cups_local_auth(http=%p) hostaddr=%08x, hostname=\"%s\"\n",
|
||||
http, ntohl(http->hostaddr.sin_addr.s_addr), http->hostname));
|
||||
|
||||
/*
|
||||
* See if we are accessing localhost...
|
||||
*/
|
||||
|
||||
if (ntohl(http->hostaddr.sin_addr.s_addr) != 0x7f000001 &&
|
||||
strcasecmp(http->hostname, "localhost") != 0)
|
||||
{
|
||||
DEBUG_puts("cups_local_auth: Not a local connection!");
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Try opening a certificate file for this PID. If that fails,
|
||||
* try the root certificate...
|
||||
*/
|
||||
|
||||
if ((root = getenv("CUPS_SERVERROOT")) == NULL)
|
||||
root = CUPS_SERVERROOT;
|
||||
|
||||
pid = getpid();
|
||||
snprintf(filename, sizeof(filename), "%s/certs/%d", root, pid);
|
||||
if ((fp = fopen(filename, "r")) == NULL && pid > 0)
|
||||
{
|
||||
DEBUG_printf(("cups_local_auth: Unable to open file %s: %s\n",
|
||||
filename, strerror(errno)));
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/certs/0", root);
|
||||
fp = fopen(filename, "r");
|
||||
}
|
||||
|
||||
if (fp == NULL)
|
||||
{
|
||||
DEBUG_printf(("cups_local_auth: Unable to open file %s: %s\n",
|
||||
filename, strerror(errno)));
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Read the certificate from the file...
|
||||
*/
|
||||
|
||||
fgets(certificate, sizeof(certificate), fp);
|
||||
fclose(fp);
|
||||
|
||||
/*
|
||||
* Set the authorization string and return...
|
||||
*/
|
||||
|
||||
snprintf(authstring, sizeof(authstring), "Local %s", certificate);
|
||||
|
||||
DEBUG_printf(("cups_local_auth: Returning authstring = \"%s\"\n",
|
||||
authstring));
|
||||
|
||||
return (1);
|
||||
#endif /* WIN32 || __EMX__ */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id$".
|
||||
*/
|
||||
|
||||
+1
-1
@@ -179,7 +179,7 @@ spm.ps: spm.shtml
|
||||
|
||||
sum.html: sum.shtml
|
||||
echo Formatting $@...
|
||||
$(HTMLDOC) --verbose --titleimage images/cups-large.gif -f $@ $<
|
||||
$(HTMLDOC) --titleimage images/cups-large.gif -f $@ $<
|
||||
sum.pdf: sum.shtml
|
||||
echo Formatting $@...
|
||||
$(HTMLDOC) --titleimage images/cups-large.gif --duplex --compression=9 \
|
||||
|
||||
+80
-86
@@ -5,7 +5,7 @@
|
||||
<META NAME="author" CONTENT="Easy Software Products">
|
||||
<META NAME="copyright" CONTENT="Copyright 1997-2003, All Rights Reserved">
|
||||
<META NAME="docnumber" CONTENT="CUPS-SAM-1.1.14">
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-iso-8859-1">
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-8859-1">
|
||||
<STYLE TYPE="text/css"><!--
|
||||
BODY { font-family: serif }
|
||||
H1 { font-family: sans-serif }
|
||||
@@ -249,13 +249,7 @@ Copyright 1997-2003, All Rights Reserved<BR>
|
||||
<LI><A HREF="#9_1_4">Support</A></LI>
|
||||
</UL>
|
||||
<LI><A HREF="#9_2">GNU GENERAL PUBLIC LICENSE</A></LI>
|
||||
<UL>
|
||||
<LI><A HREF="#9_2_1">Preamble</A></LI>
|
||||
</UL>
|
||||
<LI><A HREF="#9_3">GNU LIBRARY GENERAL PUBLIC LICENSE</A></LI>
|
||||
<UL>
|
||||
<LI><A HREF="#9_3_1">Preamble</A></LI>
|
||||
</UL>
|
||||
</UL>
|
||||
<B><A HREF="#COMMON_NETWORK">B - Réglages réseau courants</A></B>
|
||||
<UL>
|
||||
@@ -342,8 +336,8 @@ Copyright 1997-2003, All Rights Reserved<BR>
|
||||
<HR color="#000000" size="1px" width="50%">
|
||||
<H2><A NAME="1_1">Aperçu du système</A></H2>
|
||||
<P>CUPS fournit une couche d'impression portable pour les systèmes
|
||||
d'exploitation de type UNIX®. Il a été développé par <A HREF="http://www.easysw.com">
|
||||
Easy Software Products</A> pour promouvoir une solution d'impression
|
||||
d'exploitation de type UNIX®. Il a été développé par<A HREF="http://www.easysw.com">
|
||||
Easy Software Products</A> pour promouvoir une solution d'impression
|
||||
standard pour tous les vendeurs et utilisateurs d'UNIX. CUPS fournit
|
||||
des interfaces en ligne de commande de type System V et Berkeley.</P>
|
||||
<P>CUPS utilise le protocol IPP (Internet Printing Protocol) comme base
|
||||
@@ -818,7 +812,7 @@ méthode://serveur/chemin</CODE>.</P>
|
||||
</UL>
|
||||
<P>et vous quide pas à pas au travers des étapes de configuration
|
||||
d'imprimante. Si vous n'aimez pas les interfaces en ligne de commande,
|
||||
essayez plutôt <A HREF="#ADD_WEB">l'interface web</A>.</P>
|
||||
essayez plutôt<A HREF="#ADD_WEB"> l'interface web</A>.</P>
|
||||
<H3><A NAME="4_2_1">Ajouter votre première imprimante depuis la ligne de
|
||||
commande</A></H3>
|
||||
<P>Exécutez la commande <CODE>lpadmin</CODE> avec l'option <CODE>-p</CODE>
|
||||
@@ -1060,9 +1054,9 @@ devez</U> faire précéder son nom du chemin d'accès complet
|
||||
<P>Comme indiqué auparavant, les classes implicites sont automatiquement
|
||||
créées à partir des imprimantes et des classes disponibles sur le
|
||||
réseau. Pour désactiver cette fonctionnalité, réglez la valeur de la
|
||||
directive <A HREF="#ImplicitClasses"><CODE>ImplicitClasses</CODE></A>
|
||||
directive<A HREF="#ImplicitClasses"> <CODE>ImplicitClasses</CODE></A>
|
||||
sur <CODE>Off</CODE> dans le fichier <CODE>cupsd.conf</CODE>. Vous
|
||||
trouverez plus d'information sur la manière de faire cela dans le <A HREF="#PRINTING_MANAGEMENT">
|
||||
trouverez plus d'information sur la manière de faire cela dans le<A HREF="#PRINTING_MANAGEMENT">
|
||||
Chapitre 6, "Administration du système d'impression"</A>.</P>
|
||||
<H1 ALIGN="RIGHT"><A NAME="CLIENT_SETUP">5 - Configuration côté client</A>
|
||||
</H1>
|
||||
@@ -1137,7 +1131,7 @@ ServerName <I>serveur</I>
|
||||
sont automatiquement mises à jour chaque fois que des imprimantes et
|
||||
des serveurs sont ajoutés ou retirés.</P>
|
||||
<P>Si vous désirez également voir les imprimantes sur d'autres
|
||||
sous-réseau, utilisez la directive <A HREF="#BrowsePoll"><CODE>
|
||||
sous-réseau, utilisez la directive<A HREF="#BrowsePoll"> <CODE>
|
||||
BrowsePoll</CODE></A> comme indiqué ci-après.</P>
|
||||
<H3><A NAME="CLIENT_POLL">Choix de plusieurs serveurs pour l'impression</A>
|
||||
</H3>
|
||||
@@ -1147,10 +1141,10 @@ BrowsePoll</CODE></A> comme indiqué ci-après.</P>
|
||||
singulièrement la configuration sur les clients, et plusieurs clients
|
||||
sur le même sous-réseau peuvent partager les mêmes informations de
|
||||
configuration.</P>
|
||||
<P>La surveillance est activée en indiquant une ou plusieurs directives <A
|
||||
HREF="#BrowsePoll"><CODE>BrowsePoll</CODE></A> dans le fichier<VAR>
|
||||
<P>La surveillance est activée en indiquant une ou plusieurs directives<A
|
||||
HREF="#BrowsePoll"> <CODE>BrowsePoll</CODE></A> dans le fichier<VAR>
|
||||
/etc/cups/cupsd.conf</VAR>. Pour savoir comment faire ces changements,
|
||||
veuillez vous reporter au <A HREF="#PRINTING_MANAGEMENT"> Chapitre 6,
|
||||
veuillez vous reporter au<A HREF="#PRINTING_MANAGEMENT"> Chapitre 6,
|
||||
"Administration du système d'impression"</A>.</P>
|
||||
<H1 ALIGN="RIGHT"><A NAME="PRINTING_MANAGEMENT">6 - Administration du
|
||||
système d'impression</A></H1>
|
||||
@@ -1172,7 +1166,7 @@ lpadmin</CODE> ou l'interface "web".
|
||||
</DD>
|
||||
<DT>client.conf</DT>
|
||||
<DD> Ce fichier fournit le nom du serveur implicite pour les machines
|
||||
clientes. Veuillez vous reporter au <A HREF="#CLIENT_SETUP">Chapitre 5,
|
||||
clientes. Veuillez vous reporter au<A HREF="#CLIENT_SETUP"> Chapitre 5,
|
||||
"Configuration côté client"</A> pour de plus amples informations.
|
||||
<BR>
|
||||
<!-- NEED 1in -->
|
||||
@@ -1383,7 +1377,7 @@ Allow</CODE> se cumulent, ainsi plusieurs directives <CODE>Allow</CODE>
|
||||
</CENTER>
|
||||
</P>
|
||||
<P>La directive <CODE>Allow</CODE> doit apparaître à l'intérieur d'une
|
||||
directive <A HREF="#Location"><CODE>Location</CODE></A>.
|
||||
directive<A HREF="#Location"> <CODE>Location</CODE></A>.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
<H3><A NAME="AuthClass">AuthClass</A></H3>
|
||||
@@ -1430,7 +1424,7 @@ AuthGroupName lp
|
||||
<P>La directive <CODE>AuthGroupName</CODE> définit le groupe à utiliser
|
||||
pour l'authentification de type <CODE>Group</CODE>.</P>
|
||||
<P>La directive <CODE>AuthGroupName</CODE> doit apparaître à l'intérieur
|
||||
d'une directive <A HREF="#Location"> <CODE>Location</CODE></A>.
|
||||
d'une directive<A HREF="#Location"> <CODE>Location</CODE></A>.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
<H3><A NAME="AuthType">AuthType</A></H3>
|
||||
@@ -1459,10 +1453,10 @@ AuthType BasicDigest
|
||||
</UL>
|
||||
<P> Lorsque vous utilisez <CODE>Basic</CODE>, <CODE>Digest</CODE>, ou <CODE>
|
||||
BasicDigest</CODE>, les clients se connectant en utilisant l'adresse <CODE>
|
||||
localhost</CODE> peuvent également le faire en utilisant les <A HREF="#CERTIFICATES">
|
||||
certificats</A>.</P>
|
||||
localhost</CODE> peuvent également le faire en utilisant les<A HREF="#CERTIFICATES">
|
||||
certificats</A>.</P>
|
||||
<P>La directive <CODE>AuthType</CODE> doit apparaître à l'intérieur
|
||||
d'une directive <A HREF="#Location"> <CODE>Location</CODE></A>.
|
||||
d'une directive<A HREF="#Location"> <CODE>Location</CODE></A>.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
<H3><A NAME="AutoPurgeJobs">AutoPurgeJobs</A></H3>
|
||||
@@ -1532,7 +1526,7 @@ BrowseAllow from *.domain.com
|
||||
implicite est d'accepter des paquets d'exploration de n'importe quel
|
||||
hôte.</P>
|
||||
<P>Le contrôle sur la base du nom d'hôte et de domaine impose que vous
|
||||
activiez la directive <A HREF="#HostNameLookups"><CODE>HostNameLookups</CODE>
|
||||
activiez la directive<A HREF="#HostNameLookups"> <CODE>HostNameLookups</CODE>
|
||||
</A>.</P>
|
||||
<P>Le contrôle sur la base de l'adresse IP prend en charge les
|
||||
correspondances exactes, les adresses partielles qui correspondent à
|
||||
@@ -1558,7 +1552,7 @@ BrowseDeny from *.domain.com
|
||||
refuse de recevoir des paquets d'exploration. Le comportement implicite
|
||||
est de ne refuser aucun paquet d'exploration d'aucun hôte.</P>
|
||||
<P>Le contrôle sur la base du nom d'hôte et de domaine impose que vous
|
||||
activiez la directive <A HREF="#HostNameLookups"><CODE>HostNameLookups</CODE>
|
||||
activiez la directive<A HREF="#HostNameLookups"> <CODE>HostNameLookups</CODE>
|
||||
</A>.</P>
|
||||
<P>Le contrôle sur la base de l'adresse IP prend en charge les
|
||||
correspondances exactes, les adresses partielles qui correspondent à
|
||||
@@ -1601,7 +1595,7 @@ BrowseInterval 30
|
||||
de 0 interdit de diffuser des mises à jour mais autorise néanmoins un
|
||||
serveur à recevoir des mises à jour en provenance d'autres hôtes.</P>
|
||||
<P>La valeur <CODE>BrowseInterval</CODE> devrait toujours être
|
||||
inférieure à la valeur <A HREF="#BrowseTimeout"><CODE>BrowseTimeout</CODE>
|
||||
inférieure à la valeur<A HREF="#BrowseTimeout"> <CODE>BrowseTimeout</CODE>
|
||||
</A>. Sinon des imprimantes et des classes pourraient disparaître des
|
||||
système clients entre les mises à jour.
|
||||
<!-- NEED 3in -->
|
||||
@@ -1617,8 +1611,8 @@ BrowsePoll host.domain.com:631
|
||||
</UL>
|
||||
<H4>Description</H4>
|
||||
<P>La directive <CODE>BrowsePoll</CODE> collecte la liste des
|
||||
imprimantes disponibles sur un serveur une fois toutes les <A HREF="#BrowseInterval">
|
||||
<CODE>BrowseInterval</CODE></A> secondes. Plusieurs directives <CODE>
|
||||
imprimantes disponibles sur un serveur une fois toutes les<A HREF="#BrowseInterval">
|
||||
<CODE>BrowseInterval</CODE></A> secondes. Plusieurs directives <CODE>
|
||||
BrowsePoll</CODE> peuvent être indiquées pour surveiller plusieurs
|
||||
serveurs.</P>
|
||||
<P>Si <CODE>BrowseInterval</CODE> est mis à 0 alors le serveur est
|
||||
@@ -1746,7 +1740,7 @@ BrowseTimeout 60
|
||||
concernant une imprimante ou une classe dépassent ce délai, elles sont
|
||||
retirées de la liste des destinations disponibles.</P>
|
||||
<P>La valeur <CODE>BrowseTimeout</CODE> devrait toujours être supérieure
|
||||
à la valeur <A HREF="#BrowseInterval"> <CODE>BrowseInterval</CODE></A>.
|
||||
à la valeur<A HREF="#BrowseInterval"> <CODE>BrowseInterval</CODE></A>.
|
||||
Sinon des imprimantes et des classes pourraient disparaîtres des
|
||||
systèmes clients entre les mises à jour.
|
||||
<!-- NEED 4in -->
|
||||
@@ -1911,7 +1905,7 @@ Deny</CODE> peuvent être utilisées pour interdire l'accès &a
|
||||
</CENTER>
|
||||
</P>
|
||||
<P>La directive <CODE>Deny</CODE> doit apparaître à l'intérieur d'une
|
||||
directive <A HREF="#Location"> <CODE>Location</CODE></A>.
|
||||
directive<A HREF="#Location"> <CODE>Location</CODE></A>.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
<H3><A NAME="DocumentRoot">DocumentRoot</A></H3>
|
||||
@@ -1926,8 +1920,8 @@ DocumentRoot /foo/bar/doc/cups
|
||||
<H4>Description</H4>
|
||||
<P>La directive <CODE>DocumentRoot</CODE> indique l'emplacement du
|
||||
contenu que le serveur HTTP de CUPS doit publier. Si un chemin absolu
|
||||
n'est pas indiqué, celui-ci est considéré comme relatif au répertoire <A
|
||||
HREF="#ServerRoot"><CODE>ServerRoot</CODE></A>. La valeur implicite est<VAR>
|
||||
n'est pas indiqué, celui-ci est considéré comme relatif au répertoire<A HREF="#ServerRoot">
|
||||
<CODE>ServerRoot</CODE></A>. La valeur implicite est<VAR>
|
||||
/usr/share/doc/cups</VAR>.</P>
|
||||
<P>Les documents sont d'abord recherchés dans un sous-répertoire
|
||||
correspondant à la langue demandée par le client (par exemple<VAR>
|
||||
@@ -1951,7 +1945,7 @@ Encryption Always
|
||||
</UL>
|
||||
<H4>Description</H4>
|
||||
<P>La directive <CODE>Encryption</CODE> doit apparaître à l'intérieur
|
||||
d'une section <A HREF="#Location"><CODE>Location</CODE></A> et définit
|
||||
d'une section<A HREF="#Location"> <CODE>Location</CODE></A> et définit
|
||||
les réglages d'encryptage pour cet emplacement. Le réglage implicite
|
||||
est <CODE>IfRequested</CODE> pour tous les emplacements.
|
||||
<!-- NEED 3in -->
|
||||
@@ -1969,7 +1963,7 @@ ErrorLog syslog
|
||||
<H4>Description</H4>
|
||||
<P>La directive <CODE>ErrorLog</CODE> définit le nom du fichier de suivi
|
||||
d'erreurs ("error log"). Si le nom de fichier n'est pas un chemin
|
||||
absolu, il est considéré comme un chemin relatif au répertoire <A HREF="#ServerRoot">
|
||||
absolu, il est considéré comme un chemin relatif au répertoire<A HREF="#ServerRoot">
|
||||
<CODE>ServerRoot</CODE></A>. Le fichier standard est<VAR>
|
||||
/var/log/cups/error_log</VAR>.</P>
|
||||
<P>Le nom du serveur peut être inclus dans le nom du fichier en
|
||||
@@ -2089,8 +2083,8 @@ ImplicitClasses Off
|
||||
<P>La directive <CODE>ImplicitClasses</CODE> contrôle si les classes
|
||||
implicites sont créées sur la base des imprimantes et classes
|
||||
disponibles sur le réseau. La valeur implicite est <CODE>On</CODE> mais
|
||||
est automatiquement positionnée sur <CODE>Off</CODE> si <A HREF="#Browsing">
|
||||
<CODE>Browsing</CODE></A> est à la valeur <CODE>Off</CODE>.
|
||||
est automatiquement positionnée sur <CODE>Off</CODE> si<A HREF="#Browsing">
|
||||
<CODE>Browsing</CODE></A> est à la valeur <CODE>Off</CODE>.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
<H3><A NAME="ImplicitAnyClasses">ImplicitAnyClasses</A></H3>
|
||||
@@ -2123,8 +2117,8 @@ Include /foo/bar/filename
|
||||
<H4>Description</H4>
|
||||
<P>La directive <CODE>Include</CODE> inclut le fichier indiqué dans le
|
||||
corps du fichier <CODE>cupsd.conf</CODE>. Si aucun chemin n'est
|
||||
indiqué, le fichier est considéré comme étant relatif au répertoire <A HREF="#ServerRoot">
|
||||
<CODE>ServerRoot</CODE></A>.</P>
|
||||
indiqué, le fichier est considéré comme étant relatif au répertoire<A HREF="#ServerRoot">
|
||||
<CODE>ServerRoot</CODE></A>.</P>
|
||||
|
||||
<!-- NEED 3in -->
|
||||
<H3><A NAME="KeepAlive">KeepAlive</A></H3>
|
||||
@@ -2178,7 +2172,7 @@ KeepAliveTimeout 30
|
||||
<H4>Description</H4>
|
||||
<P>La directive <CODE>Limit</CODE> groupe les directives de contrôle
|
||||
d'accès pour certains types spécifiques de requêtes HTTP et doit
|
||||
apparaître à l'intérieur d'une section <A HREF="#Location"><CODE>
|
||||
apparaître à l'intérieur d'une section<A HREF="#Location"> <CODE>
|
||||
Location</CODE></A>. L'accès peut être limité à des types individuels de
|
||||
requêtes (<CODE>DELETE</CODE>, <CODE>GET</CODE>, <CODE>HEAD</CODE> , <CODE>
|
||||
OPTIONS</CODE>, <CODE>POST</CODE>, <CODE>PUT</CODE>, et <CODE>TRACE</CODE>
|
||||
@@ -2200,8 +2194,8 @@ OPTIONS</CODE>, <CODE>POST</CODE>, <CODE>PUT</CODE>, et <CODE>TRACE</CODE>
|
||||
<H4>Description</H4>
|
||||
<P>La directive <CODE>LimitExcept</CODE> groupe les directives de
|
||||
contrôle d'accès pour certains types spécifiques de requêtes HTTP et
|
||||
doit apparaître à l'intérieur d'une section <A HREF="#Location"> <CODE>
|
||||
Location</CODE></A>. Contrairement à la directive <A HREF="#Limit"><CODE>
|
||||
doit apparaître à l'intérieur d'une section<A HREF="#Location"> <CODE>
|
||||
Location</CODE></A>. Contrairement à la directive<A HREF="#Limit"> <CODE>
|
||||
Limit</CODE></A>, <CODE>LimitExcept</CODE> restreint l'accès pour toutes
|
||||
les requêtes<I> à l'exception</I> de celles listées dans la ligne <CODE>
|
||||
LimitExcept</CODE>.
|
||||
@@ -2222,8 +2216,8 @@ LimitRequestBody 0
|
||||
maximale des fichiers d'impression, des requêtes IPP, et des données
|
||||
des formulaires HTML dans les requêtes HTTP POST. La limite implicite
|
||||
est de 0 ce qui désactive la vérification de la limite.</P>
|
||||
<P>Reportez-vous également à la directive similaire <A HREF="#MaxRequestSize">
|
||||
<CODE>MaxRequestSize</CODE></A>.
|
||||
<P>Reportez-vous également à la directive similaire<A HREF="#MaxRequestSize">
|
||||
<CODE>MaxRequestSize</CODE></A>.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
<H3><A NAME="Listen">Listen</A></H3>
|
||||
@@ -2240,8 +2234,8 @@ Listen 192.0.2.1:631
|
||||
port sur lequel écouter en attente de connexions. Plusieurs directives <CODE>
|
||||
Listen</CODE> peuvent être indiquées pour écouter sur de multiples
|
||||
adresses.</P>
|
||||
<P>La directive <CODE>Listen</CODE> est similaire à la directive <A HREF="#Port">
|
||||
<CODE>Port</CODE></A> mais vous permet de restreindre l'accès à des
|
||||
<P>La directive <CODE>Listen</CODE> est similaire à la directive<A HREF="#Port">
|
||||
<CODE>Port</CODE></A> mais vous permet de restreindre l'accès à des
|
||||
interfaces ou des réseaux spécifiques.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
@@ -2267,7 +2261,7 @@ Listen</CODE> peuvent être indiquées pour écouter sur de mul
|
||||
<P>La directive <CODE>Location</CODE> indique des options de contrôle
|
||||
d'accès et d'authentification pour le chemin ou la ressource HTTP
|
||||
indiquée. Des informations supplémentaires sont disponibles plus loin
|
||||
dans le chapitre dans la section <A HREF="#PRINTING_SECURITY">"Sécurité
|
||||
dans le chapitre dans la section<A HREF="#PRINTING_SECURITY"> "Sécurité
|
||||
du système d'impression"</A>.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
@@ -2290,7 +2284,7 @@ LogLevel debug2
|
||||
</UL>
|
||||
<H4>Description</H4>
|
||||
<P>La directive <CODE>LogLevel</CODE> indique la quantité d'informations
|
||||
à consigner dans le fichier <A HREF="#ErrorLog"><CODE>ErrorLog</CODE></A>
|
||||
à consigner dans le fichier<A HREF="#ErrorLog"> <CODE>ErrorLog</CODE></A>
|
||||
. Les valeurs suivantes sont reconnues (chaque niveau inclut tout ce qui
|
||||
l'est dans les niveaux inférieurs):</P>
|
||||
<UL>
|
||||
@@ -2433,8 +2427,8 @@ MaxRequestSize 0
|
||||
des fichiers d'impression, des requêtes IPP, et des données des
|
||||
formulaires HTML contenus dans les requêtes HTTP POST. La valeur
|
||||
implicite est 0, ce qui désactive cette vérification de limite.</P>
|
||||
<P>Reportez-vous également à la directive similaire <A HREF="#LimitRequestBody">
|
||||
<CODE>LimitRequestBody</CODE></A>.
|
||||
<P>Reportez-vous également à la directive similaire<A HREF="#LimitRequestBody">
|
||||
<CODE>LimitRequestBody</CODE></A>.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
<H3><A NAME="Order">Order</A></H3>
|
||||
@@ -2457,7 +2451,7 @@ Deny</CODE>.</LI>
|
||||
les hôtes listés dans une directive <CODE>Allow</CODE>.</LI>
|
||||
</UL>
|
||||
<P>La directive <CODE>Order</CODE> doit apparaître à l'intérieur d'une
|
||||
directive <A HREF="#Location"> <CODE>Location</CODE></A>.
|
||||
directive<A HREF="#Location"> <CODE>Location</CODE></A>.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
<H3><A NAME="PageLog">PageLog</A></H3>
|
||||
@@ -2473,7 +2467,7 @@ PageLog syslog
|
||||
<H4>Description</H4>
|
||||
<P>La directive <CODE>PageLog</CODE> définit le nom du fichier "page
|
||||
log". Si le nom du fichier n'est pas absolu, il est considéré comme
|
||||
étant relatif au répertoire <A HREF="#ServerRoot"><CODE>ServerRoot</CODE>
|
||||
étant relatif au répertoire<A HREF="#ServerRoot"> <CODE>ServerRoot</CODE>
|
||||
</A>. Le fichier standard "page log" est<VAR> /var/log/cups/page_log</VAR>
|
||||
.</P>
|
||||
<P>Le nom du serveur peut être inclus dans le nom de fichier en
|
||||
@@ -2626,8 +2620,8 @@ RequestRoot /foo/bar/spool/cups
|
||||
<H4>Description</H4>
|
||||
<P>La directive <CODE>RequestRoot</CODE> définit le répertoire pour les
|
||||
requêtes entrantes IPP et les formulaires HTML. Si un chemin absolu
|
||||
n'est pas fourni alors il est considéré comme relatif au répertoire <A HREF="#ServerRoot">
|
||||
<CODE>ServerRoot</CODE></A>. Le répertoire implicite est<VAR>
|
||||
n'est pas fourni alors il est considéré comme relatif au répertoire<A HREF="#ServerRoot">
|
||||
<CODE>ServerRoot</CODE></A>. Le répertoire implicite est<VAR>
|
||||
/var/spool/cups</VAR>.
|
||||
<!-- NEED 4in -->
|
||||
</P>
|
||||
@@ -2652,7 +2646,7 @@ group</CODE> indique que l'utilisateur authentifié doit être membre
|
||||
authentifié peut accéder à la ressource.</P>
|
||||
<P>Le comportement implicite ("par défaut") est de ne faire aucune
|
||||
authentification. Cette directive doit apparaître à l'intérieur d'une
|
||||
directive <A HREF="#Location"><CODE>Location</CODE></A>.
|
||||
directive<A HREF="#Location"> <CODE>Location</CODE></A>.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
<H3><A NAME="RIPCache">RIPCache</A></H3>
|
||||
@@ -2719,7 +2713,7 @@ Satisfy any
|
||||
l'authentifiation pour l'accès à distance mais autoriser l'accès local
|
||||
sans elle.</P>
|
||||
<P>La valeur implicite est <CODE>all</CODE>. Cette directive doit
|
||||
apparaître à l'intérieur d'une directive <A HREF="#Location"> <CODE>
|
||||
apparaître à l'intérieur d'une directive<A HREF="#Location"> <CODE>
|
||||
Location</CODE></A>.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
@@ -2750,8 +2744,8 @@ ServerBin /foo/bar/lib/cups
|
||||
<H4>Description</H4>
|
||||
<P>La directive <CODE>ServerBin</CODE> définit le répertoire contenant
|
||||
les fichiers exécutables du serveur. Si un chemin absolu n'est pas
|
||||
indiqué, il est considéré comme relatif au répertoire <A HREF="#ServerRoot">
|
||||
<CODE>ServerRoot</CODE></A> . Le répertoire implicite est<VAR>
|
||||
indiqué, il est considéré comme relatif au répertoire<A HREF="#ServerRoot">
|
||||
<CODE>ServerRoot</CODE></A> . Le répertoire implicite est<VAR>
|
||||
/usr/lib/cups</VAR>.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
@@ -2833,8 +2827,8 @@ SSLListen 192.0.2.1:443
|
||||
port sur lequel écouter les tentatives de connexion sécurisées.
|
||||
Plusieurs directives <CODE>SSLListen</CODE> peuvent être fournies pour
|
||||
indiquer plusieurs adresses sur lesquelles écouter.</P>
|
||||
<P>La directive <CODE>SSLListen</CODE> est similaire à la directive <A HREF="#SSLPort">
|
||||
<CODE>SSLPort</CODE></A> mais vous permet de restreindre l'accès à
|
||||
<P>La directive <CODE>SSLListen</CODE> est similaire à la directive<A HREF="#SSLPort">
|
||||
<CODE>SSLPort</CODE></A> mais vous permet de restreindre l'accès à
|
||||
certaines interfaces ou réseaux.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
@@ -2866,7 +2860,7 @@ SystemGroup root
|
||||
<P>La directive <CODE>SystemGroup</CODE> indique le groupe système
|
||||
d'aministration pour l'authentification de type <CODE>System</CODE>.
|
||||
Plus d'information peut être trouvée plus loin dans ce chapitre dans la
|
||||
section <A HREF="#PRINTING_SECURITY">"Sécurité du système d'impression"</A>
|
||||
section<A HREF="#PRINTING_SECURITY"> "Sécurité du système d'impression"</A>
|
||||
.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
@@ -2938,8 +2932,8 @@ User guest
|
||||
efficacement le nombre potentiel d'utilisateurs de votre système.</P>
|
||||
<P>CUPS maintient à jour une liste des emplacements dont
|
||||
l'authentification et/ou le contrôle d'accès est/sont activé(e)(s). Ces
|
||||
emplacements sont indiqués en utilisant la directive <A HREF="#Location">
|
||||
<CODE>Location</CODE></A>:</P>
|
||||
emplacements sont indiqués en utilisant la directive<A HREF="#Location">
|
||||
<CODE>Location</CODE></A>:</P>
|
||||
<UL>
|
||||
<PRE>
|
||||
<Location /ressource>
|
||||
@@ -2954,7 +2948,7 @@ User guest
|
||||
</PRE>
|
||||
</UL>
|
||||
<P>Les emplacements suivent généralement la structure arborescente du
|
||||
contenu du répertoire <A HREF="#DocumentRoot"><CODE>DocumentRoot</CODE></A>
|
||||
contenu du répertoire<A HREF="#DocumentRoot"> <CODE>DocumentRoot</CODE></A>
|
||||
, cependant CUPS possède de nombreux emplacements virtuels pour
|
||||
l'administration, les classes, les travaux d'impression et les
|
||||
imprimantes:
|
||||
@@ -3000,15 +2994,15 @@ Authorization: Local 0123456789ABCDEF0123456789ABCDEF
|
||||
<P>Les certificats sont automatiquement générés par le serveur et
|
||||
stockés dans le répertoire<VAR> /etc/cups/certs</VAR> en utilisant le
|
||||
n° de processus du programme CGI ("process ID") exécuté par le serveur.
|
||||
Les fichiers de certificats sont en lecture seule pour les utilisateurs
|
||||
<A HREF="#User"><CODE>User</CODE></A> et groupes <A HREF="#Group"><CODE>
|
||||
Les fichiers de certificats sont en lecture seule pour les utilisateurs<A
|
||||
HREF="#User"> <CODE>User</CODE></A> et groupes<A HREF="#Group"> <CODE>
|
||||
Group</CODE></A> définis dans le fichier<VAR> cupsd.conf</VAR>. Quand le
|
||||
programme CGI se termine, le certificat est retiré et rendu
|
||||
automatiquement invalide.</P>
|
||||
<P>Le fichier spécial<VAR> /etc/cups/certs/0</VAR> définit le<I>
|
||||
certificat de root</I> qui peut être utilisé par tout client
|
||||
fonctionnant sous l'identité du super-utilisateur et qui appartient au
|
||||
group défini par la directive <A HREF="#SystemGroup"><CODE>SystemGroup</CODE>
|
||||
group défini par la directive<A HREF="#SystemGroup"> <CODE>SystemGroup</CODE>
|
||||
</A>. Le certificat de root est automatiquement régénéré toutes les 5
|
||||
minutes.</P>
|
||||
<H3><A NAME="7_5_2">Utilisation de l'authentification "Basic"</A></H3>
|
||||
@@ -3144,7 +3138,7 @@ AuthType Digest
|
||||
</PRE>
|
||||
</UL>
|
||||
<H3><A NAME="7_5_4">Authentifications "System" et "Group"</A></H3>
|
||||
<P>La directive <A HREF="#AuthClass"><CODE>AuthClass</CODE></A> contrôle
|
||||
<P>La directive<A HREF="#AuthClass"> <CODE>AuthClass</CODE></A> contrôle
|
||||
le niveau d'authentification à effectuer. Les authentifications <CODE>
|
||||
System</CODE> et <CODE>Group</CODE> ajoutent à l'authentification
|
||||
normale basée sur l'utilisateur une contrainte d'appartenance à un
|
||||
@@ -3152,7 +3146,7 @@ System</CODE> et <CODE>Group</CODE> ajoutent à l'authentification
|
||||
utilisateur doit être membre du groupe <CODE>sys</CODE>, <CODE>system</CODE>
|
||||
, ou <CODE>root</CODE>; le groupe réel dépend du système d'exploitation.</P>
|
||||
<P>Pour l'authentification <CODE>Group</CODE> l'utilisateur doit être
|
||||
membre du group indiqué par la directive <A HREF="#AuthGroupName"><CODE>
|
||||
membre du group indiqué par la directive<A HREF="#AuthGroupName"> <CODE>
|
||||
AuthGroupName</CODE></A>:</P>
|
||||
<UL>
|
||||
<PRE>
|
||||
@@ -3197,7 +3191,7 @@ Hôte Groupe Utilisateur Date/heure \"Méthode Ressource Version
|
||||
</PRE>
|
||||
</UL>
|
||||
<P>Le champ<I> hôte</I> ne devrait normalement être qu'une adresse IP à
|
||||
moins que vous n'activiez la directive <A HREF="#HostNameLookups"><CODE>
|
||||
moins que vous n'activiez la directive<A HREF="#HostNameLookups"> <CODE>
|
||||
HostNameLookups</CODE></A> dans le fichier<VAR> cupsd.conf</VAR>.</P>
|
||||
<P>Le champ<I> groupe</I> contient toujours "-" dans CUPS.</P>
|
||||
<P>Le champ<I> utilisateur</I> est le nom de l'utilisateur authentifié
|
||||
@@ -3291,8 +3285,8 @@ job-billing</CODE> fourni dans les requête IPP <CODE>create-job</CODE>
|
||||
fichier basé sur MIME, afin de convertir les fichiers dans un format
|
||||
utilisable par chaque imprimante. Au démarrage, le serveur CUPS lit les
|
||||
fichiers de la base de données MIME contenus dans le répertoire<VAR>
|
||||
/etc/cups</VAR> (ou un répertoire indiqué au moyen de la directive <A HREF="#ServerRoot">
|
||||
<CODE>ServerRoot</CODE></A>) afin de construire en mémoire une base de
|
||||
/etc/cups</VAR> (ou un répertoire indiqué au moyen de la directive<A HREF="#ServerRoot">
|
||||
<CODE>ServerRoot</CODE></A>) afin de construire en mémoire une base de
|
||||
données de conversion et de types de fichiers. Ces fichiers de base de
|
||||
données sont de simples fichiers texte ASCII et peuvent être modifiés
|
||||
au moyen de votre éditeur de texte préféré.</P>
|
||||
@@ -3450,8 +3444,8 @@ acme.msword.convs
|
||||
<P>Une fois choisis les noms pour ces fichiers, créez-les au moyen de
|
||||
votre éditeur de texte préféré comme décrit précédemment dans ce
|
||||
chapitre. Une fois ces fichiers créés, redémarrez le processus <CODE>
|
||||
cupsd</CODE> comme indiqué précédemment dans <A HREF="#RESTARTING">
|
||||
"Redémarrage du serveur CUPS"</A> .</P>
|
||||
cupsd</CODE> comme indiqué précédemment dans<A HREF="#RESTARTING">
|
||||
"Redémarrage du serveur CUPS"</A> .</P>
|
||||
<H3><A NAME="7_7_4">Pilotes d'imprimantes et fichiers PPD</A></H3>
|
||||
<P>Plusieurs pilotes d'imprimante CUPS utilisent un ou plusieurs filtres
|
||||
spécifiques et un fichier PPD pour chaque modèle d'imprimante. Les
|
||||
@@ -3745,7 +3739,7 @@ smbpasswd(1)</CODE> sinon vous ne pourrez pas vous authentifier.</P>
|
||||
première utilise le protocole LPD sur le système CUPS et le service
|
||||
"Serveur d'impression TCP/IP" sur le système Windows NT. Vous pouvez
|
||||
trouver plus d'information au sujet de la première configuration dans
|
||||
la section précédente <A HREF="#LPD">LPD</A> de ce chapitre.</P>
|
||||
la section précédente<A HREF="#LPD"> LPD</A> de ce chapitre.</P>
|
||||
<P>La seconde méthode utilise le protocole SMB de Microsoft ("Server
|
||||
Message Block"). La prise en charge de ce protocole est fournie par le
|
||||
logiciel libre SAMBA. Vous pouvez télécharger SAMBA à l'adresse
|
||||
@@ -3878,7 +3872,7 @@ copies of this license document, but changing it is not allowed.
|
||||
<PRE>
|
||||
|
||||
</PRE>
|
||||
<H3><A NAME="9_2_1">Preamble</A></H3>
|
||||
<H4>Preamble</H4>
|
||||
<P>The licenses for most software are designed to take away your freedom
|
||||
to share and change it. By contrast, the GNU General Public License is
|
||||
intended to guarantee your freedom to share and change free
|
||||
@@ -4132,7 +4126,7 @@ of this license document, but changing it is not allowed.
|
||||
[This is the first released version of the library GPL. It is
|
||||
numbered 2 because it goes with version 2 of the ordinary GPL.]
|
||||
</PRE>
|
||||
<H3><A NAME="9_3_1">Preamble</A></H3>
|
||||
<H4>Preamble</H4>
|
||||
<P>The licenses for most software are designed to take away your freedom
|
||||
to share and change it. By contrast, the GNU General Public Licenses
|
||||
are intended to guarantee your freedom to share and change free
|
||||
@@ -4658,8 +4652,8 @@ PING mon_imprimante (192.0.2.2): 56 data bytes
|
||||
|
||||
<!-- NEED 1in -->
|
||||
<TR ALIGN="LEFT" VALIGN="TOP"><TD>Axis w/o IPP
|
||||
<BR> <A HREF="#AXIS"> (voir instructions)</A></TD><TD>socket://<I>
|
||||
address</I> :9100
|
||||
<BR><A HREF="#AXIS"> (voir instructions)</A></TD><TD>socket://<I>address</I>
|
||||
:9100
|
||||
<BR> socket://<I>address</I>:9101
|
||||
<BR> socket://<I>address</I>:9102</TD></TR>
|
||||
|
||||
@@ -4714,7 +4708,7 @@ address</I> :9100
|
||||
|
||||
<!-- NEED 1in -->
|
||||
<TR ALIGN="LEFT" VALIGN="TOP"><TD>Linksys EtherFast®
|
||||
<BR> <A HREF="#LINKSYS"> (voir instructions)</A></TD><TD>socket://<I>
|
||||
<BR><A HREF="#LINKSYS"> (voir instructions)</A></TD><TD>socket://<I>
|
||||
address</I> :4010
|
||||
<BR> socket://<I>address</I>:4020
|
||||
<BR> socket://<I>address</I>:4030</TD></TR>
|
||||
@@ -5103,9 +5097,9 @@ ftp> <B>quit ENTREE</B>
|
||||
/etc/printcap</VAR> pour obtenir la liste des imprimantes disponibles.</P>
|
||||
<P>La configuration standard de CUPS ne crée pas ce fichier<VAR>
|
||||
/etc/printcap</VAR> automatiquement. Pour activer la création et la
|
||||
mise à jour automatiques de ce fichier, utilisez la directive <A HREF="#Printcap">
|
||||
<CODE>Printcap</CODE></A>décrite au <A HREF="#PRINTING_MANAGEMENT">
|
||||
Chapitre 6, "Administration du système d'impression"</A>.</P>
|
||||
mise à jour automatiques de ce fichier, utilisez la directive<A HREF="#Printcap">
|
||||
<CODE>Printcap</CODE></A>décrite au<A HREF="#PRINTING_MANAGEMENT">
|
||||
Chapitre 6, "Administration du système d'impression"</A>.</P>
|
||||
<H2><A NAME="13_2">CUPS ne reconnaît pas mon nom d'utilisateur et mon
|
||||
mot de passe!</A></H2>
|
||||
<P>CUPS vous demandera un nom d'utilisateur UNIX et un mot de passe
|
||||
@@ -5130,7 +5124,7 @@ AuthClass System
|
||||
</PRE>
|
||||
</UL>
|
||||
pour l'emplacement<VAR> /admin</VAR>. Redémarrez alors le serveur CUPS
|
||||
comme indiqué dans le <A HREF="#PRINTING_MANAGEMENT">Chapitre 6,
|
||||
comme indiqué dans le<A HREF="#PRINTING_MANAGEMENT"> Chapitre 6,
|
||||
"Administration du serveur d'impression"</A>.
|
||||
<CENTER>
|
||||
<TABLE BGCOLOR="#cccccc" BORDER="1" CELLPADDING="5" WIDTH="80%">
|
||||
@@ -5155,14 +5149,14 @@ Allow from 127.0.0.1
|
||||
</PRE>
|
||||
</UL>
|
||||
pour l'emplacement<VAR> /admin</VAR>. Redémarrez alors le serveur CUPS
|
||||
comme indiqué dans le <A HREF="#PRINTING_MANAGEMENT">Chapitre 6,
|
||||
comme indiqué dans le<A HREF="#PRINTING_MANAGEMENT"> Chapitre 6,
|
||||
"Administration du serveur d'impression"</A>.
|
||||
<CENTER>
|
||||
<TABLE BGCOLOR="#cccccc" BORDER="1" CELLPADDING="5" WIDTH="80%">
|
||||
<TR><TD><B> NOTE:</B>
|
||||
<P>Autoriser l'accès à l'administration pour tous les hôtes présente un
|
||||
risque potentiel de sécurité. Veuillez vous reporter au <A HREF="#PRINTING_MANAGEMENT">
|
||||
Chapitre 6, "Administration du serveur d'impression"</A> pour une
|
||||
risque potentiel de sécurité. Veuillez vous reporter au<A HREF="#PRINTING_MANAGEMENT">
|
||||
Chapitre 6, "Administration du serveur d'impression"</A> pour une
|
||||
description de ces risques ainsi que des méthodes pour les minimiser.</P>
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
@@ -5177,7 +5171,7 @@ Chapitre 6, "Administration du serveur d'impression"</A> pour une
|
||||
<LI>au fait d'accéder au serveur CUPS en utilisant le nom d'hôte ou
|
||||
l'adresse IP sans activer l'accès à distance pour les fonctions
|
||||
d'administration. Cela peut être corrigé en suivant les instructions
|
||||
présentes dans la section <A HREF="#ALLOW_REMOTE"> "Je ne peux pas
|
||||
présentes dans la section<A HREF="#ALLOW_REMOTE"> "Je ne peux pas
|
||||
effectuer de tâches d'administration depuis un poste distant!"</A>
|
||||
étudiée précédemment dans cette annexe.</LI>
|
||||
<LI>au fait de ne pas avoir de mot de passe pour le compte root. Pour
|
||||
|
||||
+7
-13
@@ -5,7 +5,7 @@
|
||||
<META NAME="author" CONTENT="Easy Software Products">
|
||||
<META NAME="copyright" CONTENT="Copyright 1997-2003, All Rights Reserved">
|
||||
<META NAME="docnumber" CONTENT="CUPS-SUM-1.1.14">
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-iso-8859-1">
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-8859-1">
|
||||
<STYLE TYPE="text/css"><!--
|
||||
BODY { font-family: serif }
|
||||
H1 { font-family: sans-serif }
|
||||
@@ -129,13 +129,7 @@ Copyright 1997-2003, All Rights Reserved<BR>
|
||||
<LI><A HREF="#6_1_4">Support</A></LI>
|
||||
</UL>
|
||||
<LI><A HREF="#6_2">GNU GENERAL PUBLIC LICENSE</A></LI>
|
||||
<UL>
|
||||
<LI><A HREF="#6_2_1">Preamble</A></LI>
|
||||
</UL>
|
||||
<LI><A HREF="#6_3">GNU LIBRARY GENERAL PUBLIC LICENSE</A></LI>
|
||||
<UL>
|
||||
<LI><A HREF="#6_3_1">Preamble</A></LI>
|
||||
</UL>
|
||||
</UL>
|
||||
<HR>
|
||||
<H1 ALIGN="RIGHT"><A NAME="1">Préface</A></H1>
|
||||
@@ -181,8 +175,8 @@ TM</SUP> ("Common Unix Printing System<SUP>TM</SUP>") Version 1.1.14.<
|
||||
<HR color="#000000" size="1px" width="50%">
|
||||
<H2><A NAME="1_1">Aperçu du système</A></H2>
|
||||
<P>CUPS fournit une couche d'impression portable pour les systèmes
|
||||
d'exploitation de type UNIX®. Il a été développé par <A HREF="http://www.easysw.com">
|
||||
Easy Software Products</A> pour promouvoir une solution d'impression
|
||||
d'exploitation de type UNIX®. Il a été développé par<A HREF="http://www.easysw.com">
|
||||
Easy Software Products</A> pour promouvoir une solution d'impression
|
||||
standard pour tous les vendeurs et utilisateurs d'UNIX. CUPS fournit
|
||||
des interfaces en ligne de commande de type System V et Berkeley.</P>
|
||||
<P>CUPS utilise le protocol IPP (Internet Printing Protocol) comme base
|
||||
@@ -470,7 +464,7 @@ Easy Software Products</A> pour promouvoir une solution d'impression
|
||||
</B></B></PRE>
|
||||
</UL>
|
||||
<P>Les options d'imprimante disponibles varient en fonction de
|
||||
l'imprimante. Les options standards sont décrites dans le <A HREF="#STANDARD_OPTIONS">
|
||||
l'imprimante. Les options standards sont décrites dans le<A HREF="#STANDARD_OPTIONS">
|
||||
Chapitre 3, "Options standards d'imprimante"</A>.</P>
|
||||
<H2><A NAME="3_4">Impression de plusieurs copies</A></H2>
|
||||
<P>Les deux commandes <CODE>lp</CODE> et <CODE>lpr</CODE> possèdent des
|
||||
@@ -970,7 +964,7 @@ page-ranges</CODE>.</P>
|
||||
imprimante et définir votre propre imprimante implicite.</P>
|
||||
<H2><A NAME="5_1">Options d'imprimante</A></H2>
|
||||
<P>Chaque imprimante prend en charge un grand nombre d'options, que vous
|
||||
avez découvertes dans le <A HREF="#STANDARD_OPTIONS"> Chapitre 3,
|
||||
avez découvertes dans le<A HREF="#STANDARD_OPTIONS"> Chapitre 3,
|
||||
"Options standards d'imprimante"</A>. Plutôt qu'indiquer ces options à
|
||||
chaque fois que vous imprimez un fichier, CUPS vous permet de
|
||||
sauvegarder comme "implicites" les options pour votre imprimante.</P>
|
||||
@@ -1150,7 +1144,7 @@ copies of this license document, but changing it is not allowed.
|
||||
<PRE>
|
||||
|
||||
</PRE>
|
||||
<H3><A NAME="6_2_1">Preamble</A></H3>
|
||||
<H4>Preamble</H4>
|
||||
<P>The licenses for most software are designed to take away your freedom
|
||||
to share and change it. By contrast, the GNU General Public License is
|
||||
intended to guarantee your freedom to share and change free
|
||||
@@ -1404,7 +1398,7 @@ of this license document, but changing it is not allowed.
|
||||
[This is the first released version of the library GPL. It is
|
||||
numbered 2 because it goes with version 2 of the ordinary GPL.]
|
||||
</PRE>
|
||||
<H3><A NAME="6_3_1">Preamble</A></H3>
|
||||
<H4>Preamble</H4>
|
||||
<P>The licenses for most software are designed to take away your freedom
|
||||
to share and change it. By contrast, the GNU General Public Licenses
|
||||
are intended to guarantee your freedom to share and change free
|
||||
|
||||
+1
-5
@@ -210,7 +210,7 @@ Copyright 1997-2003 All Rights Reserved<BR>
|
||||
("CUPS") version 1.1.</P>
|
||||
<H2><A NAME="1_2">1.2 System Overview</A></H2>
|
||||
<P>CUPS provides a portable printing layer for UNIX®-based operating
|
||||
systems. It has been developed by <A HREF="http://www.easysw.com">Easy
|
||||
systems. It has been developed by<A HREF="http://www.easysw.com"> Easy
|
||||
Software Products</A> to promote a standard printing solution for all
|
||||
UNIX vendors and users. CUPS provides the System V and Berkeley
|
||||
command-line interfaces.</P>
|
||||
@@ -1479,10 +1479,6 @@ VALIGN="TOP">0x4006</TD><TD VALIGN="TOP">Add or modify a printer class.</TD>
|
||||
user-defined media sizes.</TD></TR>
|
||||
<TR><TD VALIGN="TOP">0x00010000</TD><TD VALIGN="TOP">Is an implicit
|
||||
(server-generated) class.</TD></TR>
|
||||
<TR><TD VALIGN="TOP">0x00020000</TD><TD VALIGN="TOP">Is a network
|
||||
default printer.</TD></TR>
|
||||
<TR><TD VALIGN="TOP">0x00040000</TD><TD VALIGN="TOP">Is a facsimile
|
||||
device.</TD></TR>
|
||||
</TABLE>
|
||||
</CENTER>
|
||||
</P>
|
||||
|
||||
Arquivo binário não exibido.
@@ -2031,14 +2031,6 @@ information and the PPD file for the printer. The following bits are defined:
|
||||
<TD VALIGN="TOP">0x00010000</TD>
|
||||
<TD VALIGN="TOP">Is an implicit (server-generated) class.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD VALIGN="TOP">0x00020000</TD>
|
||||
<TD VALIGN="TOP">Is a network default printer.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD VALIGN="TOP">0x00040000</TD>
|
||||
<TD VALIGN="TOP">Is a facsimile device.</TD>
|
||||
</TR>
|
||||
</TABLE></CENTER>
|
||||
|
||||
<H3>printer-type-mask (type2 enum)</H3>
|
||||
|
||||
+180
-187
@@ -4,7 +4,7 @@
|
||||
<TITLE>CUPS Software Administrators Manual</TITLE>
|
||||
<META NAME="author" CONTENT="Easy Software Products">
|
||||
<META NAME="copyright" CONTENT="Copyright 1997-2003, All Rights Reserved">
|
||||
<META NAME="docnumber" CONTENT="CUPS-SAM-1.1.20">
|
||||
<META NAME="docnumber" CONTENT="CUPS-SAM-1.1.19">
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-8859-1">
|
||||
<STYLE TYPE="text/css"><!--
|
||||
BODY { font-family: serif }
|
||||
@@ -22,7 +22,7 @@ PRE { font-family: monospace }
|
||||
<BODY BGCOLOR="white">
|
||||
<CENTER><A HREF="#CONTENTS"><IMG SRC="images/cups-large.gif" BORDER="0" WIDTH="431" HEIGHT="511"><BR>
|
||||
<H1>CUPS Software Administrators Manual</H1></A><BR>
|
||||
CUPS-SAM-1.1.20<BR>
|
||||
CUPS-SAM-1.1.19<BR>
|
||||
Easy Software Products<BR>
|
||||
Copyright 1997-2003, All Rights Reserved<BR>
|
||||
</CENTER>
|
||||
@@ -263,7 +263,7 @@ Copyright 1997-2003, All Rights Reserved<BR>
|
||||
<UL>
|
||||
<LI><A HREF="#8_1">The Basics</A></LI>
|
||||
<LI><A HREF="#8_2">Printing from LPD Clients</A></LI>
|
||||
<LI><A HREF="#LPD">Printing to LPD Servers</A></LI>
|
||||
<LI><A HREF="#8_3">Printing to LPD Servers</A></LI>
|
||||
<LI><A HREF="#8_4">Printing from Mac OS 10.2 and Later Clients</A></LI>
|
||||
<LI><A HREF="#8_5">Printing from Mac OS 10.1 and Earlier Clients</A></LI>
|
||||
<UL>
|
||||
@@ -290,13 +290,7 @@ Copyright 1997-2003, All Rights Reserved<BR>
|
||||
<LI><A HREF="#9_1_5">Support</A></LI>
|
||||
</UL>
|
||||
<LI><A HREF="#9_2">GNU GENERAL PUBLIC LICENSE</A></LI>
|
||||
<UL>
|
||||
<LI><A HREF="#9_2_1">Preamble</A></LI>
|
||||
</UL>
|
||||
<LI><A HREF="#9_3">GNU LIBRARY GENERAL PUBLIC LICENSE</A></LI>
|
||||
<UL>
|
||||
<LI><A HREF="#9_3_1">Preamble</A></LI>
|
||||
</UL>
|
||||
</UL>
|
||||
<B><A HREF="#COMMON_NETWORK">B - Common Network Settings</A></B>
|
||||
<UL>
|
||||
@@ -340,10 +334,10 @@ Copyright 1997-2003, All Rights Reserved<BR>
|
||||
<H1 ALIGN="RIGHT"><A NAME="1">Preface</A></H1>
|
||||
<P>This software administrators manual provides printer administration
|
||||
information for the Common UNIX Printing System<SUP>TM</SUP> ("CUPS<SUP>
|
||||
TM</SUP>"), version 1.1.20.</P>
|
||||
TM</SUP>"), version 1.1.19.</P>
|
||||
<H2><A NAME="1_1">System Overview</A></H2>
|
||||
<P>CUPS provides a portable printing layer for UNIX®-based operating
|
||||
systems. It has been developed by <A HREF="http://www.easysw.com">Easy
|
||||
systems. It has been developed by<A HREF="http://www.easysw.com"> Easy
|
||||
Software Products</A> to promote a standard printing solution for all
|
||||
UNIX vendors and users. CUPS provides the System V and Berkeley
|
||||
command-line interfaces.</P>
|
||||
@@ -546,7 +540,7 @@ File and directory names.</TD></TR>
|
||||
Installing CUPS</A></H1>
|
||||
<P>This chapter shows how to build and install the Common UNIX Printing
|
||||
System. If you are installing a binary distribution from the CUPS web
|
||||
site, proceed to the section titled, <A HREF="#BINARY">Installing a
|
||||
site, proceed to the section titled,<A HREF="#BINARY"> Installing a
|
||||
Binary Distribution</A>.</P>
|
||||
<H2><A NAME="3_1">Installing a Source Distribution</A></H2>
|
||||
<P>This section describes how to compile and install CUPS on your system
|
||||
@@ -797,7 +791,7 @@ file:/directory/filename</CODE> while network devices use the more
|
||||
</PRE>
|
||||
</UL>
|
||||
<P>and steps you through printer configuration. If you don't like
|
||||
command-line interfaces, try the <A HREF="#ADD_WEB">Web interface</A>
|
||||
command-line interfaces, try the<A HREF="#ADD_WEB"> Web interface</A>
|
||||
instead.</P>
|
||||
<H3><A NAME="4_2_1">Adding Your First Printer from the Command-Line</A></H3>
|
||||
<P>Run the <CODE>lpadmin</CODE> command with the <CODE>-p</CODE> option
|
||||
@@ -824,10 +818,10 @@ file:/directory/filename</CODE> while network devices use the more
|
||||
<P>As you can see, <CODE>deskjet.ppd</CODE> and <CODE>laserjet.ppd</CODE>
|
||||
are the PPD files for the HP DeskJet and HP LaserJet drivers included
|
||||
with CUPS. You'll find a complete list of PPD files and the printers
|
||||
they will work with in <A HREF="#PRINTER_DRIVERS">Appendix C, "Printer
|
||||
they will work with in<A HREF="#PRINTER_DRIVERS"> Appendix C, "Printer
|
||||
Drivers"</A>.</P>
|
||||
<P>For a dot matrix printer connected to the serial port, this might
|
||||
look like:</P>
|
||||
<P>For a dot matrix printer connected to the serial port this would
|
||||
might look like:</P>
|
||||
<UL>
|
||||
<PRE>
|
||||
<B>/usr/sbin/lpadmin -p DotMatrix -E -m epson9.ppd \
|
||||
@@ -878,8 +872,8 @@ file:/directory/filename</CODE> while network devices use the more
|
||||
PPD's are usually stored under the<VAR> /usr/share/cups/model/</VAR>
|
||||
directory structure. A list of all available models can be displayed
|
||||
using the <CODE>lpinfo</CODE> command with the <CODE>-m</CODE> option.
|
||||
A list of printer drivers included with CUPS can be found in <A HREF="#PRINTER_DRIVERS">
|
||||
Appendix C, "Printer Drivers"</A>.</DD>
|
||||
A list of printer drivers included with CUPS can be found in<A HREF="#PRINTER_DRIVERS">
|
||||
Appendix C, "Printer Drivers"</A>.</DD>
|
||||
<DT>-r<I> class</I></DT>
|
||||
<DD>Removes the named printer from printer class<VAR> class</VAR>. If
|
||||
the resulting class becomes empty then it is removed.</DD>
|
||||
@@ -963,10 +957,8 @@ lpoptions(1)</CODE> command.</P>
|
||||
quotas:</P>
|
||||
<UL>
|
||||
<PRE>
|
||||
<B>/usr/sbin/lpadmin -p <I>printer</I> -o job-quota-period=604800 \
|
||||
-o job-k-limit=1024 <I>ENTER</I></B>
|
||||
<B>/usr/sbin/lpadmin -p <I>printer</I> -o job-quota-period=604800 \
|
||||
-o job-page-limit=100 <I>ENTER</I></B>
|
||||
<B>/usr/sbin/lpadmin -p <I>printer</I> -o job-quota-period=604800 -o job-k-limit=1024 <I>ENTER</I></B>
|
||||
<B>/usr/sbin/lpadmin -p <I>printer</I> -o job-quota-period=604800 -o job-page-limit=100 <I>ENTER</I></B>
|
||||
</PRE>
|
||||
</UL>
|
||||
<P>Or, you can combine all three options on the same line.</P>
|
||||
@@ -1080,10 +1072,10 @@ lpoptions(1)</CODE> command.</P>
|
||||
<H2><A NAME="5_4">Implicit Classes</A></H2>
|
||||
<P>A noted earlier, implicit classes are created automatically from the
|
||||
available network printers and classes. To disable this functionality,
|
||||
set the <A HREF="#ImplicitClasses"><CODE>ImplicitClasses</CODE></A>
|
||||
set the<A HREF="#ImplicitClasses"> <CODE>ImplicitClasses</CODE></A>
|
||||
directive to <CODE>Off</CODE> in the <CODE>cupsd.conf</CODE> file. You
|
||||
will find more information on doing this in <A HREF="#PRINTING_MANAGEMENT">
|
||||
Chapter 6, "Printing System Management"</A>.</P>
|
||||
will find more information on doing this in<A HREF="#PRINTING_MANAGEMENT">
|
||||
Chapter 6, "Printing System Management"</A>.</P>
|
||||
<H1 ALIGN="RIGHT"><A NAME="CLIENT_SETUP">5 - Client Setup</A></H1>
|
||||
<P>This chapter discusses several ways to configure CUPS clients for
|
||||
printing.</P>
|
||||
@@ -1154,8 +1146,8 @@ ServerName <I>server</I>
|
||||
Each client should see the available printers within 30 seconds
|
||||
automatically. The printer and class lists are updated automatically as
|
||||
printers and servers are added or removed.</P>
|
||||
<P>If you want to see printers on other subnets as well, use the <A HREF="#BrowsePoll">
|
||||
<CODE>BrowsePoll</CODE></A> directive as described next.</P>
|
||||
<P>If you want to see printers on other subnets as well, use the<A HREF="#BrowsePoll">
|
||||
<CODE>BrowsePoll</CODE></A> directive as described next.</P>
|
||||
<CENTER>
|
||||
<TABLE BGCOLOR="#cccccc" BORDER="1" CELLPADDING="5" WIDTH="80%">
|
||||
<TR><TD><B> NOTE:</B>
|
||||
@@ -1164,11 +1156,11 @@ ServerName <I>server</I>
|
||||
braodcasts printer information every 30 seconds. Although this printer
|
||||
information does not use much bandwidth, typically about 80 bytes per
|
||||
printer, it can add up with large numbers of servers and printers.</P>
|
||||
<P>Use the <A HREF="#BrowseInterval"><CODE>BrowseInterval</CODE></A> and
|
||||
<A HREF="#BrowseTimeout"><CODE>BrowseTimeout</CODE></A> directives to
|
||||
tune the amount of data that is added to your network load. In
|
||||
addition, subnets can be used to minimize the amount of traffic that is
|
||||
carried by the "backbone" of your large network.</P>
|
||||
<P>Use the<A HREF="#BrowseInterval"> <CODE>BrowseInterval</CODE></A> and<A
|
||||
HREF="#BrowseTimeout"> <CODE>BrowseTimeout</CODE></A> directives to tune
|
||||
the amount of data that is added to your network load. In addition,
|
||||
subnets can be used to minimize the amount of traffic that is carried
|
||||
by the "backbone" of your large network.</P>
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
</CENTER>
|
||||
@@ -1178,18 +1170,18 @@ ServerName <I>server</I>
|
||||
automatic configuration without significant configuration on the
|
||||
clients, and multiple clients on the same subnet can share the same
|
||||
configuration information.</P>
|
||||
<P>Polling is enabled by specifying one or more <A HREF="#BrowsePoll"><CODE>
|
||||
<P>Polling is enabled by specifying one or more<A HREF="#BrowsePoll"> <CODE>
|
||||
BrowsePoll</CODE></A> directives in the<VAR> /etc/cups/cupsd.conf</VAR>
|
||||
file. For information on making these changes, see <A HREF="#PRINTING_MANAGEMENT">
|
||||
Chapter 6, "Printing System Management"</A>.</P>
|
||||
<P>Multiple <A HREF="#BrowsePoll"><CODE>BrowsePoll</CODE></A> lines can
|
||||
file. For information on making these changes, see<A HREF="#PRINTING_MANAGEMENT">
|
||||
Chapter 6, "Printing System Management"</A>.</P>
|
||||
<P>Multiple<A HREF="#BrowsePoll"> <CODE>BrowsePoll</CODE></A> lines can
|
||||
be used to poll multiple CUPS servers. To limit the amount of polling
|
||||
you do from client machines, you can have only one of the clients do
|
||||
the polling and relay that information to the others on the same subnet
|
||||
(described next).</P>
|
||||
<H3><A NAME="CLIENT_RELAY">Relaying Printers to Other Clients</A></H3>
|
||||
<P>When you have clients and servers spread across multiple subnets, the
|
||||
polling method is inefficient. CUPS provides a <A HREF="#BrowseRelay"><CODE>
|
||||
polling method is inefficient. CUPS provides a<A HREF="#BrowseRelay"> <CODE>
|
||||
BrowseRelay</CODE></A> directive that enables a single client to relay
|
||||
(broadcast) the polled printer information to the local subnet.</P>
|
||||
<P>For example, Server A and Server B are on subnet 1 and subnet 2,
|
||||
@@ -1209,7 +1201,7 @@ BrowsePoll ServerB ENTER
|
||||
BrowseRelay 127.0.0.1 192.168.3.255 ENTER
|
||||
</B></PRE>
|
||||
</UL>
|
||||
<P>The <A HREF="#BrowseRelay"><CODE>BrowseRelay</CODE></A> line
|
||||
<P>The<A HREF="#BrowseRelay"> <CODE>BrowseRelay</CODE></A> line
|
||||
specifies a source address and mask. Any browse packets coming from a
|
||||
matching address wil be sent to the given broadcast address. In this
|
||||
case, we want the packets from the local machine (127.0.0.1) relayed to
|
||||
@@ -1217,11 +1209,11 @@ BrowseRelay 127.0.0.1 192.168.3.255 ENTER
|
||||
<P>As printers are found using polling, they are relayed from client C
|
||||
to the rest of the clients through a broadcast on subnet 3. The rest of
|
||||
the clients can use the standard<VAR> cupsd.conf</VAR> configuration.</P>
|
||||
<P>The <A HREF="#BrowseRelay"><CODE>BrowseRelay</CODE></A> directive can
|
||||
<P>The<A HREF="#BrowseRelay"> <CODE>BrowseRelay</CODE></A> directive can
|
||||
also be used to relay browsing packets from one network interface to
|
||||
another. For example, if client C in the previous example had network
|
||||
interfaces attaches to both subnet 1 and subnet 2, it could use the <A HREF="#BrowseRelay">
|
||||
<CODE>BrowseRelay</CODE></A> directive exclusively:</P>
|
||||
interfaces attaches to both subnet 1 and subnet 2, it could use the<A HREF="#BrowseRelay">
|
||||
<CODE>BrowseRelay</CODE></A> directive exclusively:</P>
|
||||
<UL>
|
||||
<PRE>
|
||||
# Relay the printers from subnet 1 and 2 to subnet 3
|
||||
@@ -1241,8 +1233,8 @@ BrowseRelay 192.168.2 192.168.3.255 ENTER
|
||||
<P>If you have two printers, LaserJet@ServerA and LaserJet@ServerB, a
|
||||
third implicit class called<I> LaserJet</I> will be created
|
||||
automatically on the client that refers to both printers. If the client
|
||||
also has a local printer with the name LaserJet and the <A HREF="#ImplicitAnyClasses">
|
||||
<CODE>ImplicitAnyClasses</CODE></A> directive is enabled, then an
|
||||
also has a local printer with the name LaserJet and the<A HREF="#ImplicitAnyClasses">
|
||||
<CODE>ImplicitAnyClasses</CODE></A> directive is enabled, then an
|
||||
implicit class named<I> AnyLaserJet</I> will be created instead.
|
||||
Otherwise, the local printer will prevent the creation of an implicit
|
||||
class, since CUPS will assume that the local printer will always be
|
||||
@@ -1277,8 +1269,9 @@ ImplicitClasses</CODE></A>) are enabled and implicit "any" classes (<A
|
||||
<!-- NEED 1in -->
|
||||
</DD>
|
||||
<DT>client.conf</DT>
|
||||
<DD>This file provides the default server name for client machines. See <A
|
||||
HREF="#CLIENT_SETUP">Chapter 5, "Client Setup"</A> for more information.
|
||||
<DD>This file provides the default server name for client machines. See<A
|
||||
HREF="#CLIENT_SETUP"> Chapter 5, "Client Setup"</A> for more
|
||||
information.
|
||||
<BR>
|
||||
<!-- NEED 1in -->
|
||||
</DD>
|
||||
@@ -1440,7 +1433,7 @@ AccessLog syslog
|
||||
<H4>Description</H4>
|
||||
<P>The <CODE>AccessLog</CODE> directive sets the name of the access log
|
||||
file. If the filename is not absolute then it is assumed to be relative
|
||||
to the <A HREF="#ServerRoot"><CODE>ServerRoot</CODE></A> directory. The
|
||||
to the<A HREF="#ServerRoot"> <CODE>ServerRoot</CODE></A> directory. The
|
||||
access log file is stored in "common log format" and can be used by any
|
||||
web access reporting tool to generate a report on CUPS server activity.</P>
|
||||
<P>The server name can be included in the filename by using <CODE>%s</CODE>
|
||||
@@ -1494,8 +1487,8 @@ mm</TH><TH WIDTH="20%">netmask</TH></TR>
|
||||
<P>The <CODE>@LOCAL</CODE> name will allow access from all local network
|
||||
interfaces, but not remote point-to-point interfaces. The <CODE>
|
||||
@IF(name)</CODE> name will allow access from the named interface.</P>
|
||||
<P>The <CODE>Allow</CODE> directive must appear inside a <A HREF="#Location">
|
||||
<CODE>Location</CODE></A> directive.
|
||||
<P>The <CODE>Allow</CODE> directive must appear inside a<A HREF="#Location">
|
||||
<CODE>Location</CODE></A> directive.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
<H3><A NAME="AuthClass">AuthClass</A></H3>
|
||||
@@ -1518,13 +1511,13 @@ AuthClass Group
|
||||
<LI><CODE>User</CODE> - A valid username and password is required.</LI>
|
||||
<LI><CODE>System</CODE> - A valid username and password is required, and
|
||||
the username must belong to the "sys" group; this can be changed using
|
||||
the <A HREF="#SystemGroup"><CODE>SystemGroup</CODE></A> directive.</LI>
|
||||
the<A HREF="#SystemGroup"> <CODE>SystemGroup</CODE></A> directive.</LI>
|
||||
<LI><CODE>Group</CODE> - A valid username and password is required, and
|
||||
the username must belong to the group named by the <CODE>AuthGroupName</CODE>
|
||||
directive.</LI>
|
||||
</UL>
|
||||
<P>The <CODE>AuthClass</CODE> directive must appear inside a <A HREF="#Location">
|
||||
<CODE>Location</CODE></A> directive.
|
||||
<P>The <CODE>AuthClass</CODE> directive must appear inside a<A HREF="#Location">
|
||||
<CODE>Location</CODE></A> directive.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
<H3><A NAME="AuthGroupName">AuthGroupName</A></H3>
|
||||
@@ -1539,8 +1532,8 @@ AuthGroupName lp
|
||||
<H4>Description</H4>
|
||||
<P>The <CODE>AuthGroupName</CODE> directive sets the group to use for <CODE>
|
||||
Group</CODE> authentication.</P>
|
||||
<P>The <CODE>AuthGroupName</CODE> directive must appear inside a <A HREF="#Location">
|
||||
<CODE>Location</CODE></A> directive.
|
||||
<P>The <CODE>AuthGroupName</CODE> directive must appear inside a<A HREF="#Location">
|
||||
<CODE>Location</CODE></A> directive.
|
||||
<!-- NEED 4in -->
|
||||
</P>
|
||||
<H3><A NAME="AuthType">AuthType</A></H3>
|
||||
@@ -1568,10 +1561,10 @@ AuthType BasicDigest
|
||||
</UL>
|
||||
<P>When using <CODE>Basic</CODE>, <CODE>Digest</CODE>, or <CODE>
|
||||
BasicDigest</CODE> authentication, clients connecting through the <CODE>
|
||||
localhost</CODE> interface can also authenticate using <A HREF="#CERTIFICATES">
|
||||
certificates</A>.</P>
|
||||
<P>The <CODE>AuthType</CODE> directive must appear inside a <A HREF="#Location">
|
||||
<CODE>Location</CODE></A> directive.
|
||||
localhost</CODE> interface can also authenticate using<A HREF="#CERTIFICATES">
|
||||
certificates</A>.</P>
|
||||
<P>The <CODE>AuthType</CODE> directive must appear inside a<A HREF="#Location">
|
||||
<CODE>Location</CODE></A> directive.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
<H3><A NAME="AutoPurgeJobs">AutoPurgeJobs</A></H3>
|
||||
@@ -1641,8 +1634,8 @@ BrowseAllow from @IF(name)
|
||||
<P>The <CODE>BrowseAllow</CODE> directive specifies a system or network
|
||||
to accept browse packets from. The default is to accept browse packets
|
||||
from all hosts.</P>
|
||||
<P>Host and domain name matching require that you enable the <A HREF="#HostNameLookups">
|
||||
<CODE>HostNameLookups</CODE></A> directive.</P>
|
||||
<P>Host and domain name matching require that you enable the<A HREF="#HostNameLookups">
|
||||
<CODE>HostNameLookups</CODE></A> directive.</P>
|
||||
<P>IP address matching supports exact matches, partial addresses that
|
||||
match networks using netmasks of 255.0.0.0, 255.255.0.0, and
|
||||
255.255.255.0, or network addresses using the specified netmask or bit
|
||||
@@ -1671,8 +1664,8 @@ BrowseDeny from @IF(name)
|
||||
<P>The <CODE>BrowseDeny</CODE> directive specifies a system or network
|
||||
to reject browse packets from. The default is to deny browse packets
|
||||
from no hosts.</P>
|
||||
<P>Host and domain name matching require that you enable the <A HREF="#HostNameLookups">
|
||||
<CODE>HostNameLookups</CODE></A> directive.</P>
|
||||
<P>Host and domain name matching require that you enable the<A HREF="#HostNameLookups">
|
||||
<CODE>HostNameLookups</CODE></A> directive.</P>
|
||||
<P>IP address matching supports exact matches, partial addresses that
|
||||
match networks using netmasks of 255.0.0.0, 255.255.0.0, and
|
||||
255.255.255.0, or network addresses using the specified netmask or bit
|
||||
@@ -1696,8 +1689,8 @@ BrowseInterval 30
|
||||
amount of time between browsing updates. Specifying a value of 0
|
||||
seconds disables outgoing browse updates but allows a server to receive
|
||||
printer information from other hosts.</P>
|
||||
<P>The <CODE>BrowseInterval</CODE> value should always be less than the <A
|
||||
HREF="#BrowseTimeout"><CODE>BrowseTimeout</CODE></A> value. Otherwise
|
||||
<P>The <CODE>BrowseInterval</CODE> value should always be less than the<A
|
||||
HREF="#BrowseTimeout"> <CODE>BrowseTimeout</CODE></A> value. Otherwise
|
||||
printers and classes will disappear from client systems between
|
||||
updates.
|
||||
<!-- NEED 3in -->
|
||||
@@ -1733,7 +1726,7 @@ BrowsePoll host.domain.com:631
|
||||
</UL>
|
||||
<H4>Description</H4>
|
||||
<P>The <CODE>BrowsePoll</CODE> directive polls a server for available
|
||||
printers once every <A HREF="#BrowseInterval"><CODE>BrowseInterval</CODE>
|
||||
printers once every<A HREF="#BrowseInterval"> <CODE>BrowseInterval</CODE>
|
||||
</A> seconds. Multiple <CODE>BrowsePoll</CODE> directives can be
|
||||
specified to poll multiple servers.</P>
|
||||
<P>If <CODE>BrowseInterval</CODE> is set to 0 then the server is polled
|
||||
@@ -1852,7 +1845,7 @@ BrowseTimeout 60
|
||||
or class times out it is removed from the list of available
|
||||
destinations.</P>
|
||||
<P>The <CODE>BrowseTimeout</CODE> value should always be greater than
|
||||
the <A HREF="#BrowseInterval"><CODE>BrowseInterval</CODE></A> value.
|
||||
the<A HREF="#BrowseInterval"> <CODE>BrowseInterval</CODE></A> value.
|
||||
Otherwise printers and classes will disappear from client systems
|
||||
between updates.
|
||||
<!-- NEED 4in -->
|
||||
@@ -2028,8 +2021,8 @@ mm</TH><TH WIDTH="20%">netmask</TH></TR>
|
||||
<P>The <CODE>@LOCAL</CODE> name will deny access from all local network
|
||||
interfaces, but not remote point-to-point interfaces. The <CODE>
|
||||
@IF(name)</CODE> name will deny access from the named interface.</P>
|
||||
<P>The <CODE>Deny</CODE> directive must appear inside a <A HREF="#Location">
|
||||
<CODE>Location</CODE></A> directive.
|
||||
<P>The <CODE>Deny</CODE> directive must appear inside a<A HREF="#Location">
|
||||
<CODE>Location</CODE></A> directive.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
<H3><A NAME="DocumentRoot">DocumentRoot</A></H3>
|
||||
@@ -2044,8 +2037,8 @@ DocumentRoot /foo/bar/doc/cups
|
||||
<H4>Description</H4>
|
||||
<P>The <CODE>DocumentRoot</CODE> directive specifies the location of web
|
||||
content for the HTTP server in CUPS. If an absolute path is not
|
||||
specified then it is assumed to be relative to the <A HREF="#ServerRoot">
|
||||
<CODE>ServerRoot</CODE></A> directory. The default directory is<VAR>
|
||||
specified then it is assumed to be relative to the<A HREF="#ServerRoot">
|
||||
<CODE>ServerRoot</CODE></A> directory. The default directory is<VAR>
|
||||
/usr/share/doc/cups</VAR>.</P>
|
||||
<P>Documents are first looked up in a sub-directory for the primary
|
||||
language requested by the client (e.g.<VAR> /usr/share/doc/cups/fr/...</VAR>
|
||||
@@ -2065,8 +2058,8 @@ Encryption Required
|
||||
</PRE>
|
||||
</UL>
|
||||
<H4>Description</H4>
|
||||
<P>The <CODE>Encryption</CODE> directive must appear instead a <A HREF="#Location">
|
||||
<CODE>Location</CODE></A> section and specifies the encryption settings
|
||||
<P>The <CODE>Encryption</CODE> directive must appear instead a<A HREF="#Location">
|
||||
<CODE>Location</CODE></A> section and specifies the encryption settings
|
||||
for that location. The default setting is <CODE>IfRequested</CODE> for
|
||||
all locations.
|
||||
<!-- NEED 3in -->
|
||||
@@ -2084,7 +2077,7 @@ ErrorLog syslog
|
||||
<H4>Description</H4>
|
||||
<P>The <CODE>ErrorLog</CODE> directive sets the name of the error log
|
||||
file. If the filename is not absolute then it is assumed to be relative
|
||||
to the <A HREF="#ServerRoot"><CODE>ServerRoot</CODE></A> directory. The
|
||||
to the<A HREF="#ServerRoot"> <CODE>ServerRoot</CODE></A> directory. The
|
||||
default error log file is<VAR> /var/log/cups/error_log</VAR>.</P>
|
||||
<P>The server name can be included in the filename by using <CODE>%s</CODE>
|
||||
in the name.</P>
|
||||
@@ -2294,7 +2287,7 @@ ImplicitClasses Off
|
||||
<P>The <CODE>ImplicitClasses</CODE> directive controls whether implicit
|
||||
classes are created based upon the available network printers and
|
||||
classes. The default setting is <CODE>On</CODE> but is automatically
|
||||
turned <CODE>Off</CODE> if <A HREF="#Browsing"><CODE>Browsing</CODE></A>
|
||||
turned <CODE>Off</CODE> if<A HREF="#Browsing"> <CODE>Browsing</CODE></A>
|
||||
is turned <CODE>Off</CODE>.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
@@ -2310,7 +2303,7 @@ Include /foo/bar/filename
|
||||
<H4>Description</H4>
|
||||
<P>The <CODE>Include</CODE> directive includes the named file in the <CODE>
|
||||
cupsd.conf</CODE> file. If no leading path is provided, the file is
|
||||
assumed to be relative to the <A HREF="#ServerRoot"><CODE>ServerRoot</CODE>
|
||||
assumed to be relative to the<A HREF="#ServerRoot"> <CODE>ServerRoot</CODE>
|
||||
</A> directory.</P>
|
||||
|
||||
<!-- NEED 3in -->
|
||||
@@ -2363,8 +2356,8 @@ KeepAliveTimeout 30
|
||||
</UL>
|
||||
<H4>Description</H4>
|
||||
<P>The <CODE>Limit</CODE> directive groups access control directives for
|
||||
specific types of HTTP requests and must appear inside a <A HREF="#Location">
|
||||
<CODE>Location</CODE></A> section. Access can be limited for individual
|
||||
specific types of HTTP requests and must appear inside a<A HREF="#Location">
|
||||
<CODE>Location</CODE></A> section. Access can be limited for individual
|
||||
request types (<CODE>DELETE</CODE>, <CODE>GET</CODE>, <CODE>HEAD</CODE>
|
||||
, <CODE>OPTIONS</CODE>, <CODE>POST</CODE>, <CODE>PUT</CODE>, and <CODE>
|
||||
TRACE</CODE>) or for all request types (<CODE>ALL</CODE>). The request
|
||||
@@ -2383,9 +2376,9 @@ TRACE</CODE>) or for all request types (<CODE>ALL</CODE>). The request
|
||||
</UL>
|
||||
<H4>Description</H4>
|
||||
<P>The <CODE>LimitExcept</CODE> directive groups access control
|
||||
directives for specific types of HTTP requests and must appear inside a
|
||||
<A HREF="#Location"><CODE>Location</CODE></A> section. Unlike the <A HREF="#Limit">
|
||||
<CODE>Limit</CODE></A> directive, <CODE>LimitExcept</CODE> restricts
|
||||
directives for specific types of HTTP requests and must appear inside a<A
|
||||
HREF="#Location"> <CODE>Location</CODE></A> section. Unlike the<A HREF="#Limit">
|
||||
<CODE>Limit</CODE></A> directive, <CODE>LimitExcept</CODE> restricts
|
||||
access for all requests<I> except</I> those listed on the <CODE>
|
||||
LimitExcept</CODE> line.
|
||||
<!-- NEED 3in -->
|
||||
@@ -2404,7 +2397,7 @@ LimitRequestBody 0
|
||||
<P>The <CODE>LimitRequestBody</CODE> directive controls the maximum size
|
||||
of print files, IPP requests, and HTML form data in HTTP POST requests.
|
||||
The default limit is 0 which disables the limit check.</P>
|
||||
<P>Also see the identical <A HREF="#MaxRequestSize"><CODE>MaxRequestSize</CODE>
|
||||
<P>Also see the identical<A HREF="#MaxRequestSize"> <CODE>MaxRequestSize</CODE>
|
||||
</A> directive.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
@@ -2421,7 +2414,7 @@ Listen 192.0.2.1:631
|
||||
<P>The <CODE>Listen</CODE> directive specifies a network address and
|
||||
port to listen for connections. Multiple <CODE>Listen</CODE> directives
|
||||
can be provided to listen on multiple addresses.</P>
|
||||
<P>The <CODE>Listen</CODE> directive is similar to the <A HREF="#Port"><CODE>
|
||||
<P>The <CODE>Listen</CODE> directive is similar to the<A HREF="#Port"> <CODE>
|
||||
Port</CODE></A> directive but allows you to restrict access to specific
|
||||
interfaces or networks.
|
||||
<!-- NEED 3in -->
|
||||
@@ -2458,13 +2451,13 @@ Port</CODE></A> directive but allows you to restrict access to specific
|
||||
</UL>
|
||||
<H4>Description</H4>
|
||||
<P>The <CODE>Location</CODE> directive specifies access control and
|
||||
authentication options for the specified HTTP resource or path. The <A HREF="#Allow">
|
||||
<CODE>Allow</CODE></A>, <A HREF="#AuthClass"><CODE>AuthClass</CODE></A>,
|
||||
<A HREF="#AuthGroupName"><CODE>AuthGroupName</CODE></A>, <A HREF="#AuthType">
|
||||
<CODE>AuthType</CODE></A>, <A HREF="#Deny"><CODE>Deny</CODE></A>, <A HREF="#Encryption">
|
||||
<CODE>Encryption</CODE></A>, <A HREF="#Limit"><CODE>Limit</CODE></A>, <A HREF="#LimitExcept">
|
||||
<CODE>LimitExcept</CODE></A>, <A HREF="#Order"><CODE>Order</CODE></A>, <A
|
||||
HREF="#Require"><CODE>Require</CODE></A>, and <A HREF="#Satisfy"><CODE>
|
||||
authentication options for the specified HTTP resource or path. The<A HREF="#Allow">
|
||||
<CODE>Allow</CODE></A>,<A HREF="#AuthClass"> <CODE>AuthClass</CODE></A>
|
||||
,<A HREF="#AuthGroupName"> <CODE>AuthGroupName</CODE></A>,<A HREF="#AuthType">
|
||||
<CODE>AuthType</CODE></A>,<A HREF="#Deny"> <CODE>Deny</CODE></A>,<A HREF="#Encryption">
|
||||
<CODE>Encryption</CODE></A>,<A HREF="#Limit"> <CODE>Limit</CODE></A>,<A HREF="#LimitExcept">
|
||||
<CODE>LimitExcept</CODE></A>,<A HREF="#Order"> <CODE>Order</CODE></A>,<A
|
||||
HREF="#Require"> <CODE>Require</CODE></A>, and<A HREF="#Satisfy"> <CODE>
|
||||
Satisfy</CODE></A> directives may all appear inside a location.
|
||||
<CENTER>
|
||||
<TABLE BORDER="1"><CAPTION>Locations on the Server.</CAPTION>
|
||||
@@ -2493,8 +2486,8 @@ name</CODE></TD></TR>
|
||||
the directives inside the <CODE>/printers/name</CODE> location will
|
||||
override ones from <CODE>/printers</CODE>. Directives inside <CODE>
|
||||
/printers</CODE> will override ones from <CODE>/</CODE>. None of the
|
||||
directives are inherited. More information can be found in section <A HREF="#PRINTING_SECURITY">
|
||||
"Printing System Security"</A>.
|
||||
directives are inherited. More information can be found in section<A HREF="#PRINTING_SECURITY">
|
||||
"Printing System Security"</A>.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
<H3><A NAME="LogFilePerm">LogFilePerm</A></H3>
|
||||
@@ -2530,7 +2523,7 @@ LogLevel debug2
|
||||
</UL>
|
||||
<H4>Description</H4>
|
||||
<P>The <CODE>LogLevel</CODE> directive specifies the level of logging
|
||||
for the <A HREF="#ErrorLog"><CODE>ErrorLog</CODE></A> file. The
|
||||
for the<A HREF="#ErrorLog"> <CODE>ErrorLog</CODE></A> file. The
|
||||
following values are recognized (each level logs everything under the
|
||||
preceding levels):</P>
|
||||
<UL>
|
||||
@@ -2705,7 +2698,7 @@ MaxRequestSize 0
|
||||
<P>The <CODE>MaxRequestSize</CODE> directive controls the maximum size
|
||||
of print files, IPP requests, and HTML form data in HTTP POST requests.
|
||||
The default limit is 0 which disables the limit check.</P>
|
||||
<P>Also see the identical <A HREF="#LimitRequestBody"><CODE>
|
||||
<P>Also see the identical<A HREF="#LimitRequestBody"> <CODE>
|
||||
LimitRequestBody</CODE></A> directive.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
@@ -2727,8 +2720,8 @@ Order Deny,Allow
|
||||
<LI><CODE>Deny,Allow</CODE> - Allow requests only from those listed in
|
||||
an <CODE>Allow</CODE> directive.</LI>
|
||||
</UL>
|
||||
<P>The <CODE>Order</CODE> directive must appear inside a <A HREF="#Location">
|
||||
<CODE>Location</CODE></A> directive.
|
||||
<P>The <CODE>Order</CODE> directive must appear inside a<A HREF="#Location">
|
||||
<CODE>Location</CODE></A> directive.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
<H3><A NAME="PageLog">PageLog</A></H3>
|
||||
@@ -2744,7 +2737,7 @@ PageLog syslog
|
||||
<H4>Description</H4>
|
||||
<P>The <CODE>PageLog</CODE> directive sets the name of the page log
|
||||
file. If the filename is not absolute then it is assumed to be relative
|
||||
to the <A HREF="#ServerRoot"><CODE>ServerRoot</CODE></A> directory. The
|
||||
to the<A HREF="#ServerRoot"> <CODE>ServerRoot</CODE></A> directory. The
|
||||
default page log file is<VAR> /var/log/cups/page_log</VAR>.</P>
|
||||
<P>The server name can be included in the filename by using <CODE>%s</CODE>
|
||||
in the name.</P>
|
||||
@@ -2891,8 +2884,8 @@ RequestRoot /foo/bar/spool/cups
|
||||
<H4>Description</H4>
|
||||
<P>The <CODE>RequestRoot</CODE> directive sets the directory for
|
||||
incoming IPP requests and HTML forms. If an absolute path is not
|
||||
provided then it is assumed to be relative to the <A HREF="#ServerRoot">
|
||||
<CODE>ServerRoot</CODE></A> directory. The default request directory is<VAR>
|
||||
provided then it is assumed to be relative to the<A HREF="#ServerRoot">
|
||||
<CODE>ServerRoot</CODE></A> directory. The default request directory is<VAR>
|
||||
/var/spool/cups</VAR>.
|
||||
<!-- NEED 4in -->
|
||||
</P>
|
||||
@@ -2916,7 +2909,7 @@ Require valid-user
|
||||
<P>The <CODE>valid-user</CODE> keyword specifies that any authenticated
|
||||
user may access the resource.</P>
|
||||
<P>The default is to do no authentication. This directive must appear
|
||||
inside a <A HREF="#Location"><CODE>Location</CODE></A> directive.
|
||||
inside a<A HREF="#Location"> <CODE>Location</CODE></A> directive.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
<H3><A NAME="RIPCache">RIPCache</A></H3>
|
||||
@@ -2994,8 +2987,8 @@ Satisfy any
|
||||
gain access if the authentication or access control requirements are
|
||||
satisfied. For example, you might require authentication for remote
|
||||
access, but allow local access without authentication.</P>
|
||||
<P>The default is <CODE>all</CODE>. This directive must appear inside a <A
|
||||
HREF="#Location"><CODE>Location</CODE></A> directive.
|
||||
<P>The default is <CODE>all</CODE>. This directive must appear inside a<A
|
||||
HREF="#Location"> <CODE>Location</CODE></A> directive.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
<H3><A NAME="ServerAdmin">ServerAdmin</A></H3>
|
||||
@@ -3026,7 +3019,7 @@ ServerBin /foo/bar/lib/cups
|
||||
<H4>Description</H4>
|
||||
<P>The <CODE>ServerBin</CODE> directive sets the directory for
|
||||
server-run executables. If an absolute path is not provided then it is
|
||||
assumed to be relative to the <A HREF="#ServerRoot"><CODE>ServerRoot</CODE>
|
||||
assumed to be relative to the<A HREF="#ServerRoot"> <CODE>ServerRoot</CODE>
|
||||
</A> directory. The default executable directory is<VAR> /usr/lib/cups</VAR>
|
||||
.
|
||||
<!-- NEED 3in -->
|
||||
@@ -3106,8 +3099,8 @@ SSLListen 192.0.2.1:443
|
||||
<P>The <CODE>SSLListen</CODE> directive specifies a network address and
|
||||
port to listen for secure connections. Multiple <CODE>SSLListen</CODE>
|
||||
directives can be provided to listen on multiple addresses.</P>
|
||||
<P>The <CODE>SSLListen</CODE> directive is similar to the <A HREF="#SSLPort">
|
||||
<CODE>SSLPort</CODE></A> directive but allows you to restrict access to
|
||||
<P>The <CODE>SSLListen</CODE> directive is similar to the<A HREF="#SSLPort">
|
||||
<CODE>SSLPort</CODE></A> directive but allows you to restrict access to
|
||||
specific interfaces or networks.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
@@ -3138,8 +3131,8 @@ SystemGroup root
|
||||
<H4>Description</H4>
|
||||
<P>The <CODE>SystemGroup</CODE> directive specifies the system
|
||||
administration group for <CODE>System</CODE> authentication. More
|
||||
information can be found later in this chapter in <A HREF="#PRINTING_SECURITY">
|
||||
"Printing System Security"</A>.
|
||||
information can be found later in this chapter in<A HREF="#PRINTING_SECURITY">
|
||||
"Printing System Security"</A>.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
<H3><A NAME="TempDir">TempDir</A></H3>
|
||||
@@ -3303,8 +3296,8 @@ Accepting no
|
||||
<P>The <CODE>Accepting</CODE> directive defines the initial Boolean
|
||||
value for the<VAR> printer-is-accepting-job</VAR> attribute which can
|
||||
be set by the <CODE>accept</CODE> and <CODE>reject</CODE> commands.</P>
|
||||
<P>This directive must appear inside a <A HREF="#Printer"><CODE>Printer</CODE>
|
||||
</A> or <A HREF="#DefaultPrinter"><CODE>DefaultPrinter</CODE></A>
|
||||
<P>This directive must appear inside a<A HREF="#Printer"> <CODE>Printer</CODE>
|
||||
</A> or<A HREF="#DefaultPrinter"> <CODE>DefaultPrinter</CODE></A>
|
||||
directive.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
@@ -3321,8 +3314,8 @@ AllowUser bar_user
|
||||
<P>The <CODE>AllowUser</CODE> directive adds a username to the<VAR>
|
||||
requesting-user-name-allowed</VAR> attribute which can be set by the <CODE>
|
||||
lpadmin -u</CODE> command.</P>
|
||||
<P>This directive must appear inside a <A HREF="#Printer"><CODE>Printer</CODE>
|
||||
</A> or <A HREF="#DefaultPrinter"><CODE>DefaultPrinter</CODE></A>
|
||||
<P>This directive must appear inside a<A HREF="#Printer"> <CODE>Printer</CODE>
|
||||
</A> or<A HREF="#DefaultPrinter"> <CODE>DefaultPrinter</CODE></A>
|
||||
directive.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
@@ -3356,8 +3349,8 @@ DenyUser bar_user
|
||||
<P>The <CODE>DenyUser</CODE> directive adds a username to the<VAR>
|
||||
requesting-user-name-allowed</VAR> attribute which can be set by the <CODE>
|
||||
lpadmin -u</CODE> command.</P>
|
||||
<P>This directive must appear inside a <A HREF="#Printer"><CODE>Printer</CODE>
|
||||
</A> or <A HREF="#DefaultPrinter"><CODE>DefaultPrinter</CODE></A>
|
||||
<P>This directive must appear inside a<A HREF="#Printer"> <CODE>Printer</CODE>
|
||||
</A> or<A HREF="#DefaultPrinter"> <CODE>DefaultPrinter</CODE></A>
|
||||
directive.</P>
|
||||
|
||||
<!-- NEED 3in -->
|
||||
@@ -3373,8 +3366,8 @@ DeviceURI socket://foo.bar.com:9100
|
||||
<P>The <CODE>DeviceURI</CODE> directive defines the value of the<VAR>
|
||||
device-uri-attribute</VAR> attribute which can be set by the <CODE>
|
||||
lpadmin -v</CODE> command.</P>
|
||||
<P>This directive must appear inside a <A HREF="#Printer"><CODE>Printer</CODE>
|
||||
</A> or <A HREF="#DefaultPrinter"><CODE>DefaultPrinter</CODE></A>
|
||||
<P>This directive must appear inside a<A HREF="#Printer"> <CODE>Printer</CODE>
|
||||
</A> or<A HREF="#DefaultPrinter"> <CODE>DefaultPrinter</CODE></A>
|
||||
directive.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
@@ -3390,8 +3383,8 @@ Info My Printer
|
||||
<P>The <CODE>Info</CODE> directive defines the string for the<VAR>
|
||||
printer-info</VAR> attribute which can be set by the <CODE>lpadmin -D</CODE>
|
||||
command.</P>
|
||||
<P>This directive must appear inside a <A HREF="#Printer"><CODE>Printer</CODE>
|
||||
</A> or <A HREF="#DefaultPrinter"><CODE>DefaultPrinter</CODE></A>
|
||||
<P>This directive must appear inside a<A HREF="#Printer"> <CODE>Printer</CODE>
|
||||
</A> or<A HREF="#DefaultPrinter"> <CODE>DefaultPrinter</CODE></A>
|
||||
directive.</P>
|
||||
|
||||
<!-- NEED 6in -->
|
||||
@@ -3432,8 +3425,8 @@ JobSheets none,standard
|
||||
<LI><CODE>unclassified</CODE> - A banner page with an "unclassified"
|
||||
label at the top and bottom.</LI>
|
||||
</UL>
|
||||
<P>This directive must appear inside a <A HREF="#Printer"><CODE>Printer</CODE>
|
||||
</A> or <A HREF="#DefaultPrinter"><CODE>DefaultPrinter</CODE></A>
|
||||
<P>This directive must appear inside a<A HREF="#Printer"> <CODE>Printer</CODE>
|
||||
</A> or<A HREF="#DefaultPrinter"> <CODE>DefaultPrinter</CODE></A>
|
||||
directive.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
@@ -3449,8 +3442,8 @@ KLimit 1234
|
||||
<P>The <CODE>KLimit</CODE> directive defines the value of the<VAR>
|
||||
job-k-limit</VAR> attribute which can be set by the <CODE>lpadmin -o
|
||||
job-k-limit=</CODE> command.</P>
|
||||
<P>This directive must appear inside a <A HREF="#Printer"><CODE>Printer</CODE>
|
||||
</A> or <A HREF="#DefaultPrinter"><CODE>DefaultPrinter</CODE></A>
|
||||
<P>This directive must appear inside a<A HREF="#Printer"> <CODE>Printer</CODE>
|
||||
</A> or<A HREF="#DefaultPrinter"> <CODE>DefaultPrinter</CODE></A>
|
||||
directive.</P>
|
||||
|
||||
<!-- NEED 6in -->
|
||||
@@ -3474,8 +3467,8 @@ Location Building 3321
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
</CENTER>
|
||||
<P>This directive must appear inside a <A HREF="#Printer"><CODE>Printer</CODE>
|
||||
</A> or <A HREF="#DefaultPrinter"><CODE>DefaultPrinter</CODE></A>
|
||||
<P>This directive must appear inside a<A HREF="#Printer"> <CODE>Printer</CODE>
|
||||
</A> or<A HREF="#DefaultPrinter"> <CODE>DefaultPrinter</CODE></A>
|
||||
directive.</P>
|
||||
|
||||
<!-- NEED 3in -->
|
||||
@@ -3491,8 +3484,8 @@ PageLimit 1234
|
||||
<P>The <CODE>PageLimit</CODE> directive defines the value of the<VAR>
|
||||
job-page-limit</VAR> attribute which can be set by the <CODE>lpadmin -o
|
||||
job-page-limit=</CODE> command.</P>
|
||||
<P>This directive must appear inside a <A HREF="#Printer"><CODE>Printer</CODE>
|
||||
</A> or <A HREF="#DefaultPrinter"><CODE>DefaultPrinter</CODE></A>
|
||||
<P>This directive must appear inside a<A HREF="#Printer"> <CODE>Printer</CODE>
|
||||
</A> or<A HREF="#DefaultPrinter"> <CODE>DefaultPrinter</CODE></A>
|
||||
directive.</P>
|
||||
|
||||
<!-- NEED 3in -->
|
||||
@@ -3523,8 +3516,8 @@ QuotaPeriod 604800
|
||||
<P>The <CODE>QuotaPeriod</CODE> directive defines the value of the<VAR>
|
||||
job-quota-period</VAR> attribute which can be set by the <CODE>lpadmin
|
||||
-o job-quota-period=</CODE> command.</P>
|
||||
<P>This directive must appear inside a <A HREF="#Printer"><CODE>Printer</CODE>
|
||||
</A> or <A HREF="#DefaultPrinter"><CODE>DefaultPrinter</CODE></A>
|
||||
<P>This directive must appear inside a<A HREF="#Printer"> <CODE>Printer</CODE>
|
||||
</A> or<A HREF="#DefaultPrinter"> <CODE>DefaultPrinter</CODE></A>
|
||||
directive.</P>
|
||||
|
||||
<!-- NEED 3in -->
|
||||
@@ -3540,8 +3533,8 @@ State stopped
|
||||
<P>The <CODE>State</CODE> directive defines the initial value of the<VAR>
|
||||
printer-state</VAR> attribute. The strings<VAR> idle</VAR> and<VAR>
|
||||
stopped</VAR> correspond to the IPP enumeration values.</P>
|
||||
<P>This directive must appear inside a <A HREF="#Printer"><CODE>Printer</CODE>
|
||||
</A> or <A HREF="#DefaultPrinter"><CODE>DefaultPrinter</CODE></A>
|
||||
<P>This directive must appear inside a<A HREF="#Printer"> <CODE>Printer</CODE>
|
||||
</A> or<A HREF="#DefaultPrinter"> <CODE>DefaultPrinter</CODE></A>
|
||||
directive.</P>
|
||||
|
||||
<!-- NEED 6in -->
|
||||
@@ -3569,8 +3562,8 @@ StateMessage Ready to print.
|
||||
<LI>Ready to print.</LI>
|
||||
<LI>Waiting for job to complete</LI>
|
||||
</UL>
|
||||
<P>This directive must appear inside a <A HREF="#Printer"><CODE>Printer</CODE>
|
||||
</A> or <A HREF="#DefaultPrinter"><CODE>DefaultPrinter</CODE></A>
|
||||
<P>This directive must appear inside a<A HREF="#Printer"> <CODE>Printer</CODE>
|
||||
</A> or<A HREF="#DefaultPrinter"> <CODE>DefaultPrinter</CODE></A>
|
||||
directive.</P>
|
||||
|
||||
<!-- NEW PAGE -->
|
||||
@@ -3626,8 +3619,8 @@ Accepting no
|
||||
<P>The <CODE>Accepting</CODE> directive defines the initial Boolean
|
||||
value for the<VAR> printer-is-accepting-job</VAR> attribute which can
|
||||
be set by the <CODE>accept</CODE> and <CODE>reject</CODE> commands.</P>
|
||||
<P>This directive must appear inside a <A HREF="#Class"><CODE>Class</CODE>
|
||||
</A> or <A HREF="#DefaultClass"><CODE>DefaultClass</CODE></A> directive.
|
||||
<P>This directive must appear inside a<A HREF="#Class"> <CODE>Class</CODE>
|
||||
</A> or<A HREF="#DefaultClass"> <CODE>DefaultClass</CODE></A> directive.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
<H3><A NAME="ClassAllowUser">AllowUser</A></H3>
|
||||
@@ -3643,8 +3636,8 @@ AllowUser bar_user
|
||||
<P>The <CODE>AllowUser</CODE> directive adds a username to the<VAR>
|
||||
requesting-user-name-allowed</VAR> attribute which can be set by the <CODE>
|
||||
lpadmin -u</CODE> command.</P>
|
||||
<P>This directive must appear inside a <A HREF="#Class"><CODE>Class</CODE>
|
||||
</A> or <A HREF="#DefaultClass"><CODE>DefaultClass</CODE></A> directive.
|
||||
<P>This directive must appear inside a<A HREF="#Class"> <CODE>Class</CODE>
|
||||
</A> or<A HREF="#DefaultClass"> <CODE>DefaultClass</CODE></A> directive.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
<H3><A NAME="Class">Class</A></H3>
|
||||
@@ -3692,8 +3685,8 @@ DenyUser bar_user
|
||||
<P>The <CODE>DenyUser</CODE> directive adds a username to the<VAR>
|
||||
requesting-user-name-allowed</VAR> attribute which can be set by the <CODE>
|
||||
lpadmin -u</CODE> command.</P>
|
||||
<P>This directive must appear inside a <A HREF="#Class"><CODE>Class</CODE>
|
||||
</A> or <A HREF="#DefaultClass"><CODE>DefaultClass</CODE></A> directive.
|
||||
<P>This directive must appear inside a<A HREF="#Class"> <CODE>Class</CODE>
|
||||
</A> or<A HREF="#DefaultClass"> <CODE>DefaultClass</CODE></A> directive.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
<H3><A NAME="ClassInfo">Info</A></H3>
|
||||
@@ -3708,8 +3701,8 @@ Info My Printer
|
||||
<P>The <CODE>Info</CODE> directive defines the string for the<VAR>
|
||||
printer-info</VAR> attribute which can be set by the <CODE>lpadmin -D</CODE>
|
||||
command.</P>
|
||||
<P>This directive must appear inside a <A HREF="#Class"><CODE>Class</CODE>
|
||||
</A> or <A HREF="#DefaultClass"><CODE>DefaultClass</CODE></A> directive.
|
||||
<P>This directive must appear inside a<A HREF="#Class"> <CODE>Class</CODE>
|
||||
</A> or<A HREF="#DefaultClass"> <CODE>DefaultClass</CODE></A> directive.
|
||||
<!-- NEED 6in -->
|
||||
</P>
|
||||
<H3><A NAME="ClassJobSheets">JobSheets</A></H3>
|
||||
@@ -3749,8 +3742,8 @@ JobSheets none,standard
|
||||
<LI><CODE>unclassified</CODE> - A banner page with an "unclassified"
|
||||
label at the top and bottom.</LI>
|
||||
</UL>
|
||||
<P>This directive must appear inside a <A HREF="#Class"><CODE>Class</CODE>
|
||||
</A> or <A HREF="#DefaultClass"><CODE>DefaultClass</CODE></A> directive.
|
||||
<P>This directive must appear inside a<A HREF="#Class"> <CODE>Class</CODE>
|
||||
</A> or<A HREF="#DefaultClass"> <CODE>DefaultClass</CODE></A> directive.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
<H3><A NAME="ClassKLimit">KLimit</A></H3>
|
||||
@@ -3765,8 +3758,8 @@ KLimit 1234
|
||||
<P>The <CODE>KLimit</CODE> directive defines the value of the<VAR>
|
||||
job-k-limit</VAR> attribute which can be set by the <CODE>lpadmin -o
|
||||
job-k-limit=</CODE> command.</P>
|
||||
<P>This directive must appear inside a <A HREF="#Class"><CODE>Class</CODE>
|
||||
</A> or <A HREF="#DefaultClass"><CODE>DefaultClass</CODE></A> directive.
|
||||
<P>This directive must appear inside a<A HREF="#Class"> <CODE>Class</CODE>
|
||||
</A> or<A HREF="#DefaultClass"> <CODE>DefaultClass</CODE></A> directive.
|
||||
<!-- NEED 6in -->
|
||||
</P>
|
||||
<H3><A NAME="ClassLocation">Location</A></H3>
|
||||
@@ -3789,8 +3782,8 @@ Location Building 3321
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
</CENTER>
|
||||
<P>This directive must appear inside a <A HREF="#Class"><CODE>Class</CODE>
|
||||
</A> or <A HREF="#DefaultClass"><CODE>DefaultClass</CODE></A> directive.
|
||||
<P>This directive must appear inside a<A HREF="#Class"> <CODE>Class</CODE>
|
||||
</A> or<A HREF="#DefaultClass"> <CODE>DefaultClass</CODE></A> directive.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
<H3><A NAME="ClassPageLimit">PageLimit</A></H3>
|
||||
@@ -3805,8 +3798,8 @@ PageLimit 1234
|
||||
<P>The <CODE>PageLimit</CODE> directive defines the value of the<VAR>
|
||||
job-page-limit</VAR> attribute which can be set by the <CODE>lpadmin -o
|
||||
job-page-limit=</CODE> command.</P>
|
||||
<P>This directive must appear inside a <A HREF="#Class"><CODE>Class</CODE>
|
||||
</A> or <A HREF="#DefaultClass"><CODE>DefaultClass</CODE></A> directive.
|
||||
<P>This directive must appear inside a<A HREF="#Class"> <CODE>Class</CODE>
|
||||
</A> or<A HREF="#DefaultClass"> <CODE>DefaultClass</CODE></A> directive.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
<H3><A NAME="ClassPrinter">Printer</A></H3>
|
||||
@@ -3830,8 +3823,8 @@ Printer foo@bar
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
</CENTER>
|
||||
<P>This directive must appear inside a <A HREF="#Class"><CODE>Class</CODE>
|
||||
</A> or <A HREF="#DefaultClass"><CODE>DefaultClass</CODE></A> directive.</P>
|
||||
<P>This directive must appear inside a<A HREF="#Class"> <CODE>Class</CODE>
|
||||
</A> or<A HREF="#DefaultClass"> <CODE>DefaultClass</CODE></A> directive.</P>
|
||||
|
||||
<!-- NEED 3in -->
|
||||
<H3><A NAME="ClassQuotaPeriod">QuotaPeriod</A></H3>
|
||||
@@ -3846,8 +3839,8 @@ QuotaPeriod 604800
|
||||
<P>The <CODE>QuotaPeriod</CODE> directive defines the value of the<VAR>
|
||||
job-quota-period</VAR> attribute which can be set by the <CODE>lpadmin
|
||||
-o job-quota-period=</CODE> command.</P>
|
||||
<P>This directive must appear inside a <A HREF="#Class"><CODE>Class</CODE>
|
||||
</A> or <A HREF="#DefaultClass"><CODE>DefaultClass</CODE></A> directive.
|
||||
<P>This directive must appear inside a<A HREF="#Class"> <CODE>Class</CODE>
|
||||
</A> or<A HREF="#DefaultClass"> <CODE>DefaultClass</CODE></A> directive.
|
||||
<!-- NEED 3in -->
|
||||
</P>
|
||||
<H3><A NAME="ClassState">State</A></H3>
|
||||
@@ -3862,8 +3855,8 @@ State stopped
|
||||
<P>The <CODE>State</CODE> directive defines the initial value of the<VAR>
|
||||
printer-state</VAR> attribute. The strings<VAR> idle</VAR> and<VAR>
|
||||
stopped</VAR> correspond to the IPP enumeration values.</P>
|
||||
<P>This directive must appear inside a <A HREF="#Class"><CODE>Class</CODE>
|
||||
</A> or <A HREF="#DefaultClass"><CODE>DefaultClass</CODE></A> directive.
|
||||
<P>This directive must appear inside a<A HREF="#Class"> <CODE>Class</CODE>
|
||||
</A> or<A HREF="#DefaultClass"> <CODE>DefaultClass</CODE></A> directive.
|
||||
<!-- NEED 6in -->
|
||||
</P>
|
||||
<H3><A NAME="ClassStateMessage">StateMessage</A></H3>
|
||||
@@ -3890,8 +3883,8 @@ StateMessage Ready to print.
|
||||
<LI>Ready to print.</LI>
|
||||
<LI>Waiting for job to complete</LI>
|
||||
</UL>
|
||||
<P>This directive must appear inside a <A HREF="#Class"><CODE>Class</CODE>
|
||||
</A> or <A HREF="#DefaultClass"><CODE>DefaultClass</CODE></A> directive.</P>
|
||||
<P>This directive must appear inside a<A HREF="#Class"> <CODE>Class</CODE>
|
||||
</A> or<A HREF="#DefaultClass"> <CODE>DefaultClass</CODE></A> directive.</P>
|
||||
|
||||
<!-- NEW PAGE -->
|
||||
<H2><A NAME="PRINTING_SECURITY">Printing System Security</A></H2>
|
||||
@@ -3904,8 +3897,8 @@ StateMessage Ready to print.
|
||||
authentication, it does allow you to limit the potential users of your
|
||||
system efficiently.</P>
|
||||
<P>CUPS maintains a list of locations that have access control and/or
|
||||
authentication enabled. Locations are specified using the <A HREF="#Location">
|
||||
<CODE>Location</CODE></A> directive:</P>
|
||||
authentication enabled. Locations are specified using the<A HREF="#Location">
|
||||
<CODE>Location</CODE></A> directive:</P>
|
||||
<UL>
|
||||
<PRE>
|
||||
<Location /resource>
|
||||
@@ -3919,8 +3912,8 @@ StateMessage Ready to print.
|
||||
</Location>
|
||||
</PRE>
|
||||
</UL>
|
||||
<P>Locations generally follow the directory structure of the <A HREF="#DocumentRoot">
|
||||
<CODE>DocumentRoot</CODE></A> directory, however CUPS does have several
|
||||
<P>Locations generally follow the directory structure of the<A HREF="#DocumentRoot">
|
||||
<CODE>DocumentRoot</CODE></A> directory, however CUPS does have several
|
||||
virtual locations for administration, classes, jobs, and printers:
|
||||
<CENTER>
|
||||
<TABLE BORDER="1">
|
||||
@@ -3959,13 +3952,13 @@ Authorization: Local 0123456789ABCDEF0123456789ABCDEF
|
||||
<P>Certificates are generated by the server automatically and stored in
|
||||
the<VAR> /etc/cups/certs</VAR> directory using the process ID of the
|
||||
CGI program started by the server. Certificate files are only readable
|
||||
by the <A HREF="#User"><CODE>User</CODE></A> and <A HREF="#Group"><CODE>
|
||||
by the<A HREF="#User"> <CODE>User</CODE></A> and<A HREF="#Group"> <CODE>
|
||||
Group</CODE></A> defined in the<VAR> cupsd.conf</VAR> file. When the CGI
|
||||
program ends the certificate is removed and invalidated automatically.</P>
|
||||
<P>The special file<VAR> /etc/cups/certs/0</VAR> defines the<I> root
|
||||
certificate</I> which can be used by any client running as the
|
||||
super-user or another user that is part of the group defined by the <A HREF="#SystemGroup">
|
||||
<CODE>SystemGroup</CODE></A> directive. The root certificate is
|
||||
super-user or another user that is part of the group defined by the<A HREF="#SystemGroup">
|
||||
<CODE>SystemGroup</CODE></A> directive. The root certificate is
|
||||
automatically regenerated every 5 minutes.</P>
|
||||
<H3><A NAME="7_11_2">Using Basic Authentication</A></H3>
|
||||
<P>Basic authentication uses UNIX users and passwords to authenticate
|
||||
@@ -4085,7 +4078,7 @@ AuthType Digest
|
||||
</PRE>
|
||||
</UL>
|
||||
<H3><A NAME="7_11_4">System and Group Authentication</A></H3>
|
||||
<P>The <A HREF="#AuthClass"><CODE>AuthClass</CODE></A> directive
|
||||
<P>The<A HREF="#AuthClass"> <CODE>AuthClass</CODE></A> directive
|
||||
controls the level of authentication to perform. <CODE>System</CODE>
|
||||
and <CODE>Group</CODE> authentication extend the normal user-based
|
||||
authentication to require membership in a UNIX group. For <CODE>System</CODE>
|
||||
@@ -4093,7 +4086,7 @@ AuthType Digest
|
||||
system</CODE>, or <CODE>root</CODE> group; the actual group depends on
|
||||
the operating system.</P>
|
||||
<P>For <CODE>Group</CODE> authentication each user must belong to the
|
||||
group named by the <A HREF="#AuthGroupName"><CODE>AuthGroupName</CODE></A>
|
||||
group named by the<A HREF="#AuthGroupName"> <CODE>AuthGroupName</CODE></A>
|
||||
directive:</P>
|
||||
<UL>
|
||||
<PRE>
|
||||
@@ -4136,7 +4129,7 @@ host group user date-time \"method resource version\" status bytes
|
||||
</PRE>
|
||||
</UL>
|
||||
<P>The<I> host</I> field will normally only be an IP address unless you
|
||||
have enabled the <A HREF="#HostNameLookups"><CODE>HostNameLookups</CODE>
|
||||
have enabled the<A HREF="#HostNameLookups"> <CODE>HostNameLookups</CODE>
|
||||
</A> directive in the<VAR> cupsd.conf</VAR> file.</P>
|
||||
<P>The<I> group</I> field always contains "-" in CUPS.</P>
|
||||
<P>The<I> user</I> field is the authenticated username of the requesting
|
||||
@@ -4225,7 +4218,7 @@ job-originating-host-name</CODE> attribute) that originated the print
|
||||
<P>CUPS provides a MIME-based file typing and filtering mechanism to
|
||||
convert files to a printable format for each printer. On startup the
|
||||
CUPS server reads MIME database files from the<VAR> /etc/cups</VAR>
|
||||
directory (or a directory specified by the <A HREF="#ServerRoot"><CODE>
|
||||
directory (or a directory specified by the<A HREF="#ServerRoot"> <CODE>
|
||||
ServerRoot</CODE></A> directive) to build a file type and conversion
|
||||
database in memory. These database files are plain ASCII text and can
|
||||
be edited with your favorite text editor.</P>
|
||||
@@ -4378,7 +4371,7 @@ acme-msword.convs
|
||||
<P>Once you choose the names for these files, create them using your
|
||||
favorite text editor as described earlier in this chapter. Once you
|
||||
have created the files, restart the <CODE>cupsd</CODE> process as
|
||||
described earlier in <A HREF="#RESTARTING">"Restarting the CUPS Server"</A>
|
||||
described earlier in<A HREF="#RESTARTING"> "Restarting the CUPS Server"</A>
|
||||
.</P>
|
||||
<H3><A NAME="7_13_4">Printer Drivers and PPD Files</A></H3>
|
||||
<P>Most CUPS printer drivers utilize one or more printer-specific
|
||||
@@ -4468,14 +4461,14 @@ server = /usr/lib/cups/daemon/cups-lpd
|
||||
</TABLE>
|
||||
</CENTER>
|
||||
</P>
|
||||
<H2><A NAME="LPD">Printing to LPD Servers</A></H2>
|
||||
<H2><A NAME="8_3">Printing to LPD Servers</A></H2>
|
||||
<P>CUPS provides the <CODE>lpd</CODE> backend for printing to LPD-based
|
||||
servers and printers. Use a device URI of <CODE>lpd://server/name</CODE>
|
||||
to print to a printer on an LPD server, where <CODE>server</CODE> is
|
||||
the hostname or IP address of the server and <CODE>name</CODE> is the
|
||||
queue name. Additional options can be specified after the remote queue
|
||||
name to control how the LPD requests are sent - consult <A HREF="#COMMON_NETWORK">
|
||||
Appendix B - Common Network Settings</A> for a complete description.</P>
|
||||
name to control how the LPD requests are sent - consult<A HREF="#COMMON_NETWORK">
|
||||
Appendix B - Common Network Settings</A> for a complete description.</P>
|
||||
<P>Microsoft Windows NT provides an LPD service under the name "TCP/IP
|
||||
Printing Services". To enable LPD printing on NT, open the "Services"
|
||||
control panel, select the "TCP/IP Printing Services" service, and click
|
||||
@@ -4743,7 +4736,7 @@ smbpasswd(1)</CODE> command. Otherwise you will not be able to
|
||||
<P>CUPS can print to Windows servers in one of two ways. The first way
|
||||
uses the LPD protocol on the CUPS system and the "TCP/IP Printing
|
||||
Services" on the Windows system. You can find out more about this
|
||||
configuration in the <A HREF="#LPD">LPD</A> section earlier in this
|
||||
configuration in the<A HREF="#LPD"> LPD</A> section earlier in this
|
||||
chapter.</P>
|
||||
<P>The second way is through the Microsoft Server Message Block ("SMB")
|
||||
protocol. Support for this protocol is provided with the free SAMBA
|
||||
@@ -4782,8 +4775,8 @@ smb://user:pass@server/sharename
|
||||
<BR> HOLLYWOOD, MARYLAND 20636-3111 USA
|
||||
<BR>
|
||||
<BR> Voice: +1.301.373.9600
|
||||
<BR> Email: <A HREF="mailto:cups-info@cups.org">cups-info@cups.org</A>
|
||||
<BR> WWW: <A HREF="http://www.cups.org">http://www.cups.org</A></P>
|
||||
<BR> Email:<A HREF="mailto:cups-info@cups.org"> cups-info@cups.org</A>
|
||||
<BR> WWW:<A HREF="http://www.cups.org"> http://www.cups.org</A></P>
|
||||
<H3><A NAME="9_1_1">Introduction</A></H3>
|
||||
<P>The Common UNIX Printing System<SUP>TM</SUP>, ("CUPS<SUP>TM</SUP>"),
|
||||
is provided under the GNU General Public License ("GPL") and GNU
|
||||
@@ -4873,9 +4866,9 @@ smb://user:pass@server/sharename
|
||||
<P>The Common UNIX Printing System provides a "pdftops" filter that is
|
||||
based on the Xpdf software. For binary distribution licensing of this
|
||||
software, please contact:<BLOCKQUOTE> Derek B. Noonburg
|
||||
<BR> Email: <A HREF="mailto:derekn@foolabs.com">derekn@foolabs.com</A>
|
||||
<BR> WWW: <A HREF="http://www.foolabs.com/xpdf/">
|
||||
http://www.foolabs.com/xpdf/</A></BLOCKQUOTE></P>
|
||||
<BR> Email:<A HREF="mailto:derekn@foolabs.com"> derekn@foolabs.com</A>
|
||||
<BR> WWW:<A HREF="http://www.foolabs.com/xpdf/">
|
||||
http://www.foolabs.com/xpdf/</A></BLOCKQUOTE></P>
|
||||
<H3><A NAME="9_1_5">Support</A></H3>
|
||||
<P>Easy Software Products sells software support for CUPS as well as a
|
||||
commercial printing product based on CUPS called ESP Print Pro. You can
|
||||
@@ -4896,7 +4889,7 @@ Copyright 1989, 1991 Free Software Foundation, Inc.
|
||||
Everyone is permitted to copy and distribute verbatim
|
||||
copies of this license document, but changing it is not allowed.
|
||||
</PRE>
|
||||
<H3><A NAME="9_2_1">Preamble</A></H3>
|
||||
<H4>Preamble</H4>
|
||||
<P>The licenses for most software are designed to take away your freedom
|
||||
to share and change it. By contrast, the GNU General Public License is
|
||||
intended to guarantee your freedom to share and change free
|
||||
@@ -5154,7 +5147,7 @@ of this license document, but changing it is not allowed.
|
||||
[This is the first released version of the library GPL. It is
|
||||
numbered 2 because it goes with version 2 of the ordinary GPL.]
|
||||
</PRE>
|
||||
<H3><A NAME="9_3_1">Preamble</A></H3>
|
||||
<H4>Preamble</H4>
|
||||
<P>The licenses for most software are designed to take away your freedom
|
||||
to share and change it. By contrast, the GNU General Public Licenses
|
||||
are intended to guarantee your freedom to share and change free
|
||||
@@ -5671,7 +5664,7 @@ address</I>/PASSTHRU</TD></TR>
|
||||
|
||||
<!-- NEED 1in -->
|
||||
<TR ALIGN="LEFT" VALIGN="TOP"><TD>Axis w/o IPP
|
||||
<BR> <A HREF="#AXIS">(see directions)</A></TD><TD>socket://<I>address</I>
|
||||
<BR><A HREF="#AXIS"> (see directions)</A></TD><TD>socket://<I>address</I>
|
||||
:9100
|
||||
<BR> socket://<I>address</I>:9101
|
||||
<BR> socket://<I>address</I>:9102</TD></TR>
|
||||
@@ -5727,7 +5720,7 @@ lpd://<I>address</I>/ps</TD></TR>
|
||||
|
||||
<!-- NEED 1in -->
|
||||
<TR ALIGN="LEFT" VALIGN="TOP"><TD>Linksys EtherFast®
|
||||
<BR> <A HREF="#LINKSYS">(see directions)</A></TD><TD>socket://<I>address</I>
|
||||
<BR><A HREF="#LINKSYS"> (see directions)</A></TD><TD>socket://<I>address</I>
|
||||
:4010
|
||||
<BR> socket://<I>address</I>:4020
|
||||
<BR> socket://<I>address</I>:4030</TD></TR>
|
||||
@@ -6171,9 +6164,9 @@ ftp> <B>quit ENTER</B>
|
||||
<P>Commercial support for CUPS is available from Easy Software Products.
|
||||
For more information please contact us at:</P>
|
||||
<UL>
|
||||
<LI>WWW: <A HREF="http://www.easysw.com/cups/"> <CODE>
|
||||
<LI>WWW:<A HREF="http://www.easysw.com/cups/"> <CODE>
|
||||
http://www.easysw.com/cups/</CODE></A></LI>
|
||||
<LI>EMail: <A HREF="mailto:info@easysw.com">info@easysw.com</A></LI>
|
||||
<LI>EMail:<A HREF="mailto:info@easysw.com"> info@easysw.com</A></LI>
|
||||
<LI>Telephone (M-F, 9-5 EST): +1.301.373.9600</LI>
|
||||
</UL>
|
||||
<H2><A NAME="13_1">My Applications Don't See the Available Printers</A></H2>
|
||||
@@ -6181,8 +6174,8 @@ http://www.easysw.com/cups/</CODE></A></LI>
|
||||
list of available printers.</P>
|
||||
<P>The default CUPS configuration creates the<VAR> /etc/printcap</VAR>
|
||||
file automatically. To enable or disable automatic creation and
|
||||
updating of this file, use the <A HREF="#Printcap"><CODE>Printcap</CODE>
|
||||
</A> directive described in <A HREF="#PRINTING_MANAGEMENT">Chapter 6,
|
||||
updating of this file, use the<A HREF="#Printcap"> <CODE>Printcap</CODE>
|
||||
</A> directive described in<A HREF="#PRINTING_MANAGEMENT"> Chapter 6,
|
||||
"Printing System Management"</A>.</P>
|
||||
<H2><A NAME="13_2">CUPS Doesn't Recognize My Username or Password!</A></H2>
|
||||
<P>CUPS will ask you for a UNIX username and password when you perform
|
||||
@@ -6204,7 +6197,7 @@ AuthClass System
|
||||
</PRE>
|
||||
</UL>
|
||||
<P>for the<VAR> /admin</VAR> location. Then restart the CUPS server as
|
||||
described in <A HREF="#PRINTING_MANAGEMENT">Chapter 6, "Printing System
|
||||
described in<A HREF="#PRINTING_MANAGEMENT"> Chapter 6, "Printing System
|
||||
Management"</A>.</P>
|
||||
<CENTER>
|
||||
<TABLE BGCOLOR="#cccccc" BORDER="1" CELLPADDING="5" WIDTH="80%">
|
||||
@@ -6228,13 +6221,13 @@ Allow from 127.0.0.1
|
||||
</PRE>
|
||||
</UL>
|
||||
<P>for the<VAR> /admin</VAR> location. Then restart the CUPS server as
|
||||
described in <A HREF="#PRINTING_MANAGEMENT">Chapter 6, "Printing System
|
||||
described in<A HREF="#PRINTING_MANAGEMENT"> Chapter 6, "Printing System
|
||||
Management"</A>.</P>
|
||||
<CENTER>
|
||||
<TABLE BGCOLOR="#cccccc" BORDER="1" CELLPADDING="5" WIDTH="80%">
|
||||
<TR><TD><B> NOTE:</B>
|
||||
<P>Allowing administration access from all hosts is a potential security
|
||||
risk. Please read <A HREF="#PRINTING_SECURITY">Chapter 6, "Printing
|
||||
risk. Please read<A HREF="#PRINTING_SECURITY"> Chapter 6, "Printing
|
||||
System Management"</A> for a description of these risks and ways to
|
||||
minimize them.</P>
|
||||
</TD></TR>
|
||||
@@ -6249,8 +6242,8 @@ Allow from 127.0.0.1
|
||||
<LI>not specifying the correct password for the root account.</LI>
|
||||
<LI>accessing the CUPS server using the hostname or IP address of the
|
||||
server without enabling remote access for administration functions.
|
||||
This can be corrected by following the instructions in the <A HREF="#ALLOW_REMOTE">
|
||||
"I Can't Do Administration Tasks from Another Machine!"</A> section
|
||||
This can be corrected by following the instructions in the<A HREF="#ALLOW_REMOTE">
|
||||
"I Can't Do Administration Tasks from Another Machine!"</A> section
|
||||
earlier in this appendix.</LI>
|
||||
<LI>not setting a password on the root account. CUPS will not
|
||||
authenticate a user account that does not have a password for security
|
||||
|
||||
Arquivo binário não exibido.
+4
-4
@@ -1,7 +1,7 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2003, All Rights Reserved">
|
||||
<META NAME="DOCNUMBER" CONTENT="CUPS-SAM-1.1.20">
|
||||
<META NAME="DOCNUMBER" CONTENT="CUPS-SAM-1.1.19">
|
||||
<META NAME="Author" CONTENT="Easy Software Products">
|
||||
<TITLE>CUPS Software Administrators Manual</TITLE>
|
||||
</HEAD>
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
<P>This software administrators manual provides printer administration
|
||||
information for the Common UNIX Printing System<SUP>TM</SUP>
|
||||
("CUPS<SUP>TM</SUP>"), version 1.1.20.
|
||||
("CUPS<SUP>TM</SUP>"), version 1.1.19.
|
||||
|
||||
<EMBED SRC="system-overview.shtml">
|
||||
|
||||
@@ -450,7 +450,7 @@ You'll find a complete list of PPD files and the printers they will work with
|
||||
in <A HREF="#PRINTER_DRIVERS">Appendix C, "Printer Drivers"</A>.
|
||||
|
||||
|
||||
<P>For a dot matrix printer connected to the serial port, this might look like:
|
||||
<P>For a dot matrix printer connected to the serial port this would might look like:
|
||||
|
||||
<UL><PRE>
|
||||
<B>/usr/sbin/lpadmin -p DotMatrix -E -m epson9.ppd \
|
||||
@@ -4823,7 +4823,7 @@ server.
|
||||
</TR>
|
||||
</TABLE></CENTER>
|
||||
|
||||
<H2><A NAME="LPD">Printing to LPD Servers</A></H2>
|
||||
<H2>Printing to LPD Servers</H2>
|
||||
|
||||
<P>CUPS provides the <CODE>lpd</CODE> backend for printing to
|
||||
LPD-based servers and printers. Use a device URI of
|
||||
|
||||
+1429
-1816
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
Arquivo binário não exibido.
+5
-479
@@ -1,7 +1,7 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2003, All Rights Reserved">
|
||||
<META NAME="DOCNUMBER" CONTENT="CUPS-SPM-1.1.20">
|
||||
<META NAME="DOCNUMBER" CONTENT="CUPS-SPM-1.1.19">
|
||||
<META NAME="Author" CONTENT="Easy Software Products">
|
||||
<TITLE>CUPS Software Programmers Manual</TITLE>
|
||||
</HEAD>
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
<P>This software programmers manual provides software
|
||||
programming information for the Common UNIX Printing System
|
||||
("CUPS") Version 1.1.20.
|
||||
("CUPS") Version 1.1.19.
|
||||
|
||||
<EMBED SRC="system-overview.shtml">
|
||||
|
||||
@@ -2851,26 +2851,8 @@ current state of a IPP request or response:
|
||||
</TR>
|
||||
</TABLE></CENTER>
|
||||
|
||||
<H3><A NAME="ipp_attribute_t">IPP Attribute</A></H3>
|
||||
|
||||
<P>TODO</P>
|
||||
|
||||
<H2>PPD Structures</H2>
|
||||
|
||||
<H3><A NAME="ppd_file_t">PPD File</A></H3>
|
||||
|
||||
<P>TODO</P>
|
||||
|
||||
<H3><A NAME="ppd_choice_t">PPD Choice</A></H3>
|
||||
|
||||
<P>TODO</P>
|
||||
|
||||
<H2>Raster Structures</H2>
|
||||
|
||||
<H3><A NAME="cups_raster_t">Raster Stream</A></H3>
|
||||
|
||||
<P>TODO</P>
|
||||
|
||||
<H3><A NAME="cups_raster_header_t">Raster Page Header</A></H3>
|
||||
|
||||
<P>The raster page header (<CODE>cups_raster_header_t</CODE>)
|
||||
@@ -3280,108 +3262,6 @@ cupsCancelJob("LaserJet", 1);
|
||||
<A HREF="#cupsPrintFiles"><CODE>cupsPrintFiles()</CODE></A>
|
||||
|
||||
|
||||
<!-- NEW PAGE --><H2><A NAME="cupsDoAuthentication">cupsDoAuthentication()</A></H2>
|
||||
|
||||
<H3>Usage</H3>
|
||||
|
||||
<PRE>
|
||||
int
|
||||
cupsDoAuthentication(http_t *http,
|
||||
const char *method,
|
||||
const char *resource);
|
||||
</PRE>
|
||||
|
||||
<H3>Arguments</H3>
|
||||
|
||||
<CENTER><TABLE WIDTH="80%" BORDER>
|
||||
<TR>
|
||||
<TH>Argument</TH>
|
||||
<TH>Description</TH>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>http</TD>
|
||||
<TD>HTTP connection to server.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>method</TD>
|
||||
<TD>HTTP method name ("GET", "POST", "PUT", etc.)</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>resource</TD>
|
||||
<TD>HTTP resource name.</TD>
|
||||
</TR>
|
||||
</TABLE></CENTER>
|
||||
|
||||
<H3>Returns</H3>
|
||||
|
||||
<P>0 if the authentication string was successfully generated, -1 otherwise.
|
||||
|
||||
<H3>Description</H3>
|
||||
|
||||
<P><CODE>cupsDoAuthentication()</CODE> generates an
|
||||
authentication string for the given method and request. It
|
||||
supports Basic, Digest, and CUPS local certificate
|
||||
authentication methods and uses the current user and password
|
||||
callback to collect authentication information as needed.
|
||||
|
||||
<P>Applications using this function should set the
|
||||
<CODE>HTTP_FIELD_AUTHORIZATION</CODE> field to the
|
||||
<CODE>authstring</CODE> value in the <CODE>http_t</CODE>
|
||||
structure prior to issuing a new request.
|
||||
|
||||
<H3>Example</H3>
|
||||
|
||||
<PRE>
|
||||
#include <cups.h>
|
||||
|
||||
http_t *http;
|
||||
char resource[HTTP_MAX_URI];
|
||||
http_status_t status;
|
||||
|
||||
...
|
||||
|
||||
do
|
||||
{
|
||||
httpClearFields(http);
|
||||
httpSetField(http, HTTP_FIELD_AUTHORIZATION, http->authstring);
|
||||
|
||||
if (httpGet(http, resource))
|
||||
{
|
||||
if (httpReconnect(http))
|
||||
{
|
||||
status = HTTP_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
while ((status = httpUpdate(http)) == HTTP_CONTINUE);
|
||||
|
||||
if (status == HTTP_UNAUTHORIZED)
|
||||
{
|
||||
httpFlush(http);
|
||||
|
||||
if (cupsDoAuthentication(http, "GET", resource))
|
||||
break;
|
||||
|
||||
httpReconnect(http);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
while (status == HTTP_UNAUTHORIZED);
|
||||
</PRE>
|
||||
|
||||
<H3>See Also</H3>
|
||||
|
||||
<P>
|
||||
<A HREF="#cupsDoAuthentication"><CODE>cupsDoAuthentication()</CODE></A>,
|
||||
<A HREF="#cupsGetPassword"><CODE>cupsGetPassword()</CODE></A>,
|
||||
<A HREF="#cupsSetPasswordCB"><CODE>cupsSetPasswordCB()</CODE></A>,
|
||||
<A HREF="#cupsSetUser"><CODE>cupsSetUser()</CODE></A>,
|
||||
<A HREF="#cupsUser"><CODE>cupsUser()</CODE></A>
|
||||
|
||||
|
||||
<!-- NEW PAGE --><H2><A NAME="cupsDoFileRequest">cupsDoFileRequest()</A></H2>
|
||||
|
||||
<H3>Usage</H3>
|
||||
@@ -4074,152 +3954,6 @@ cupsFreeDests(num_dests, dests);
|
||||
<A HREF="#cupsGetJobs"><CODE>cupsGetJobs()</CODE></A>
|
||||
|
||||
|
||||
<!-- NEW PAGE --><H2><A NAME="cupsGetFd">cupsGetFd()</A></H2>
|
||||
|
||||
<H3>Usage</H3>
|
||||
|
||||
<PRE>
|
||||
http_status_t
|
||||
cupsGetFd(http_t *http,
|
||||
const char *resource,
|
||||
int fd);
|
||||
</PRE>
|
||||
|
||||
<H3>Arguments</H3>
|
||||
|
||||
<CENTER><TABLE WIDTH="80%" BORDER>
|
||||
<TR>
|
||||
<TH>Argument</TH>
|
||||
<TH>Description</TH>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>http</TD>
|
||||
<TD>The HTTP connection to the server.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>resource</TD>
|
||||
<TD>The resource name on the server.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>fd</TD>
|
||||
<TD>The file descriptor to write to.</TD>
|
||||
</TR>
|
||||
</TABLE></CENTER>
|
||||
|
||||
<H3>Returns</H3>
|
||||
|
||||
<P>The HTTP status code associated with the request.
|
||||
|
||||
<H3>Description</H3>
|
||||
|
||||
<P><CODE>cupsGetFd()</CODE> gets a file from the given HTTP
|
||||
server and writes it to the specified file descriptor,
|
||||
performing any authentication or encryption as required.
|
||||
|
||||
<H3>Example</H3>
|
||||
|
||||
<PRE>
|
||||
#include <cups/cups.h>
|
||||
|
||||
http_t *http;
|
||||
int fd;
|
||||
char filename[1024];
|
||||
http_status_t status;
|
||||
...
|
||||
|
||||
http = httpConnectEncrypt(cupsServer(), ippPort(), cupsEncryption());
|
||||
fd = cupsTempFd(filename, sizeof(filename));
|
||||
status = cupsGetFd(http, "/admin/cupsd.conf", fd);
|
||||
|
||||
...
|
||||
|
||||
close(fd);
|
||||
unlink(filename);
|
||||
|
||||
httpClose(http);
|
||||
</PRE>
|
||||
|
||||
<H3>See Also</H3>
|
||||
|
||||
<P>
|
||||
<A HREF="#cupsGetFile"><CODE>cupsGetFile()</CODE></A>,
|
||||
<A HREF="#cupsPutFd"><CODE>cupsPutFd()</CODE></A>,
|
||||
<A HREF="#cupsPutFile"><CODE>cupsPutFile()</CODE></A>
|
||||
|
||||
|
||||
<!-- NEW PAGE --><H2><A NAME="cupsGetFile">cupsGetFile()</A></H2>
|
||||
|
||||
<H3>Usage</H3>
|
||||
|
||||
<PRE>
|
||||
http_status_t
|
||||
cupsGetFile(http_t *http,
|
||||
const char *resource,
|
||||
const char *filename);
|
||||
</PRE>
|
||||
|
||||
<H3>Arguments</H3>
|
||||
|
||||
<CENTER><TABLE WIDTH="80%" BORDER>
|
||||
<TR>
|
||||
<TH>Argument</TH>
|
||||
<TH>Description</TH>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>http</TD>
|
||||
<TD>The HTTP connection to the server.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>resource</TD>
|
||||
<TD>The resource name on the server.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>filename</TD>
|
||||
<TD>The filename to write to.</TD>
|
||||
</TR>
|
||||
</TABLE></CENTER>
|
||||
|
||||
<H3>Returns</H3>
|
||||
|
||||
<P>The HTTP status code associated with the request.
|
||||
|
||||
<H3>Description</H3>
|
||||
|
||||
<P><CODE>cupsGetFile()</CODE> gets a file from the given HTTP
|
||||
server and writes it to the specified filename, performing any
|
||||
authentication or encryption as required.
|
||||
|
||||
<H3>Example</H3>
|
||||
|
||||
<PRE>
|
||||
#include <cups/cups.h>
|
||||
|
||||
http_t *http;
|
||||
char filename[1024];
|
||||
http_status_t status;
|
||||
...
|
||||
|
||||
http = httpConnectEncrypt(cupsServer(), ippPort(), cupsEncryption());
|
||||
|
||||
cupsTempFile(filename, sizeof(filename));
|
||||
|
||||
status = cupsGetFile(http, "/admin/cupsd.conf", filename);
|
||||
|
||||
...
|
||||
|
||||
unlink(filename);
|
||||
|
||||
httpClose(http);
|
||||
</PRE>
|
||||
|
||||
<H3>See Also</H3>
|
||||
|
||||
<P>
|
||||
<A HREF="#cupsGetFd"><CODE>cupsGetFd()</CODE></A>,
|
||||
<A HREF="#cupsPutFd"><CODE>cupsPutFd()</CODE></A>,
|
||||
<A HREF="#cupsPutFile"><CODE>cupsPutFile()</CODE></A>
|
||||
|
||||
|
||||
<!-- NEW PAGE --><H2><A NAME="cupsGetJobs">cupsGetJobs()</A></H2>
|
||||
|
||||
<H3>Usage</H3>
|
||||
@@ -4410,7 +4144,6 @@ password = cupsGetPassword("Please enter a password:");
|
||||
<H3>See Also</H3>
|
||||
|
||||
<P>
|
||||
<A HREF="#cupsDoAuthentication"><CODE>cupsDoAuthentication()</CODE></A>,
|
||||
<A HREF="#cupsServer"><CODE>cupsServer()</CODE></A>,
|
||||
<A HREF="#cupsSetPasswordCB"><CODE>cupsSetPasswordCB()</CODE></A>,
|
||||
<A HREF="#cupsSetServer"><CODE>cupsSetServer()</CODE></A>,
|
||||
@@ -4993,7 +4726,7 @@ be called multiple times to combine the options from several strings.
|
||||
#include <cups/cups.h>
|
||||
|
||||
int num_options;
|
||||
<A HREF="#cups_option_t">cups_option_t</A> *options;
|
||||
<A HREF="#cups_options_t">cups_option_t</A> *options;
|
||||
|
||||
...
|
||||
|
||||
@@ -5168,137 +4901,6 @@ jobid = cupsPrintFiles("printer@hostname", num_files, files,
|
||||
<A HREF="#cupsPrintFile"><CODE>cupsPrintFile()</CODE></A>
|
||||
|
||||
|
||||
<!-- NEW PAGE --><H2><A NAME="cupsPutFd">cupsPutFd()</A></H2>
|
||||
|
||||
<H3>Usage</H3>
|
||||
|
||||
<PRE>
|
||||
http_status_t
|
||||
cupsPutFd(http_t *http,
|
||||
const char *resource,
|
||||
int fd);
|
||||
</PRE>
|
||||
|
||||
<H3>Arguments</H3>
|
||||
|
||||
<CENTER><TABLE WIDTH="80%" BORDER>
|
||||
<TR>
|
||||
<TH>Argument</TH>
|
||||
<TH>Description</TH>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>http</TD>
|
||||
<TD>The HTTP connection to the server.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>resource</TD>
|
||||
<TD>The resource name on the server.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>fd</TD>
|
||||
<TD>The file descriptor to read from.</TD>
|
||||
</TR>
|
||||
</TABLE></CENTER>
|
||||
|
||||
<H3>Returns</H3>
|
||||
|
||||
<P>The HTTP status code associated with the request.
|
||||
|
||||
<H3>Description</H3>
|
||||
|
||||
<P><CODE>cupsPutFd()</CODE> puts a file to the given HTTP
|
||||
server, reading it from the specified file descriptor and
|
||||
performing any authentication or encryption as required.
|
||||
|
||||
<H3>Example</H3>
|
||||
|
||||
<PRE>
|
||||
#include <cups/cups.h>
|
||||
|
||||
http_t *http;
|
||||
int fd;
|
||||
http_status_t status;
|
||||
...
|
||||
|
||||
http = httpConnectEncrypt(cupsServer(), ippPort(), cupsEncryption());
|
||||
status = cupsPutFd(http, "/admin/cupsd.conf", fd);
|
||||
|
||||
httpClose(http);
|
||||
</PRE>
|
||||
|
||||
<H3>See Also</H3>
|
||||
|
||||
<P>
|
||||
<A HREF="#cupsGetFd"><CODE>cupsGetFd()</CODE></A>,
|
||||
<A HREF="#cupsGetFile"><CODE>cupsGetFile()</CODE></A>,
|
||||
<A HREF="#cupsPutFile"><CODE>cupsPutFile()</CODE></A>
|
||||
|
||||
|
||||
<!-- NEW PAGE --><H2><A NAME="cupsPutFile">cupsPutFile()</A></H2>
|
||||
|
||||
<H3>Usage</H3>
|
||||
|
||||
<PRE>
|
||||
http_status_t
|
||||
cupsPutFile(http_t *http,
|
||||
const char *resource,
|
||||
const char *filename);
|
||||
</PRE>
|
||||
|
||||
<H3>Arguments</H3>
|
||||
|
||||
<CENTER><TABLE WIDTH="80%" BORDER>
|
||||
<TR>
|
||||
<TH>Argument</TH>
|
||||
<TH>Description</TH>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>http</TD>
|
||||
<TD>The HTTP connection to the server.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>resource</TD>
|
||||
<TD>The resource name on the server.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>filename</TD>
|
||||
<TD>The filename to read from.</TD>
|
||||
</TR>
|
||||
</TABLE></CENTER>
|
||||
|
||||
<H3>Returns</H3>
|
||||
|
||||
<P>The HTTP status code associated with the request.
|
||||
|
||||
<H3>Description</H3>
|
||||
|
||||
<P><CODE>cupsPutFile()</CODE> puts a file on the given HTTP
|
||||
server, reading it from the specified filename and performing
|
||||
any authentication or encryption as required.
|
||||
|
||||
<H3>Example</H3>
|
||||
|
||||
<PRE>
|
||||
#include <cups/cups.h>
|
||||
|
||||
http_t *http;
|
||||
char filename[1024];
|
||||
http_status_t status;
|
||||
...
|
||||
|
||||
http = httpConnectEncrypt(cupsServer(), ippPort(), cupsEncryption());
|
||||
status = cupsPutFile(http, "/admin/cupsd.conf", filename);
|
||||
|
||||
httpClose(http);
|
||||
</PRE>
|
||||
|
||||
<H3>See Also</H3>
|
||||
|
||||
<P>
|
||||
<A HREF="#cupsGetFd"><CODE>cupsGetFd()</CODE></A>,
|
||||
<A HREF="#cupsGetFile"><CODE>cupsGetFile()</CODE></A>,
|
||||
<A HREF="#cupsPutFd"><CODE>cupsPutFd()</CODE></A>
|
||||
|
||||
<!-- NEW PAGE --><H2><A NAME="cupsRasterClose">cupsRasterClose()</A></H2>
|
||||
|
||||
<H3>Usage</H3>
|
||||
@@ -5890,7 +5492,6 @@ password = cupsGetPassword("Please enter a password:");
|
||||
<H3>See Also</H3>
|
||||
|
||||
<P>
|
||||
<A HREF="#cupsDoAuthentication"><CODE>cupsDoAuthentication()</CODE></A>,
|
||||
<A HREF="#cupsServer"><CODE>cupsServer()</CODE></A>,
|
||||
<A HREF="#cupsSetServer"><CODE>cupsSetServer()</CODE></A>,
|
||||
<A HREF="#cupsSetUser"><CODE>cupsSetUser()</CODE></A>,
|
||||
@@ -5983,7 +5584,6 @@ cupsSetUser("root");
|
||||
<H3>See Also</H3>
|
||||
|
||||
<P>
|
||||
<A HREF="#cupsDoAuthentication"><CODE>cupsDoAuthentication()</CODE></A>,
|
||||
<A HREF="#cupsServer"><CODE>cupsServer()</CODE></A>,
|
||||
<A HREF="#cupsSetPasswordCB"><CODE>cupsSetPasswordCB()</CODE></A>,
|
||||
<A HREF="#cupsSetServer"><CODE>cupsSetServer()</CODE></A>,
|
||||
@@ -6129,11 +5729,8 @@ user = cupsUser();
|
||||
<H3>See Also</H3>
|
||||
|
||||
<P>
|
||||
<A HREF="#cupsDoAuthentication"><CODE>cupsDoAuthentication()</CODE></A>,
|
||||
<A HREF="#cupsGetPassword"><CODE>cupsGetPassword()</CODE></A>,
|
||||
<A HREF="#cupsServer"><CODE>cupsServer()</CODE></A>,
|
||||
<A HREF="#cupsSetServer"><CODE>cupsSetServer()</CODE></A>,
|
||||
<A HREF="#cupsSetUser"><CODE>cupsSetUser()</CODE></A>
|
||||
<A HREF="#cupsServer"><CODE>cupsServer()</CODE></A>
|
||||
|
||||
|
||||
<!-- NEW PAGE --><H2><A NAME="httpBlocking">httpBlocking()</A></H2>
|
||||
@@ -9946,78 +9543,7 @@ ppdEmitFd(ppd, 1, PPD_ORDER_PAGE);
|
||||
|
||||
<H3>See Also</H3>
|
||||
|
||||
<A HREF="#ppdEmit"><CODE>ppdEmit()</CODE></A>,
|
||||
<A HREF="#ppdEmitJCL"><CODE>ppdEmitJCL()</CODE></A>
|
||||
|
||||
|
||||
<!-- NEW PAGE --><H2><A NAME="ppdEmitJCL">ppdEmitJCL()</A></H2>
|
||||
|
||||
<H3>Usage</H3>
|
||||
|
||||
<PRE>
|
||||
int
|
||||
ppdEmitJCL(ppd_file_t *ppd,
|
||||
FILE *file,
|
||||
int job_id,
|
||||
const char *user,
|
||||
const char *title);
|
||||
</PRE>
|
||||
|
||||
<H3>Arguments</H3>
|
||||
|
||||
<CENTER><TABLE WIDTH="80%" BORDER>
|
||||
<TR>
|
||||
<TH>Argument</TH>
|
||||
<TH>Description</TH>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>ppd</TD>
|
||||
<TD>The PPD file</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>file</TD>
|
||||
<TD>The file to write to</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>job_id</TD>
|
||||
<TD>The job ID number</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>user</TD>
|
||||
<TD>The job user</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>title</TD>
|
||||
<TD>The job name</TD>
|
||||
</TR>
|
||||
</TABLE></CENTER>
|
||||
|
||||
<H3>Returns</H3>
|
||||
|
||||
<P>0 on success, -1 on error.
|
||||
|
||||
<H3>Description</H3>
|
||||
|
||||
<P>The <CODE>ppdEmitJCL()</CODE> function sends printer-specific
|
||||
job control commands to the specified file. For printers that
|
||||
support the HP Printer Job Language (PJL) job control language,
|
||||
the output also contains a display string that usually appears
|
||||
on the printer's LCD.
|
||||
|
||||
<H3>Example</H3>
|
||||
|
||||
<PRE>
|
||||
#include <cups/ppd.h>
|
||||
|
||||
ppd_file_t *ppd;
|
||||
|
||||
ppdEmitJCL(ppd, stdout, job_id, user, title);
|
||||
</PRE>
|
||||
|
||||
<H3>See Also</H3>
|
||||
|
||||
<A HREF="#ppdEmit"><CODE>ppdEmit()</CODE></A>,
|
||||
<A HREF="#ppdEmitFd"><CODE>ppdEmitFd()</CODE></A>
|
||||
<A HREF="#ppdEmit"><CODE>ppdEmit()</CODE></A>
|
||||
|
||||
|
||||
<!-- NEW PAGE --><H2><A NAME="ppdFindAttr">ppdFindAttr()</A></H2>
|
||||
|
||||
+13
-19
@@ -4,7 +4,7 @@
|
||||
<TITLE>CUPS Software Users Manual</TITLE>
|
||||
<META NAME="author" CONTENT="Easy Software Products">
|
||||
<META NAME="copyright" CONTENT="Copyright 1997-2003, All Rights Reserved">
|
||||
<META NAME="docnumber" CONTENT="CUPS-SUM-1.1.20">
|
||||
<META NAME="docnumber" CONTENT="CUPS-SUM-1.1.19">
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-8859-1">
|
||||
<STYLE TYPE="text/css"><!--
|
||||
BODY { font-family: serif }
|
||||
@@ -22,7 +22,7 @@ PRE { font-family: monospace }
|
||||
<BODY BGCOLOR="white">
|
||||
<CENTER><A HREF="#CONTENTS"><IMG SRC="images/cups-large.gif" BORDER="0" WIDTH="431" HEIGHT="511"><BR>
|
||||
<H1>CUPS Software Users Manual</H1></A><BR>
|
||||
CUPS-SUM-1.1.20<BR>
|
||||
CUPS-SUM-1.1.19<BR>
|
||||
Easy Software Products<BR>
|
||||
Copyright 1997-2003, All Rights Reserved<BR>
|
||||
</CENTER>
|
||||
@@ -125,21 +125,15 @@ Copyright 1997-2003, All Rights Reserved<BR>
|
||||
<LI><A HREF="#6_1_5">Support</A></LI>
|
||||
</UL>
|
||||
<LI><A HREF="#6_2">GNU GENERAL PUBLIC LICENSE</A></LI>
|
||||
<UL>
|
||||
<LI><A HREF="#6_2_1">Preamble</A></LI>
|
||||
</UL>
|
||||
<LI><A HREF="#6_3">GNU LIBRARY GENERAL PUBLIC LICENSE</A></LI>
|
||||
<UL>
|
||||
<LI><A HREF="#6_3_1">Preamble</A></LI>
|
||||
</UL>
|
||||
</UL>
|
||||
<HR>
|
||||
<H1 ALIGN="RIGHT"><A NAME="1">Preface</A></H1>
|
||||
<P>This software users manual describes how to use the Common UNIX
|
||||
Printing System<SUP>TM</SUP> ("CUPS<SUP>TM</SUP>") Version 1.1.20.</P>
|
||||
Printing System<SUP>TM</SUP> ("CUPS<SUP>TM</SUP>") Version 1.1.19.</P>
|
||||
<H2><A NAME="1_1">System Overview</A></H2>
|
||||
<P>CUPS provides a portable printing layer for UNIX®-based operating
|
||||
systems. It has been developed by <A HREF="http://www.easysw.com">Easy
|
||||
systems. It has been developed by<A HREF="http://www.easysw.com"> Easy
|
||||
Software Products</A> to promote a standard printing solution for all
|
||||
UNIX vendors and users. CUPS provides the System V and Berkeley
|
||||
command-line interfaces.</P>
|
||||
@@ -393,7 +387,7 @@ lpr(1)</CODE>) printing commands. Type the following command to print a
|
||||
</B></B></PRE>
|
||||
</UL>
|
||||
<P>The available printer options vary depending on the printer. The
|
||||
standard options are described in <A HREF="#STANDARD_OPTIONS">Chapter
|
||||
standard options are described in<A HREF="#STANDARD_OPTIONS"> Chapter
|
||||
3, "Standard Printing Options"</A>.</P>
|
||||
<H2><A NAME="3_4">Printing Multiple Copies</A></H2>
|
||||
<P>Both the <CODE>lp</CODE> and <CODE>lpr</CODE> commands have options
|
||||
@@ -911,7 +905,7 @@ printer DeskJet now printing DeskJet-1.
|
||||
and set your own default printer.</P>
|
||||
<H2><A NAME="5_1">Printer Options</A></H2>
|
||||
<P>Each printer supports a large number of options, which you learned
|
||||
about in <A HREF="#STANDARD_OPTIONS">Chapter 3, "Standard Printer
|
||||
about in<A HREF="#STANDARD_OPTIONS"> Chapter 3, "Standard Printer
|
||||
Options"</A>. Rather than specifying these options each time you print
|
||||
a file, CUPS allows you to save them as "default" options for the
|
||||
printer.</P>
|
||||
@@ -1028,8 +1022,8 @@ deskjet@server</CODE>).</P>
|
||||
<BR> HOLLYWOOD, MARYLAND 20636-3111 USA
|
||||
<BR>
|
||||
<BR> Voice: +1.301.373.9600
|
||||
<BR> Email: <A HREF="mailto:cups-info@cups.org">cups-info@cups.org</A>
|
||||
<BR> WWW: <A HREF="http://www.cups.org">http://www.cups.org</A></P>
|
||||
<BR> Email:<A HREF="mailto:cups-info@cups.org"> cups-info@cups.org</A>
|
||||
<BR> WWW:<A HREF="http://www.cups.org"> http://www.cups.org</A></P>
|
||||
<H3><A NAME="6_1_1">Introduction</A></H3>
|
||||
<P>The Common UNIX Printing System<SUP>TM</SUP>, ("CUPS<SUP>TM</SUP>"),
|
||||
is provided under the GNU General Public License ("GPL") and GNU
|
||||
@@ -1119,9 +1113,9 @@ deskjet@server</CODE>).</P>
|
||||
<P>The Common UNIX Printing System provides a "pdftops" filter that is
|
||||
based on the Xpdf software. For binary distribution licensing of this
|
||||
software, please contact:<BLOCKQUOTE> Derek B. Noonburg
|
||||
<BR> Email: <A HREF="mailto:derekn@foolabs.com">derekn@foolabs.com</A>
|
||||
<BR> WWW: <A HREF="http://www.foolabs.com/xpdf/">
|
||||
http://www.foolabs.com/xpdf/</A></BLOCKQUOTE></P>
|
||||
<BR> Email:<A HREF="mailto:derekn@foolabs.com"> derekn@foolabs.com</A>
|
||||
<BR> WWW:<A HREF="http://www.foolabs.com/xpdf/">
|
||||
http://www.foolabs.com/xpdf/</A></BLOCKQUOTE></P>
|
||||
<H3><A NAME="6_1_5">Support</A></H3>
|
||||
<P>Easy Software Products sells software support for CUPS as well as a
|
||||
commercial printing product based on CUPS called ESP Print Pro. You can
|
||||
@@ -1142,7 +1136,7 @@ Copyright 1989, 1991 Free Software Foundation, Inc.
|
||||
Everyone is permitted to copy and distribute verbatim
|
||||
copies of this license document, but changing it is not allowed.
|
||||
</PRE>
|
||||
<H3><A NAME="6_2_1">Preamble</A></H3>
|
||||
<H4>Preamble</H4>
|
||||
<P>The licenses for most software are designed to take away your freedom
|
||||
to share and change it. By contrast, the GNU General Public License is
|
||||
intended to guarantee your freedom to share and change free
|
||||
@@ -1400,7 +1394,7 @@ of this license document, but changing it is not allowed.
|
||||
[This is the first released version of the library GPL. It is
|
||||
numbered 2 because it goes with version 2 of the ordinary GPL.]
|
||||
</PRE>
|
||||
<H3><A NAME="6_3_1">Preamble</A></H3>
|
||||
<H4>Preamble</H4>
|
||||
<P>The licenses for most software are designed to take away your freedom
|
||||
to share and change it. By contrast, the GNU General Public Licenses
|
||||
are intended to guarantee your freedom to share and change free
|
||||
|
||||
Arquivo binário não exibido.
+2
-2
@@ -2,7 +2,7 @@
|
||||
<HEAD>
|
||||
<META NAME="Description" CONTENT="Common UNIX Printing System Software Users Manual">
|
||||
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2003, All Rights Reserved">
|
||||
<META NAME="DOCNUMBER" CONTENT="CUPS-SUM-1.1.20">
|
||||
<META NAME="DOCNUMBER" CONTENT="CUPS-SUM-1.1.19">
|
||||
<META NAME="Author" CONTENT="Easy Software Products">
|
||||
<TITLE>CUPS Software Users Manual</TITLE>
|
||||
</HEAD>
|
||||
@@ -11,7 +11,7 @@
|
||||
<H1 ALIGN="RIGHT">Preface</H1>
|
||||
|
||||
<P>This software users manual describes how to use the Common UNIX Printing
|
||||
System<SUP>TM</SUP> ("CUPS<SUP>TM</SUP>") Version 1.1.20.
|
||||
System<SUP>TM</SUP> ("CUPS<SUP>TM</SUP>") Version 1.1.19.
|
||||
|
||||
<EMBED SRC="system-overview.shtml">
|
||||
|
||||
|
||||
+1
-2
@@ -3,9 +3,8 @@ hpgltops
|
||||
images
|
||||
imagetops
|
||||
imagetoraster
|
||||
libcupsimage.2.dylib
|
||||
libcupsimage.a
|
||||
libcupsimage.dylib
|
||||
libcupsimage.dylib.2
|
||||
libcupsimage_s.a
|
||||
libcupsimage.sl.2
|
||||
libcupsimage.so.2
|
||||
|
||||
+5
-6
@@ -26,9 +26,8 @@
|
||||
|
||||
include ../Makedefs
|
||||
|
||||
FILTERS = gziptoany hpgltops texttops pstops imagetops imagetoraster \
|
||||
rastertodymo rastertoepson rastertohp
|
||||
TARGETS = $(FILTERS)
|
||||
TARGETS = gziptoany hpgltops texttops pstops imagetops imagetoraster \
|
||||
rastertodymo rastertoepson rastertohp libcupsimage.a
|
||||
|
||||
HPGLOBJS = hpgl-attr.o hpgl-config.o hpgl-main.o hpgl-prolog.o \
|
||||
hpgl-char.o hpgl-input.o hpgl-polygon.o hpgl-vector.o
|
||||
@@ -54,7 +53,7 @@ all: $(TARGETS) libcupsimage.a
|
||||
#
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) $(TARGETS) $(LIBCUPSIMAGE) libcupsimage.a
|
||||
$(RM) $(OBJS) $(TARGETS) $(LIBCUPSIMAGE)
|
||||
$(RM) `basename $(LIBCUPSIMAGE) .2` libcupsimage.dylib
|
||||
|
||||
|
||||
@@ -156,8 +155,8 @@ libcupsimage.2.dylib: $(IMAGEOBJS) ../Makedefs
|
||||
|
||||
libcupsimage_s.a: $(IMAGEOBJS) ../Makedefs
|
||||
echo Linking $@...
|
||||
$(DSO) $(DSOFLAGS) -Wl,-berok -o libcupsimage_s.o $(IMAGEOBJS) \
|
||||
$(DSOLIBS) -lm
|
||||
$(DSO) $(DSOFLAGS) -o libcupsimage_s.o $(IMAGEOBJS) $(DSOLIBS) \
|
||||
$(LINKCUPS) -lm
|
||||
$(RM) $@
|
||||
$(AR) $(ARFLAGS) $@ libcupsimage_s.o
|
||||
|
||||
|
||||
+92
-229
@@ -44,7 +44,6 @@
|
||||
* SR_relative_size() - Set the relative size of text.
|
||||
* SS_select_standard() - Select the standard font for text.
|
||||
* TD_transparent_data() - Send transparent print data.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -54,89 +53,6 @@
|
||||
#include "hpgltops.h"
|
||||
|
||||
|
||||
/*
|
||||
* 'define_font()' - Define the specified font...
|
||||
*/
|
||||
|
||||
void
|
||||
define_font(int f) /* I - Font number */
|
||||
{
|
||||
font_t *font; /* Font */
|
||||
const char *fstring; /* Font string - SA or SS */
|
||||
float xform[2][2]; /* Transform matrix */
|
||||
|
||||
|
||||
/*
|
||||
* Get the correct font data...
|
||||
*/
|
||||
|
||||
if (f)
|
||||
{
|
||||
font = &AlternateFont;
|
||||
fstring = "SA";
|
||||
}
|
||||
else
|
||||
{
|
||||
font = &StandardFont;
|
||||
fstring = "SS";
|
||||
}
|
||||
|
||||
/*
|
||||
* Compute the font matrix, accounting for any rotation...
|
||||
*/
|
||||
|
||||
switch (Rotation)
|
||||
{
|
||||
default :
|
||||
case 0 :
|
||||
xform[0][0] = font->xpitch * font->x * font->height;
|
||||
xform[0][1] = font->xpitch * font->y * font->height;
|
||||
xform[1][0] = -font->y * font->height;
|
||||
xform[1][1] = font->x * font->height;
|
||||
break;
|
||||
|
||||
case 90 :
|
||||
xform[0][0] = -font->xpitch * font->y * font->height;
|
||||
xform[0][1] = font->xpitch * font->x * font->height;
|
||||
xform[1][0] = -font->x * font->height;
|
||||
xform[1][1] = -font->y * font->height;
|
||||
break;
|
||||
|
||||
case 180 :
|
||||
xform[0][0] = -font->xpitch * font->x * font->height;
|
||||
xform[0][1] = -font->xpitch * font->y * font->height;
|
||||
xform[1][0] = font->y * font->height;
|
||||
xform[1][1] = -font->x * font->height;
|
||||
break;
|
||||
|
||||
case 270 :
|
||||
xform[0][0] = font->xpitch * font->y * font->height;
|
||||
xform[0][1] = -font->xpitch * font->x * font->height;
|
||||
xform[1][0] = font->x * font->height;
|
||||
xform[1][1] = font->y * font->height;
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Send the font definition...
|
||||
*/
|
||||
|
||||
printf("/%s {\n"
|
||||
" /%s%s%s%s findfont\n"
|
||||
" [ %f %f %f %f 0.0 0.0 ] makefont\n"
|
||||
" setfont\n"
|
||||
"} bind def\n",
|
||||
fstring, font->spacing ? "Helvetica" : "Courier",
|
||||
(font->weight > 0 || font->posture) ? "-" : "",
|
||||
font->weight > 0 ? "Bold" : "",
|
||||
font->posture ? "Oblique" : "",
|
||||
xform[0][0], xform[0][1], xform[1][0], xform[1][1]);
|
||||
|
||||
if (f == CharFont)
|
||||
printf("%s\n", fstring);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 'AD_define_alternate()' - Define the alternate font.
|
||||
*/
|
||||
@@ -152,15 +68,10 @@ AD_define_alternate(int num_params, /* I - Number of parameters */
|
||||
* Set default font attributes...
|
||||
*/
|
||||
|
||||
AlternateFont.symbol_set = 277;
|
||||
AlternateFont.spacing = 0;
|
||||
AlternateFont.pitch = 9;
|
||||
AlternateFont.height = 11.5;
|
||||
AlternateFont.posture = 0;
|
||||
AlternateFont.weight = 0;
|
||||
AlternateFont.typeface = 48;
|
||||
AlternateFont.x = 1.0;
|
||||
AlternateFont.y = 0.0;
|
||||
AlternateFont.typeface = 48;
|
||||
AlternateFont.posture = 0;
|
||||
AlternateFont.weight = 0;
|
||||
AlternateFont.height = 11.5;
|
||||
|
||||
/*
|
||||
* Loop through parameter value pairs...
|
||||
@@ -169,62 +80,38 @@ AD_define_alternate(int num_params, /* I - Number of parameters */
|
||||
for (i = 0; i < (num_params - 1); i += 2)
|
||||
switch ((int)params[i].value.number)
|
||||
{
|
||||
case 1 : /* Symbol Set */
|
||||
AlternateFont.symbol_set = (int)params[i + 1].value.number;
|
||||
break;
|
||||
case 2 : /* Font Spacing */
|
||||
AlternateFont.spacing = (int)params[i + 1].value.number;
|
||||
break;
|
||||
case 3 : /* Pitch */
|
||||
AlternateFont.pitch = params[i + 1].value.number;
|
||||
break;
|
||||
case 4 : /* Height */
|
||||
case 4 :
|
||||
AlternateFont.height = params[i + 1].value.number;
|
||||
break;
|
||||
case 5 : /* Posture */
|
||||
case 5 :
|
||||
AlternateFont.posture = (int)params[i + 1].value.number;
|
||||
break;
|
||||
case 6 : /* Stroke Weight */
|
||||
case 6 :
|
||||
AlternateFont.weight = (int)params[i + 1].value.number;
|
||||
break;
|
||||
case 7 : /* Typeface */
|
||||
case 7 :
|
||||
AlternateFont.typeface = (int)params[i + 1].value.number;
|
||||
break;
|
||||
}
|
||||
|
||||
if (AlternateFont.spacing)
|
||||
{
|
||||
/*
|
||||
* Set proportional spacing font...
|
||||
*/
|
||||
|
||||
AlternateFont.xpitch = 1.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Set fixed-spaced font...
|
||||
*/
|
||||
|
||||
AlternateFont.xpitch = 0.6f * AlternateFont.height / AlternateFont.pitch;
|
||||
}
|
||||
|
||||
/*
|
||||
* Define the font...
|
||||
*/
|
||||
|
||||
if (PageDirty)
|
||||
{
|
||||
printf("%% AD");
|
||||
for (i = 0; i < num_params; i ++)
|
||||
if (i)
|
||||
printf(",%g", params[i].value.number);
|
||||
else
|
||||
printf("%g", params[i].value.number);
|
||||
puts(";");
|
||||
|
||||
define_font(1);
|
||||
}
|
||||
printf("/SA {\n"
|
||||
" /%s%s%s%s findfont\n"
|
||||
" [ %f %f %f %f 0.0 0.0 ] makefont\n"
|
||||
" setfont\n"
|
||||
"} bind def\n",
|
||||
AlternateFont.typeface == 48 ? "Courier" : "Helvetica",
|
||||
(AlternateFont.weight != 0 || AlternateFont.posture != 0) ? "-" : "",
|
||||
AlternateFont.weight != 0 ? "Bold" : "",
|
||||
AlternateFont.posture != 0 ? "Oblique" : "",
|
||||
AlternateFont.x * AlternateFont.height,
|
||||
-AlternateFont.y * AlternateFont.height,
|
||||
AlternateFont.y * AlternateFont.height,
|
||||
AlternateFont.x * AlternateFont.height);
|
||||
|
||||
CharHeight[1] = AlternateFont.height;
|
||||
}
|
||||
@@ -290,25 +177,57 @@ void
|
||||
DI_absolute_direction(int num_params, /* I - Number of parameters */
|
||||
param_t *params) /* I - Parameters */
|
||||
{
|
||||
if (num_params != 2)
|
||||
return;
|
||||
|
||||
if (CharFont)
|
||||
{
|
||||
AlternateFont.x = params[0].value.number;
|
||||
AlternateFont.y = params[1].value.number;
|
||||
if (num_params == 2)
|
||||
{
|
||||
AlternateFont.x = params[0].value.number;
|
||||
AlternateFont.y = params[1].value.number;
|
||||
}
|
||||
|
||||
if (PageDirty)
|
||||
{
|
||||
printf("/SA {\n"
|
||||
" /%s%s%s%s findfont\n"
|
||||
" [ %f %f %f %f 0.0 0.0 ] makefont\n"
|
||||
" setfont\n"
|
||||
"} bind def\n",
|
||||
AlternateFont.typeface == 48 ? "Courier" : "Helvetica",
|
||||
(AlternateFont.weight != 0 || AlternateFont.posture != 0) ? "-" : "",
|
||||
AlternateFont.weight != 0 ? "Bold" : "",
|
||||
AlternateFont.posture != 0 ? "Oblique" : "",
|
||||
AlternateFont.x * AlternateFont.height,
|
||||
-AlternateFont.y * AlternateFont.height,
|
||||
AlternateFont.y * AlternateFont.height,
|
||||
AlternateFont.x * AlternateFont.height);
|
||||
puts("SA");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
StandardFont.x = params[0].value.number;
|
||||
StandardFont.y = params[1].value.number;
|
||||
}
|
||||
if (num_params == 2)
|
||||
{
|
||||
StandardFont.x = params[0].value.number;
|
||||
StandardFont.y = params[1].value.number;
|
||||
}
|
||||
|
||||
if (PageDirty)
|
||||
{
|
||||
printf("%% DI%g,%g\n", params[0].value.number, params[1].value.number);
|
||||
|
||||
define_font(CharFont);
|
||||
if (PageDirty)
|
||||
{
|
||||
printf("/SS {\n"
|
||||
" /%s%s%s%s findfont\n"
|
||||
" [ %f %f %f %f 0.0 0.0 ] makefont\n"
|
||||
" setfont\n"
|
||||
"} bind def\n",
|
||||
StandardFont.typeface == 48 ? "Courier" : "Helvetica",
|
||||
(StandardFont.weight != 0 || StandardFont.posture != 0) ? "-" : "",
|
||||
StandardFont.weight != 0 ? "Bold" : "",
|
||||
StandardFont.posture != 0 ? "Oblique" : "",
|
||||
StandardFont.x * StandardFont.height,
|
||||
-StandardFont.y * StandardFont.height,
|
||||
StandardFont.y * StandardFont.height,
|
||||
StandardFont.x * StandardFont.height);
|
||||
puts("SS");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -382,7 +301,7 @@ LB_label(int num_params, /* I - Number of parameters */
|
||||
return;
|
||||
|
||||
Outputf("gsave\n");
|
||||
Outputf("currentmiterlimit 1.0 setmiterlimit\n");
|
||||
Outputf("currentmiterlimit 1.0 \n");
|
||||
Outputf("MP\n");
|
||||
Outputf("%.3f %.3f MO\n", PenPosition[0], PenPosition[1]);
|
||||
|
||||
@@ -457,15 +376,12 @@ SD_define_standard(int num_params, /* I - Number of parameters */
|
||||
* Set default font attributes...
|
||||
*/
|
||||
|
||||
StandardFont.symbol_set = 277;
|
||||
StandardFont.spacing = 0;
|
||||
StandardFont.pitch = 9;
|
||||
StandardFont.height = 11.5;
|
||||
StandardFont.posture = 0;
|
||||
StandardFont.weight = 0;
|
||||
StandardFont.typeface = 48;
|
||||
StandardFont.x = 1.0;
|
||||
StandardFont.y = 0.0;
|
||||
StandardFont.typeface = 48;
|
||||
StandardFont.posture = 0;
|
||||
StandardFont.weight = 0;
|
||||
StandardFont.height = 11.5;
|
||||
StandardFont.x = 1.0;
|
||||
StandardFont.y = 0.0;
|
||||
|
||||
/*
|
||||
* Loop through parameter value pairs...
|
||||
@@ -474,62 +390,38 @@ SD_define_standard(int num_params, /* I - Number of parameters */
|
||||
for (i = 0; i < (num_params - 1); i += 2)
|
||||
switch ((int)params[i].value.number)
|
||||
{
|
||||
case 1 : /* Symbol Set */
|
||||
StandardFont.symbol_set = (int)params[i + 1].value.number;
|
||||
break;
|
||||
case 2 : /* Font Spacing */
|
||||
StandardFont.spacing = (int)params[i + 1].value.number;
|
||||
break;
|
||||
case 3 : /* Pitch */
|
||||
StandardFont.pitch = params[i + 1].value.number;
|
||||
break;
|
||||
case 4 : /* Height */
|
||||
case 4 :
|
||||
StandardFont.height = params[i + 1].value.number;
|
||||
break;
|
||||
case 5 : /* Posture */
|
||||
case 5 :
|
||||
StandardFont.posture = (int)params[i + 1].value.number;
|
||||
break;
|
||||
case 6 : /* Stroke Weight */
|
||||
case 6 :
|
||||
StandardFont.weight = (int)params[i + 1].value.number;
|
||||
break;
|
||||
case 7 : /* Typeface */
|
||||
case 7 :
|
||||
StandardFont.typeface = (int)params[i + 1].value.number;
|
||||
break;
|
||||
}
|
||||
|
||||
if (StandardFont.spacing || StandardFont.pitch <= 0.0)
|
||||
{
|
||||
/*
|
||||
* Set proportional spacing font...
|
||||
*/
|
||||
|
||||
StandardFont.xpitch = 1.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Set fixed-spaced font...
|
||||
*/
|
||||
|
||||
StandardFont.xpitch = 0.6f * StandardFont.height / StandardFont.pitch;
|
||||
}
|
||||
|
||||
/*
|
||||
* Define the font...
|
||||
*/
|
||||
|
||||
if (PageDirty)
|
||||
{
|
||||
printf("%% SD");
|
||||
for (i = 0; i < num_params; i ++)
|
||||
if (i)
|
||||
printf(",%g", params[i].value.number);
|
||||
else
|
||||
printf("%g", params[i].value.number);
|
||||
puts(";");
|
||||
|
||||
define_font(0);
|
||||
}
|
||||
printf("/SS {\n"
|
||||
" /%s%s%s%s findfont\n"
|
||||
" [ %f %f %f %f 0.0 0.0 ] makefont\n"
|
||||
" setfont\n"
|
||||
"} bind def\n",
|
||||
StandardFont.typeface == 48 ? "Courier" : "Helvetica",
|
||||
(StandardFont.weight != 0 || StandardFont.posture != 0) ? "-" : "",
|
||||
StandardFont.weight != 0 ? "Bold" : "",
|
||||
StandardFont.posture != 0 ? "Oblique" : "",
|
||||
StandardFont.x * StandardFont.height,
|
||||
-StandardFont.y * StandardFont.height,
|
||||
StandardFont.y * StandardFont.height,
|
||||
StandardFont.x * StandardFont.height);
|
||||
|
||||
CharHeight[0] = StandardFont.height;
|
||||
}
|
||||
@@ -543,37 +435,8 @@ void
|
||||
SI_absolute_size(int num_params, /* I - Number of parameters */
|
||||
param_t *params) /* I - Parameters */
|
||||
{
|
||||
float xsize, ysize; /* Font size... */
|
||||
|
||||
|
||||
if (num_params != 2)
|
||||
return;
|
||||
|
||||
/*
|
||||
* The "SI" values are supposed to be cm, but they appear to be inches
|
||||
* when tested on real HP devices...
|
||||
*/
|
||||
|
||||
xsize = params[0].value.number * 72.0f;
|
||||
ysize = params[1].value.number * 72.0f * 0.6f;
|
||||
|
||||
if (CharFont)
|
||||
{
|
||||
AlternateFont.xpitch = xsize / ysize;
|
||||
AlternateFont.height = ysize;
|
||||
}
|
||||
else
|
||||
{
|
||||
StandardFont.xpitch = xsize / ysize;
|
||||
StandardFont.height = ysize;
|
||||
}
|
||||
|
||||
if (PageDirty)
|
||||
{
|
||||
printf("%% SI%g,%g\n", params[0].value.number, params[1].value.number);
|
||||
|
||||
define_font(CharFont);
|
||||
}
|
||||
(void)num_params;
|
||||
(void)params;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -182,7 +182,6 @@ update_transform(void)
|
||||
|
||||
switch (Rotation)
|
||||
{
|
||||
default :
|
||||
case 0 :
|
||||
Transform[0][0] = scaling;
|
||||
Transform[0][1] = 0.0;
|
||||
@@ -281,7 +280,6 @@ DF_default_values(int num_params, /* I - Number of parameters */
|
||||
(void)num_params;
|
||||
(void)params;
|
||||
|
||||
NP_number_pens(0, NULL);
|
||||
AC_anchor_corner(0, NULL);
|
||||
AD_define_alternate(0, NULL);
|
||||
SD_define_standard(0, NULL);
|
||||
|
||||
@@ -192,14 +192,10 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
shading = 1;
|
||||
PenWidth = 1.0;
|
||||
|
||||
if ((val = cupsGetOption("blackplot", num_options, options)) != NULL &&
|
||||
strcasecmp(val, "no") && strcasecmp(val, "off") &&
|
||||
strcasecmp(val, "false"))
|
||||
if ((val = cupsGetOption("blackplot", num_options, options)) != NULL)
|
||||
shading = 0;
|
||||
|
||||
if ((val = cupsGetOption("fitplot", num_options, options)) != NULL &&
|
||||
strcasecmp(val, "no") && strcasecmp(val, "off") &&
|
||||
strcasecmp(val, "false"))
|
||||
if ((val = cupsGetOption("fitplot", num_options, options)) != NULL)
|
||||
FitPlot = 1;
|
||||
|
||||
if ((val = cupsGetOption("penwidth", num_options, options)) != NULL)
|
||||
|
||||
+33
-2
@@ -76,6 +76,7 @@ OutputProlog(char *title, /* I - Job title */
|
||||
puts("%%EndComments");
|
||||
puts("%%BeginProlog");
|
||||
printf("/DefaultPenWidth %.2f def\n", PenWidth * 72.0 / 25.4);
|
||||
puts("3.0 setmiterlimit");
|
||||
if (!shading) /* Black only */
|
||||
puts("/setrgbcolor { pop pop pop } bind def");
|
||||
else if (!ColorDevice) /* Greyscale */
|
||||
@@ -295,8 +296,38 @@ Outputf(const char *format, /* I - Printf-style string */
|
||||
}
|
||||
}
|
||||
|
||||
define_font(0);
|
||||
define_font(1);
|
||||
printf("/SA {\n"
|
||||
" /%s%s%s%s findfont\n"
|
||||
" [ %f %f %f %f 0.0 0.0 ] makefont\n"
|
||||
" setfont\n"
|
||||
"} bind def\n",
|
||||
AlternateFont.typeface == 48 ? "Courier" : "Helvetica",
|
||||
(AlternateFont.weight != 0 || AlternateFont.posture != 0) ? "-" : "",
|
||||
AlternateFont.weight != 0 ? "Bold" : "",
|
||||
AlternateFont.posture != 0 ? "Oblique" : "",
|
||||
AlternateFont.x * AlternateFont.height,
|
||||
-AlternateFont.y * AlternateFont.height,
|
||||
AlternateFont.y * AlternateFont.height,
|
||||
AlternateFont.x * AlternateFont.height);
|
||||
|
||||
printf("/SS {\n"
|
||||
" /%s%s%s%s findfont\n"
|
||||
" [ %f %f %f %f 0.0 0.0 ] makefont\n"
|
||||
" setfont\n"
|
||||
"} bind def\n",
|
||||
StandardFont.typeface == 48 ? "Courier" : "Helvetica",
|
||||
(StandardFont.weight != 0 || StandardFont.posture != 0) ? "-" : "",
|
||||
StandardFont.weight != 0 ? "Bold" : "",
|
||||
StandardFont.posture != 0 ? "Oblique" : "",
|
||||
StandardFont.x * StandardFont.height,
|
||||
-StandardFont.y * StandardFont.height,
|
||||
StandardFont.y * StandardFont.height,
|
||||
StandardFont.x * StandardFont.height);
|
||||
|
||||
if (CharFont)
|
||||
puts("SA");
|
||||
else
|
||||
puts("SS");
|
||||
|
||||
printf("%.1f setmiterlimit\n", MiterLimit);
|
||||
printf("%d setlinecap\n", LineCap);
|
||||
|
||||
+3
-8
@@ -60,14 +60,10 @@ typedef struct
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int symbol_set, /* Symbol set */
|
||||
spacing, /* Spacing (0 = fixed, 1 = proportional) */
|
||||
int typeface, /* Typeface number */
|
||||
posture, /* Posture number */
|
||||
weight, /* Weight number */
|
||||
typeface; /* Typeface number */
|
||||
float pitch, /* Characters per inch */
|
||||
height, /* Height/size of font */
|
||||
xpitch; /* X pitch scaling value */
|
||||
weight; /* Weight number */
|
||||
float height; /* Height/size of font */
|
||||
float x, y; /* X and Y direction/scaling */
|
||||
} font_t;
|
||||
|
||||
@@ -196,7 +192,6 @@ extern void RR_fill_rect_relative(int num_params, param_t *params);
|
||||
extern void WG_fill_wedge(int num_params, param_t *params);
|
||||
|
||||
/* hpgl-char.c */
|
||||
extern void define_font(int f);
|
||||
extern void AD_define_alternate(int num_params, param_t *params);
|
||||
extern void CF_character_fill(int num_params, param_t *params);
|
||||
extern void CP_character_plot(int num_params, param_t *params);
|
||||
|
||||
+24
-68
@@ -1542,87 +1542,43 @@ exec_code(cups_page_header_t *header, /* I - Page header */
|
||||
*ptr = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Read a single name...
|
||||
*/
|
||||
|
||||
for (ptr = value;
|
||||
(isalnum(*code) || *code == '_') &&
|
||||
(ptr - value) < (sizeof(value) - 1);)
|
||||
*ptr++ = *code++;
|
||||
*ptr = '\0';
|
||||
}
|
||||
continue;
|
||||
|
||||
/*
|
||||
* Assign the value as needed...
|
||||
*/
|
||||
|
||||
if (!strcmp(name, "MediaClass"))
|
||||
strlcpy(header->MediaClass, value, sizeof(header->MediaClass));
|
||||
else if (!strcmp(name, "MediaColor"))
|
||||
strlcpy(header->MediaColor, value, sizeof(header->MediaColor));
|
||||
else if (!strcmp(name, "MediaType"))
|
||||
strlcpy(header->MediaType, value, sizeof(header->MediaType));
|
||||
else if (!strcmp(name, "OutputType"))
|
||||
strlcpy(header->OutputType, value, sizeof(header->OutputType));
|
||||
else if (!strcmp(name, "AdvanceDistance"))
|
||||
header->AdvanceDistance = atoi(value);
|
||||
else if (!strcmp(name, "AdvanceMedia"))
|
||||
header->AdvanceMedia = atoi(value);
|
||||
else if (!strcmp(name, "Collate"))
|
||||
header->Collate = !strcmp(value, "true");
|
||||
else if (!strcmp(name, "CutMedia"))
|
||||
header->CutMedia = (cups_cut_t)atoi(value);
|
||||
else if (!strcmp(name, "Duplex"))
|
||||
header->Duplex = !strcmp(value, "true");
|
||||
else if (!strcmp(name, "HWResolution"))
|
||||
sscanf(value, "%d%d", header->HWResolution + 0, header->HWResolution + 1);
|
||||
else if (!strcmp(name, "InsertSheet"))
|
||||
header->InsertSheet = !strcmp(value, "true");
|
||||
else if (!strcmp(name, "Jog"))
|
||||
header->Jog = atoi(value);
|
||||
else if (!strcmp(name, "LeadingEdge"))
|
||||
header->LeadingEdge = atoi(value);
|
||||
else if (!strcmp(name, "Margins"))
|
||||
sscanf(value, "%d%d", header->Margins + 0, header->Margins + 1);
|
||||
else if (!strcmp(name, "ManualFeed"))
|
||||
header->ManualFeed = !strcmp(value, "true");
|
||||
else if (!strcmp(name, "cupsMediaPosition") || /* Compatibility */
|
||||
!strcmp(name, "MediaPosition"))
|
||||
header->MediaPosition = atoi(value);
|
||||
else if (!strcmp(name, "MediaWeight"))
|
||||
header->MediaWeight = atoi(value);
|
||||
else if (!strcmp(name, "MirrorPrint"))
|
||||
header->MirrorPrint = !strcmp(value, "true");
|
||||
else if (!strcmp(name, "NegativePrint"))
|
||||
header->NegativePrint = !strcmp(value, "true");
|
||||
else if (!strcmp(name, "Orientation"))
|
||||
header->Orientation = atoi(value);
|
||||
else if (!strcmp(name, "OutputFaceUp"))
|
||||
header->OutputFaceUp = !strcmp(value, "true");
|
||||
else if (!strcmp(name, "Separations"))
|
||||
header->Separations = !strcmp(value, "true");
|
||||
else if (!strcmp(name, "TraySwitch"))
|
||||
header->TraySwitch = !strcmp(value, "true");
|
||||
else if (!strcmp(name, "Tumble"))
|
||||
header->Tumble = !strcmp(value, "true");
|
||||
else if (!strcmp(name, "cupsMediaType"))
|
||||
if (strcmp(name, "cupsMediaType") == 0)
|
||||
header->cupsMediaType = atoi(value);
|
||||
else if (!strcmp(name, "cupsBitsPerColor"))
|
||||
else if (strcmp(name, "cupsBitsPerColor") == 0)
|
||||
header->cupsBitsPerColor = atoi(value);
|
||||
else if (!strcmp(name, "cupsColorOrder"))
|
||||
else if (strcmp(name, "cupsColorOrder") == 0)
|
||||
header->cupsColorOrder = (cups_order_t)atoi(value);
|
||||
else if (!strcmp(name, "cupsColorSpace"))
|
||||
else if (strcmp(name, "cupsColorSpace") == 0)
|
||||
header->cupsColorSpace = (cups_cspace_t)atoi(value);
|
||||
else if (!strcmp(name, "cupsCompression"))
|
||||
else if (strcmp(name, "cupsCompression") == 0)
|
||||
header->cupsCompression = atoi(value);
|
||||
else if (!strcmp(name, "cupsRowCount"))
|
||||
else if (strcmp(name, "cupsRowCount") == 0)
|
||||
header->cupsRowCount = atoi(value);
|
||||
else if (!strcmp(name, "cupsRowFeed"))
|
||||
else if (strcmp(name, "cupsRowFeed") == 0)
|
||||
header->cupsRowFeed = atoi(value);
|
||||
else if (!strcmp(name, "cupsRowStep"))
|
||||
else if (strcmp(name, "cupsRowStep") == 0)
|
||||
header->cupsRowStep = atoi(value);
|
||||
else if (strcmp(name, "CutMedia") == 0)
|
||||
header->CutMedia = (cups_cut_t)atoi(value);
|
||||
else if (strcmp(name, "HWResolution") == 0)
|
||||
sscanf(value, "%d%d", header->HWResolution + 0, header->HWResolution + 1);
|
||||
else if (strcmp(name, "cupsMediaPosition") == 0 || /* Compatibility */
|
||||
strcmp(name, "MediaPosition") == 0)
|
||||
header->MediaPosition = atoi(value);
|
||||
else if (strcmp(name, "MediaClass") == 0)
|
||||
strlcpy(header->MediaClass, value, sizeof(header->MediaClass));
|
||||
else if (strcmp(name, "MediaColor") == 0)
|
||||
strlcpy(header->MediaColor, value, sizeof(header->MediaColor));
|
||||
else if (strcmp(name, "MediaType") == 0)
|
||||
strlcpy(header->MediaType, value, sizeof(header->MediaType));
|
||||
else if (strcmp(name, "OutputType") == 0)
|
||||
strlcpy(header->OutputType, value, sizeof(header->OutputType));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+57
-63
@@ -81,6 +81,8 @@
|
||||
|
||||
int NumPages = 0; /* Number of pages in file */
|
||||
long Pages[MAX_PAGES]; /* Offsets to each page */
|
||||
char PageLabels[MAX_PAGES][64];
|
||||
/* Page labels */
|
||||
const char *PageRanges = NULL; /* Range of pages selected */
|
||||
const char *PageSet = NULL; /* All, Even, Odd pages */
|
||||
int Order = 0, /* 0 = normal, 1 = reverse pages */
|
||||
@@ -230,12 +232,11 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
}
|
||||
|
||||
if ((val = cupsGetOption("Collate", num_options, options)) != NULL &&
|
||||
(!strcasecmp(val, "true") ||!strcasecmp(val, "on") ||
|
||||
!strcasecmp(val, "yes")))
|
||||
strcasecmp(val, "True") == 0)
|
||||
Collate = 1;
|
||||
|
||||
if ((val = cupsGetOption("OutputOrder", num_options, options)) != NULL &&
|
||||
!strcasecmp(val, "Reverse"))
|
||||
strcasecmp(val, "Reverse") == 0)
|
||||
Order = 1;
|
||||
|
||||
if ((val = cupsGetOption("number-up", num_options, options)) != NULL)
|
||||
@@ -243,35 +244,35 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
if ((val = cupsGetOption("page-border", num_options, options)) != NULL)
|
||||
{
|
||||
if (!strcasecmp(val, "none"))
|
||||
if (strcasecmp(val, "none") == 0)
|
||||
Border = BORDER_NONE;
|
||||
else if (!strcasecmp(val, "single"))
|
||||
else if (strcasecmp(val, "single") == 0)
|
||||
Border = BORDER_SINGLE;
|
||||
else if (!strcasecmp(val, "single-thick"))
|
||||
else if (strcasecmp(val, "single-thick") == 0)
|
||||
Border = BORDER_SINGLE2;
|
||||
else if (!strcasecmp(val, "double"))
|
||||
else if (strcasecmp(val, "double") == 0)
|
||||
Border = BORDER_DOUBLE;
|
||||
else if (!strcasecmp(val, "double-thick"))
|
||||
else if (strcasecmp(val, "double-thick") == 0)
|
||||
Border = BORDER_DOUBLE2;
|
||||
}
|
||||
|
||||
if ((val = cupsGetOption("number-up-layout", num_options, options)) != NULL)
|
||||
{
|
||||
if (!strcasecmp(val, "lrtb"))
|
||||
if (strcasecmp(val, "lrtb") == 0)
|
||||
Layout = LAYOUT_LRTB;
|
||||
else if (!strcasecmp(val, "lrbt"))
|
||||
else if (strcasecmp(val, "lrbt") == 0)
|
||||
Layout = LAYOUT_LRBT;
|
||||
else if (!strcasecmp(val, "rltb"))
|
||||
else if (strcasecmp(val, "rltb") == 0)
|
||||
Layout = LAYOUT_RLTB;
|
||||
else if (!strcasecmp(val, "rlbt"))
|
||||
else if (strcasecmp(val, "rlbt") == 0)
|
||||
Layout = LAYOUT_RLBT;
|
||||
else if (!strcasecmp(val, "tblr"))
|
||||
else if (strcasecmp(val, "tblr") == 0)
|
||||
Layout = LAYOUT_TBLR;
|
||||
else if (!strcasecmp(val, "tbrl"))
|
||||
else if (strcasecmp(val, "tbrl") == 0)
|
||||
Layout = LAYOUT_TBRL;
|
||||
else if (!strcasecmp(val, "btlr"))
|
||||
else if (strcasecmp(val, "btlr") == 0)
|
||||
Layout = LAYOUT_BTLR;
|
||||
else if (!strcasecmp(val, "btrl"))
|
||||
else if (strcasecmp(val, "btrl") == 0)
|
||||
Layout = LAYOUT_BTRL;
|
||||
}
|
||||
|
||||
@@ -282,8 +283,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
b = atoi(val) * 0.01f;
|
||||
|
||||
if ((val = cupsGetOption("mirror", num_options, options)) != NULL &&
|
||||
(!strcasecmp(val, "true") ||!strcasecmp(val, "on") ||
|
||||
!strcasecmp(val, "yes")))
|
||||
strcasecmp(val, "True") == 0)
|
||||
Flip = 1;
|
||||
|
||||
/*
|
||||
@@ -387,7 +387,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
* Handle leading PJL fun...
|
||||
*/
|
||||
|
||||
while (!strncmp(line, "\033%-12345X", 9))
|
||||
while (strncmp(line, "\033%-12345X", 9) == 0)
|
||||
{
|
||||
/*
|
||||
* Yup, we have leading PJL fun, so copy it until we hit the line
|
||||
@@ -450,7 +450,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
*/
|
||||
|
||||
if (Duplex)
|
||||
puts("%%Requirements: duplex");
|
||||
puts("%%Requirements: duplex\n");
|
||||
|
||||
/*
|
||||
* Apple uses RBI comments for various non-PPD options...
|
||||
@@ -478,7 +478,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
fprintf(stderr, "DEBUG: slowcollate=%d, slowduplex=%d, sloworder=%d\n",
|
||||
slowcollate, slowduplex, sloworder);
|
||||
|
||||
if (!strncmp(line, "%!PS-Adobe-", 11) && !strstr(line, "EPSF"))
|
||||
if (strncmp(line, "%!PS-Adobe-", 11) == 0 && strstr(line, "EPSF") == NULL)
|
||||
{
|
||||
/*
|
||||
* OK, we have DSC comments and this isn't an EPS file; read until we
|
||||
@@ -495,7 +495,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
if (psgets(line, &len, fp) == NULL)
|
||||
break;
|
||||
|
||||
if (!strncmp(line, "%%", 2))
|
||||
if (strncmp(line, "%%", 2) == 0)
|
||||
fprintf(stderr, "DEBUG: %d %s", level, line);
|
||||
else if (line[0] != '%' && line[0] && !sent_espsp && UseESPsp)
|
||||
{
|
||||
@@ -509,18 +509,18 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
"userdict/showpage{}put");
|
||||
}
|
||||
|
||||
if (!strncmp(line, "%%BeginDocument:", 16) ||
|
||||
!strncmp(line, "%%BeginDocument ", 16)) /* Adobe Acrobat BUG */
|
||||
if (strncmp(line, "%%BeginDocument:", 16) == 0 ||
|
||||
strncmp(line, "%%BeginDocument ", 16) == 0) /* Adobe Acrobat BUG */
|
||||
{
|
||||
fputs(line, stdout);
|
||||
level ++;
|
||||
}
|
||||
else if (!strncmp(line, "%%EndDocument", 13) && level > 0)
|
||||
else if (strncmp(line, "%%EndDocument", 13) == 0 && level > 0)
|
||||
{
|
||||
fputs(line, stdout);
|
||||
level --;
|
||||
}
|
||||
else if (!strncmp(line, "%cupsRotation:", 14) && level == 0)
|
||||
else if (strncmp(line, "%cupsRotation:", 14) == 0 && level == 0)
|
||||
{
|
||||
/*
|
||||
* Reset orientation of document?
|
||||
@@ -535,7 +535,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
Orientation = orient;
|
||||
}
|
||||
}
|
||||
else if (!strncmp(line, "%%BeginProlog", 13) && level == 0)
|
||||
else if (strncmp(line, "%%BeginProlog", 13) == 0 && level == 0)
|
||||
{
|
||||
/*
|
||||
* Write the existing comment line, and then follow with patches
|
||||
@@ -550,7 +550,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
do_prolog(ppd);
|
||||
}
|
||||
}
|
||||
else if (!strncmp(line, "%%BeginSetup", 12) && level == 0)
|
||||
else if (strncmp(line, "%%BeginSetup", 12) == 0 && level == 0)
|
||||
{
|
||||
/*
|
||||
* Write the existing comment line, and then follow with document
|
||||
@@ -565,11 +565,11 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
do_setup(ppd, Copies, Collate, slowcollate, g, b);
|
||||
}
|
||||
}
|
||||
else if (!strncmp(line, "%%Page:", 7) && level == 0)
|
||||
else if (strncmp(line, "%%Page:", 7) == 0 && level == 0)
|
||||
break;
|
||||
else if (!strncmp(line, "%%BeginBinary:", 14) ||
|
||||
(!strncmp(line, "%%BeginData:", 12) &&
|
||||
!strstr(line, "ASCII") && !strstr(line, "Hex")))
|
||||
else if (strncmp(line, "%%BeginBinary:", 14) == 0 ||
|
||||
(strncmp(line, "%%BeginData:", 12) == 0 &&
|
||||
strstr(line, "ASCII") == NULL && strstr(line, "Hex") == NULL))
|
||||
{
|
||||
/*
|
||||
* Copy binary data...
|
||||
@@ -661,23 +661,23 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
|
||||
for (page = 1, real_page = 1;;)
|
||||
{
|
||||
if (!strncmp(line, "%%", 2))
|
||||
if (strncmp(line, "%%", 2) == 0)
|
||||
fprintf(stderr, "DEBUG: %d %s", level, line);
|
||||
|
||||
if (!strncmp(line, "%%BeginDocument:", 16) ||
|
||||
!strncmp(line, "%%BeginDocument ", 16)) /* Adobe Acrobat BUG */
|
||||
if (strncmp(line, "%%BeginDocument:", 16) == 0 ||
|
||||
strncmp(line, "%%BeginDocument ", 16) == 0) /* Adobe Acrobat BUG */
|
||||
level ++;
|
||||
else if (!strncmp(line, "%%EndDocument", 13) && level > 0)
|
||||
else if (strncmp(line, "%%EndDocument", 13) == 0 && level > 0)
|
||||
level --;
|
||||
else if (!strcmp(line, "\004") && len == 1)
|
||||
else if (strcmp(line, "\004") == 0)
|
||||
break;
|
||||
else if (!strncmp(line, "%%EOF", 5) && level == 0)
|
||||
else if (strncmp(line, "%%EOF", 5) == 0 && level == 0)
|
||||
{
|
||||
fputs("DEBUG: Saw EOF!\n", stderr);
|
||||
saweof = 1;
|
||||
break;
|
||||
}
|
||||
else if (!strncmp(line, "%%Page:", 7) && level == 0)
|
||||
else if (strncmp(line, "%%Page:", 7) == 0 && level == 0)
|
||||
{
|
||||
if (!check_range(real_page))
|
||||
{
|
||||
@@ -687,22 +687,22 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
if (psgets(line, &len, fp) == NULL)
|
||||
break;
|
||||
|
||||
if (!strncmp(line, "%%", 2))
|
||||
if (strncmp(line, "%%", 2) == 0)
|
||||
fprintf(stderr, "DEBUG: %d %s", level, line);
|
||||
|
||||
if (!strncmp(line, "%%BeginDocument:", 16) ||
|
||||
!strncmp(line, "%%BeginDocument ", 16)) /* Adobe Acrobat BUG */
|
||||
if (strncmp(line, "%%BeginDocument:", 16) == 0 ||
|
||||
strncmp(line, "%%BeginDocument ", 16) == 0) /* Adobe Acrobat BUG */
|
||||
level ++;
|
||||
else if (!strncmp(line, "%%EndDocument", 13) && level > 0)
|
||||
else if (strncmp(line, "%%EndDocument", 13) == 0 && level > 0)
|
||||
level --;
|
||||
else if (!strncmp(line, "%%Page:", 7) && level == 0)
|
||||
else if (strncmp(line, "%%Page:", 7) == 0 && level == 0)
|
||||
{
|
||||
real_page ++;
|
||||
break;
|
||||
}
|
||||
else if (!strncmp(line, "%%BeginBinary:", 14) ||
|
||||
(!strncmp(line, "%%BeginData:", 12) &&
|
||||
!strstr(line, "ASCII") && !strstr(line, "Hex")))
|
||||
else if (strncmp(line, "%%BeginBinary:", 14) == 0 ||
|
||||
(strncmp(line, "%%BeginData:", 12) == 0 &&
|
||||
strstr(line, "ASCII") == NULL && strstr(line, "Hex") == NULL))
|
||||
{
|
||||
/*
|
||||
* Skip binary data...
|
||||
@@ -755,9 +755,9 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
NumPages ++;
|
||||
real_page ++;
|
||||
}
|
||||
else if (!strncmp(line, "%%BeginBinary:", 14) ||
|
||||
(!strncmp(line, "%%BeginData:", 12) &&
|
||||
!strstr(line, "ASCII") && !strstr(line, "Hex")))
|
||||
else if (strncmp(line, "%%BeginBinary:", 14) == 0 ||
|
||||
(strncmp(line, "%%BeginData:", 12) == 0 &&
|
||||
strstr(line, "ASCII") == NULL && strstr(line, "Hex") == NULL))
|
||||
{
|
||||
/*
|
||||
* Copy binary data...
|
||||
@@ -792,7 +792,7 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
tbytes -= nbytes;
|
||||
}
|
||||
}
|
||||
else if (!strncmp(line, "%%Trailer", 9) && level == 0)
|
||||
else if (strncmp(line, "%%Trailer", 9) == 0 && level == 0)
|
||||
{
|
||||
fputs("DEBUG: Saw Trailer!\n", stderr);
|
||||
break;
|
||||
@@ -967,11 +967,11 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
if (psgets(line, &len, fp) == NULL)
|
||||
break;
|
||||
|
||||
if (!(!strcmp(line, "\004") && len == 1) &&
|
||||
if (strcmp(line, "\004") != 0 &&
|
||||
strncmp(line, "%%Pages:", 8) != 0)
|
||||
pswrite(line, len, stdout);
|
||||
|
||||
if (!strncmp(line, "%%EOF", 5))
|
||||
if (strncmp(line, "%%EOF", 5) == 0)
|
||||
{
|
||||
fputs("DEBUG: Saw EOF!\n", stderr);
|
||||
saweof = 1;
|
||||
@@ -1060,14 +1060,8 @@ main(int argc, /* I - Number of command-line arguments */
|
||||
{
|
||||
if (ppd->jcl_end)
|
||||
fputs(ppd->jcl_end, stdout);
|
||||
else
|
||||
{
|
||||
if (ppd->num_filters == 0)
|
||||
putchar(0x04);
|
||||
|
||||
if (Protocol == PROT_TBCP)
|
||||
fputs("\033%-12345X", stdout);
|
||||
}
|
||||
else if (ppd->num_filters == 0)
|
||||
putchar(0x04);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1107,9 +1101,9 @@ check_range(int page) /* I - Page number */
|
||||
* See if we only print even or odd pages...
|
||||
*/
|
||||
|
||||
if (!strcasecmp(PageSet, "even") && ((page - 1) % (NUp << 1)) < NUp)
|
||||
if (strcasecmp(PageSet, "even") == 0 && ((page - 1) % (NUp << 1)) < NUp)
|
||||
return (0);
|
||||
if (!strcasecmp(PageSet, "odd") && ((page - 1) % (NUp << 1)) >= NUp)
|
||||
if (strcasecmp(PageSet, "odd") == 0 && ((page - 1) % (NUp << 1)) >= NUp)
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
@@ -555,8 +555,8 @@ TextMain(const char *name, /* I - Name of filter */
|
||||
num_options = cupsParseOptions(argv[5], 0, &options);
|
||||
|
||||
if ((val = cupsGetOption("prettyprint", num_options, options)) != NULL &&
|
||||
strcasecmp(val, "no") && strcasecmp(val, "off") &&
|
||||
strcasecmp(val, "false"))
|
||||
strcasecmp(val, "no") != 0 && strcasecmp(val, "off") != 0 &&
|
||||
strcasecmp(val, "false") != 0)
|
||||
{
|
||||
PageLeft = 72.0f;
|
||||
PageRight = PageWidth - 36.0f;
|
||||
@@ -602,8 +602,7 @@ TextMain(const char *name, /* I - Name of filter */
|
||||
if ((val = cupsGetOption("wrap", num_options, options)) == NULL)
|
||||
WrapLines = 1;
|
||||
else
|
||||
WrapLines = !strcasecmp(val, "true") || !strcasecmp(val, "on") ||
|
||||
!strcasecmp(val, "yes");
|
||||
WrapLines = strcasecmp(val, "true") == 0;
|
||||
|
||||
if ((val = cupsGetOption("columns", num_options, options)) != NULL)
|
||||
PageColumns = atoi(val);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
.\"
|
||||
.\" "$Id: cupstestppd.man 3848 2003-08-01 19:42:43Z mike $"
|
||||
.\" "$Id: cupstestppd.man 3360 2003-02-14 20:01:26Z mike $"
|
||||
.\"
|
||||
.\" cupstestppd man page for the Common UNIX Printing System (CUPS).
|
||||
.\"
|
||||
@@ -21,15 +21,15 @@
|
||||
.\" EMail: cups-info@cups.org
|
||||
.\" WWW: http://www.cups.org
|
||||
.\"
|
||||
.TH cupstestppd 1 "Common UNIX Printing System" "1 August 2003" "Easy Software Products"
|
||||
.TH cupstestppd 1 "Common UNIX Printing System" "14 February 2003" "Easy Software Products"
|
||||
.SH NAME
|
||||
cupstestppd \- test conformance of ppd files
|
||||
.SH SYNOPSIS
|
||||
.B cupstestppd
|
||||
[ -q ] [-r] [ -v[v] ] filename.ppd[.gz] [ ... filenameN.ppd[.gz] ]
|
||||
[ -q ] [ -v[v] ] filename.ppd[.gz] [ ... filenameN.ppd[.gz] ]
|
||||
.br
|
||||
.B cupstestppd
|
||||
[ -q ] [-r] [ -v[v] ] -
|
||||
[ -q ] [ -v[v] ] -
|
||||
.SH DESCRIPTION
|
||||
\fIcupstestppd\fR tests the conformance of PPD files to the
|
||||
Adobe PostScript Printer Description file format specification
|
||||
@@ -43,10 +43,6 @@ on the standard input.
|
||||
.LP
|
||||
The \fI-q\fR option specifies that no information should be displayed.
|
||||
.LP
|
||||
The \fI-r\fR option relaxes the PPD conformance requirements so
|
||||
that common whitespace, control character, and formatting
|
||||
problems are not treated as hard errors.
|
||||
.LP
|
||||
The \fI-v\fR option specifies that detailed conformance testing
|
||||
results should be displayed rather than the concise PASS/FAIL/ERROR
|
||||
status.
|
||||
@@ -101,5 +97,5 @@ Adobe PostScript Printer Description File Format Specification, Version 4.3.
|
||||
.SH COPYRIGHT
|
||||
Copyright 1993-2003 by Easy Software Products, All Rights Reserved.
|
||||
.\"
|
||||
.\" End of "$Id: cupstestppd.man 3848 2003-08-01 19:42:43Z mike $".
|
||||
.\" End of "$Id: cupstestppd.man 3360 2003-02-14 20:01:26Z mike $".
|
||||
.\"
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Annot.h
|
||||
//
|
||||
// Copyright 2000-2003 Glyph & Cog, LLC
|
||||
// Copyright 2000-2002 Glyph & Cog, LLC
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
|
||||
+1
-16
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Array.cc
|
||||
//
|
||||
// Copyright 1996-2003 Glyph & Cog, LLC
|
||||
// Copyright 1996-2002 Glyph & Cog, LLC
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#pragma implementation
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include "gmem.h"
|
||||
#include "Object.h"
|
||||
@@ -47,23 +46,9 @@ void Array::add(Object *elem) {
|
||||
}
|
||||
|
||||
Object *Array::get(int i, Object *obj) {
|
||||
if (i < 0 || i >= length) {
|
||||
#ifdef DEBUG_MEM
|
||||
abort();
|
||||
#else
|
||||
return obj->initNull();
|
||||
#endif
|
||||
}
|
||||
return elems[i].fetch(xref, obj);
|
||||
}
|
||||
|
||||
Object *Array::getNF(int i, Object *obj) {
|
||||
if (i < 0 || i >= length) {
|
||||
#ifdef DEBUG_MEM
|
||||
abort();
|
||||
#else
|
||||
return obj->initNull();
|
||||
#endif
|
||||
}
|
||||
return elems[i].copy(obj);
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Array.h
|
||||
//
|
||||
// Copyright 1996-2003 Glyph & Cog, LLC
|
||||
// Copyright 1996-2002 Glyph & Cog, LLC
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// BuiltinFont.cc
|
||||
//
|
||||
// Copyright 2001-2003 Glyph & Cog, LLC
|
||||
// Copyright 2001-2002 Glyph & Cog, LLC
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// BuiltinFont.h
|
||||
//
|
||||
// Copyright 2001-2003 Glyph & Cog, LLC
|
||||
// Copyright 2001-2002 Glyph & Cog, LLC
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// BuiltinFontTables.cc
|
||||
//
|
||||
// Copyright 2001-2003 Glyph & Cog, LLC
|
||||
// Copyright 2001-2002 Glyph & Cog, LLC
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// BuiltinFontTables.h
|
||||
//
|
||||
// Copyright 2001-2003 Glyph & Cog, LLC
|
||||
// Copyright 2001-2002 Glyph & Cog, LLC
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// CMap.cc
|
||||
//
|
||||
// Copyright 2001-2003 Glyph & Cog, LLC
|
||||
// Copyright 2001-2002 Glyph & Cog, LLC
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// CMap.h
|
||||
//
|
||||
// Copyright 2001-2003 Glyph & Cog, LLC
|
||||
// Copyright 2001-2002 Glyph & Cog, LLC
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Catalog.cc
|
||||
//
|
||||
// Copyright 1996-2003 Glyph & Cog, LLC
|
||||
// Copyright 1996-2002 Glyph & Cog, LLC
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Catalog.h
|
||||
//
|
||||
// Copyright 1996-2003 Glyph & Cog, LLC
|
||||
// Copyright 1996-2002 Glyph & Cog, LLC
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// CharCodeToUnicode.cc
|
||||
//
|
||||
// Copyright 2001-2003 Glyph & Cog, LLC
|
||||
// Copyright 2001-2002 Glyph & Cog, LLC
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
//
|
||||
// Mapping from character codes to Unicode.
|
||||
//
|
||||
// Copyright 2001-2003 Glyph & Cog, LLC
|
||||
// Copyright 2001-2002 Glyph & Cog, LLC
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// CharTypes.h
|
||||
//
|
||||
// Copyright 2001-2003 Glyph & Cog, LLC
|
||||
// Copyright 2001-2002 Glyph & Cog, LLC
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// CompactFontTables.h
|
||||
//
|
||||
// Copyright 1999-2003 Glyph & Cog, LLC
|
||||
// Copyright 1999-2002 Glyph & Cog, LLC
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Decrypt.cc
|
||||
//
|
||||
// Copyright 1996-2003 Glyph & Cog, LLC
|
||||
// Copyright 1996-2002 Glyph & Cog, LLC
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Decrypt.h
|
||||
//
|
||||
// Copyright 1996-2003 Glyph & Cog, LLC
|
||||
// Copyright 1996-2002 Glyph & Cog, LLC
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
|
||||
@@ -73,11 +73,10 @@ PDFDoc.o: Object.h gmem.h Array.h Dict.h Stream.h Catalog.h XRef.h Link.h
|
||||
PDFDoc.o: OutputDev.h Error.h ErrorCodes.h Lexer.h Parser.h Outline.h
|
||||
PDFDoc.o: PDFDoc.h
|
||||
PDFDocEncoding.o: PDFDocEncoding.h CharTypes.h
|
||||
PSOutputDev.o: ../config.h GString.h GList.h gtypes.h GlobalParams.h
|
||||
PSOutputDev.o: CharTypes.h Object.h gmem.h Array.h Dict.h Stream.h Error.h
|
||||
PSOutputDev.o: Function.h Gfx.h GfxState.h GfxFont.h CharCodeToUnicode.h
|
||||
PSOutputDev.o: UnicodeMap.h FontFile.h Catalog.h Page.h Annot.h PSOutputDev.h
|
||||
PSOutputDev.o: OutputDev.h
|
||||
PSOutputDev.o: ../config.h GString.h GlobalParams.h gtypes.h CharTypes.h
|
||||
PSOutputDev.o: Object.h gmem.h Array.h Dict.h Stream.h Error.h Function.h
|
||||
PSOutputDev.o: Gfx.h GfxState.h GfxFont.h CharCodeToUnicode.h UnicodeMap.h
|
||||
PSOutputDev.o: FontFile.h Catalog.h Page.h Annot.h PSOutputDev.h OutputDev.h
|
||||
PSTokenizer.o: ../config.h PSTokenizer.h gtypes.h
|
||||
Stream.o: ../config.h gmem.h gfile.h gtypes.h Error.h Object.h GString.h
|
||||
Stream.o: Array.h Dict.h Stream.h Decrypt.h JBIG2Stream.h Stream-CCITT.h
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Dict.cc
|
||||
//
|
||||
// Copyright 1996-2003 Glyph & Cog, LLC
|
||||
// Copyright 1996-2002 Glyph & Cog, LLC
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Dict.h
|
||||
//
|
||||
// Copyright 1996-2003 Glyph & Cog, LLC
|
||||
// Copyright 1996-2002 Glyph & Cog, LLC
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// DisplayFontTable.h
|
||||
//
|
||||
// Copyright 2001-2003 Glyph & Cog, LLC
|
||||
// Copyright 2001-2002 Glyph & Cog, LLC
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
|
||||
+3
-3
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Error.cc
|
||||
//
|
||||
// Copyright 1996-2003 Glyph & Cog, LLC
|
||||
// Copyright 1996-2002 Glyph & Cog, LLC
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
@@ -26,9 +26,9 @@ void CDECL error(int pos, const char *msg, ...) {
|
||||
return;
|
||||
}
|
||||
if (pos >= 0) {
|
||||
fprintf(stderr, "ERROR: (%d) ", pos);
|
||||
fprintf(stderr, "Error (%d): ", pos);
|
||||
} else {
|
||||
fprintf(stderr, "ERROR: ");
|
||||
fprintf(stderr, "Error: ");
|
||||
}
|
||||
va_start(args, msg);
|
||||
vfprintf(stderr, msg, args);
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Error.h
|
||||
//
|
||||
// Copyright 1996-2003 Glyph & Cog, LLC
|
||||
// Copyright 1996-2002 Glyph & Cog, LLC
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// ErrorCodes.h
|
||||
//
|
||||
// Copyright 2002-2003 Glyph & Cog, LLC
|
||||
// Copyright 2002 Glyph & Cog, LLC
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
@@ -21,6 +21,4 @@
|
||||
#define errEncrypted 4 // file was encrypted and password was
|
||||
// incorrect or not supplied
|
||||
|
||||
#define errHighlightFile 5 // nonexistent or invalid highlight file
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// FontEncodingTables.cc
|
||||
//
|
||||
// Copyright 2001-2003 Glyph & Cog, LLC
|
||||
// Copyright 2001-2002 Glyph & Cog, LLC
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// FontEncodingTables.h
|
||||
//
|
||||
// Copyright 2001-2003 Glyph & Cog, LLC
|
||||
// Copyright 2001-2002 Glyph & Cog, LLC
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
|
||||
+533
-817
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+15
-23
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// FontFile.h
|
||||
//
|
||||
// Copyright 1999-2003 Glyph & Cog, LLC
|
||||
// Copyright 1999-2002 Glyph & Cog, LLC
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
@@ -75,7 +75,6 @@ public:
|
||||
|
||||
Type1CFontFile(const char *fileA, int lenA);
|
||||
virtual ~Type1CFontFile();
|
||||
GBool isOk() { return ok; }
|
||||
|
||||
virtual const char *getName();
|
||||
virtual const char **getEncoding();
|
||||
@@ -98,14 +97,14 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
void readEncoding();
|
||||
void readNameAndEncoding();
|
||||
void readTopDict(Type1CTopDict *dict);
|
||||
void readPrivateDict(Type1CPrivateDict *privateDict,
|
||||
int offset, int size);
|
||||
Gushort *readCharset(int charset, int nGlyphs);
|
||||
void eexecWrite(const char *s);
|
||||
void eexecCvtGlyph(const char *glyphName, int pos, int n);
|
||||
void cvtGlyph(int pos, int n, GBool top);
|
||||
void eexecCvtGlyph(const char *glyphName, Guchar *s, int n);
|
||||
void cvtGlyph(Guchar *s, int n);
|
||||
void cvtGlyphWidth(GBool useOp);
|
||||
void eexecDumpNum(double x, GBool fpA);
|
||||
void eexecDumpOp1(int opA);
|
||||
@@ -113,33 +112,29 @@ private:
|
||||
void eexecWriteCharstring(Guchar *s, int n);
|
||||
void getDeltaInt(char *buf, const char *key, double *opA, int n);
|
||||
void getDeltaReal(char *buf, const char *key, double *opA, int n);
|
||||
int getIndexLen(int indexPos);
|
||||
int getIndexValPos(int indexPos, int i, int *valLen);
|
||||
int getIndexEnd(int indexPos);
|
||||
Guint getWord(int pos, int size);
|
||||
double getNum(int *pos, GBool *fp);
|
||||
int getIndexLen(Guchar *indexPtr);
|
||||
Guchar *getIndexValPtr(Guchar *indexPtr, int i);
|
||||
Guchar *getIndexEnd(Guchar *indexPtr);
|
||||
Guint getWord(Guchar *ptr, int size);
|
||||
double getNum(Guchar **ptr, GBool *fp);
|
||||
char *getString(int sid, char *buf);
|
||||
|
||||
const Guchar *file;
|
||||
const char *file;
|
||||
int len;
|
||||
|
||||
GString *name;
|
||||
char **encoding;
|
||||
|
||||
int topDictIdxPos;
|
||||
int stringIdxPos;
|
||||
int gsubrIdxPos;
|
||||
int subrIdxPos;
|
||||
int gsubrBias;
|
||||
int subrBias;
|
||||
int topOffSize;
|
||||
Guchar *topDictIdxPtr;
|
||||
Guchar *stringIdxPtr;
|
||||
Guchar *gsubrIdxPtr;
|
||||
|
||||
FontFileOutputFunc outputFunc;
|
||||
void *outputStream;
|
||||
double op[48]; // operands
|
||||
GBool fp[48]; // true if operand is fixed point
|
||||
int nOps; // number of operands
|
||||
int nHints; // number of hints for the current glyph
|
||||
GBool firstOp; // true if we haven't hit the first op yet
|
||||
double defaultWidthX; // default glyph width
|
||||
double nominalWidthX; // nominal glyph width
|
||||
GBool defaultWidthXFP; // true if defaultWidthX is fixed point
|
||||
@@ -147,8 +142,6 @@ private:
|
||||
Gushort r1; // eexec encryption key
|
||||
GString *charBuf; // charstring output buffer
|
||||
int line; // number of eexec chars on current line
|
||||
|
||||
GBool ok;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
@@ -178,7 +171,6 @@ public:
|
||||
void convertToType42(const char *name, const char **encodingA,
|
||||
CharCodeToUnicode *toUnicode,
|
||||
GBool pdfFontHasEncoding,
|
||||
GBool pdfFontIsSymbolic,
|
||||
FontFileOutputFunc outputFunc, void *outputStream);
|
||||
|
||||
// Convert to a Type 2 CIDFont, suitable for embedding in a
|
||||
@@ -225,7 +217,7 @@ private:
|
||||
void cvtEncoding(const char **encodingA, GBool pdfFontHasEncoding,
|
||||
FontFileOutputFunc outputFunc, void *outputStream);
|
||||
void cvtCharStrings(const char **encodingA, CharCodeToUnicode *toUnicode,
|
||||
GBool pdfFontHasEncoding, GBool pdfFontIsSymbolic,
|
||||
GBool pdfFontHasEncoding,
|
||||
FontFileOutputFunc outputFunc, void *outputStream);
|
||||
int getCmapEntry(int cmapFmt, int pos, int code);
|
||||
void cvtSfnts(FontFileOutputFunc outputFunc, void *outputStream,
|
||||
|
||||
Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais
Referência em uma Nova Issue
Bloquear um usuário