Comparar commits

..

1 Commits

Autor SHA1 Mensagem Data
msweet b28f92ab0e Import cups.org releases
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/tags/release-1.1.5.2@4306 a1ca3aef-8c08-0410-bb20-df032aa958be
2013-05-10 18:56:23 +00:00
432 arquivos alterados com 64335 adições e 163670 exclusões
+1 -430
Ver Arquivo
@@ -1,435 +1,6 @@
CHANGES.txt - 05/22/2001
CHANGES.txt - 01/03/2000
------------------------
CHANGES IN CUPS V1.1.8
- Updated configure script to check for /etc/pam.d and
to only set PAMDIR if it exists.
- Updated spec file to generate separate cups-pstoraster
package for pstoraster.
- The spec file wasn't setting LOGDIR in the install.
- The scheduler might restart a stopped printer after
stopping a print job. Thanks to Florent
Guiliani for finding this bug!
- The init script showed run level 0 for the Red Hat
chkconfig program. This is incorrect because Red Hat
doesn't use run level 0 for shutdown scripts.
- The IPP backend did not handle the
client-error-not-found error when checking the status
of the job that was sent. This caused remote queues
to stop on client machines when the server had job
history disabled.
- Added httpConnectEncrypt() function to avoid
performance penalty for setting up encrypted
connections initially.
- Use httpConnectEncrypt() in all client apps and in the
CUPS API to ensure consistent usage of encryption
throughout.
- Jobs weren't queued to remote classes (fix from
Richard Begg.)
- AIX changes from Richard Begg.
- Fixed the pstops fix for GNOME output - no longer use
the page numbers in the %%Page: comment since GNOME
puts a filename instead (!?@!#?!). There is still an
issue with N-up printing since GNOME defines its fonts
in the first page instead of the document setup section
(pages must be independent according to the DSC spec)
People with GNOME printing problems should consult bug
#54489...
- The imagetops filter produced PAGE: messages when
generating PostScript for a non-PostScript printer
(only affects page-label and Classification
options.)
- The updated pdftops filter was looking for an options
file called xpdf.conf instead of pdftops.conf.
- The scheduler would not force the default job sheets
for printers to the current classification setting.
- Added a new ippFindNextAttribute() function to the
CUPS API.
- ppdEmitJCL() now strips any leading path info from
the title string. This is only an issue for non-CUPS
clients that don't do this already...
- Other pstops fixed from Helge Blischke for printing
non-conforming documents.
- The MaxJobs parameter was not reset when loading the
cupsd.conf file.
CHANGES IN CUPS V1.1.7
- Configuration script changes, including new
"--with-docdir=/dir" option to relocate CUPS
documentation and web content according to your
favorite version of the FHS.
- Documentation updates for encryption, SLP, etc.
- New Software Test Plan and automated test script to
test CUPS prior to installation.
- All scheduler configuration files are now case
insensitive to match Apache.
- Added support for Apache ListenBackLog, LogFormat,
Require, UseCanonicalName, Satisfy, <Limit>,
<LimitExcept>, LimitRequestSize, and Options
directives.
- Added support for all Apache log levels...
- Added support for "double" HostNameLookups.
- Added new "RunAsUser" directive to support non-root
configurations on the standard (priviledged) ports.
- Added support for non-root invocation of the lpd
backend (does no reserve a priviledged port, which
might not work with some LPD servers...)
- Added new PrintcapFormat directive to control the
output format of the printcap file (BSD or Solaris
formats are supported at present.)
- The CUPS directory service routines now handle
ECONNREFUSED errors gracefully rather than shutting
all browsing off.
- ippErrorString() now returns the recommended error
messages from the IPP/1.1 Model and Semantics
document.
- Fixed a minor IPP compliance issue with responses
to requests without the attributes-charset or
attributes-natural-language attributes.
- Sun fix: need httpFlush() call for chunked IPP
requests in cupsDoFileRequest().
- httpConnect() now looks up "localhost" by name and
by address (127.0.0.1) for users the go to the
trouble of removing the required localhost entry
in /etc/hosts or on their DNS server...
- Added support for Linux 2.4.x devfs parallel port
filenames (/dev/parallel/N).
- cupsDo[File]Request() and cupsGetPPD() no longer
block trying to reconnect to a crashed or inaccessable
server.
- Added new ppdEmitJCL() function to better handle
PJL commands from PPD files.
- A bug in UpdateJob() would cause the scheduler to
consume 100% CPU until another request was submitted.
- The cancel command did not support the "-" option to
cancel all jobs on all printers.
- The cancel and lprm commands did not support cancelling
the next/current job in the queue.
- The pdftops and pstoraster filters were using unsafe
temporary file functions; while this is not a problem
in normal configurations (the CUPS temporary directory
is restricted), they now use the cupsTempFd() function.
- The mime.types file was missing the recognition rule
for Sun Raster images.
- The admin CGI was passing a printer make string to
ippSetCGIVars() that was being replaced in that
function.
- "lpoptions -l" would resave the options...
- The EPSON drivers now send the "end packet mode"
command when printing to USB devices.
- The scheduler initialized certificates before loading
the cupsd.conf file.
- The scheduler used /dev/random to collect random data,
which could block if insufficient entropy information
had been collected by the kernel. Now use
/dev/urandom.
- Fixed a bug in the whitespace skipping code in
httpGetSubField().
- The LPD backend now supports a new "order" option:
"lpd://server/queue?order=control,data" (default) and
"lpd://server/queue?order=data,control".
- The scheduler enforced a 30 second timeout on all
clients regardless of the Timeout directive and if a
CGI was currently running.
- cupsParseOptions() now sets boolean options to
option=true or option=false.
- The "percent complete" calculations in the LPD backend
could overflow on large files, causing the percentage
to wrap to 0 every 40MB or so.
- Fixed a memory reallocation bug in pstoraster that
could cause it to crash.
- The LPD backend now sanitizes the job title to avoid
potential problems on remote LPD servers.
- The lp command did not send the requesting-user-name
attribute when altering a job.
- The pstops filter did not handle PostScript files with
lines longer than 8191 bytes.
- The scheduler no longer uses inet_addr() to convert IP
addresses in dot format (mmm.nnn.ooo.ppp) to the
32-bit format, since it will not work for IPv6
addresses.
- New "Classification" directive to force labeling of
the current classification on each page.
- New "page-label" attribute to add per-page labels
("For Official Use Only", "Draft", etc.)
- The scheduler now sets the HTTPS environment variable
for CGI programs when a client connects using
encryption.
- Fixed a recursion bug in the scheduler that could
cause cupsd to crash when a printer was removed.
- The LPDEST and PRINTER environment variables didn't
support instances.
- Dropped the "file" backend from the device list that
is reported, since it is only available for *testing*
and should never be used in a production environment.
The file: device can still be used, but it won't show
up in the list of devices from lpinfo or the web
interface.
- Added support for /dev/lpa# parallel ports under *BSD.
- Added META variables to the CGI header template to
prevent caching of the results.
- Fixed an unaligned memory buffer for the pstoraster
clist states; this caused bus errors for some
combinations of printers, drivers, and options.
- Re-added black reduction for colorful colors; this
helps to prevent dark colors from getting desaturated.
(only used when converting RGB to CMYK)
- Added two new directives - MaxJobsPerPrinter and
MaxJobsPerUser - to allow an administrator to set
the maximum number of pending jobs in a queue or
submitted by a user.
- The scheduler no longer stops a printer if it can't
create the status pipe or run the filters or backend.
This will allow heavily loaded servers to service
clients or start print jobs as the load allows.
- Fixed a bug in the Set-Job-Attributes code that could
crash the scheduler (patch from Martin Zielinski)
- cupsSetDests() did not quote option values with
embedded spaces.
- Added support for the Enable-Printer and
Disable-Printer extension operations (same as
CUPS-Accept-Jobs and CUPS-Reject-Jobs.)
- The AppSocket and IPP backends now wait for the print
job to be finished before exiting; this should prevent
the loss of print jobs with older JetDirect firmware
and make consecutive print jobs print faster.
- The BMP loading code did not handle resolution values
of 0. This is a problem with BMP image files produced
by the GIMP.
- The HTTP Upgrade code (upgrade to TLS encryption)
bypassed the authentication checks.
- The HTTP Upgrade code did not send a 426 status code
to the client and end the current request. This caused
a race condition between the client and server for the
upgrade to TLS.
- Fixed a bug in the EOF and Trailer detection code in
the pstops filter.
- The imagetoraster filter did not add the margins to
the custom page size in the raster header.
- The imagetops filter did not adjust the custom page
size to the size of the printed image.
- The imagetops filter did not include DSC comments
which are required by some printers.
- The imagetops filter did not insert newlines in
Base85 encoded output, causing files to contain
lines longer than 255 characters (violation of the
DSC).
- Added support for the DeskJet 900 series duplexer
and CRET color modes in the HP driver.
- Added support for PPD-defined margins in the HP
driver.
- Fixed the debugging output from pstoraster - the
font list was not terminated by a newline.
- Some versions of the HP-UX pam_unix authentication
module apparently do not pass the appdata_ptr argument
to the conversation function, preventing the scheduler
from authenticating users using PAM under HP-UX. A
workaround using a static variable has been added to
address this problem.
- Fixed a bug in the scheduler SortPrinters() function
that could cause printers to disappear or the
scheduler to crash when adding a printer.
- Changed the pstops filter to not do per-page filtering
if the file does not conform to at least version 3.0
of the document structuring conventions. This seems
to "fix" printing with broken apps.
- The image filters did not handle older TIFF files that
lacked the samples-per-pixel and bits-per-pixel tags.
- Added new cupsGetJobs() and cupsFreeJobs() functions
to manage print jobs.
- cupsEncodeOptions() would encode names of 0 length and
cupsAddOption() and cupsParseOptions() would add names
of 0 length.
- The scheduler might block waiting for status messages
after starting a new print job. Thanks to Florent
Guiliani for finding this bug!
CHANGES IN CUPS V1.1.6-3
- The configure script put the JPEG library before the
TIFF library; this caused problems in some
configurations since the TIFF library also supports
JPEG compression of TIFF images.
- Updated the configure script and makefiles to handle
admin man pages with the "1m" extension (HP-UX, IRIX,
Solaris, Tru64) and in odd directories (IRIX)
- The updated cupsTempFile() function did not return
the filename when called with a filename buffer of
NULL (previously it used a static buffer.)
- FreeBSD uses /dev/unlptN, but NetBSD and OpenBSD use
/dev/ulptN.
- DeletePrinter() didn't remove the printer from any
classes it was a member of.
- DeletePrinterFromClass() didn't preserve the
implicit status of a class.
- DeletePrinterFromClasses() didn't remove printers
from implicit classes.
- StartJob() didn't send the job-sheets, job-priority,
and job-hold-until attributes to remote printers.
- LoadAllJobs() was looking for job-sheets-completed
instead of job-media-sheets-completed. This would
prevent accumulation of page data after a restart
of the scheduler.
- The pstops and imagetops filters now generate copies
using the appropriate method for a Level 1, 2, or 3
printer since some Level 2/3 printers don't support
the /#copies variable anymore.
- The man page for cups-lpd did not mention the "-o"
option.
- The IPP backend didn't handle version-not-supported
errors and revert to IPP/1.0 (previously it only checked
for a bad-request error)
- Caldera fix: lpc now reports unimplemented commands as
unimplemented, not invalid.
- Caldera fix: lpq didn't recognize BSD lpq "-a" option.
- Caldera fix: lpr didn't recognize BSD lpr "-1", "-2",
"-3", "-4", "-q", or "-U" options.
- RedHat fixes: patches to GNU Ghostscript
- SuSE fix: temp file creation patch to GNU Ghostscript
(pstoraster).
- SuSE fix: remove cgi-bin/abort.c and cgi-bin/email.c,
which are not used.
- SuSE fix: missing NULL check in cgi_initialize_post().
- SuSE fix: potential buffer overflows in
cgi_initialize_string().
- SuSE fix: potential buffer overflows in
ippSetCGIVars()
- SuSE fix: more NULL checks in ppdOpen(); also make
sure that all memory is freed on error to avoid memory
leaks.
- SuSE fix: Exit from child if setgid() or setuid()
fails.
- SuSE fix: Added setgroups() calls after setgid() and
setuid() calls.
- SuSE fix: potential buffer overflows in httpEncode64()
calls.
- SuSE fix: potential buffer overflows in httpSeparate()
- SuSE fix: potential buffer overflows in ippWrite() for
bad input.
- SuSE fix: potential nul skip in ppd_decode() for
missing hex digits.
CHANGES IN CUPS V1.1.6-2
- Added changes to support NetBSD startup scripts.
- Added separate compiler options for pstoraster
(Ghostscript) to avoid compiler-induced errors
from Ghostscript's twisted code.
- The mime.types file contained syntax errors.
- Updated the *BSD USB device filenames to use
the /dev/unlptN files so that the USB device
is not reset prior to printing (causes print
corruption on many printers)
- Added new cupsTempFd() function to avoid serious
security bug in glibc fopen() function. The glibc
fopen() function unlinks a file before creating it,
which opens up possible symlink attacks.
- Now reject 0-length names in add-printer and add-class
requests.
- Fix for pstoraster when ZLIB is not available.
- cupsGetPPD() didn't reconnect when a HTTP connection
was lost.
- SuSE fix: httpConnect() didn't check that the
value from gethostbyname() was a valid IPv4 address.
- SuSE fix: httpConnect() didn't allow file descriptor 0
to be used for a socket.
- SuSE fix: ippRead() didn't confirm that all values in
a set were numeric or string types.
- SuSE fix: lppasswd race condition fixes.
- SuSE fix: directive names could overflow buffer when
reading *.conf files.
- SuSE fix: HEAD requests for PPD files did not use the
same logic as GET requests.
- SuSE fix: possible buffer overflow when adding
/index.html to requested directory name.
- SuSE fix: possible buffer overflow when converting
IPP attributes to string options for filters.
- SuSE fix: creating file: device output with mode 0666
instead of mode 0600.
- SuSE fix: creating job info files with mode 0640
instead of 0600.
- SuSE fix: don't rely on snprintf() for including
system name in log filenames.
- SuSE fix: add bounds checking when copying quoted
and hex strings.
CHANGES IN CUPS V1.1.6-1
- Added configure check for getting the correct
strftime() format string; %c is not Y2k safe,
and %KC and NULL are not universally supported.
CHANGES IN CUPS V1.1.6
- Fixed another possible DoS attack in httpGets()
- Added check for "LANGUAGE = PCL" and "LANGUAGE =
POSTSCRIPT" in mime.types.
- Resolution options were not being passed into the
filter programs properly.
- The default compiler options for GCC no longer include
"-g3", which apparently is deprecated in newer
versions of GCC.
- CheckJobs() could cause cupsd to crash if a job is
cancelled in StartJob().
- The printers.conf and classes.conf files are now
written with restricted permissions.
- The round-robin algorithm used by FindAvailablePrinter()
had problems; fixes contributed by Joel Fredrikson.
- If LoadAllJobs() is unable to determine the file type
of a print job, assume "application/vnd.cups-raw".
- The web interface now provides a job_printer_name
value for any corresponding job_printer_uri value.
- The cups-lpd mini-daemon now logs the client address
and hostname as well as all commands and errors in the
syslog file.
- The IPP backend now detects the supported file formats
and only specifies the document format if it is
supported. This makes IPP printing to network print
servers and cards more reliable without affecting the
capabilities of CUPS servers.
- The time_at_xyz attributes are now converted to human-
readable dates and times for the web interfaces.
- The HP and EPSON sample drivers now correctly catch
signals and eject the current page when a job is
cancelled.
- Fixed bug in CGI code - did not ignore control
characters (e.g. newlines) in form data. This caused
sporatic web interface problems.
- The file type logging code in the scheduler referenced
the optional document-format attribute; the new code
uses the resolved MIME type instead.
- The client.conf parsing code now removes trailing
whitespace.
- The MaxJobs directive was being treated as a boolean
instead of an integer.
- The scheduler would not timeout remote printers if
BrowseInterval was set to 0.
- The lpadmin command now supports setting of options
and user-level access control.
- Added "-E" option to all printing commands to force
encryption.
- The client code did not consume the response to the
OPTIONS request when switching to secure mode.
- The scheduler did not output a Content-Length field
when responding to an OPTIONS request.
- Added documentation on using cups-lpd with xinetd
to the man page.
- The socket backend now starts retries at 5 seconds and
increases the interval to 30 seconds. This should
provide faster printing when multiple jobs/files are
queued for a printer.
- The filters and backends no longer buffer output to
stderr. This should provide much more accurate status
reporting.
CHANGES IN CUPS V1.1.5-2
- Fixed configure check for OpenSSL to work with RSA
+5 -14
Ver Arquivo
@@ -1,4 +1,4 @@
ENCRYPTION - CUPS v1.1.7 - 02/21/2001
ENCRYPTION - CUPS v1.1.5 - 12/20/2000
-------------------------------------
This file describes the encryption support provided by CUPS.
@@ -37,12 +37,9 @@ Stick with "https" for web browsers.
The current implementation is very basic. The CUPS client
software (lp, lpr, etc.) uses encryption as requested by the
user or server.
The user can specify the "-E" option with the printing commands
to force encryption of the connection. Encryption can also be
specified using the Encryption directive in the client.conf file
or in the CUPS_ENCRYPTION environment variable:
server and/or as specified by the Encryption directive in the
client.conf file or in the CUPS_ENCRYPTION environment
variable:
Never
@@ -63,18 +60,12 @@ or in the CUPS_ENCRYPTION environment variable:
connection is made. This is different than the "Always"
mode above since the connection is initially unsecure
and the client initiates the upgrade to TLS encryption.
(same as using the "-E" option)
These keywords are also used in the cupsd.conf file to secure
particular locations. To secure all traffic on the server, listen
on port 443 (https port) instead of port 631 and change the "ipp"
service listing (or add it if you don't have one) in /etc/services
to 443. To provide both secure and normal methods, add a line
reading:
SSLPort 443
to /etc/cups/cupsd.conf.
to 443.
BEFORE YOU BEGIN
+1 -4
Ver Arquivo
@@ -1,4 +1,4 @@
INSTALL - CUPS v1.1.7 - 05/01/2001
INSTALL - CUPS v1.1.5 - 12/20/2000
----------------------------------
This file describes how to compile and install CUPS from source
@@ -72,9 +72,6 @@ SSL and TLS support require the OpenSSL library, available at:
http://www.openssl.org
See the file "ENCRYPTION.txt" for information on using the
encryption support in CUPS.
Once you have configured things, just type:
make ENTER
+2 -2
Ver Arquivo
@@ -7,11 +7,11 @@
<H2 ALIGN="CENTER">Common UNIX Printing System License Agreement</H2>
<P ALIGN="CENTER">Copyright 1997-2001 by Easy Software Products<BR>
<P ALIGN="CENTER">Copyright 1997-2000 by Easy Software Products<BR>
44141 AIRPORT VIEW DR STE 204<BR>
HOLLYWOOD, MARYLAND 20636-3111 USA<BR>
<BR>
Voice: +1.301.373.9600<BR>
Voice: +1.301.373.9603<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>
+7 -10
Ver Arquivo
@@ -3,7 +3,7 @@
#
# Common makefile definitions for the Common UNIX Printing System (CUPS).
#
# Copyright 1997-2001 by Easy Software Products, all rights reserved.
# Copyright 1997-2000 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
# property of Easy Software Products and are protected by Federal
@@ -76,9 +76,8 @@ LIBZ = @LIBZ@
#
ARFLAGS = crvs
CFLAGS = @CFLAGS@ -I.. $(OPTIONS)
CXXFLAGS = @CXXFLAGS@ -I.. $(OPTIONS)
DSOFLAGS = @DSOFLAGS@
CFLAGS = @CFLAGS@ $(OPTIM) -I.. $(OPTIONS)
CXXFLAGS = @CXXFLAGS@ $(OPTIM) -I.. $(OPTIONS)
DSOLIBS = @DSOLIBS@
IMGLIBS = @IMGLIBS@ -lm
LDFLAGS = @LDFLAGS@ $(OPTIM)
@@ -119,7 +118,6 @@ srcdir = @srcdir@
sysconfdir = @sysconfdir@
top_srcdir = @top_srcdir@
AMANDIR = @AMANDIR@
BINDIR = @bindir@
DATADIR = @CUPS_DATADIR@
DOCDIR = @CUPS_DOCROOT@
@@ -139,21 +137,20 @@ SERVERROOT = @CUPS_SERVERROOT@
CAT1EXT = @CAT1EXT@
CAT5EXT = @CAT5EXT@
CAT8EXT = @CAT8EXT@
MAN8EXT = @MAN8EXT@
#
# Rules...
#
.SILENT:
.SUFFIXES: .a .c .cxx .h .man .o .0 .1 .1m .5 .8 .z
.SUFFIXES: .a .c .cxx .h .man .o .0 .1 .5 .8 .z
.c.o:
echo Compiling $<...
$(CC) $(OPTIM) $(CFLAGS) -c $<
$(CC) $(CFLAGS) -c $<
.cxx.o:
echo Compiling $<...
$(CXX) $(OPTIM) $(CXXFLAGS) -c $<
.man.0 .man.1 .man.1m .man.5 .man.8:
$(CXX) $(CXXFLAGS) -c $<
.man.0 .man.1 .man.5 .man.8:
echo Formatting $<...
$(RM) $@
$(NROFF) -man $< >$@
+1 -21
Ver Arquivo
@@ -3,7 +3,7 @@
#
# Top-level Makefile for the Common UNIX Printing System (CUPS).
#
# Copyright 1997-2001 by Easy Software Products, all rights reserved.
# Copyright 1997-2000 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
# property of Easy Software Products and are protected by Federal
@@ -83,9 +83,6 @@ install:
$(MKDIR) $(prefix)/$(INITDIR)/rc0.d; \
$(RM) $(prefix)/$(INITDIR)/rc0.d/K00cups; \
ln -s $(INITDDIR)/cups $(prefix)/$(INITDIR)/rc0.d/K00cups; \
$(MKDIR) $(prefix)/$(INITDIR)/rc2.d; \
$(RM) $(prefix)/$(INITDIR)/rc2.d/S99cups; \
ln -s $(INITDDIR)/cups $(prefix)/$(INITDIR)/rc2.d/S99cups; \
$(MKDIR) $(prefix)/$(INITDIR)/rc3.d; \
$(RM) $(prefix)/$(INITDIR)/rc3.d/S99cups; \
ln -s $(INITDDIR)/cups $(prefix)/$(INITDIR)/rc3.d/S99cups; \
@@ -93,29 +90,12 @@ install:
$(RM) $(prefix)/$(INITDIR)/rc5.d/S99cups; \
ln -s $(INITDDIR)/cups $(prefix)/$(INITDIR)/rc5.d/S99cups; \
fi
if test "x$(INITDIR)" = "x" -a "x$(INITDDIR)" != "x"; then \
$(MKDIR) $(prefix)/$(INITDDIR); \
$(RM) $(prefix)/$(INITDDIR)/cups; \
$(INSTALL_SCRIPT) cups.sh $(prefix)/$(INITDDIR)/cups; \
$(CHMOD) ugo+rx $(prefix)/$(INITDDIR)/cups; \
fi
#
# Run the test suite...
#
test: all
echo Running CUPS test suite...
cd test; ./run-stp-tests.sh
#
# Make software distributions using EPM (http://www.easysw.com/epm)...
#
EPMFLAGS = -v \
AMANDIR=$(AMANDIR) \
BINDIR=$(BINDIR) DATADIR=$(DATADIR) \
DOCDIR=$(DOCDIR) INCLUDEDIR=$(INCLUDEDIR) \
LIBDIR=$(LIBDIR) LOCALEDIR=$(LOCALEDIR) \
+3 -3
Ver Arquivo
@@ -1,4 +1,4 @@
README - CUPS v1.1.8 - 05/22/2001
README - CUPS v1.1.5 - 12/20/2000
---------------------------------
Looking for compile instructions? Read the file "INSTALL.txt"
@@ -236,7 +236,7 @@ file.
LEGAL STUFF
CUPS is Copyright 1993-2001 by Easy Software Products. CUPS,
CUPS is Copyright 1993-2000 by Easy Software Products. CUPS,
the CUPS logo, and the Common UNIX Printing System are the
trademark property of Easy Software Products.
@@ -266,7 +266,7 @@ For commercial licensing information, please contact:
44141 Airport View Drive, Suite 204
Hollywood, Maryland 20636-3111 USA
Voice: +1.301.373.9600
Voice: +1.301.373.9603
Email: cups-info@cups.org
WWW: http://www.cups.org
+1 -1
Ver Arquivo
@@ -3,7 +3,7 @@
#
# Backend makefile for the Common UNIX Printing System (CUPS).
#
# Copyright 1997-2001 by Easy Software Products, all rights reserved.
# Copyright 1997-2000 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
# property of Easy Software Products and are protected by Federal
+1 -1
Ver Arquivo
@@ -3,7 +3,7 @@
*
* Backend test program for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products, all rights reserved.
* Copyright 1997-2000 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
+281 -248
Ver Arquivo
@@ -3,7 +3,7 @@
*
* IPP backend for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products, all rights reserved.
* Copyright 1997-2000 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -23,8 +23,7 @@
*
* Contents:
*
* main() - Send a file to the printer or server.
* password_cb() - Disable the password prompt for cupsDoFileRequest().
* main() - Send a file to the printer or server.
*/
/*
@@ -42,20 +41,6 @@
#include <signal.h>
/*
* Local functions...
*/
const char *password_cb(const char *);
/*
* Local globals...
*/
char *password = NULL;
/*
* 'main()' - Send a file to the printer or server.
*
@@ -77,20 +62,23 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
resource[1024], /* Resource info (printer name) */
filename[1024]; /* File to print */
int port; /* Port number (not used) */
char uri[HTTP_MAX_URI];/* Updated URI without user/pass */
char password[255], /* Password info */
uri[HTTP_MAX_URI];/* Updated URI without user/pass */
http_status_t status; /* Status of HTTP job */
ipp_status_t ipp_status; /* Status of IPP request */
FILE *fp; /* File to print */
http_t *http; /* HTTP connection */
ipp_t *request, /* IPP request */
*response, /* IPP response */
*supported; /* get-printer-attributes response */
ipp_attribute_t *job_id_attr; /* job-id attribute */
int job_id; /* job-id value */
ipp_attribute_t *job_state; /* job-state attribute */
*response; /* IPP response */
ipp_attribute_t *job_id; /* job-id attribute */
ipp_attribute_t *copies_sup; /* copies-supported attribute */
ipp_attribute_t *charset_sup; /* charset-supported attribute */
ipp_attribute_t *format_sup; /* document-format-supported attribute */
const char *charset; /* Character set to use */
cups_lang_t *language; /* Default language */
struct stat fileinfo; /* File statistics */
size_t nbytes, /* Number of bytes written */
tbytes; /* Total bytes written */
char buffer[8192]; /* Output buffer */
int copies; /* Number of copies remaining */
const char *content_type; /* CONTENT_TYPE environment variable */
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
@@ -99,16 +87,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
int version; /* IPP version */
/*
* Make sure status messages are not buffered...
*/
setbuf(stderr, NULL);
/*
* Check command-line...
*/
if (argc == 1)
{
char *s;
@@ -140,27 +118,27 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Copy stdin to a temporary file...
*/
int fd; /* Temporary file */
FILE *fp; /* Temporary file */
char buffer[8192]; /* Buffer for copying */
int bytes; /* Number of bytes read */
if ((fd = cupsTempFd(filename, sizeof(filename))) < 0)
if ((fp = fopen(cupsTempFile(filename, sizeof(filename)), "w")) == NULL)
{
perror("ERROR: unable to create temporary file");
return (1);
}
while ((bytes = fread(buffer, 1, sizeof(buffer), stdin)) > 0)
if (write(fd, buffer, bytes) < bytes)
if (fwrite(buffer, 1, bytes, fp) < bytes)
{
perror("ERROR: unable to write to temporary file");
close(fd);
fclose(fp);
unlink(filename);
return (1);
}
close(fd);
fclose(fp);
}
else
{
@@ -168,26 +146,24 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
filename[sizeof(filename) - 1] = '\0';
}
/*
* Open the print file...
*/
if ((fp = fopen(filename, "rb")) == NULL)
{
perror("ERROR: Unable to open print file");
return (1);
}
else
stat(filename, &fileinfo);
/*
* Extract the hostname and printer name from the URI...
*/
httpSeparate(argv[0], method, username, hostname, &port, resource);
/*
* Set the authentication info, if any...
*/
cupsSetPasswordCB(password_cb);
if (username[0])
{
if ((password = strchr(username, ':')) != NULL)
*password++ = '\0';
cupsSetUser(username);
}
/*
* Try connecting to the remote server...
*/
@@ -230,9 +206,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
language = cupsLangDefault();
charset_sup = NULL;
copies_sup = NULL;
format_sup = NULL;
version = 1;
supported = NULL;
do
{
@@ -255,65 +229,144 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, uri);
/*
* Now fill in the HTTP request stuff...
*/
httpClearFields(http);
httpSetField(http, HTTP_FIELD_CONTENT_TYPE, "application/ipp");
if (username[0])
{
httpEncode64(password, username);
httpSetField(http, HTTP_FIELD_AUTHORIZATION, password);
}
sprintf(buffer, "%u", ippLength(request));
httpSetField(http, HTTP_FIELD_CONTENT_LENGTH, buffer);
/*
* Do the request...
*/
if ((supported = cupsDoRequest(http, request, resource)) == NULL)
ipp_status = cupsLastError();
else
ipp_status = supported->request.status.status_code;
if (ipp_status > IPP_OK_CONFLICT)
{
if (supported)
ippDelete(supported);
if (ipp_status == IPP_PRINTER_BUSY ||
ipp_status == IPP_SERVICE_UNAVAILABLE)
{
fputs("INFO: Printer busy; will retry in 10 seconds...\n", stderr);
sleep(10);
}
else if ((ipp_status == IPP_BAD_REQUEST ||
ipp_status == IPP_VERSION_NOT_SUPPORTED) && version == 1)
{
/*
* Switch to IPP/1.0...
*/
fputs("INFO: Printer does not support IPP/1.1, trying IPP/1.0...\n", stderr);
version = 0;
}
else
fprintf(stderr, "ERROR: Printer will not accept print file (%s)!\n",
ippErrorString(ipp_status));
}
else if ((copies_sup = ippFindAttribute(supported, "copies-supported",
IPP_TAG_RANGE)) != NULL)
for (response = NULL, ipp_status = IPP_ERROR;;)
{
/*
* Has the "copies-supported" attribute - does it have an upper
* bound > 1?
* POST the request, retrying as needed...
*/
if (copies_sup->values[0].range.upper <= 1)
copies_sup = NULL; /* No */
if (httpPost(http, resource))
{
fputs("INFO: Unable to POST get-printer-attributes request; retrying...\n", stderr);
sleep(10);
httpReconnect(http);
continue;
}
fputs("INFO: POST successful, sending IPP request...\n", stderr);
/*
* Send the IPP request...
*/
request->state = IPP_IDLE;
if (ippWrite(http, request) == IPP_ERROR)
{
fputs("ERROR: Unable to send IPP request!\n", stderr);
status = HTTP_ERROR;
break;
}
fputs("INFO: IPP request sent, getting status...\n", stderr);
/*
* Finally, check the status from the HTTP server...
*/
while ((status = httpUpdate(http)) == HTTP_CONTINUE);
if (status == HTTP_OK)
{
response = ippNew();
ippRead(http, response);
ipp_status = response->request.status.status_code;
if (ipp_status > IPP_OK_CONFLICT)
{
if (ipp_status == IPP_PRINTER_BUSY ||
ipp_status == IPP_SERVICE_UNAVAILABLE)
{
fputs("INFO: Printer busy; will retry in 10 seconds...\n", stderr);
sleep(10);
}
else if (ipp_status == IPP_BAD_REQUEST && version == 1)
{
/*
* Switch to IPP/1.0...
*/
fputs("INFO: Printer does not support IPP/1.1, trying IPP/1.0...\n", stderr);
version = 0;
}
else
{
fprintf(stderr, "ERROR: Printer will not accept print file (%x)!\n",
ipp_status);
fprintf(stderr, "ERROR: %s\n", ippErrorString(ipp_status));
status = HTTP_ERROR;
}
}
else if ((copies_sup = ippFindAttribute(response, "copies-supported",
IPP_TAG_RANGE)) != NULL)
{
/*
* Has the "copies-supported" attribute - does it have an upper
* bound > 1?
*/
if (copies_sup->values[0].range.upper <= 1)
copies_sup = NULL; /* No */
}
charset_sup = ippFindAttribute(response, "charset-supported",
IPP_TAG_CHARSET);
}
else
{
response = NULL;
if (status == HTTP_ERROR)
{
fprintf(stderr, "WARNING: Did not receive the IPP response (%d)\n",
errno);
status = HTTP_OK;
ipp_status = IPP_PRINTER_BUSY;
}
else
{
fprintf(stderr, "ERROR: Validate request was not accepted (%d)!\n",
status);
ipp_status = IPP_FORBIDDEN;
}
}
httpFlush(http);
break;
}
charset_sup = ippFindAttribute(supported, "charset-supported",
IPP_TAG_CHARSET);
format_sup = ippFindAttribute(supported, "document-format-supported",
IPP_TAG_MIMETYPE);
if (format_sup)
if (status != HTTP_OK)
{
fprintf(stderr, "DEBUG: document-format-supported (%d values)\n",
format_sup->num_values);
for (i = 0; i < format_sup->num_values; i ++)
fprintf(stderr, "DEBUG: [%d] = \"%s\"\n", i,
format_sup->values[i].string.text);
if (fp != stdin)
fclose(fp);
httpClose(http);
return (1);
}
else if (ipp_status > IPP_OK_CONFLICT)
httpReconnect(http);
}
while (ipp_status > IPP_OK_CONFLICT);
@@ -381,6 +434,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
}
}
if (response)
ippDelete(response);
/*
* Then issue the print-job request...
*/
@@ -425,16 +481,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
options = NULL;
num_options = cupsParseOptions(argv[5], 0, &options);
if ((content_type = getenv("CONTENT_TYPE")) != NULL && format_sup != NULL)
{
for (i = 0; i < format_sup->num_values; i ++)
if (strcasecmp(content_type, format_sup->values[i].string.text) == 0)
break;
if (i < format_sup->num_values)
num_options = cupsAddOption("document-format", content_type,
num_options, &options);
}
if ((content_type = getenv("CONTENT_TYPE")) != NULL &&
strcasecmp(content_type, "application/vnd.cups-raw") == 0)
num_options = cupsAddOption("raw", "", num_options, &options);
cupsEncodeOptions(request, num_options, options);
cupsFreeOptions(num_options, options);
@@ -442,40 +491,134 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
if (copies_sup)
ippAddInteger(request, IPP_TAG_JOB, IPP_TAG_INTEGER, "copies", atoi(argv[4]));
/*
* Now fill in the HTTP request stuff...
*/
httpClearFields(http);
httpSetField(http, HTTP_FIELD_CONTENT_TYPE, "application/ipp");
if (username[0])
{
httpEncode64(password, username);
httpSetField(http, HTTP_FIELD_AUTHORIZATION, password);
}
sprintf(buffer, "%u", ippLength(request) + (size_t)fileinfo.st_size);
httpSetField(http, HTTP_FIELD_CONTENT_LENGTH, buffer);
/*
* Do the request...
*/
if ((response = cupsDoFileRequest(http, request, resource, filename)) == NULL)
ipp_status = cupsLastError();
else
ipp_status = response->request.status.status_code;
if (ipp_status > IPP_OK_CONFLICT)
for (;;)
{
if (ipp_status == IPP_SERVICE_UNAVAILABLE ||
ipp_status == IPP_PRINTER_BUSY)
/*
* POST the request, retrying as needed...
*/
httpReconnect(http);
if (httpPost(http, resource))
{
fputs("INFO: Printer is busy; retrying print job...\n", stderr);
fputs("INFO: Unable to POST print request; retrying...\n", stderr);
sleep(10);
continue;
}
fputs("INFO: POST successful, sending IPP request...\n", stderr);
/*
* Send the IPP request...
*/
request->state = IPP_IDLE;
if (ippWrite(http, request) == IPP_ERROR)
{
fputs("ERROR: Unable to send IPP request!\n", stderr);
status = HTTP_ERROR;
break;
}
fputs("INFO: IPP request sent, sending print file...\n", stderr);
/*
* Then send the file...
*/
rewind(fp);
tbytes = 0;
while ((nbytes = fread(buffer, 1, sizeof(buffer), fp)) > 0)
{
tbytes += nbytes;
fprintf(stderr, "INFO: Sending print file, %uk...\n", tbytes / 1024);
if (httpWrite(http, buffer, nbytes) < nbytes)
{
perror("ERROR: Unable to send print file to printer");
status = HTTP_ERROR;
break;
}
}
fputs("INFO: Print file sent; checking status...\n", stderr);
/*
* Finally, check the status from the HTTP server...
*/
while ((status = httpUpdate(http)) == HTTP_CONTINUE);
if (status == HTTP_OK)
{
response = ippNew();
ippRead(http, response);
if ((ipp_status = response->request.status.status_code) > IPP_OK_CONFLICT)
{
if (ipp_status == IPP_SERVICE_UNAVAILABLE ||
ipp_status == IPP_PRINTER_BUSY)
{
fputs("INFO: Printer is busy; retrying print job...\n", stderr);
sleep(10);
}
else
{
fprintf(stderr, "ERROR: Print file was not accepted (%04x)!\n",
response->request.status.status_code);
fprintf(stderr, "ERROR: %s\n", ippErrorString(ipp_status));
}
}
else if ((job_id = ippFindAttribute(response, "job-id", IPP_TAG_INTEGER)) == NULL)
fputs("INFO: Print file accepted - job ID unknown.\n", stderr);
else
fprintf(stderr, "INFO: Print file accepted - job ID %d.\n",
job_id->values[0].integer);
}
else
fprintf(stderr, "ERROR: Print file was not accepted (%s)!\n",
ippErrorString(ipp_status));
}
else if ((job_id_attr = ippFindAttribute(response, "job-id",
IPP_TAG_INTEGER)) == NULL)
{
fputs("INFO: Print file accepted - job ID unknown.\n", stderr);
job_id = 0;
}
else
{
job_id = job_id_attr->values[0].integer;
fprintf(stderr, "INFO: Print file accepted - job ID %d.\n", job_id);
{
response = NULL;
ipp_status = IPP_PRINTER_BUSY;
if (status == HTTP_ERROR)
{
fprintf(stderr, "WARNING: Did not receive the IPP response (%d)\n",
errno);
status = HTTP_OK;
}
else
fprintf(stderr, "ERROR: Print request was not accepted (%d)!\n", status);
}
httpFlush(http);
break;
}
if (response)
if (request != NULL)
ippDelete(request);
if (response != NULL)
ippDelete(response);
if (ipp_status <= IPP_OK_CONFLICT)
@@ -486,99 +629,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
else if (ipp_status != IPP_SERVICE_UNAVAILABLE &&
ipp_status != IPP_PRINTER_BUSY)
break;
/*
* Wait for the job to complete...
*/
if (!job_id)
continue;
fputs("INFO: Waiting for job to complete...\n", stderr);
for (;;)
{
/*
* Build an IPP_GET_JOB_ATTRIBUTES request...
*/
request = ippNew();
request->request.op.version[1] = version;
request->request.op.operation_id = IPP_GET_JOB_ATTRIBUTES;
request->request.op.request_id = 1;
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
"attributes-charset", NULL, charset);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
"attributes-natural-language", NULL,
language != NULL ? language->language : "en");
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
NULL, uri);
ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_INTEGER, "job-id",
job_id);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
"requested-attributes", NULL, "job-state");
/*
* Do the request...
*/
if ((response = cupsDoRequest(http, request, resource)) == NULL)
ipp_status = cupsLastError();
else
ipp_status = response->request.status.status_code;
if (ipp_status == IPP_NOT_FOUND)
{
/*
* Job has gone away and/or the server has no job history...
*/
ippDelete(response);
ipp_status = IPP_OK;
break;
}
if (ipp_status > IPP_OK_CONFLICT)
{
if (ipp_status != IPP_SERVICE_UNAVAILABLE &&
ipp_status != IPP_PRINTER_BUSY)
{
if (response)
ippDelete(response);
fprintf(stderr, "ERROR: Unable to get job %d attributes (%s)!\n",
job_id, ippErrorString(ipp_status));
break;
}
}
else if ((job_state = ippFindAttribute(response, "job-state", IPP_TAG_ENUM)) != NULL)
{
/*
* Stop polling if the job is finished...
*/
if (job_state->values[0].integer > IPP_JOB_PROCESSING)
{
ippDelete(response);
break;
}
}
/*
* Wait 10 seconds before polling again...
*/
if (response)
ippDelete(response);
sleep(10);
}
}
/*
@@ -587,13 +637,12 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
httpClose(http);
if (supported)
ippDelete(supported);
/*
* Close and remove the temporary file if necessary...
*/
fclose(fp);
if (argc < 7)
unlink(filename);
@@ -601,23 +650,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Return the queue status...
*/
if (ipp_status <= IPP_OK_CONFLICT)
fputs("INFO: " CUPS_SVERSION " is ready to print.\n", stderr);
return (ipp_status > IPP_OK_CONFLICT);
}
/*
* 'password_cb()' - Disable the password prompt for cupsDoFileRequest().
*/
const char * /* O - Password */
password_cb(const char *prompt) /* I - Prompt (not used) */
{
(void)prompt;
return (password);
return (status != HTTP_OK);
}
+39 -176
Ver Arquivo
@@ -3,7 +3,7 @@
*
* Line Printer Daemon backend for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products, all rights reserved.
* Copyright 1997-2000 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -26,7 +26,6 @@
* main() - Send a file to the printer or server.
* lpd_command() - Send an LPR command sequence and wait for a reply.
* lpd_queue() - Queue a file using the Line Printer Daemon protocol.
* lpd_write() - Write a buffer of data to an LPD server.
*/
/*
@@ -37,7 +36,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <ctype.h>
#include <cups/string.h>
#include <errno.h>
#include <sys/types.h>
@@ -53,20 +51,7 @@
# include <netdb.h>
#endif /* WIN32 || __EMX__ */
/*
* The order for control and data files in LPD requests...
*/
#define ORDER_CONTROL_DATA 0
#define ORDER_DATA_CONTROL 1
/*
* It appears that rresvport() is never declared on most systems...
*/
extern int rresvport(int *port);
extern int rresvport(int *port); /* Hello? No prototype for this... */
/*
@@ -76,8 +61,7 @@ extern int rresvport(int *port);
static int lpd_command(int lpd_fd, char *format, ...);
static int lpd_queue(char *hostname, char *printer, char *filename,
char *user, char *title, int copies, int banner,
int format, int order);
static int lpd_write(int lpd_fd, char *buffer, int length);
int format);
/*
@@ -100,25 +84,13 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
name[255], /* Name of option */
value[255], /* Value of option */
*ptr, /* Pointer into name or value */
filename[1024], /* File to print */
title[256]; /* Title string */
filename[1024]; /* File to print */
int port; /* Port number (not used) */
int status; /* Status of LPD job */
int banner; /* Print banner page? */
int format; /* Print format */
int order; /* Order of control/data files */
/*
* Make sure status messages are not buffered...
*/
setbuf(stderr, NULL);
/*
* Check command-line...
*/
if (argc == 1)
{
puts("network lpd \"Unknown\" \"LPD/LPR Host or Printer\"");
@@ -143,27 +115,27 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Copy stdin to a temporary file...
*/
int fd; /* Temporary file */
FILE *fp; /* Temporary file */
char buffer[8192]; /* Buffer for copying */
int bytes; /* Number of bytes read */
if ((fd = cupsTempFd(filename, sizeof(filename))) < 0)
if ((fp = fopen(cupsTempFile(filename, sizeof(filename)), "w")) == NULL)
{
perror("ERROR: unable to create temporary file");
return (1);
}
while ((bytes = fread(buffer, 1, sizeof(buffer), stdin)) > 0)
if (write(fd, buffer, bytes) < bytes)
if (fwrite(buffer, 1, bytes, fp) < bytes)
{
perror("ERROR: unable to write to temporary file");
close(fd);
fclose(fp);
unlink(filename);
return (1);
}
close(fd);
fclose(fp);
}
else
{
@@ -183,7 +155,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
banner = 0;
format = 'l';
order = ORDER_CONTROL_DATA;
if ((options = strchr(resource, '?')) != NULL)
{
@@ -252,33 +223,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
else
fprintf(stderr, "ERROR: Unknown format character \"%c\"\n", value[0]);
}
else if (strcasecmp(name, "order") == 0 && value[0])
{
/*
* Set control/data order...
*/
if (strcasecmp(value, "control,data") == 0)
order = ORDER_CONTROL_DATA;
else if (strcasecmp(value, "data,control") == 0)
order = ORDER_DATA_CONTROL;
else
fprintf(stderr, "ERROR: Unknown file order \"%s\"\n", value);
}
}
}
/*
* Sanitize the document title...
*/
strncpy(title, argv[3], sizeof(title) - 1);
title[sizeof(title) - 1] = '\0';
for (ptr = title; *ptr; ptr ++)
if (!isalnum(*ptr) && !isspace(*ptr))
*ptr = '_';
/*
* Queue the job...
*/
@@ -286,15 +233,16 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
if (argc > 6)
{
status = lpd_queue(hostname, resource + 1, filename,
argv[2] /* user */, title, atoi(argv[4]) /* copies */,
banner, format, order);
argv[2] /* user */, argv[3] /* title */,
atoi(argv[4]) /* copies */, banner, format);
if (!status)
fprintf(stderr, "PAGE: 1 %d\n", atoi(argv[4]));
}
else
status = lpd_queue(hostname, resource + 1, filename,
argv[2] /* user */, title, 1, banner, format, order);
argv[2] /* user */, argv[3] /* title */, 1,
banner, format);
/*
* Remove the temporary file if necessary...
@@ -342,7 +290,7 @@ lpd_command(int fd, /* I - Socket connection to LPD host */
fprintf(stderr, "DEBUG: Sending command string (%d bytes)...\n", bytes);
if (lpd_write(fd, buf, bytes) < bytes)
if (send(fd, buf, bytes, 0) < bytes)
return (-1);
/*
@@ -372,8 +320,7 @@ lpd_queue(char *hostname, /* I - Host to connect to */
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 format) /* I - Format specifier */
{
FILE *fp; /* Job file */
char localhost[255]; /* Local host name */
@@ -415,31 +362,11 @@ lpd_queue(char *hostname, /* I - Host to connect to */
for (port = 732;;)
{
if (getuid())
if ((fd = rresvport(&port)) < 0)
{
/*
* We're running as a normal user, so just create a regular socket...
*/
if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
{
perror("ERROR: Unable to create socket");
return (1);
}
}
else
{
/*
* We're running as root, so comply with RFC 1179 and reserve a
* priviledged port between 721 and 732...
*/
if ((fd = rresvport(&port)) < 0)
{
perror("ERROR: Unable to reserve port");
sleep(30);
continue;
}
perror("ERROR: Unable to reserve port");
sleep(30);
continue;
}
if (connect(fd, (struct sockaddr *)&addr, sizeof(addr)) < 0)
@@ -470,7 +397,7 @@ lpd_queue(char *hostname, /* I - Host to connect to */
break;
}
fprintf(stderr, "INFO: Connected from port %d...\n", port);
fprintf(stderr, "INFO: Connected on port %d...\n", port);
/*
* Now that we are "connected" to the port, ignore SIGTERM so that we
@@ -540,36 +467,27 @@ lpd_queue(char *hostname, /* I - Host to connect to */
fprintf(stderr, "DEBUG: Control file is:\n%s", control);
if (order == ORDER_CONTROL_DATA)
lpd_command(fd, "\002%d cfA%03.3d%s\n", strlen(control), getpid() % 1000,
localhost);
fprintf(stderr, "INFO: Sending control file (%d bytes)\n", strlen(control));
if (send(fd, control, strlen(control) + 1, 0) < (strlen(control) + 1))
{
lpd_command(fd, "\002%d cfA%03.3d%s\n", strlen(control), getpid() % 1000,
localhost);
fprintf(stderr, "INFO: Sending control file (%d bytes)\n", strlen(control));
if (lpd_write(fd, control, strlen(control) + 1) < (strlen(control) + 1))
{
status = errno;
perror("ERROR: Unable to write control file");
}
else if (read(fd, &status, 1) < 1)
status = errno;
if (status != 0)
fprintf(stderr, "ERROR: Remote host did not accept control file (%d)\n",
status);
else
fputs("INFO: Control file sent successfully\n", stderr);
perror("ERROR: Unable to write control file");
status = 1;
}
else if (read(fd, &status, 1) < 1 || status != 0)
fprintf(stderr, "ERROR: Remote host did not accept control file (%d)\n",
status);
else
status = 0;
if (status == 0)
{
/*
* Send the print file...
*/
fputs("INFO: Control file sent successfully\n", stderr);
lpd_command(fd, "\003%u dfA%03.3d%s\n", (unsigned)filestats.st_size,
getpid() % 1000, localhost);
@@ -580,9 +498,9 @@ lpd_queue(char *hostname, /* I - Host to connect to */
while ((nbytes = fread(buffer, 1, sizeof(buffer), fp)) > 0)
{
fprintf(stderr, "INFO: Spooling LPR job, %u%% complete...\n",
(unsigned)(100.0f * tbytes / filestats.st_size));
(unsigned)(100 * tbytes / filestats.st_size));
if (lpd_write(fd, buffer, nbytes) < nbytes)
if (send(fd, buffer, nbytes, 0) < nbytes)
{
perror("ERROR: Unable to send print file to printer");
break;
@@ -591,42 +509,17 @@ lpd_queue(char *hostname, /* I - Host to connect to */
tbytes += nbytes;
}
if (tbytes < filestats.st_size)
status = errno;
else if (lpd_write(fd, "", 1) < 1)
status = errno;
else if (recv(fd, &status, 1, 0) < 1)
status = errno;
send(fd, "", 1, 0);
if (status != 0)
if (tbytes < filestats.st_size)
status = 1;
else if (recv(fd, &status, 1, 0) < 1 || status != 0)
fprintf(stderr, "ERROR: Remote host did not accept data file (%d)\n",
status);
else
fputs("INFO: Data file sent successfully\n", stderr);
}
if (status == 0 && order == ORDER_DATA_CONTROL)
{
lpd_command(fd, "\002%d cfA%03.3d%s\n", strlen(control), getpid() % 1000,
localhost);
fprintf(stderr, "INFO: Sending control file (%d bytes)\n", strlen(control));
if (lpd_write(fd, control, strlen(control) + 1) < (strlen(control) + 1))
{
status = errno;
perror("ERROR: Unable to write control file");
}
else if (read(fd, &status, 1) < 1)
status = errno;
if (status != 0)
fprintf(stderr, "ERROR: Remote host did not accept control file (%d)\n",
status);
else
fputs("INFO: Control file sent successfully\n", stderr);
}
/*
* Close the socket connection and input file and return...
*/
@@ -638,36 +531,6 @@ lpd_queue(char *hostname, /* I - Host to connect to */
}
/*
* 'lpd_write()' - Write a buffer of data to an LPD server.
*/
static int /* O - Number of bytes written or -1 on error */
lpd_write(int lpd_fd, /* I - LPD socket */
char *buffer, /* I - Buffer to write */
int length) /* I - Number of bytes to write */
{
int bytes, /* Number of bytes written */
total; /* Total number of bytes written */
total = 0;
while ((bytes = send(lpd_fd, buffer, length - total, 0)) >= 0)
{
total += bytes;
buffer += bytes;
if (total == length)
break;
}
if (bytes < 0)
return (-1);
else
return (length);
}
/*
* End of "$Id$".
*/
+9 -43
Ver Arquivo
@@ -3,7 +3,7 @@
*
* Parallel port backend for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products, all rights reserved.
* Copyright 1997-2000 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -97,16 +97,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
/*
* Make sure status messages are not buffered...
*/
setbuf(stderr, NULL);
/*
* Check command-line...
*/
if (argc == 1)
{
list_devices();
@@ -288,8 +278,7 @@ list_devices(void)
int i; /* Looping var */
int fd; /* File descriptor */
char device[255], /* Device filename */
probefile[255], /* Probe filename */
basedevice[255]; /* Base device filename for ports */
probefile[255]; /* Probe filename */
FILE *probe; /* /proc/parport/n/autoprobe file */
char line[1024], /* Line from file */
*delim, /* Delimiter in file */
@@ -303,30 +292,14 @@ list_devices(void)
* First open the device to make sure the driver module is loaded...
*/
if ((fd = open("/dev/parallel/0", O_WRONLY)) >= 0)
{
sprintf(device, "/dev/lp%d", i);
if ((fd = open(device, O_WRONLY)) >= 0)
close(fd);
strcpy(basedevice, "/dev/parallel/");
}
else
{
sprintf(device, "/dev/lp%d", i);
sprintf(device, "/dev/par%d", i);
if ((fd = open(device, O_WRONLY)) >= 0)
{
close(fd);
strcpy(basedevice, "/dev/lp");
}
else
{
sprintf(device, "/dev/par%d", i);
if ((fd = open(device, O_WRONLY)) >= 0)
{
close(fd);
strcpy(basedevice, "/dev/par");
}
else
strcpy(basedevice, "/dev/unknown-parallel");
}
}
/*
@@ -380,11 +353,11 @@ list_devices(void)
fclose(probe);
if (make[0])
printf("direct parallel:%s%d \"%s %s\" \"Parallel Port #%d\"\n",
basedevice, i, make, model, i + 1);
printf("direct parallel:/dev/lp%d \"%s %s\" \"Parallel Port #%d\"\n",
i, make, model, i + 1);
else
printf("direct parallel:%s%d \"%s\" \"Parallel Port #%d\"\n",
basedevice, i, model, i + 1);
printf("direct parallel:/dev/lp%d \"%s\" \"Parallel Port #%d\"\n",
i, model, i + 1);
}
else if (fd >= 0)
{
@@ -606,13 +579,6 @@ list_devices(void)
close(fd);
printf("direct parallel:%s \"Unknown\" \"Parallel Port #%d\"\n", device, i + 1);
}
sprintf(device, "/dev/lpa%d", i);
if ((fd = open(device, O_WRONLY)) >= 0)
{
close(fd);
printf("direct parallel:%s \"Unknown\" \"Parallel Port #%d\"\n", device, i + 1);
}
}
#endif
}
+6 -16
Ver Arquivo
@@ -3,7 +3,7 @@
*
* Serial port backend for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products, all rights reserved.
* Copyright 1997-2000 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -50,7 +50,7 @@
# include <termios.h>
# ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
# endif /* HAVE_SYS_IOCTL_H */
# endif /* __linux */
#endif /* WIN32 || __EMX__ */
#ifdef __sgi
@@ -117,16 +117,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
/*
* Make sure status messages are not buffered...
*/
setbuf(stderr, NULL);
/*
* Check command-line...
*/
if (argc == 1)
{
list_devices();
@@ -542,7 +532,7 @@ list_devices(void)
*/
for (n = 0; n < 6; n ++)
printf("serial serial:/dev/ttyd%d?baud=38400 \"Unknown\" \"CDSIO Board %d Serial Port #%d\"\n",
printf("serial serial:/dev/ttyd%d?baud=19200 \"Unknown\" \"CDSIO Board %d Serial Port #%d\"\n",
n + 5 + 8 * inv->inv_controller, inv->inv_controller, n + 1);
}
else if (inv->inv_type == INV_EPC_SERIAL)
@@ -557,7 +547,7 @@ list_devices(void)
i = 41 + 4 * (int)inv->inv_controller;
for (n = 0; n < (int)inv->inv_state; n ++)
printf("serial serial:/dev/ttyd%d?baud=38400 \"Unknown\" \"EPC Serial Port %d, Ebus slot %d\"\n",
printf("serial serial:/dev/ttyd%d?baud=19200 \"Unknown\" \"EPC Serial Port %d, Ebus slot %d\"\n",
n + i, n + 1, (int)inv->inv_controller);
}
else if (inv->inv_state > 1)
@@ -567,7 +557,7 @@ list_devices(void)
*/
for (n = 0; n < (int)inv->inv_state; n ++)
printf("serial serial:/dev/ttyd%d?baud=38400 \"Unknown\" \"Onboard Serial Port %d\"\n",
printf("serial serial:/dev/ttyd%d?baud=19200 \"Unknown\" \"Onboard Serial Port %d\"\n",
n + (int)inv->inv_unit + 1, n + (int)inv->inv_unit + 1);
}
else
@@ -810,7 +800,7 @@ list_devices(void)
device, i + 1);
}
}
#elif defined(__NetBSD__)
+#elif defined(__NetBSD__)
int i, j; /* Looping vars */
int fd; /* File descriptor */
char device[255]; /* Device filename */
+7 -69
Ver Arquivo
@@ -3,7 +3,7 @@
*
* AppSocket backend for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products, all rights reserved.
* Copyright 1997-2000 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -69,7 +69,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
FILE *fp; /* Print file */
int copies; /* Number of copies to print */
int port; /* Port number */
int delay; /* Delay for retries... */
int fd; /* AppSocket */
int error; /* Error code (if any) */
struct sockaddr_in addr; /* Socket address */
@@ -86,16 +85,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
/*
* Make sure status messages are not buffered...
*/
setbuf(stderr, NULL);
/*
* Check command-line...
*/
if (argc == 1)
{
puts("network socket \"Unknown\" \"AppSocket/HP JetDirect\"");
@@ -163,7 +152,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
while (copies > 0)
{
for (delay = 5;;)
for (;;)
{
if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
{
@@ -179,16 +168,13 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
if (error == ECONNREFUSED)
{
fprintf(stderr, "INFO: Network host \'%s\' is busy; will retry in %d seconds...\n",
hostname, delay);
sleep(delay);
if (delay < 30)
delay += 5;
fprintf(stderr, "INFO: Network host \'%s\' is busy; will retry in 30 seconds...\n",
hostname);
sleep(30);
}
else
{
perror("ERROR: Unable to connect to printer (retrying in 30 seconds)");
perror("ERROR: Unable to connect to printer");
sleep(30);
}
}
@@ -254,16 +240,11 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
* Check for possible data coming back from the printer...
*/
timeout.tv_sec = 0;
timeout.tv_sec = 0;
timeout.tv_usec = 0;
FD_ZERO(&input);
FD_SET(fd, &input);
#ifdef __hpux
if (select(fd + 1, (int *)&input, NULL, NULL, &timeout) > 0)
#else
if (select(fd + 1, &input, NULL, NULL, &timeout) > 0)
#endif /* __hpux */
{
/*
* Grab the data coming back and spit it out to stderr...
@@ -277,47 +258,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
fprintf(stderr, "INFO: Sending print file, %u bytes...\n", tbytes);
}
/*
* Shutdown the socket and wait for the other end to finish...
*/
fputs("INFO: Print file sent, waiting for printer to finish...\n", stderr);
shutdown(fd, 1);
for (;;)
{
/*
* Wait a maximum of 90 seconds for backchannel data or a closed
* connection...
*/
timeout.tv_sec = 90;
timeout.tv_usec = 0;
FD_ZERO(&input);
FD_SET(fd, &input);
#ifdef __hpux
if (select(fd + 1, (int *)&input, NULL, NULL, &timeout) > 0)
#else
if (select(fd + 1, &input, NULL, NULL, &timeout) > 0)
#endif /* __hpux */
{
/*
* Grab the data coming back and spit it out to stderr...
*/
if ((nbytes = recv(fd, buffer, sizeof(buffer), 0)) > 0)
fprintf(stderr, "INFO: Received %u bytes of back-channel data!\n",
nbytes);
else
break;
}
else
break;
}
/*
* Close the socket connection...
*/
@@ -332,8 +272,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
if (fp != stdin)
fclose(fp);
fputs("INFO: " CUPS_SVERSION " is ready to print.\n", stderr);
return (0);
}
+2 -27
Ver Arquivo
@@ -3,7 +3,7 @@
*
* USB port backend for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products, all rights reserved.
* Copyright 1997-2000 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -86,16 +86,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
/*
* Make sure status messages are not buffered...
*/
setbuf(stderr, NULL);
/*
* Check command-line...
*/
if (argc == 1)
{
list_devices();
@@ -398,22 +388,7 @@ list_devices(void)
#elif defined(__sun)
#elif defined(__hpux)
#elif defined(__osf)
#elif defined(__FreeBSD__)
int i; /* Looping var */
int fd; /* File descriptor */
char device[255]; /* Device filename */
for (i = 0; i < 3; i ++)
{
sprintf(device, "/dev/unlpt%d", i);
if ((fd = open(device, O_WRONLY)) >= 0)
{
close(fd);
printf("direct usb:%s \"Unknown\" \"USB Port #%d\"\n", device, i + 1);
}
}
#elif defined(__NetBSD__) || defined(__OpenBSD__)
#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
int i; /* Looping var */
int fd; /* File descriptor */
char device[255]; /* Device filename */
+1 -1
Ver Arquivo
@@ -3,7 +3,7 @@
#
# Berkeley commands makefile for the Common UNIX Printing System (CUPS).
#
# Copyright 1997-2001 by Easy Software Products, all rights reserved.
# Copyright 1997-2000 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
# property of Easy Software Products and are protected by Federal
+3 -3
Ver Arquivo
@@ -3,7 +3,7 @@
*
* "lpc" command for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products.
* Copyright 1997-2000 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -69,7 +69,7 @@ main(int argc, /* I - Number of command-line arguments */
* Connect to the scheduler...
*/
http = httpConnectEncrypt(cupsServer(), ippPort(), cupsEncryption());
http = httpConnect(cupsServer(), ippPort());
if (argc > 1)
{
@@ -178,7 +178,7 @@ do_command(http_t *http, /* I - HTTP connection to server */
strcmp(command, "?") == 0)
show_help(params);
else
printf("%s is not implemented by the CUPS version of lpc.\n", command);
puts("?Invalid command");
}
+2 -25
Ver Arquivo
@@ -3,7 +3,7 @@
*
* "lpq" command for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products.
* Copyright 1997-2000 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -39,7 +39,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <config.h>
#include <cups/cups.h>
#include <cups/language.h>
#include <cups/debug.h>
@@ -72,19 +71,13 @@ main(int argc, /* I - Number of command-line arguments */
longstatus; /* Show file details */
int num_dests; /* Number of destinations */
cups_dest_t *dests; /* Destinations */
http_encryption_t encryption; /* Encryption? */
/*
* Connect to the scheduler...
*/
if ((http = httpConnectEncrypt(cupsServer(), ippPort(),
cupsEncryption())) == NULL)
{
fputs("lpq: Unable to contact server!\n", stderr);
return (1);
}
http = httpConnect(cupsServer(), ippPort());
/*
* Check for command-line options...
@@ -109,18 +102,6 @@ main(int argc, /* I - Number of command-line arguments */
{
switch (argv[i][1])
{
case 'E' : /* Encrypt */
#ifdef HAVE_LIBSSL
encryption = HTTP_ENCRYPT_REQUIRED;
if (http)
httpEncryption(http, encryption);
#else
fprintf(stderr, "%s: Sorry, no encryption support compiled in!\n",
argv[0]);
#endif /* HAVE_LIBSSL */
break;
case 'P' : /* Printer */
if (argv[i][2])
dest = argv[i] + 2;
@@ -134,10 +115,6 @@ main(int argc, /* I - Number of command-line arguments */
*instance = '\0';
break;
case 'a' : /* All printers */
dest = NULL;
break;
case 'l' : /* Long status */
longstatus = 1;
break;
+12 -80
Ver Arquivo
@@ -3,7 +3,7 @@
*
* "lpr" command for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products.
* Copyright 1997-2000 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -33,8 +33,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <config.h>
#include <cups/cups.h>
@@ -67,7 +65,6 @@ main(int argc, /* I - Number of command-line arguments */
{
int i, j; /* Looping var */
int job_id; /* Job ID */
char ch; /* Option character */
char *printer, /* Destination printer or class */
*instance; /* Instance */
const char *title; /* Job title */
@@ -81,10 +78,10 @@ main(int argc, /* I - Number of command-line arguments */
cups_option_t *options; /* Options */
int deletefile; /* Delete file after print? */
char buffer[8192]; /* Copy buffer */
int temp; /* Temporary file descriptor */
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
FILE *temp; /* Temporary file pointer */
#ifdef HAVE_SIGACTION
struct sigaction action; /* Signal action */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
#endif /* HAVE_SIGACTION */
deletefile = 0;
@@ -98,34 +95,12 @@ main(int argc, /* I - Number of command-line arguments */
for (i = 1; i < argc; i ++)
if (argv[i][0] == '-')
switch (ch = argv[i][1])
switch (argv[i][1])
{
case 'E' : /* Encrypt */
#ifdef HAVE_LIBSSL
cupsSetEncryption(HTTP_ENCRYPT_REQUIRED);
#else
fprintf(stderr, "%s: Sorry, no encryption support compiled in!\n",
argv[0]);
#endif /* HAVE_LIBSSL */
break;
case '1' : /* TROFF font set 1 */
case '2' : /* TROFF font set 2 */
case '3' : /* TROFF font set 3 */
case '4' : /* TROFF font set 4 */
case 'i' : /* indent */
case 'w' : /* width */
if (argv[i][2] == '\0')
{
i ++;
if (i >= argc)
{
fprintf(stderr, "lpr: Expected value after -%c option!\n", ch);
return (1);
}
}
case 'c' : /* CIFPLOT */
case 'd' : /* DVI */
case 'f' : /* FORTRAN */
@@ -134,7 +109,7 @@ main(int argc, /* I - Number of command-line arguments */
case 't' : /* Troff */
case 'v' : /* Raster image */
fprintf(stderr, "Warning: \'%c\' format modifier not supported - output may not be correct!\n",
ch);
argv[i][1]);
break;
case 'o' : /* Option */
@@ -143,12 +118,6 @@ main(int argc, /* I - Number of command-line arguments */
else
{
i ++;
if (i >= argc)
{
fputs("lpr: Expected option=value after -o option!\n", stderr);
return (1);
}
num_options = cupsParseOptions(argv[i], num_options, &options);
}
break;
@@ -172,11 +141,6 @@ main(int argc, /* I - Number of command-line arguments */
fputs("Warning: email notification is not supported!\n", stderr);
break;
case 'q' : /* Queue file but don't print */
num_options = cupsAddOption("job-hold-until", "indefinite",
num_options, &options);
break;
case 'r' : /* Remove file after printing */
deletefile = 1;
break;
@@ -187,12 +151,6 @@ main(int argc, /* I - Number of command-line arguments */
else
{
i ++;
if (i >= argc)
{
fputs("lpr: Expected destination after -P option!\n", stderr);
return (1);
}
printer = argv[i];
}
@@ -218,12 +176,6 @@ main(int argc, /* I - Number of command-line arguments */
else
{
i ++;
if (i >= argc)
{
fputs("lpr: Expected copy count after -# option!\n", stderr);
return (1);
}
num_copies = atoi(argv[i]);
}
@@ -245,32 +197,10 @@ main(int argc, /* I - Number of command-line arguments */
else
{
i ++;
if (i >= argc)
{
fprintf(stderr, "lpr: Expected name after -%c option!\n", ch);
return (1);
}
title = argv[i];
}
break;
case 'U' : /* User */
if (argv[i][2] != '\0')
cupsSetUser(argv[i] + 2);
else
{
i ++;
if (i >= argc)
{
fputs("lpr: Expected username after -U option!\n", stderr);
return (1);
}
cupsSetUser(argv[i]);
}
break;
default :
fprintf(stderr, "lpr: Unknown option \'%c\'!\n", argv[i][1]);
return (1);
@@ -360,17 +290,19 @@ main(int argc, /* I - Number of command-line arguments */
# endif
#endif /* !WIN32 */
if ((temp = cupsTempFd(tempfile, sizeof(tempfile))) < 0)
temp = fopen(cupsTempFile(tempfile, sizeof(tempfile)), "w");
if (temp == NULL)
{
fputs("lpr: unable to create temporary file.\n", stderr);
return (1);
}
while ((i = fread(buffer, 1, sizeof(buffer), stdin)) > 0)
write(temp, buffer, i);
fwrite(buffer, 1, i, temp);
i = lseek(temp, 0, SEEK_CUR);
close(temp);
i = ftell(temp);
fclose(temp);
if (i == 0)
{
+7 -31
Ver Arquivo
@@ -3,7 +3,7 @@
*
* "lprm" command for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products.
* Copyright 1997-2000 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -58,19 +58,17 @@ main(int argc, /* I - Number of command-line arguments */
cups_lang_t *language; /* Language */
int num_dests; /* Number of destinations */
cups_dest_t *dests; /* Destinations */
http_encryption_t encryption; /* Encryption? */
/*
* Setup to cancel individual print jobs...
*/
op = IPP_CANCEL_JOB;
job_id = 0;
dest = NULL;
response = NULL;
http = NULL;
encryption = cupsEncryption();
op = IPP_CANCEL_JOB;
job_id = 0;
dest = NULL;
response = NULL;
http = NULL;
num_dests = cupsGetDests(&dests);
@@ -82,7 +80,7 @@ main(int argc, /* I - Number of command-line arguments */
* Open a connection to the server...
*/
if ((http = httpConnectEncrypt(cupsServer(), ippPort(), encryption)) == NULL)
if ((http = httpConnect(cupsServer(), ippPort())) == NULL)
{
fputs("lprm: Unable to contact server!\n", stderr);
cupsFreeDests(num_dests, dests);
@@ -97,17 +95,6 @@ main(int argc, /* I - Number of command-line arguments */
if (argv[i][0] == '-' && argv[i][1] != '\0')
switch (argv[i][1])
{
case 'E' : /* Encrypt */
#ifdef HAVE_LIBSSL
encryption = HTTP_ENCRYPT_REQUIRED;
httpEncryption(http, encryption);
#else
fprintf(stderr, "%s: Sorry, no encryption support compiled in!\n",
argv[0]);
#endif /* HAVE_LIBSSL */
break;
case 'P' : /* Cancel jobs on a printer */
if (argv[i][2])
dest = argv[i] + 2;
@@ -148,10 +135,7 @@ main(int argc, /* I - Number of command-line arguments */
op = IPP_PURGE_JOBS;
}
else
{
dest = argv[i];
job_id = 0;
}
/*
* Build an IPP request, which requires the following
@@ -222,14 +206,6 @@ main(int argc, /* I - Number of command-line arguments */
break;
}
if (response->request.status.status_code > IPP_OK_CONFLICT)
{
ippDelete(response);
cupsFreeDests(num_dests, dests);
httpClose(http);
return (1);
}
ippDelete(response);
}
else
+5 -7
Ver Arquivo
@@ -3,7 +3,7 @@
#
# CGI makefile for the Common UNIX Printing System (CUPS).
#
# Copyright 1997-2001 by Easy Software Products.
# Copyright 1997-1999 by Easy Software Products.
#
# These coded instructions, statements, and computer programs are the
# property of Easy Software Products and are protected by Federal
@@ -24,9 +24,8 @@
include ../Makedefs
CGIS = admin.cgi classes.cgi jobs.cgi printers.cgi
TARGETS = libcgi.a $(CGIS)
LIBOBJS = html.o ipp-var.o template.o var.o
TARGETS = admin.cgi classes.cgi jobs.cgi printers.cgi
LIBOBJS = abort.o email.o html.o ipp-var.o template.o var.o
OBJS = $(LIBOBJS) admin.o classes.o jobs.o printers.o
@@ -42,7 +41,7 @@ all: $(TARGETS)
#
clean:
$(RM) $(OBJS) $(TARGETS)
$(RM) $(OBJS) libcgi.a $(TARGETS)
#
@@ -53,7 +52,7 @@ install:
-$(MKDIR) $(SERVERBIN)/cgi-bin
$(CHMOD) ugo+rx $(SERVERBIN)
$(CHMOD) ugo+rx $(SERVERBIN)/cgi-bin
$(INSTALL_BIN) $(CGIS) $(SERVERBIN)/cgi-bin
$(INSTALL_BIN) $(TARGETS) $(SERVERBIN)/cgi-bin
#
@@ -115,7 +114,6 @@ printers.o: cgi.h ipp-var.h ../cups/cups.h ../cups/ipp.h ../cups/language.h
$(OBJS): ../Makedefs
#
# End of "$Id$".
#
+13 -26
Ver Arquivo
@@ -3,7 +3,7 @@
*
* Administration CGI for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products.
* Copyright 1997-2000 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -40,7 +40,6 @@
#include "ipp-var.h"
#include <ctype.h>
#include <errno.h>
/*
@@ -105,7 +104,7 @@ main(int argc, /* I - Number of command-line arguments */
* Connect to the HTTP server...
*/
http = httpConnectEncrypt("localhost", ippPort(), cupsEncryption());
http = httpConnect("localhost", ippPort());
/*
* Do the operation...
@@ -495,7 +494,6 @@ do_am_printer(http_t *http, /* I - HTTP connection */
*uriptr; /* Pointer into URI */
int maxrate; /* Maximum baud rate */
char baudrate[255]; /* Baud rate string */
char make[255]; /* Make string */
const char *name, /* Pointer to class name */
*ptr; /* Pointer to CGI variable */
static int baudrates[] = /* Baud rates */
@@ -694,7 +692,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */
* Get the PPD file...
*/
int fd; /* PPD file */
FILE *fp; /* PPD file */
char filename[1024]; /* PPD filename */
ppd_file_t *ppd; /* PPD information */
char buffer[1024]; /* Buffer */
@@ -702,18 +700,19 @@ do_am_printer(http_t *http, /* I - HTTP connection */
snprintf(uri, sizeof(uri), "/printers/%s.ppd", name);
cupsTempFile(filename, sizeof(filename));
if (httpGet(http, uri))
httpGet(http, uri);
while (httpUpdate(http) == HTTP_CONTINUE);
if ((fd = cupsTempFd(filename, sizeof(filename))) >= 0)
if ((fp = fopen(filename, "w")) != NULL)
{
while ((bytes = httpRead(http, buffer, sizeof(buffer))) > 0)
write(fd, buffer, bytes);
fwrite(buffer, 1, bytes, fp);
close(fd);
fclose(fp);
if ((ppd = ppdOpenFile(filename)) != NULL)
{
@@ -724,11 +723,11 @@ do_am_printer(http_t *http, /* I - HTTP connection */
ppdClose(ppd);
}
unlink(filename);
}
else
httpFlush(http);
unlink(filename);
}
/*
@@ -788,10 +787,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */
* Let the user choose a model...
*/
strncpy(make, var, sizeof(make) - 1);
make[sizeof(make) - 1] = '\0';
ippSetCGIVars(response, "ppd-make", make);
ippSetCGIVars(response, "ppd-make", var);
cgiCopyTemplateLang(stdout, TEMPLATES, "choose-model.tmpl",
getenv("LANG"));
}
@@ -925,7 +921,6 @@ do_config_printer(http_t *http, /* I - HTTP connection */
char tempfile[1024]; /* Temporary filename */
FILE *in, /* Input file */
*out; /* Output file */
int outfd; /* Output file descriptor */
char line[1024]; /* Line from PPD file */
char keyword[1024], /* Keyword from Default line */
*keyptr; /* Pointer into keyword... */
@@ -1118,17 +1113,10 @@ do_config_printer(http_t *http, /* I - HTTP connection */
* Set default options...
*/
outfd = cupsTempFd(tempfile, sizeof(tempfile));
in = fopen(filename, "rb");
out = fdopen(outfd, "wb");
cupsTempFile(tempfile, sizeof(tempfile));
if (outfd < 0 || in == NULL || out == NULL)
{
cgiSetVariable("ERROR", strerror(errno));
cgiCopyTemplateLang(stdout, TEMPLATES, "error.tmpl", getenv("LANG"));
unlink(filename);
return;
}
in = fopen(filename, "rb");
out = fopen(tempfile, "wb");
while (get_line(line, sizeof(line), in) != NULL)
{
@@ -1163,7 +1151,6 @@ do_config_printer(http_t *http, /* I - HTTP connection */
fclose(in);
fclose(out);
close(outfd);
/*
* Build a CUPS_ADD_PRINTER request, which requires the following
+1 -1
Ver Arquivo
@@ -3,7 +3,7 @@
*
* CGI support library definitions.
*
* Copyright 1997-2001 by Easy Software Products.
* Copyright 1997-2000 by Easy Software Products.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
+2 -2
Ver Arquivo
@@ -3,7 +3,7 @@
*
* Class status CGI for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products.
* Copyright 1997-2000 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -71,7 +71,7 @@ main(int argc, /* I - Number of command-line arguments */
* Connect to the HTTP server...
*/
http = httpConnectEncrypt("localhost", ippPort(), cupsEncryption());
http = httpConnect("localhost", ippPort());
/*
* Tell the client to expect HTML...
+1 -1
Ver Arquivo
@@ -3,7 +3,7 @@
*
* CGI HTML functions.
*
* Copyright 1997-2001 by Easy Software Products.
* Copyright 1997-2000 by Easy Software Products.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
+21 -57
Ver Arquivo
@@ -3,7 +3,7 @@
*
* IPP variable routines for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products.
* Copyright 1997-2000 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -97,15 +97,12 @@ ippSetCGIVars(ipp_t *response, /* I - Response data to be copied... */
resource[HTTP_MAX_URI],
uri[HTTP_MAX_URI];
int port; /* URI data */
int ishttps; /* Using encryption? */
const char *server; /* Name of server */
struct tm *date; /* Date information */
ippSetServerVersion();
server = getenv("SERVER_NAME");
ishttps = getenv("HTTPS") != NULL;
server = getenv("SERVER_NAME");
for (attr = response->attrs;
attr && attr->group_tag == IPP_TAG_OPERATION;
@@ -158,33 +155,17 @@ ippSetCGIVars(ipp_t *response, /* I - Response data to be copied... */
name[i] = '\0';
/*
* Add "job_printer_name" variable if we have a "job_printer_uri"
* attribute...
*/
if (strcmp(name, "job_printer_uri") == 0)
{
if ((valptr = strrchr(attr->values[0].string.text, '/')) == NULL)
valptr = "unknown";
else
valptr ++;
cgiSetArray("job_printer_name", element, valptr);
}
/*
* Copy values...
*/
value[0] = '\0'; /* Initially an empty string */
value[sizeof(value) - 1] = '\0'; /* In case string gets full */
valptr = value; /* Start at the beginning */
value[0] = '\0';
valptr = value;
for (i = 0; i < attr->num_values; i ++)
{
if (i)
strncat(valptr, ",", sizeof(value) - (valptr - value) - 1);
strcat(valptr, ",");
valptr += strlen(valptr);
@@ -192,38 +173,27 @@ ippSetCGIVars(ipp_t *response, /* I - Response data to be copied... */
{
case IPP_TAG_INTEGER :
case IPP_TAG_ENUM :
if (strncmp(name, "time_at_", 8) == 0)
{
date = localtime((time_t *)&(attr->values[i].integer));
strftime(valptr, sizeof(value) - (valptr - value),
CUPS_STRFTIME_FORMAT, date);
}
else
snprintf(valptr, sizeof(value) - (valptr - value),
"%d", attr->values[i].integer);
sprintf(valptr, "%d", attr->values[i].integer);
break;
case IPP_TAG_BOOLEAN :
snprintf(valptr, sizeof(value) - (valptr - value),
"%d", attr->values[i].boolean);
sprintf(valptr, "%d", attr->values[i].boolean);
break;
case IPP_TAG_NOVALUE :
strncat(valptr, "novalue", sizeof(value) - (valptr - value) - 1);
strcat(valptr, "novalue");
break;
case IPP_TAG_RANGE :
snprintf(valptr, sizeof(value) - (valptr - value),
"%d-%d", attr->values[i].range.lower,
attr->values[i].range.upper);
sprintf(valptr, "%d-%d", attr->values[i].range.lower,
attr->values[i].range.upper);
break;
case IPP_TAG_RESOLUTION :
snprintf(valptr, sizeof(value) - (valptr - value),
"%dx%d%s", attr->values[i].resolution.xres,
attr->values[i].resolution.yres,
attr->values[i].resolution.units == IPP_RES_PER_INCH ?
"dpi" : "dpc");
sprintf(valptr, "%dx%d%s", attr->values[i].resolution.xres,
attr->values[i].resolution.yres,
attr->values[i].resolution.units == IPP_RES_PER_INCH ?
"dpi" : "dpc");
break;
case IPP_TAG_URI :
@@ -236,32 +206,27 @@ ippSetCGIVars(ipp_t *response, /* I - Response data to be copied... */
strcmp(method, "http") == 0)
{
/*
* Map localhost access to localhost and local port...
* Map localhost access to localhost...
*/
if (strcasecmp(hostname, server) == 0 &&
(strcmp(getenv("REMOTE_HOST"), "127.0.0.1") == 0 ||
strcmp(getenv("REMOTE_HOST"), "localhost") == 0 ||
strcmp(getenv("REMOTE_HOST"), server) == 0))
{
strcpy(hostname, "localhost");
port = atoi(getenv("SERVER_PORT"));
}
/*
* Rewrite URI with HTTP address...
*/
if (username[0])
snprintf(uri, sizeof(uri), "%s://%s@%s:%d%s",
ishttps ? "https" : "http",
username, hostname, port, resource);
snprintf(uri, sizeof(uri), "http://%s@%s:%d%s", username,
hostname, port, resource);
else
snprintf(uri, sizeof(uri), "%s://%s:%d%s",
ishttps ? "https" : "http",
hostname, port, resource);
snprintf(uri, sizeof(uri), "http://%s:%d%s", hostname, port,
resource);
strncat(valptr, uri, sizeof(value) - (valptr - value) - 1);
strcat(valptr, uri);
break;
}
}
@@ -272,8 +237,7 @@ ippSetCGIVars(ipp_t *response, /* I - Response data to be copied... */
case IPP_TAG_KEYWORD :
case IPP_TAG_CHARSET :
case IPP_TAG_LANGUAGE :
strncat(valptr, attr->values[i].string.text,
sizeof(value) - (valptr - value) - 1);
strcat(valptr, attr->values[i].string.text);
break;
default :
+1 -1
Ver Arquivo
@@ -3,7 +3,7 @@
*
* IPP variable definitions for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products.
* Copyright 1997-2000 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
+2 -2
Ver Arquivo
@@ -3,7 +3,7 @@
*
* Job status CGI for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products.
* Copyright 1997-2000 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -64,7 +64,7 @@ main(int argc, /* I - Number of command-line arguments */
* Connect to the HTTP server...
*/
http = httpConnectEncrypt("localhost", ippPort(), cupsEncryption());
http = httpConnect("localhost", ippPort());
/*
* Tell the client to expect HTML...
+2 -2
Ver Arquivo
@@ -3,7 +3,7 @@
*
* Printer status CGI for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products.
* Copyright 1997-2000 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -71,7 +71,7 @@ main(int argc, /* I - Number of command-line arguments */
* Connect to the HTTP server...
*/
http = httpConnectEncrypt("localhost", ippPort(), cupsEncryption());
http = httpConnect("localhost", ippPort());
/*
* Tell the client to expect HTML...
+1 -1
Ver Arquivo
@@ -3,7 +3,7 @@
*
* CGI template function.
*
* Copyright 1997-2001 by Easy Software Products.
* Copyright 1997-2000 by Easy Software Products.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
+27 -42
Ver Arquivo
@@ -3,7 +3,7 @@
*
* CGI form variable and array functions.
*
* Copyright 1997-2001 by Easy Software Products.
* Copyright 1997-2000 by Easy Software Products.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
@@ -39,8 +39,6 @@
/*#define DEBUG*/
#include "cgi.h"
#include <errno.h>
#include <syslog.h>
/*
@@ -475,7 +473,7 @@ cgi_initialize_post(void)
*/
content_length = getenv("CONTENT_LENGTH");
if (content_length == NULL || atoi(content_length) <= 0)
if (content_length == NULL || atoi(content_length) == 0)
return (0);
/*
@@ -485,20 +483,16 @@ cgi_initialize_post(void)
length = atoi(content_length);
data = malloc(length + 1);
if (data == NULL)
return (0);
/*
* Read the data into the buffer...
*/
for (tbytes = 0; tbytes < length; tbytes += nbytes)
if ((nbytes = read(0, data + tbytes, length - tbytes)) < 0)
if (errno != EAGAIN)
{
free(data);
return (0);
}
{
free(data);
return (0);
}
data[length] = '\0';
@@ -549,11 +543,11 @@ cgi_initialize_string(const char *data) /* I - Form data string */
* Get the variable name...
*/
for (s = name; *data != '\0'; data ++)
for (s = name; *data != '\0'; data ++, s ++)
if (*data == '=')
break;
else if (*data >= ' ' && s < (name + sizeof(name) - 1))
*s++ = *data;
else
*s = *data;
*s = '\0';
if (*data == '=')
@@ -565,44 +559,38 @@ cgi_initialize_string(const char *data) /* I - Form data string */
* Read the variable value...
*/
for (s = value, done = 0; !done && *data != '\0'; data ++)
for (s = value, done = 0; !done && *data != '\0'; data ++, s ++)
switch (*data)
{
case '&' : /* End of data... */
done = 1;
s --;
break;
case '+' : /* Escaped space character */
if (s < (value + sizeof(value) - 1))
*s++ = ' ';
*s = ' ';
break;
case '%' : /* Escaped control character */
/*
* Read the hex code...
* Read the hex code from stdin...
*/
if (s < (value + sizeof(value) - 1))
{
data ++;
ch = *data - '0';
if (ch > 9)
ch -= 7;
*s = ch << 4;
data ++;
ch = *data - '0';
if (ch > 9)
ch -= 7;
*s = ch << 4;
data ++;
ch = *data - '0';
if (ch > 9)
ch -= 7;
*s++ |= ch;
}
else
data += 2;
data ++;
ch = *data - '0';
if (ch > 9)
ch -= 7;
*s |= ch;
break;
default : /* Other characters come straight through */
if (*data >= ' ' && s < (value + sizeof(value) - 1))
*s++ = *data;
*s = *data;
break;
}
@@ -612,9 +600,7 @@ cgi_initialize_string(const char *data) /* I - Form data string */
* Remove trailing whitespace...
*/
if (s > value)
s --;
s --;
while (s >= value && *s == ' ')
*s-- = '\0';
@@ -659,10 +645,9 @@ cgi_sort_variables(void)
(int (*)(const void *, const void *))cgi_compare_variables);
#ifdef DEBUG
puts("Sorted variable list is:");
puts("New variable list is:");
for (i = 0; i < form_count; i ++)
printf("%d: %s (%d) = \"%s\" ...\n", i, form_vars[i].name,
form_vars[i].nvalues, form_vars[i].values[0]);
printf("%s = %s\n", form_vars[i].name, form_vars[i].value);
#endif /* DEBUG */
}
+1 -1
Ver Arquivo
@@ -3,7 +3,7 @@
#
# Configuration file makefile for the Common UNIX Printing System (CUPS).
#
# Copyright 1993-2001 by Easy Software Products.
# Copyright 1993-2000 by Easy Software Products.
#
# These coded instructions, statements, and computer programs are the
# property of Easy Software Products and are protected by Federal
+3 -3
Ver Arquivo
@@ -1,10 +1,10 @@
#
# "$Id: classes.conf 1605 2001-03-02 22:34:21Z andy $"
# "$Id: classes.conf 1152 2000-06-22 18:25:29Z mike $"
#
# Sample class configuration file for the Common UNIX Printing System
# (CUPS) scheduler.
#
# Copyright 1997-2001 by Easy Software Products, all rights reserved.
# Copyright 1997-2000 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
# property of Easy Software Products and are protected by Federal
@@ -85,5 +85,5 @@
#</Class>
#
# End of "$Id: classes.conf 1605 2001-03-02 22:34:21Z andy $".
# End of "$Id: classes.conf 1152 2000-06-22 18:25:29Z mike $".
#
+3 -3
Ver Arquivo
@@ -1,10 +1,10 @@
#
# "$Id: client.conf 1605 2001-03-02 22:34:21Z andy $"
# "$Id: client.conf 1485 2000-12-20 13:41:17Z mike $"
#
# Sample client configuration file for the Common UNIX Printing System
# (CUPS).
#
# Copyright 1997-2001 by Easy Software Products, all rights reserved.
# Copyright 1997-2000 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
# property of Easy Software Products and are protected by Federal
@@ -61,5 +61,5 @@
#
# End of "$Id: client.conf 1605 2001-03-02 22:34:21Z andy $".
# End of "$Id: client.conf 1485 2000-12-20 13:41:17Z mike $".
#
+4 -15
Ver Arquivo
@@ -1,10 +1,10 @@
#
# "$Id: cupsd.conf 1631 2001-03-14 13:45:35Z mike $"
# "$Id: cupsd.conf 1485 2000-12-20 13:41:17Z mike $"
#
# Sample configuration file for the Common UNIX Printing System (CUPS)
# scheduler.
#
# Copyright 1997-2001 by Easy Software Products, all rights reserved.
# Copyright 1997-2000 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
# property of Easy Software Products and are protected by Federal
@@ -71,17 +71,6 @@
#AccessLog /var/log/cups/access_log
#
# Classification: the classification level of the server. If set, this
# classification is displayed on all pages, and raw printing is disabled.
# The default is the empty string.
#Classification classified
#Classification confidential
#Classification secret
#Classification topsecret
#Classification unclassified
#
# DataDir: the root directory for the CUPS data files.
# By default /usr/share/cups.
@@ -109,7 +98,7 @@
# By default the compiled in directory.
#
#DocumentRoot /usr/share/doc/cups
#DocumentRoot /usr/share/cups/doc
#
# ErrorLog: the error log file; if this does not start with a leading /
@@ -635,5 +624,5 @@ Allow From 127.0.0.1
</Location>
#
# End of "$Id: cupsd.conf 1631 2001-03-14 13:45:35Z mike $".
# End of "$Id: cupsd.conf 1485 2000-12-20 13:41:17Z mike $".
#
+3 -3
Ver Arquivo
@@ -1,9 +1,9 @@
#
# "$Id: mime.convs 1605 2001-03-02 22:34:21Z andy $"
# "$Id: mime.convs 1340 2000-09-06 13:53:00Z mike $"
#
# MIME converts file for the Common UNIX Printing System (CUPS).
#
# Copyright 1997-2001 by Easy Software Products.
# Copyright 1997-2000 by Easy Software Products.
#
# These coded instructions, statements, and computer programs are the
# property of Easy Software Products and are protected by Federal
@@ -74,5 +74,5 @@ application/vnd.cups-postscript application/vnd.cups-raster 100 pstoraster
#*/* application/vnd.cups-raw 0 -
#
# End of "$Id: mime.convs 1605 2001-03-02 22:34:21Z andy $".
# End of "$Id: mime.convs 1340 2000-09-06 13:53:00Z mike $".
#
+11 -17
Ver Arquivo
@@ -1,9 +1,9 @@
#
# "$Id: mime.types 1681 2001-04-19 15:42:39Z mike $"
# "$Id: mime.types 1430 2000-11-06 16:39:17Z mike $"
#
# MIME types file for the Common UNIX Printing System (CUPS).
#
# Copyright 1997-2001 by Easy Software Products.
# Copyright 1997-2000 by Easy Software Products.
#
# These coded instructions, statements, and computer programs are the
# property of Easy Software Products and are protected by Federal
@@ -60,7 +60,7 @@
# accepts 8-bit characters in the range 128-255.
#
# String constants must be surrounded by "" if they contain whitespace.
# To insert binary data into a string, use the <hex> notation.
# To instead binary data into a string, use the <hex> notation.
#
########################################################################
@@ -71,13 +71,9 @@
application/msword doc string(0,<D0CF11E0A1B11AE1>)
application/pdf pdf string(0,%PDF)
application/postscript ai eps ps string(0,%!) string(0,<04>%!)
application/vnd.hp-HPGL hpgl string(0,<1B>&)\
string(0,<1B>E<1B>%0B) string(0,<201B>)\
string(0,BP;) string(0,IN;) string(0,DF;) \
string(0,BPINPS;) \
(string(0,<1B>%-12345X) + \
(contains(9,512,"LANGUAGE=HPGL") \
contains(9,512,"LANGUAGE = HPGL")))
application/vnd.hp-HPGL hpgl string(0,<1b>%) string(0,<1b>&)\
string(0,<1b>E) string(0,<201b>)\
string(0,BP;) string(0,IN;) string(0,DF;)
########################################################################
#
@@ -101,7 +97,7 @@ image/x-sgi-rgb rgb sgi bw icon short(0,474)
image/x-xbitmap xbm
image/x-xpixmap xpm ascii(0,1024) + string(3,"XPM")
image/x-xwindowdump xwd
image/x-sun-raster ras string(0,<59a66a95>)
image/x-sun-raster ras
#image/fpx fpx
image/x-alias pix short(8,8) short(8,24)
@@ -130,14 +126,12 @@ text/plain txt printable(0,1024)
application/vnd.cups-form string(0,"<CUPSFORM>")
application/vnd.cups-postscript string(0,<1B>%-12345X) + \
(contains(9,512,"LANGUAGE=POSTSCRIPT") \
contains(9,512,"LANGUAGE = POSTSCRIPT"))
contains(9,512,"LANGUAGE=POSTSCRIPT")
application/vnd.cups-raster string(0,"RaSt") string(0,"tSaR")
application/vnd.cups-raw (string(0,<1B>E) + !string(2,<1B>%0B)) \
application/vnd.cups-raw string(0,<1B>E) \
string(0,<1B>@) \
(string(0,<1B>%-12345X) + \
(contains(9,512,"LANGUAGE=PCL") \
contains(9,512,"LANGUAGE = PCL")))
contains(9,512,"LANGUAGE=PCL"))
########################################################################
#
@@ -151,5 +145,5 @@ application/vnd.cups-raw (string(0,<1B>E) + !string(2,<1B>%0B)) \
#application/octet-stream
#
# End of "$Id: mime.types 1681 2001-04-19 15:42:39Z mike $".
# End of "$Id: mime.types 1430 2000-11-06 16:39:17Z mike $".
#
+3 -3
Ver Arquivo
@@ -1,10 +1,10 @@
#
# "$Id: printers.conf 1605 2001-03-02 22:34:21Z andy $"
# "$Id: printers.conf 1152 2000-06-22 18:25:29Z mike $"
#
# Sample printer configuration file for the Common UNIX Printing System
# (CUPS) scheduler.
#
# Copyright 1997-2001 by Easy Software Products, all rights reserved.
# Copyright 1997-2000 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
# property of Easy Software Products and are protected by Federal
@@ -92,5 +92,5 @@
#</Printer>
#
# End of "$Id: printers.conf 1605 2001-03-02 22:34:21Z andy $".
# End of "$Id: printers.conf 1152 2000-06-22 18:25:29Z mike $".
#
+3 -15
Ver Arquivo
@@ -5,7 +5,7 @@
*
* @configure_input@
*
* Copyright 1997-2001 by Easy Software Products.
* Copyright 1997-2000 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -19,7 +19,7 @@
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636-3111 USA
*
* Voice: (301) 373-9600
* Voice: (301) 373-9603
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
*/
@@ -28,7 +28,7 @@
* Version of software...
*/
#define CUPS_SVERSION "CUPS v1.1.8"
#define CUPS_SVERSION "CUPS v1.1.5"
/*
* Where are files stored?
@@ -43,11 +43,6 @@
#define CUPS_DATADIR "/usr/share/cups"
#define CUPS_FONTPATH "/usr/share/cups/fonts"
/*
* What is the format string for strftime?
*/
#define CUPS_STRFTIME_FORMAT NULL
/*
* Do we have various image libraries?
@@ -93,13 +88,6 @@
#undef HAVE_CRYPT_H
/*
* Use <string.h>, <strings.h>, or both?
*/
#undef HAVE_STRING_H
#undef HAVE_STRINGS_H
/*
* Do we have the strXXX() functions?
*/
+79 -194
Ver Arquivo
@@ -3,7 +3,7 @@ dnl "$Id$"
dnl
dnl Configuration script for the Common UNIX Printing System (CUPS).
dnl
dnl Copyright 1997-2001 by Easy Software Products, all rights reserved.
dnl Copyright 1997-2000 by Easy Software Products, all rights reserved.
dnl
dnl These coded instructions, statements, and computer programs are the
dnl property of Easy Software Products and are protected by Federal
@@ -42,11 +42,9 @@ AC_SUBST(OPTIM)
PICFLAG=1
CFLAGS="${CFLAGS:=}"
CXXFLAGS="${CXXFLAGS:=}"
DSOFLAGS="${DSOFLAGS:=}"
AC_SUBST(DSOFLAGS)
AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]],[if eval "test x$enable_debug = xyes"; then
OPTIM="-g"
OPTIM="-g "
fi])
AC_ARG_ENABLE(shared, [ --enable-shared turn on shared libraries [default=yes]])
AC_ARG_ENABLE(ssl, [ --enable-ssl turn on SSL/TLS support [default=no]])
@@ -66,48 +64,34 @@ if test "$enable_shared" != "no"; then
SunOS* | UNIX_S*)
LIBCUPS="libcups.so.2"
LIBCUPSIMAGE="libcupsimage.so.2"
DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-h,\$@ -G \$(OPTIM)"
DSO="\$(CC) -Wl,-h,\$@ -G \$(OPTIM) -o"
;;
HP-UX*)
LIBCUPS="libcups.sl.2"
LIBCUPSIMAGE="libcupsimage.sl.2"
DSO="ld"
DSOFLAGS="$DSOFLAGS -b -z +h \$@"
DSO="ld -b -z +h \$@ -o"
;;
FreeBSD* | NetBSD* | OpenBSD*)
LIBCUPS="libcups.so.2"
LIBCUPSIMAGE="libcupsimage.so.2"
DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,\$@ -shared \$(OPTIM)"
DSO="\$(CC) -Wl,-soname,\$@ -shared \$(OPTIM) -o"
;;
OSF1* | Linux*)
LIBCUPS="libcups.so.2"
LIBCUPSIMAGE="libcupsimage.so.2"
DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,\$@ -shared \$(OPTIM)"
DSO="\$(CC) -Wl,-soname,\$@ -shared \$(OPTIM) -o"
;;
IRIX*)
LIBCUPS="libcups.so.2"
LIBCUPSIMAGE="libcupsimage.so.2"
DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -soname \$@ -shared \$(OPTIM)"
;;
AIX*)
AC_MSG_WARN(Shared library support for AIX not available yet - defaulting to static)
enable_shared=no
PICFLAG=0
LIBCUPS="libcups.a"
LIBCUPSIMAGE="libcupsimage.a"
DSO=":"
DSO="\$(CC) -soname \$@ -shared \$(OPTIM) -o"
;;
*)
echo "Warning: shared libraries may not be supported. Trying -shared"
echo " option with compiler."
LIBCUPS="libcups.so.2"
LIBCUPSIMAGE="libcupsimage.so.2"
DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,\$@ -shared \$(OPTIM)"
DSO="\$(CC) -Wl,-soname,\$@ -shared \$(OPTIM) -o"
;;
esac
else
@@ -123,7 +107,6 @@ if test "$LIBTOOL" != ""; then
LINKCUPS="../cups/\$(LIBCUPS)"
LINKCUPSIMAGE="../filter/\$(LIBCUPSIMAGE)"
DSO=":"
DSOFLAGS=""
else
LINKCUPS="-L../cups -lcups"
LINKCUPSIMAGE="-L../filter -lcupsimage"
@@ -131,15 +114,7 @@ fi
AC_ARG_ENABLE(pam, [ --enable-pam turn on PAM support [default=yes]])
# Don't use PAM with AIX...
if test $uname = AIX; then
enable_pam=no
fi
AC_ARG_WITH(fontpath, [ --with-fontpath set font path for pstoraster],fontpath="$withval",fontpath="")
AC_ARG_WITH(docdir, [ --with-docdir set path for documentation],docdir="$withval",docdir="")
AC_ARG_WITH(logdir, [ --with-logdir set path for log files],logdir="$withval",logdir="")
AC_ARG_WITH(rcdir, [ --with-rcdir set path for rc scripts],rcdir="$withval",rcdir="")
dnl Checks for programs...
AC_PROG_AWK
@@ -175,7 +150,6 @@ if test "$ac_cv_lib_c_crypt" = "no"; then
AC_CHECK_LIB(crypt,crypt)
fi
AC_CHECK_LIB(sec,getspent)
AC_CHECK_LIB(gen,getspent)
LIBMALLOC=""
AC_CHECK_LIB(c,mallinfo,LIBS="$LIBS"; AC_DEFINE(HAVE_MALLINFO),LIBS="$LIBS")
@@ -193,9 +167,7 @@ if test "$enable_pam" != "no"; then
AC_CHECK_LIB(dl,dlopen)
AC_CHECK_LIB(pam,pam_start)
if test "$ac_cv_lib_pam_pam_start" != "no"; then
if test -d /etc/pam.d; then
PAMDIR="/etc/pam.d"
fi
PAMDIR="/etc/pam.d"
else
PAMDIR=""
LIBS="$OLDLIBS"
@@ -299,37 +271,14 @@ AC_CHECK_HEADER(malloc.h,AC_DEFINE(HAVE_MALLOC_H))
AC_CHECK_HEADER(shadow.h,AC_DEFINE(HAVE_SHADOW_H))
AC_CHECK_HEADER(stddef.h,AC_DEFINE(HAVE_STDDEF_H))
AC_CHECK_HEADER(stdlib.h,AC_DEFINE(HAVE_STDLIB_H))
AC_CHECK_HEADER(string.h,AC_DEFINE(HAVE_STRING_H))
AC_CHECK_HEADER(strings.h,AC_DEFINE(HAVE_STRINGS_H))
AC_CHECK_HEADER(usersec.h,AC_DEFINE(HAVE_USERSEC_H))
AC_CHECK_HEADER(sys/ioctl.h,AC_DEFINE(HAVE_SYS_IOCTL_H))
dnl Checks for string functions.
AC_CHECK_FUNCS(strdup)
AC_CHECK_FUNCS(strcasecmp)
AC_CHECK_FUNCS(strncasecmp)
if test "$uname" = "HP-UX" -a "$uversion" = "1020"; then
echo Forcing snprintf emulation for HP-UX.
else
AC_CHECK_FUNCS(snprintf)
AC_CHECK_FUNCS(vsnprintf)
fi
dnl Check OS version and use appropriate format string for strftime...
AC_MSG_CHECKING(for correct format string to use with strftime)
case "$uname" in
IRIX* | SunOS*)
# IRIX and SunOS
AC_MSG_RESULT(NULL)
AC_DEFINE(CUPS_STRFTIME_FORMAT, NULL)
;;
*)
# All others
AC_MSG_RESULT("%c")
AC_DEFINE(CUPS_STRFTIME_FORMAT, "%c")
;;
esac
AC_CHECK_FUNCS(snprintf)
AC_CHECK_FUNCS(vsnprintf)
dnl Checks for vsyslog function.
AC_CHECK_FUNCS(vsyslog)
@@ -347,10 +296,10 @@ AC_CHECK_FUNCS(wait3)
dnl Update compiler options...
if test -n "$GCC"; then
CXX="$CC"
GXX="gcc"
if test -z "$OPTIM"; then
OPTIM="-O2"
OPTIM="-O2 -g3"
fi
if test $PICFLAG = 1; then
OPTIM="-fPIC $OPTIM"
@@ -358,21 +307,6 @@ if test -n "$GCC"; then
OPTIM="-Wall $OPTIM"
else
case $uname in
AIX*)
if test -z "$OPTIM"; then
OPTIM="-O2 -qmaxmem=6000"
fi
;;
HP-UX*)
if test -z "$OPTIM"; then
OPTIM="+O2"
fi
CFLAGS="-Ae $CFLAGS"
OPTIM="+DAportable $OPTIM"
if test $PICFLAG = 1; then
OPTIM="+z $OPTIM"
fi
;;
IRIX*)
if test -z "$OPTIM"; then
OPTIM="-O2"
@@ -382,21 +316,17 @@ else
fi
OPTIM="-fullwarn $OPTIM"
;;
HP-UX*)
if test -z "$OPTIM"; then
OPTIM="+O2 -g3"
fi
OPTIM="-Ae $OPTIM"
;;
SunOS*)
# Solaris
if test -z "$OPTIM"; then
OPTIM="-xO4"
fi
OPTIM="$OPTIM -xarch=generic"
if test $PICFLAG = 1; then
OPTIM="-KPIC $OPTIM"
fi
;;
UNIX_SVR*)
# UnixWare
if test -z "$OPTIM"; then
OPTIM="-O"
fi
if test $PICFLAG = 1; then
OPTIM="-KPIC $OPTIM"
fi
@@ -418,32 +348,28 @@ if test "$DSO" != ":"; then
# rather than to the executables. This makes things smaller if you
# are using any static libraries, and it also allows us to distribute
# a single DSO rather than a bunch...
DSOLIBS="\$(LIBPNG) \$(LIBTIFF) \$(LIBJPEG) \$(LIBZ)"
DSOLIBS="\$(LIBJPEG) \$(LIBPNG) \$(LIBTIFF) \$(LIBZ)"
IMGLIBS=""
# The *BSD, HP-UX, and Solaris run-time linkers need help when
# deciding where to find a DSO. Add linker options to tell them
# where to find the DSO (usually in /usr/lib... duh!)
case $uname in
HP-UX*)
# HP-UX
DSOFLAGS="+b $libdir +fb $DSOFLAGS"
LDFLAGS="$LDFLAGS -Wl,+b,$libdir,+fb"
;;
SunOS*)
# Solaris
DSOFLAGS="-R$libdir $DSOFLAGS"
LDFLAGS="$LDFLAGS -R$libdir"
;;
FreeBSD* | NetBSD* | OpenBSD*)
# *BSD
DSOFLAGS="-Wl,-R$libdir $DSOFLAGS"
LDFLAGS="$LDFLAGS -Wl,-R$libdir"
;;
HP-UX*)
LDFLAGS="$LDFLAGS -Wl,+b,$libdir,+fb"
;;
SunOS*)
# Solaris
LDFLAGS="$LDFLAGS -R$libdir"
;;
FreeBSD* | NetBSD* | OpenBSD*)
# *BSD
LDFLAGS="$LDFLAGS -Wl,-R$libdir"
;;
esac
else
DSOLIBS=""
IMGLIBS="\$(LIBPNG) \$(LIBTIFF) \$(LIBJPEG) \$(LIBZ)"
IMGLIBS="\$(LIBJPEG) \$(LIBPNG) \$(LIBTIFF) \$(LIBZ)"
fi
AC_SUBST(DSO)
@@ -474,6 +400,11 @@ if test "$sharedstatedir" = "\${prefix}/com" -a "$prefix" = "/"; then
sharedstatedir="/usr/com"
fi
dnl Fix "infodir" variable if it hasn't been specified...
if test "$infodir" = "\${prefix}/info" -a "$prefix" = "/"; then
infodir="/usr/info"
fi
dnl Fix "datadir" variable if it hasn't been specified...
if test "$datadir" = "\${prefix}/share"; then
if test "$prefix" = "/"; then
@@ -514,28 +445,21 @@ fi
dnl Fix "mandir" variable...
if test "$mandir" = "\${prefix}/man" -a "$prefix" = "/"; then
case "$uname" in
FreeBSD* | NetBSD* | OpenBSD* | AIX*)
# *BSD + AIX
FreeBSD* | NetBSD* | OpenBSD*)
# *BSD
mandir="/usr/share/man"
AMANDIR="/usr/share/man"
;;
IRIX*)
# SGI IRIX
mandir="/usr/share/catman/u_man"
AMANDIR="/usr/share/catman/a_man"
mandir="/usr/share/catman"
;;
*)
# All others
mandir="/usr/man"
AMANDIR="/usr/man"
;;
esac
else
AMANDIR="$mandir"
fi
AC_SUBST(AMANDIR)
dnl Fix "fontpath" variable...
if test "x$fontpath" = "x"; then
fontpath="$datadir/cups/fonts"
@@ -548,109 +472,76 @@ case "$uname" in
CAT1EXT=0
CAT5EXT=0
CAT8EXT=0
MAN8EXT=8
;;
IRIX*)
# SGI IRIX
CAT1EXT=z
CAT5EXT=z
CAT8EXT=z
MAN8EXT=1m
;;
SunOS* | HP-UX*)
# Solaris and HP-UX
CAT1EXT=1
CAT5EXT=5
CAT8EXT=1m
MAN8EXT=1m
;;
*)
# All others
CAT1EXT=1
CAT5EXT=5
CAT8EXT=8
MAN8EXT=8
;;
esac
AC_SUBST(CAT1EXT)
AC_SUBST(CAT5EXT)
AC_SUBST(CAT8EXT)
AC_SUBST(MAN8EXT)
dnl Setup init.d locations...
if test x$rcdir = x; then
case "$uname" in
FreeBSD* | OpenBSD*)
# FreeBSD and OpenBSD
INITDIR=""
INITDDIR=""
;;
case "$uname" in
FreeBSD* | NetBSD* | OpenBSD*)
# *BSD
INITDIR=""
INITDDIR=""
;;
NetBSD*)
# NetBSD
INITDIR=""
INITDDIR="/etc/rc.d"
;;
Linux*)
# Linux seems to choose an init.d directory at random...
if test -d /sbin/init.d; then
# SuSE
INITDIR="/sbin/init.d"
INITDDIR=".."
else
if test -d /etc/rc.d; then
# RedHat
INITDIR="/etc/rc.d"
INITDDIR="../init.d"
else
# Others
INITDIR="/etc"
INITDDIR="../init.d"
fi
fi
;;
OSF1* | HP-UX*)
INITDIR="/sbin"
INITDDIR="../init.d"
;;
AIX*)
INITDIR="/etc/rc.d"
Linux*)
# Linux seems to choose an init.d directory at random...
if test -d /sbin/init.d; then
# SuSE
INITDIR="/sbin/init.d"
INITDDIR=".."
;;
else
if test -d /etc/rc.d; then
# RedHat
INITDIR="/etc/rc.d"
INITDDIR="../init.d"
else
# Others
INITDIR="/etc"
INITDDIR="../init.d"
fi
fi
;;
*)
INITDIR="/etc"
INITDDIR="../init.d"
;;
OSF1* | HP-UX*)
INITDIR="/sbin"
INITDDIR="../init.d"
;;
esac
else
INITDIR=""
INITDDIR="$rcdir"
fi
*)
INITDIR="/etc"
INITDDIR="../init.d"
;;
esac
AC_SUBST(INITDIR)
AC_SUBST(INITDDIR)
dnl Setup default locations...
CUPS_SERVERROOT='${sysconfdir}/cups'
CUPS_SERVERROOT='${sysconfdif}/cups'
CUPS_LOGDIR='${localstatedir}/log/cups'
CUPS_REQUESTS='${localstatedir}/spool/cups'
AC_DEFINE_UNQUOTED(CUPS_SERVERROOT, "$sysconfdir/cups")
AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$localstatedir/log/cups")
AC_DEFINE_UNQUOTED(CUPS_REQUESTS, "$localstatedir/spool/cups")
if test x$logdir = x; then
CUPS_LOGDIR='${localstatedir}/log/cups'
AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$localstatedir/log/cups")
else
CUPS_LOGDIR="$logdir"
AC_DEFINE_UNQUOTED(CUPS_LOGDIR, "$logdir")
fi
dnl See what directory to put server executables...
case "$uname" in
FreeBSD* | NetBSD* | OpenBSD*)
@@ -680,7 +571,7 @@ case "$uname" in
AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$datadir/locale")
;;
OSF1* | AIX*)
OSF1*)
CUPS_LOCALEDIR='${exec_prefix}/lib/nls/msg'
AC_DEFINE_UNQUOTED(CUPS_LOCALEDIR, "$exec_prefix/lib/nls/msg")
;;
@@ -700,14 +591,8 @@ AC_DEFINE_UNQUOTED(CUPS_DATADIR, "$datadir/cups")
AC_SUBST(CUPS_DATADIR)
dnl Set the CUPS_DOCROOT directory...
if test x$docdir = x; then
CUPS_DOCROOT='${datadir}/doc/cups'
docdir="$datadir/doc/cups"
else
CUPS_DOCROOT="$docdir"
fi
AC_DEFINE_UNQUOTED(CUPS_DOCROOT, "$docdir")
CUPS_DOCROOT='${datadir}/doc/cups'
AC_DEFINE_UNQUOTED(CUPS_DOCROOT, "$datadir/doc/cups")
AC_SUBST(CUPS_DOCROOT)
dnl Set the CUPS_FONTPATH directory...
+35 -35
Ver Arquivo
@@ -1,10 +1,10 @@
#
# "$Id: cups.list 1735 2001-05-21 21:39:39Z mike $"
# "$Id: cups.list 1471 2000-12-11 04:40:31Z mike $"
#
# ESP Package Manager (EPM) file list for the Common UNIX Printing
# System (CUPS).
#
# Copyright 1997-2001 by Easy Software Products, all rights reserved.
# Copyright 1997-2000 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
# property of Easy Software Products and are protected by Federal
@@ -25,11 +25,11 @@
# Product information
%product Common UNIX Printing System
%copyright 1993-2001 by Easy Software Products, All Rights Reserved.
%copyright 1993-2000 by Easy Software Products, All Rights Reserved.
%vendor Easy Software Products
%license LICENSE.txt
%readme README.txt
%version 1.1.8
%version 1.1.5
%incompat printpro
# Server programs
@@ -217,37 +217,37 @@ f 0444 root sys $DOCDIR/images doc/images/*.gif
# Man pages
%system irix
d 0555 root sys $AMANDIR -
d 0555 root sys $AMANDIR/cat1 -
d 0555 root sys $MANDIR -
d 0555 root sys $MANDIR/cat1 -
d 0555 root sys $MANDIR/cat5 -
d 0555 root sys $MANDIR/a_man -
d 0555 root sys $MANDIR/a_man/cat1 -
d 0555 root sys $MANDIR/u_man -
d 0555 root sys $MANDIR/u_man/cat1 -
d 0555 root sys $MANDIR/u_man/cat5 -
f 0444 root sys $AMANDIR/cat1/accept.z man/accept.z
l 0444 root sys $AMANDIR/cat1/reject.z accept.z
f 0444 root sys $MANDIR/cat1/backend.z man/backend.z
f 0444 root sys $MANDIR/cat5/classes.conf.z man/classes.conf.z
f 0444 root sys $AMANDIR/cat1/cups-lpd.z man/cups-lpd.z
f 0444 root sys $AMANDIR/cat1/cups-polld.z man/cups-polld.z
f 0444 root sys $MANDIR/cat5/cupsd.conf.z man/cupsd.conf.z
f 0444 root sys $AMANDIR/cat1/cupsd.z man/cupsd.z
f 0444 root sys $AMANDIR/cat1/enable.z man/enable.z
l 0444 root sys $AMANDIR/cat1/disable.z enable.z
f 0444 root sys $MANDIR/cat1/filter.z man/filter.z
f 0444 root sys $AMANDIR/cat1/lpadmin.z man/lpadmin.z
f 0444 root sys $AMANDIR/cat1/lpc.z man/lpc.z
f 0444 root sys $AMANDIR/cat1/lpinfo.z man/lpinfo.z
f 0444 root sys $AMANDIR/cat1/lpmove.z man/lpmove.z
f 0444 root sys $MANDIR/cat1/lpoptions.z man/lpoptions.z
f 0444 root sys $MANDIR/cat1/lpq.z man/lpq.z
f 0444 root sys $MANDIR/cat1/lprm.z man/lprm.z
f 0444 root sys $MANDIR/cat1/lpr.z man/lpr.z
f 0444 root sys $MANDIR/cat1/lpstat.z man/lpstat.z
f 0444 root sys $MANDIR/cat1/lp.z man/lp.z
l 0444 root sys $MANDIR/cat1/cancel.z lp.z
f 0444 root sys $MANDIR/cat5/mime.convs.z man/mime.convs.z
f 0444 root sys $MANDIR/cat5/mime.types.z man/mime.types.z
f 0444 root sys $MANDIR/cat5/printers.conf.z man/printers.conf.z
f 0444 root sys $MANDIR/a_man/cat1/accept.z man/accept.z
l 0444 root sys $MANDIR/a_man/cat1/reject.z accept.z
f 0444 root sys $MANDIR/u_man/cat1/backend.z man/backend.z
f 0444 root sys $MANDIR/u_man/cat5/classes.conf.z man/classes.conf.z
f 0444 root sys $MANDIR/a_man/cat1/cups-lpd.z man/cups-lpd.z
f 0444 root sys $MANDIR/a_man/cat1/cups-polld.z man/cups-polld.z
f 0444 root sys $MANDIR/u_man/cat5/cupsd.conf.z man/cupsd.conf.z
f 0444 root sys $MANDIR/a_man/cat1/cupsd.z man/cupsd.z
f 0444 root sys $MANDIR/a_man/cat1/enable.z man/enable.z
l 0444 root sys $MANDIR/a_man/cat1/disable.z enable.z
f 0444 root sys $MANDIR/u_man/cat1/filter.z man/filter.z
f 0444 root sys $MANDIR/a_man/cat1/lpadmin.z man/lpadmin.z
f 0444 root sys $MANDIR/a_man/cat1/lpc.z man/lpc.z
f 0444 root sys $MANDIR/a_man/cat1/lpinfo.z man/lpinfo.z
f 0444 root sys $MANDIR/a_man/cat1/lpmove.z man/lpmove.z
f 0444 root sys $MANDIR/u_man/cat1/lpoptions.z man/lpoptions.z
f 0444 root sys $MANDIR/u_man/cat1/lpq.z man/lpq.z
f 0444 root sys $MANDIR/u_man/cat1/lprm.z man/lprm.z
f 0444 root sys $MANDIR/u_man/cat1/lpr.z man/lpr.z
f 0444 root sys $MANDIR/u_man/cat1/lpstat.z man/lpstat.z
f 0444 root sys $MANDIR/u_man/cat1/lp.z man/lp.z
l 0444 root sys $MANDIR/u_man/cat1/cancel.z lp.z
f 0444 root sys $MANDIR/u_man/cat5/mime.convs.z man/mime.convs.z
f 0444 root sys $MANDIR/u_man/cat5/mime.types.z man/mime.types.z
f 0444 root sys $MANDIR/u_man/cat5/printers.conf.z man/printers.conf.z
%system solaris hpux
d 0555 root sys $MANDIR/man1 -
@@ -316,5 +316,5 @@ f 0444 root sys $MANDIR/man5/printers.conf.5 man/printers.conf.man
i 0555 root sys cups cups.sh
#
# End of "$Id: cups.list 1735 2001-05-21 21:39:39Z mike $".
# End of "$Id: cups.list 1471 2000-12-11 04:40:31Z mike $".
#
+22 -55
Ver Arquivo
@@ -4,7 +4,13 @@
#
# Startup/shutdown script for the Common UNIX Printing System (CUPS).
#
# Copyright 1997-2001 by Easy Software Products, all rights reserved.
# Linux chkconfig stuff:
#
# chkconfig: 0235 99 00
# description: Startup/shutdown script for the Common UNIX \
# Printing System (CUPS).
#
# Copyright 1997-2000 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
# property of Easy Software Products and are protected by Federal
@@ -23,70 +29,34 @@
# WWW: http://www.cups.org
#
#### OS-Dependent Information
#
# Linux chkconfig stuff:
#
# chkconfig: 235 99 00
# description: Startup/shutdown script for the Common UNIX \
# Printing System (CUPS).
#
#
# NetBSD 1.5+ rcorder script lines. The format of the following two
# lines is very strict -- please don't add additional spaces!
#
# PROVIDE: cups
# REQUIRE: DAEMON
#
#### OS-Dependent Configuration
# See what program to use for configuration stuff...
case "`uname`" in
IRIX*)
IS_ON=/sbin/chkconfig
;;
NetBSD*)
IS_ON=:
;;
*)
IS_ON=/bin/true
;;
esac
#### OS-Independent Stuff
#
# The verbose flag controls the printing of the names of
# daemons as they are started. Currently always echos for
# all but IRIX, which can configure verbose bootup messages.
#
# daemons as they are started.
if $IS_ON verbose; then
ECHO=echo
else
ECHO=:
fi
#
# See if the CUPS server (cupsd) is running...
#
# See if the CUPS server is running...
case "`uname`" in
IRIX* | HP-UX* | SunOS* | AIX* | SINIX*)
IRIX* | HP-UX | SunOS)
pid=`ps -e | awk '{print $1,$4}' | grep cupsd | awk '{print $1}'`
;;
UnixWare*)
pid=`ps -e | awk '{print $1,$6}' | grep cupsd | awk '{print $1}'`
. /etc/TIMEZONE
;;
OSF1*)
OSF1)
pid=`ps -e | awk '{print $1,$5}' | grep cupsd | awk '{print $1}'`
;;
Linux* | NetBSD*)
Linux)
pid=`ps ax | awk '{print $1,$5}' | grep cupsd | awk '{print $1}'`
;;
*)
@@ -94,23 +64,24 @@ case "`uname`" in
;;
esac
#
# Start or stop the CUPS server based upon the first argument to the script.
#
case $1 in
start | restart | reload)
if $IS_ON cups; then
if test "$pid" != ""; then
if test "$pid" != ""; then
if $IS_ON cups; then
kill -HUP $pid
$ECHO "cups: scheduler restarted."
else
kill $pid
$ECHO "cups: scheduler stopped."
fi
else
if $IS_ON cups; then
prefix=@prefix@
exec_prefix=@exec_prefix@
@sbindir@/cupsd
$ECHO "cups: scheduler started."
fi
$ECHO "cups: scheduler ${1}ed."
else
$ECHO "cups: scheduler stopped."
fi
;;
@@ -135,10 +106,6 @@ case $1 in
;;
esac
#
# Exit with no errors.
#
exit 0
+24 -65
Ver Arquivo
@@ -1,11 +1,11 @@
#
# "$Id: cups.spec 1735 2001-05-21 21:39:39Z mike $"
# "$Id: cups.spec 1421 2000-10-19 20:55:06Z mike $"
#
# RPM "spec" file for the Common UNIX Printing System (CUPS).
#
# Original version by Jason McMullan <jmcc@ontv.com>.
#
# Copyright 1999-2001 by Easy Software Products, all rights reserved.
# Copyright 1999-2000 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
# property of Easy Software Products and are protected by Federal
@@ -26,8 +26,8 @@
Summary: Common Unix Printing System
Name: cups
Version: 1.1.8
Release: 1
Version: 1.1.5
Release: 0
Copyright: GPL
Group: System Environment/Daemons
Source: ftp://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.gz
@@ -36,20 +36,12 @@ Packager: Michael Sweet <mike@easysw.com>
Vendor: Easy Software Products
# use buildroot so as not to disturb the version already installed
BuildRoot: /var/tmp/%{name}-root
Conflicts: lpr, LPRng
Provides: libcups.so.2
Provides: libcupsimage.so.2
Provides: cupsd
Conflicts: lpr
%package devel
Summary: Common Unix Printing System - development environment
Group: Development/Libraries
%package pstoraster
Summary: Common Unix Printing System - PostScript RIP
Group: System Environment/Daemons
Provides: pstoraster
%description
The Common UNIX Printing System provides a portable printing layer for
UNIX® operating systems. It has been developed by Easy Software Products
@@ -61,11 +53,6 @@ The Common UNIX Printing System provides a portable printing layer for
UNIX® operating systems. This is the development package for creating
additional printer drivers, and other CUPS services.
%description devel
The Common UNIX Printing System provides a portable printing layer for
UNIX® operating systems. This is the PostScript RIP package for
supporting non-PostScript printer drivers.
%prep
%setup
@@ -76,18 +63,21 @@ supporting non-PostScript printer drivers.
make
%install
# Make sure the RPM_BUILD_ROOT directory exists.
# these lines just make sure the directory structure in the
# RPM_BUILD_ROOT exists
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/rc0.d
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/rc3.d
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/rc5.d
make prefix=$RPM_BUILD_ROOT \
exec_prefix=$RPM_BUILD_ROOT/usr \
AMANDIR=$RPM_BUILD_ROOT/usr/man \
BINDIR=$RPM_BUILD_ROOT/usr/bin \
DATADIR=$RPM_BUILD_ROOT/usr/share/cups \
DOCDIR=$RPM_BUILD_ROOT/usr/share/doc/cups \
INCLUDEDIR=$RPM_BUILD_ROOT/usr/include \
LIBDIR=$RPM_BUILD_ROOT/usr/lib \
LOGDIR=$RPM_BUILD_ROOT/var/log/cups \
LOCALEDIR=$RPM_BUILD_ROOT/usr/share/locale \
MANDIR=$RPM_BUILD_ROOT/usr/man \
PAMDIR=$RPM_BUILD_ROOT/etc/pam.d \
@@ -103,17 +93,15 @@ if test -x /sbin/chkconfig; then
/sbin/chkconfig cups on
fi
# these lines automatically start cupsd after installation; commented out
# by request...
#if test -f /sbin/init.d/cups; then
# /sbin/init.d/cups start
#fi
#if test -f /etc/rc.d/init.d/cups; then
# /etc/rc.d/init.d/cups start
#fi
#if test -f /etc/init.d/cups; then
# /etc/init.d/cups start
#fi
if test -f /sbin/init.d/cups; then
/sbin/init.d/cups start
fi
if test -f /etc/rc.d/init.d/cups; then
/etc/rc.d/init.d/cups start
fi
if test -f /etc/init.d/cups; then
/etc/init.d/cups start
fi
%preun
if test -f /sbin/init.d/cups; then
@@ -136,7 +124,7 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%dir /etc/cups
%config(noreplace) /etc/cups/*.conf
%config /etc/cups/*.conf
%dir /etc/cups/certs
%dir /etc/cups/interfaces
/etc/cups/mime.types
@@ -166,32 +154,11 @@ rm -rf $RPM_BUILD_ROOT
/usr/bin/*
/usr/lib/*.so*
%dir /usr/lib/cups
%dir /usr/lib/cups/backend
/usr/lib/cups/backend/*
%dir /usr/lib/cups/cgi-bin
/usr/lib/cups/cgi-bin/*
%dir /usr/lib/cups/filter
/usr/lib/cups/filter/hpgltops
/usr/lib/cups/filter/imagetops
/usr/lib/cups/filter/imagetoraster
/usr/lib/cups/filter/pdftops
/usr/lib/cups/filter/pstops
/usr/lib/cups/filter/rastertoepson
/usr/lib/cups/filter/rastertohp
/usr/lib/cups/filter/texttops
/usr/lib/cups/*
/usr/man/*
/usr/sbin/*
%dir /usr/share/cups
%dir /usr/share/cups/banners
/usr/share/cups/banners/*
%dir /usr/share/cups/charsets
/usr/share/cups/charsets/*
%dir /usr/share/cups/data
/usr/share/cups/data/*
%dir /usr/share/cups/model
/usr/share/cups/model/*
%dir /usr/share/cups/templates
/usr/share/cups/templates/*
/usr/share/cups/*
%dir /usr/share/doc/cups
/usr/share/doc/cups/*
%dir /usr/share/locale
@@ -204,14 +171,6 @@ rm -rf $RPM_BUILD_ROOT
/usr/include/cups/*
/usr/lib/*.a
%files pstoraster
%dir /usr/lib/cups/filter
/usr/lib/cups/filter/pstoraster
%dir /usr/share/cups/fonts
/usr/share/cups/fonts/*
%dir /usr/share/cups/pstoraster
/usr/share/cups/pstoraster/*
#
# End of "$Id: cups.spec 1735 2001-05-21 21:39:39Z mike $".
# End of "$Id: cups.spec 1421 2000-10-19 20:55:06Z mike $".
#
+6 -10
Ver Arquivo
@@ -3,7 +3,7 @@
#
# Support library Makefile for the Common UNIX Printing System (CUPS).
#
# Copyright 1997-2001 by Easy Software Products, all rights reserved.
# Copyright 1997-2000 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
# property of Easy Software Products and are protected by Federal
@@ -28,9 +28,8 @@ include ../Makedefs
# Object files...
#
LIBOBJS = dest.o emit.o encode.o http.o ipp.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 = dest.o emit.o http.o ipp.o language.o mark.o md5.o md5passwd.o \
options.o page.o ppd.o snprintf.o string.o usersys.o util.o
OBJS = $(LIBOBJS) testhttp.o testppd.o
@@ -88,7 +87,7 @@ install: all
libcups.so.2 libcups.sl.2: $(LIBOBJS) ../Makedefs
echo Linking $@...
$(DSO) $(DSOFLAGS) -o $@ $(LIBOBJS) $(SSLLIBS)
$(DSO) $@ $(LIBOBJS) $(LDFLAGS) $(SSLLIBS)
$(RM) `basename $@ .2`
$(LN) $@ `basename $@ .2`
@@ -99,8 +98,7 @@ libcups.so.2 libcups.sl.2: $(LIBOBJS) ../Makedefs
libcups.la: $(LIBOBJS) ../Makedefs
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
-version-info 2:3 $(SSLLIBS)
$(CC) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) -version-info 2:0
#
@@ -125,7 +123,6 @@ cups_C.h: ../locale/C/cups_C
dest.o: cups.h http.h ipp.h language.h string.h
emit.o: ppd.h
encode.o: cups.h ipp.h string.h
http.o: http.h ipp.h md5.h string.h
ipp.o: http.h ipp.h string.h language.h
language.o: cups_C.h language.h string.h
@@ -136,7 +133,6 @@ page.o: ppd.h
ppd.o: language.h ppd.h
snprintf.o: string.h
string.o: string.h
tempfile.o: cups.h string.h
usersys.o: cups.h
util.o: cups.h http.h ipp.h
@@ -147,7 +143,7 @@ util.o: cups.h http.h ipp.h
testhttp: testhttp.o libcups.a
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testhttp.o libcups.a $(NETLIBS) $(SSLLIBS)
$(CC) $(LDFLAGS) -o $@ testhttp.o libcups.a $(NETLIBS)
testhttp.o: http.h
+2 -21
Ver Arquivo
@@ -3,7 +3,7 @@
*
* API definitions for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products.
* Copyright 1997-2000 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -94,22 +94,7 @@ typedef struct /**** Destination ****/
cups_option_t *options; /* Options */
} cups_dest_t;
typedef struct /**** Job ****/
{
int id; /* The job ID */
char *dest, /* Printer or class name */
*title, /* Title/job name */
*user, /* User the submitted the job */
*format; /* Document format */
ipp_jstate_t state; /* Job state */
int size, /* Size in kilobytes */
priority; /* Priority (1-100) */
time_t completed_time, /* Time the job was completed */
creation_time, /* Time the job was created */
processing_time; /* Time the job was processed */
} cups_job_t;
/*
* Functions...
*/
@@ -119,11 +104,8 @@ extern int cupsCancelJob(const char *printer, int job);
extern ipp_t *cupsDoFileRequest(http_t *http, ipp_t *request,
const char *resource, const char *filename);
extern http_encryption_t cupsEncryption(void);
extern void cupsFreeJobs(int num_jobs, cups_job_t *jobs);
extern int cupsGetClasses(char ***classes);
extern const char *cupsGetDefault(void);
extern int cupsGetJobs(cups_job_t **jobs, const char *dest,
int myjobs, int completed);
extern const char *cupsGetPPD(const char *printer);
extern int cupsGetPrinters(char ***printers);
extern ipp_status_t cupsLastError(void);
@@ -134,7 +116,6 @@ extern int cupsPrintFiles(const char *printer, int num_files,
const char **files, const char *title,
int num_options, cups_option_t *options);
extern char *cupsTempFile(char *filename, int len);
extern int cupsTempFd(char *filename, int len);
extern int cupsAddDest(const char *name, const char *instance,
int num_dests, cups_dest_t **dests);
+1 -1
Ver Arquivo
@@ -18,7 +18,7 @@
"Cyan",
"Magenta",
"Yellow",
"Copyright 1993-2001 by Easy Software Products, All Rights Reserved.",
"Copyright 1993-2000 by Easy Software Products, All Rights Reserved.",
"General",
"Printer",
"Image",
+1 -1
Ver Arquivo
@@ -3,7 +3,7 @@
*
* Debugging macros for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products.
* Copyright 1997-2000 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
+4 -29
Ver Arquivo
@@ -4,7 +4,7 @@
* User-defined destination (and option) support for the Common UNIX
* Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products.
* Copyright 1997-2000 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -210,9 +210,6 @@ cupsGetDests(cups_dest_t **dests) /* O - Destinations */
cups_dest_t *dest; /* Destination pointer */
const char *home; /* HOME environment variable */
char filename[1024]; /* Local ~/.lpoptions file */
const char *defprinter; /* Default printer */
char name[1024], /* Copy of printer name */
*instance; /* Pointer to instance name */
/*
@@ -256,25 +253,8 @@ cupsGetDests(cups_dest_t **dests) /* O - Destinations */
* Grab the default destination...
*/
if ((defprinter = cupsGetDefault()) != NULL)
{
/*
* Grab printer and instance name...
*/
strncpy(name, defprinter, sizeof(name) - 1);
name[sizeof(name) - 1] = '\0';
if ((instance = strchr(name, '/')) != NULL)
*instance++ = '\0';
/*
* Lookup the printer and instance and make it the default...
*/
if ((dest = cupsGetDest(name, instance, num_dests, *dests)) != NULL)
dest->is_default = 1;
}
if ((dest = cupsGetDest(cupsGetDefault(), NULL, num_dests, *dests)) != NULL)
dest->is_default = 1;
/*
* Load the /etc/cups/lpoptions and ~/.lpoptions files...
@@ -365,12 +345,7 @@ cupsSetDests(int num_dests, /* I - Number of destinations */
for (j = dest->num_options, option = dest->options; j > 0; j --, option ++)
if (option->value[0])
{
if (strchr(option->value, ' ') != NULL)
fprintf(fp, " %s=\"%s\"", option->name, option->value);
else
fprintf(fp, " %s=%s", option->name, option->value);
}
fprintf(fp, " %s=%s", option->name, option->value);
else
fprintf(fp, " %s", option->name);
+1 -90
Ver Arquivo
@@ -3,7 +3,7 @@
*
* PPD code emission routines for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products, all rights reserved.
* Copyright 1997-2000 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -28,7 +28,6 @@
* ppdCollect() - Collect all marked options that reside in the specified
* ppdEmit() - Emit code for marked options to a file.
* ppdEmitFd() - Emit code for marked options to a file.
* ppdEmitJCL() - Emit code for JCL options to a file.
* ppd_sort() - Sort options by ordering numbers...
*/
@@ -315,94 +314,6 @@ ppdEmitFd(ppd_file_t *ppd, /* I - PPD file record */
}
/*
* 'ppdEmitJCL()' - Emit code for JCL options to a file.
*/
int /* O - 0 on success, -1 on failure */
ppdEmitJCL(ppd_file_t *ppd, /* I - PPD file record */
FILE *fp, /* I - File to write to */
int job_id, /* I - Job ID */
const char *user, /* I - Username */
const char *title) /* I - Title */
{
const char *ptr; /* Pointer into JCL string */
/*
* Range check the input...
*/
if (ppd == NULL || ppd->jcl_begin == NULL || ppd->jcl_ps == NULL)
return (0);
/*
* See if the printer supports HP PJL...
*/
if (strncmp(ppd->jcl_begin, "\033%-12345X@", 10) == 0)
{
/*
* This printer uses HP PJL commands for output; filter the output
* so that we only have a single "@PJL JOB" command in the header...
*/
fputs("\033%-12345X", fp);
for (ptr = ppd->jcl_begin + 9; *ptr;)
if (strncmp(ptr, "@PJL JOB", 8) == 0)
{
/*
* Skip job command...
*/
for (;*ptr; ptr ++)
if (*ptr == '\n')
break;
if (*ptr)
ptr ++;
}
else
{
/*
* Copy line...
*/
for (;*ptr; ptr ++)
{
putc(*ptr, fp);
if (*ptr == '\n')
break;
}
if (*ptr)
ptr ++;
}
/*
* Eliminate any path info from the job title...
*/
if ((ptr = strrchr(title, '/')) != NULL)
title = ptr + 1;
/*
* Send PJL JOB command before we enter PostScript mode...
*/
fprintf(fp, "@PJL JOB NAME = \"%s\" DISPLAY = \"%d %s %s\"\n", title,
job_id, user, title);
}
else
fputs(ppd->jcl_begin, stdout);
ppdEmit(ppd, stdout, PPD_ORDER_JCL);
fputs(ppd->jcl_ps, stdout);
return (0);
}
/*
* 'ppd_sort()' - Sort options by ordering numbers...
*/
-311
Ver Arquivo
@@ -1,311 +0,0 @@
/*
* "$Id$"
*
* Option encoding routines for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 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
*
* Contents:
*
* cupsEncodeOptions() - Encode printer options into IPP attributes.
*/
/*
* Include necessary headers...
*/
#include "cups.h"
#include <stdlib.h>
#include <ctype.h>
#include "string.h"
#include "debug.h"
/*
* 'cupsEncodeOptions()' - Encode printer options into IPP attributes.
*/
void
cupsEncodeOptions(ipp_t *ipp, /* I - Request to add to */
int num_options, /* I - Number of options */
cups_option_t *options) /* I - Options */
{
int i, j; /* Looping vars */
int count; /* Number of values */
int n; /* Attribute value */
char *s, /* Pointer into option value */
*val, /* Pointer to option value */
*copy, /* Copy of option value */
*sep; /* Option separator */
ipp_attribute_t *attr; /* IPP job-id attribute */
DEBUG_printf(("cupsEncodeOptions(%p, %d, %p)\n", ipp, num_options, options));
if (ipp == NULL || num_options < 1 || options == NULL)
return;
/*
* Handle the document format stuff first...
*/
if ((val = (char *)cupsGetOption("document-format", num_options, options)) != NULL)
ippAddString(ipp, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE, "document-format",
NULL, val);
else if (cupsGetOption("raw", num_options, options))
ippAddString(ipp, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE, "document-format",
NULL, "application/vnd.cups-raw");
else
ippAddString(ipp, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE, "document-format",
NULL, "application/octet-stream");
/*
* Then add all other options...
*/
for (i = 0; i < num_options; i ++)
{
/*
* Skip document format options - handled above...
*/
if (strcasecmp(options[i].name, "raw") == 0 ||
strcasecmp(options[i].name, "document-format") == 0 ||
!options[i].name[0])
continue;
/*
* Count the number of values...
*/
for (count = 1, sep = options[i].value;
(sep = strchr(sep + 1, ',')) != NULL;
count ++);
DEBUG_printf(("cupsEncodeOptions: option = \'%s\', count = %d\n",
options[i].name, count));
if ((attr = _ipp_add_attr(ipp, count)) == NULL)
{
/*
* Ran out of memory!
*/
DEBUG_puts("cupsEncodeOptions: Ran out of memory for attributes!");
return;
}
attr->group_tag = IPP_TAG_JOB;
if ((attr->name = strdup(options[i].name)) == NULL)
{
/*
* Ran out of memory!
*/
DEBUG_puts("cupsEncodeOptions: Ran out of memory for name!");
return;
}
if (count > 1)
{
/*
* Make a copy of the value we can fiddle with...
*/
if ((copy = strdup(options[i].value)) == NULL)
{
/*
* Ran out of memory!
*/
DEBUG_puts("cupsEncodeOptions: Ran out of memory for value copy!");
return;
}
val = copy;
}
else
{
/*
* Since we have a single value, use the value directly...
*/
val = options[i].value;
copy = NULL;
}
/*
* See what the option value is; for compatibility with older interface
* scripts, we have to support single-argument options as well as
* option=value, option=low-high, option=MxN, and option=val1,val2,...,valN.
*/
if (*val == '\0')
{
/*
* Old-style System V boolean value...
*/
attr->value_tag = IPP_TAG_BOOLEAN;
if (strncasecmp(attr->name, "no", 2) == 0)
{
DEBUG_puts("cupsEncodeOptions: Added boolean false value...");
strcpy(attr->name, attr->name + 2);
attr->values[0].boolean = 0;
}
else
{
DEBUG_puts("cupsEncodeOptions: Added boolean true value...");
attr->values[0].boolean = 1;
}
}
else
{
/*
* Scan the value string for values...
*/
for (j = 0; *val != '\0'; val = sep, j ++)
{
/*
* Find the end of this value and mark it if needed...
*/
if ((sep = strchr(val, ',')) != NULL)
*sep++ = '\0';
else
sep = val + strlen(val);
/*
* See what kind of value it is...
*/
if (strcasecmp(val, "true") == 0 ||
strcasecmp(val, "on") == 0 ||
strcasecmp(val, "yes") == 0)
{
/*
* Boolean value - true...
*/
attr->value_tag = IPP_TAG_BOOLEAN;
attr->values[j].boolean = 1;
DEBUG_puts("cupsEncodeOptions: Added boolean true value...");
}
else if (strcasecmp(val, "false") == 0 ||
strcasecmp(val, "off") == 0 ||
strcasecmp(val, "no") == 0)
{
/*
* Boolean value - false...
*/
attr->value_tag = IPP_TAG_BOOLEAN;
attr->values[j].boolean = 0;
DEBUG_puts("cupsEncodeOptions: Added boolean false value...");
}
else
{
/*
* Number, range, resolution, or string...
*/
n = strtol(val, &s, 0);
if (*s != '\0' && *s != '-' && (*s != 'x' || s == val))
{
/*
* String value(s)...
*/
if ((attr->values[j].string.text = strdup(val)) == NULL)
{
/*
* Ran out of memory!
*/
DEBUG_puts("cupsEncodeOptions: Ran out of memory for string!");
return;
}
attr->value_tag = IPP_TAG_NAME;
DEBUG_printf(("cupsEncodeOptions: Added string value \'%s\'...\n", val));
}
else if (*s == '-')
{
attr->value_tag = IPP_TAG_RANGE;
attr->values[j].range.lower = n;
attr->values[j].range.upper = strtol(s + 1, NULL, 0);
DEBUG_printf(("cupsEncodeOptions: Added range option value %d-%d...\n",
n, attr->values[j].range.upper));
}
else if (*s == 'x')
{
attr->value_tag = IPP_TAG_RESOLUTION;
attr->values[j].resolution.xres = n;
attr->values[j].resolution.yres = strtol(s + 1, &s, 0);
if (strcasecmp(s, "dpc") == 0)
attr->values[j].resolution.units = IPP_RES_PER_CM;
else if (strcasecmp(s, "dpi") == 0)
attr->values[j].resolution.units = IPP_RES_PER_INCH;
else
{
if ((attr->values[j].string.text = strdup(val)) == NULL)
{
/*
* Ran out of memory!
*/
DEBUG_puts("cupsEncodeOptions: Ran out of memory for string!");
return;
}
attr->value_tag = IPP_TAG_NAME;
DEBUG_printf(("cupsEncodeOptions: Added string value \'%s\'...\n", val));
continue;
}
DEBUG_printf(("cupsEncodeOptions: Adding resolution option value %s...\n",
val));
}
else
{
attr->value_tag = IPP_TAG_INTEGER;
attr->values[j].integer = n;
DEBUG_printf(("cupsEncodeOptions: Adding integer option value %d...\n", n));
}
}
}
}
}
}
/*
* End of "$Id$".
*/
+107 -205
Ver Arquivo
@@ -3,7 +3,7 @@
*
* HTTP routines for the Common UNIX Printing System (CUPS) scheduler.
*
* Copyright 1997-2001 by Easy Software Products, all rights reserved.
* Copyright 1997-2000 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -23,42 +23,41 @@
*
* Contents:
*
* httpInitialize() - Initialize the HTTP interface library and set the
* default HTTP proxy (if any).
* httpCheck() - Check to see if there is a pending response from
* the server.
* httpClose() - Close an HTTP connection...
* httpConnect() - Connect to a HTTP server.
* httpConnectEncrypt() - Connect to a HTTP server using encryption.
* httpEncryption() - Set the required encryption on the link.
* httpReconnect() - Reconnect to a HTTP server...
* httpSeparate() - Separate a Universal Resource Identifier into its
* components.
* httpSetField() - Set the value of an HTTP header.
* httpDelete() - Send a DELETE request to the server.
* httpGet() - Send a GET request to the server.
* httpHead() - Send a HEAD request to the server.
* httpOptions() - Send an OPTIONS request to the server.
* httpPost() - Send a POST request to the server.
* httpPut() - Send a PUT request to the server.
* httpTrace() - Send an TRACE request to the server.
* httpFlush() - Flush data from a HTTP connection.
* httpRead() - Read data from a HTTP connection.
* httpWrite() - Write data to a HTTP connection.
* httpGets() - Get a line of text from a HTTP connection.
* httpPrintf() - Print a formatted string to a HTTP connection.
* httpStatus() - Return a short string describing a HTTP status code.
* httpGetDateString() - Get a formatted date/time string from a time value.
* httpGetDateTime() - Get a time value from a formatted date/time string.
* httpUpdate() - Update the current HTTP state for incoming data.
* httpDecode64() - Base64-decode a string.
* httpEncode64() - Base64-encode a string.
* httpGetLength() - Get the amount of data remaining from the
* content-length or transfer-encoding fields.
* http_field() - Return the field index for a field name.
* http_send() - Send a request with all fields and the trailing
* blank line.
* http_upgrade() - Force upgrade to TLS encryption.
* httpInitialize() - Initialize the HTTP interface library and set the
* default HTTP proxy (if any).
* httpCheck() - Check to see if there is a pending response from
* the server.
* httpClose() - Close an HTTP connection...
* httpConnect() - Connect to a HTTP server.
* httpEncryption() - Set the required encryption on the link.
* httpReconnect() - Reconnect to a HTTP server...
* httpSeparate() - Separate a Universal Resource Identifier into its
* components.
* httpSetField() - Set the value of an HTTP header.
* httpDelete() - Send a DELETE request to the server.
* httpGet() - Send a GET request to the server.
* httpHead() - Send a HEAD request to the server.
* httpOptions() - Send an OPTIONS request to the server.
* httpPost() - Send a POST request to the server.
* httpPut() - Send a PUT request to the server.
* httpTrace() - Send an TRACE request to the server.
* httpFlush() - Flush data from a HTTP connection.
* httpRead() - Read data from a HTTP connection.
* httpWrite() - Write data to a HTTP connection.
* httpGets() - Get a line of text from a HTTP connection.
* httpPrintf() - Print a formatted string to a HTTP connection.
* httpStatus() - Return a short string describing a HTTP status code.
* httpGetDateString() - Get a formatted date/time string from a time value.
* httpGetDateTime() - Get a time value from a formatted date/time string.
* httpUpdate() - Update the current HTTP state for incoming data.
* httpDecode64() - Base64-decode a string.
* httpEncode64() - Base64-encode a string.
* httpGetLength() - Get the amount of data remaining from the
* content-length or transfer-encoding fields.
* http_field() - Return the field index for a field name.
* http_send() - Send a request with all fields and the trailing
* blank line.
* http_upgrade() - Force upgrade to TLS encryption.
*/
/*
@@ -82,7 +81,6 @@
#endif /* !WIN32 && !__EMX__ */
#ifdef HAVE_LIBSSL
# include <openssl/err.h>
# include <openssl/rand.h>
# include <openssl/ssl.h>
#endif /* HAVE_LIBSSL */
@@ -105,9 +103,7 @@
static http_field_t http_field(const char *name);
static int http_send(http_t *http, http_state_t request,
const char *uri);
#ifdef HAVE_LIBSSL
static int http_upgrade(http_t *http);
#endif /* HAVE_LIBSSL */
/*
@@ -180,9 +176,10 @@ void
httpInitialize(void)
{
#ifdef HAVE_LIBSSL
# if defined(WIN32) || defined(__EMX__)
# else
struct timeval curtime; /* Current time in microseconds */
int i; /* Looping var */
unsigned char data[1024]; /* Seed data */
# endif /* WIN32 || __EMX__ */
#endif /* HAVE_LIBSSL */
#if defined(WIN32) || defined(__EMX__)
@@ -210,7 +207,6 @@ httpInitialize(void)
#endif /* WIN32 || __EMX__ */
#ifdef HAVE_LIBSSL
SSL_load_error_strings();
SSL_library_init();
/*
@@ -218,13 +214,11 @@ httpInitialize(void)
* it is the best we can do (on others, this seed isn't even used...)
*/
# if defined(WIN32) || defined(__EMX__)
# else
gettimeofday(&curtime, NULL);
srand(curtime.tv_sec + curtime.tv_usec);
for (i = 0; i < sizeof(data); i ++)
data[i] = rand(); /* Yes, this is a poor source of random data... */
RAND_seed(&data, sizeof(data));
RAND_seed(&curtime, sizeof(curtime));
# endif /* WIN32 || __EMX__ */
#endif /* HAVE_LIBSSL */
}
@@ -311,32 +305,6 @@ httpClose(http_t *http) /* I - Connection to close */
http_t * /* O - New HTTP connection */
httpConnect(const char *host, /* I - Host to connect to */
int port) /* I - Port number */
{
http_encryption_t encrypt;/* Type of encryption to use */
/*
* Set the default encryption status...
*/
if (port == 443)
encrypt = HTTP_ENCRYPT_ALWAYS;
else
encrypt = HTTP_ENCRYPT_IF_REQUESTED;
return (httpConnectEncrypt(host, port, encrypt));
}
/*
* 'httpConnectEncrypt()' - Connect to a HTTP server using encryption.
*/
http_t * /* O - New HTTP connection */
httpConnectEncrypt(const char *host, /* I - Host to connect to */
int port, /* I - Port number */
http_encryption_t encrypt)
/* I - Type of encryption to use */
{
http_t *http; /* New HTTP connection */
struct hostent *hostaddr; /* Host address data */
@@ -352,23 +320,6 @@ httpConnectEncrypt(const char *host, /* I - Host to connect to */
*/
if ((hostaddr = gethostbyname(host)) == NULL)
{
/*
* This hack to make users that don't have a localhost entry in
* their hosts file or DNS happy...
*/
if (strcasecmp(host, "localhost") != 0)
return (NULL);
else if ((hostaddr = gethostbyname("127.0.0.1")) == NULL)
return (NULL);
}
/*
* Verify that it is an IPv4 address (IPv6 support will come in CUPS 1.2...)
*/
if (hostaddr->h_addrtype != AF_INET || hostaddr->h_length != 4)
return (NULL);
/*
@@ -382,7 +333,6 @@ httpConnectEncrypt(const char *host, /* I - Host to connect to */
http->version = HTTP_1_1;
http->blocking = 1;
http->activity = time(NULL);
http->fd = -1;
/*
* Copy the hostname and port and then "reconnect"...
@@ -398,10 +348,11 @@ httpConnectEncrypt(const char *host, /* I - Host to connect to */
#endif /* WIN32 */
/*
* Set the encryption status...
* Set the default encryption status...
*/
http->encryption = encrypt;
if (port == 443)
http->encryption = HTTP_ENCRYPT_ALWAYS;
/*
* Connect to the remote system...
@@ -477,7 +428,7 @@ httpReconnect(http_t *http) /* I - HTTP data */
* Close any previously open socket...
*/
if (http->fd >= 0)
if (http->fd)
#ifdef WIN32
closesocket(http->fd);
#else
@@ -532,8 +483,6 @@ httpReconnect(http_t *http) /* I - HTTP data */
close(http->fd);
#endif
http->fd = -1;
return (-1);
}
@@ -598,27 +547,12 @@ httpSeparate(const char *uri, /* I - Universal Resource Identifier */
char *ptr; /* Pointer into string... */
const char *atsign, /* @ sign */
*slash; /* Separator */
char safeuri[HTTP_MAX_URI]; /* "Safe" local copy of URI */
/*
* Range check input...
*/
if (uri == NULL || method == NULL || username == NULL || host == NULL ||
port == NULL || resource == NULL)
return;
/*
* Copy the URL to a local string to make sure we don't have a URL
* longer than HTTP_MAX_URI characters long...
*/
strncpy(safeuri, uri, sizeof(safeuri));
safeuri[sizeof(safeuri) - 1] = '\0';
uri = safeuri;
/*
* Grab the method portion of the URI...
*/
@@ -637,9 +571,9 @@ httpSeparate(const char *uri, /* I - Universal Resource Identifier */
* Standard URI with method...
*/
for (ptr = host; *uri != ':' && *uri != '\0'; uri ++)
if (ptr < (host + HTTP_MAX_URI - 1))
*ptr++ = *uri;
ptr = host;
while (*uri != ':' && *uri != '\0')
*ptr++ = *uri++;
*ptr = '\0';
if (*uri == ':')
@@ -654,7 +588,7 @@ httpSeparate(const char *uri, /* I - Universal Resource Identifier */
{
if ((ptr = strchr(host, '/')) != NULL)
{
strncpy(resource, ptr, HTTP_MAX_URI);
strncpy(resource, ptr, HTTP_MAX_URI - 1);
resource[HTTP_MAX_URI - 1] = '\0';
*ptr = '\0';
}
@@ -671,7 +605,7 @@ httpSeparate(const char *uri, /* I - Universal Resource Identifier */
if (*uri == '/')
{
strncpy(resource, uri, HTTP_MAX_URI);
strncpy(resource, uri, HTTP_MAX_URI - 1);
resource[HTTP_MAX_URI - 1] = '\0';
}
}
@@ -705,7 +639,7 @@ httpSeparate(const char *uri, /* I - Universal Resource Identifier */
}
/*
* Grab the username, if any...
* Grab the usenname, if any...
*/
while (*uri == '/')
@@ -720,9 +654,9 @@ httpSeparate(const char *uri, /* I - Universal Resource Identifier */
* Got a username:password combo...
*/
for (ptr = username; uri < atsign; uri ++)
if (ptr < (username + HTTP_MAX_URI - 1))
*ptr++ = *uri;
for (ptr = username;
uri < atsign && ptr < (username + sizeof(username) - 1);
*ptr++ = *uri++);
*ptr = '\0';
@@ -735,9 +669,9 @@ httpSeparate(const char *uri, /* I - Universal Resource Identifier */
* Grab the hostname...
*/
for (ptr = host; *uri != ':' && *uri != '/' && *uri != '\0'; uri ++)
if (ptr < (host + HTTP_MAX_URI - 1))
*ptr++ = *uri;
ptr = host;
while (*uri != ':' && *uri != '/' && *uri != '\0')
*ptr ++ = *uri ++;
*ptr = '\0';
@@ -784,7 +718,7 @@ httpSeparate(const char *uri, /* I - Universal Resource Identifier */
* The remaining portion is the resource string...
*/
strncpy(resource, uri, HTTP_MAX_URI);
strncpy(resource, uri, HTTP_MAX_URI - 1);
resource[HTTP_MAX_URI - 1] = '\0';
}
@@ -816,7 +750,7 @@ httpGetSubField(http_t *http, /* I - HTTP data */
* Skip leading whitespace...
*/
while (isspace(*fptr))
while (isspace(*fptr));
fptr ++;
if (*fptr == ',')
@@ -851,7 +785,7 @@ httpGetSubField(http_t *http, /* I - HTTP data */
fptr ++;
while (isspace(*fptr))
while (isspace(*fptr));
fptr ++;
if (*fptr == '\"')
@@ -1337,7 +1271,6 @@ httpGets(char *line, /* I - Line to read into */
lineptr = line;
bufptr = http->buffer;
bytes = 0;
length --;
while (bufptr < bufend && bytes < length)
{
@@ -1346,7 +1279,14 @@ httpGets(char *line, /* I - Line to read into */
if (*bufptr == 0x0a)
{
bufptr ++;
break;
*lineptr = '\0';
http->used -= bytes;
if (http->used > 0)
memcpy(http->buffer, bufptr, http->used);
DEBUG_printf(("httpGets(): Returning \"%s\"\n", line));
return (line);
}
else if (*bufptr == 0x0d)
bufptr ++;
@@ -1354,18 +1294,6 @@ httpGets(char *line, /* I - Line to read into */
*lineptr++ = *bufptr++;
}
if (bytes > 0)
{
*lineptr = '\0';
http->used -= bytes;
if (http->used > 0)
memcpy(http->buffer, bufptr, http->used);
DEBUG_printf(("httpGets(): Returning \"%s\"\n", line));
return (line);
}
DEBUG_puts("httpGets(): No new line available!");
return (NULL);
@@ -1901,15 +1829,12 @@ http_send(http_t *http, /* I - HTTP data */
* Encode the URI as needed...
*/
for (ptr = buf; *uri != '\0' && ptr < (buf + sizeof(buf) - 1); uri ++)
for (ptr = buf; *uri != '\0'; uri ++)
if (*uri <= ' ' || *uri >= 127)
{
if (ptr < (buf + sizeof(buf) - 1))
*ptr ++ = '%';
if (ptr < (buf + sizeof(buf) - 1))
*ptr ++ = hex[(*uri >> 4) & 15];
if (ptr < (buf + sizeof(buf) - 1))
*ptr ++ = hex[*uri & 15];
*ptr ++ = '%';
*ptr ++ = hex[(*uri >> 4) & 15];
*ptr ++ = hex[*uri & 15];
}
else
*ptr ++ = *uri;
@@ -1979,73 +1904,50 @@ http_send(http_t *http, /* I - HTTP data */
static int /* O - Status of connection */
http_upgrade(http_t *http) /* I - HTTP data */
{
int ret; /* Return value */
http_t myhttp; /* Local copy of HTTP data */
SSL_CTX *context; /* Context for encryption */
SSL *conn; /* Connection for encryption */
char buffer[1024]; /* Status from server... */
DEBUG_printf(("http_upgrade(%p)\n", http));
/*
* Copy the HTTP data to a local variable so we can do the OPTIONS
* request without interfering with the existing request data...
*/
memcpy(&myhttp, http, sizeof(myhttp));
/*
* Send an OPTIONS request to the server, requiring SSL or TLS
* encryption on the link...
*/
httpClearFields(&myhttp);
httpSetField(&myhttp, HTTP_FIELD_CONNECTION, "upgrade");
httpSetField(&myhttp, HTTP_FIELD_UPGRADE, "TLS/1.0, SSL/2.0, SSL/3.0");
if ((ret = httpOptions(&myhttp, "*")) == 0)
{
/*
* Wait for the secure connection...
*/
while (httpUpdate(&myhttp) == HTTP_CONTINUE);
}
httpFlush(&myhttp);
if (httpPrintf(http, "OPTIONS * HTTP/1.1\r\n") < 0)
return (-1);
if (httpPrintf(http, "Host: %s\r\n", http->hostname) < 0)
return (-1);
if (httpPrintf(http, "Connection: upgrade\r\n") < 0)
return (-1);
if (httpPrintf(http, "Upgrade: TLS/1.0, SSL/2.0, SSL/3.0\r\n") < 0)
return (-1);
if (httpPrintf(http, "\r\n") < 0)
return (-1);
/*
* Copy the HTTP data back over, if any...
* Wait for the response data...
*/
http->fd = myhttp.fd;
http->error = myhttp.error;
http->activity = myhttp.activity;
http->status = myhttp.status;
http->version = myhttp.version;
http->keep_alive = myhttp.keep_alive;
http->used = myhttp.used;
while (httpGets(buffer, sizeof(buffer), http) != NULL)
if (!buffer[0])
break;
if (http->used)
memcpy(http->buffer, myhttp.buffer, http->used);
context = SSL_CTX_new(SSLv23_method());
conn = SSL_new(context);
http->auth_type = myhttp.auth_type;
http->nonce_count = myhttp.nonce_count;
memcpy(http->nonce, myhttp.nonce, sizeof(http->nonce));
http->tls = myhttp.tls;
http->encryption = myhttp.encryption;
/*
* See if we actually went secure...
*/
if (!http->tls)
SSL_set_fd(conn, http->fd);
if (SSL_connect(conn) != 1)
{
/*
* Server does not support HTTP upgrade...
*/
SSL_CTX_free(context);
SSL_free(conn);
DEBUG_puts("Server does not support HTTP upgrade!");
#if defined(WIN32) || defined(__EMX__)
http->error = WSAGetLastError();
#else
http->error = errno;
#endif /* WIN32 || __EMX__ */
http->status = HTTP_ERROR;
#ifdef WIN32
closesocket(http->fd);
@@ -2053,12 +1955,12 @@ http_upgrade(http_t *http) /* I - HTTP data */
close(http->fd);
#endif
http->fd = -1;
return (-1);
}
else
return (ret);
http->tls = conn;
return (0);
}
#endif /* HAVE_LIBSSL */
+1 -3
Ver Arquivo
@@ -4,7 +4,7 @@
* Hyper-Text Transport Protocol definitions for the Common UNIX Printing
* System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products, all rights reserved.
* Copyright 1997-2000 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -290,8 +290,6 @@ extern int httpCheck(http_t *http);
httpSetField((http), HTTP_FIELD_HOST, (http)->hostname)
extern void httpClose(http_t *http);
extern http_t *httpConnect(const char *host, int port);
extern http_t *httpConnectEncrypt(const char *host, int port,
http_encryption_t encrypt);
extern int httpDelete(http_t *http, const char *uri);
extern int httpEncryption(http_t *http, http_encryption_t e);
# define httpError(http) ((http)->error)
+97 -271
Ver Arquivo
@@ -4,7 +4,7 @@
* Internet Printing Protocol support functions for the Common UNIX
* Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products, all rights reserved.
* Copyright 1997-2000 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -24,35 +24,32 @@
*
* Contents:
*
* ippAddBoolean() - Add a boolean attribute to an IPP request.
* ippAddBooleans() - Add an array of boolean values.
* ippAddDate() - Add a date attribute to an IPP request.
* ippAddInteger() - Add a integer attribute to an IPP request.
* ippAddIntegers() - Add an array of integer values.
* ippAddString() - Add a language-encoded string to an IPP request.
* ippAddStrings() - Add language-encoded strings to an IPP request.
* ippAddRange() - Add a range of values to an IPP request.
* ippAddRanges() - Add ranges of values to an IPP request.
* ippAddResolution() - Add a resolution value to an IPP request.
* ippAddResolutions() - Add resolution values to an IPP request.
* ippAddSeparator() - Add a group separator to an IPP request.
* ippDateToTime() - Convert from RFC 1903 Date/Time format to UNIX
* time in seconds.
* ippDelete() - Delete an IPP request.
* ippErrorString() - Return a textual message for the given error
* message.
* ippFindAttribute() - Find a named attribute in a request...
* ippFindNextAttribute() - Find the next named attribute in a request...
* ippLength() - Compute the length of an IPP request.
* ippNew() - Allocate a new IPP request.
* ippPort() - Return the default IPP port number.
* ippRead() - Read data for an IPP request.
* ippSetPort() - Set the default port number.
* ippTimeToDate() - Convert from UNIX time to RFC 1903 format.
* ippWrite() - Write data for an IPP request.
* _ipp_add_attr() - Add a new attribute to the request.
* _ipp_free_attr() - Free an attribute.
* ipp_read() - Semi-blocking read on a HTTP connection...
* ippAddBoolean() - Add a boolean attribute to an IPP request.
* ippAddBooleans() - Add an array of boolean values.
* ippAddDate() - Add a date attribute to an IPP request.
* ippAddInteger() - Add a integer attribute to an IPP request.
* ippAddIntegers() - Add an array of integer values.
* ippAddString() - Add a language-encoded string to an IPP request.
* ippAddStrings() - Add language-encoded strings to an IPP request.
* ippAddRange() - Add a range of values to an IPP request.
* ippAddRanges() - Add ranges of values to an IPP request.
* ippAddResolution() - Add a resolution value to an IPP request.
* ippAddResolutions() - Add resolution values to an IPP request.
* ippAddSeparator() - Add a group separator to an IPP request.
* ippDateToTime() - Convert from RFC 1903 Date/Time format to UNIX time
* ippDelete() - Delete an IPP request.
* ippErrorString() - Return a textual message for the given error message.
* ippFindAttribute() - Find a named attribute in a request...
* ippLength() - Compute the length of an IPP request.
* ippNew() - Allocate a new IPP request.
* ippPort() - Return the default IPP port number.
* ippRead() - Read data for an IPP request.
* ippSetPort() - Set the default port number.
* ippTimeToDate() - Convert from UNIX time to RFC 1903 format.
* ippWrite() - Write data for an IPP request.
* _ipp_add_attr() - Add a new attribute to the request.
* _ipp_free_attr() - Free an attribute.
* ipp_read() - Semi-blocking read on a HTTP connection...
*/
/*
@@ -501,7 +498,7 @@ ippAddSeparator(ipp_t *ipp) /* I - IPP request */
/*
* 'ippDateToTime()' - Convert from RFC 1903 Date/Time format to UNIX time
* in seconds.
* in seconds.
*/
time_t /* O - UNIX time value */
@@ -581,80 +578,75 @@ ippDelete(ipp_t *ipp) /* I - IPP request */
const char * /* O - Text string */
ippErrorString(ipp_status_t error) /* I - Error status */
{
static char unknown[255]; /* Unknown error statuses */
static const char *status_oks[] = /* "OK" status codes */
{
"successful-ok",
"successful-ok-ignored-or-substituted-attributes",
"successful-ok-conflicting-attributes",
"successful-ok-ignored-subscriptions",
"successful-ok-ignored-notifications",
"successful-ok-too-many-events",
"successful-ok-but-cancel-subscription"
},
*status_400s[] = /* Client errors */
{
"client-error-bad-request",
"client-error-forbidden",
"client-error-not-authenticated",
"client-error-not-authorized",
"client-error-not-possible",
"client-error-timeout",
"client-error-not-found",
"client-error-gone",
"client-error-request-entity-too-large",
"client-error-request-value-too-long",
"client-error-document-format-not-supported",
"client-error-attributes-or-values-not-supported",
"client-error-uri-scheme-not-supported",
"client-error-charset-not-supported",
"client-error-conflicting-attributes",
"client-error-compression-not-supported",
"client-error-compression-error",
"client-error-document-format-error",
"client-error-document-access-error",
"client-error-attributes-not-settable",
"client-error-ignored-all-subscriptions",
"client-error-too-many-subscriptions",
"client-error-ignored-all-notifications",
"client-error-print-support-file-not-found"
},
*status_500s[] = /* Server errors */
{
"server-error-internal-error",
"server-error-operation-not-supported",
"server-error-service-unavailable",
"server-error-version-not-supported",
"server-error-device-error",
"server-error-temporary-error",
"server-error-not-accepting-jobs",
"server-error-busy",
"server-error-job-canceled",
"server-error-multiple-document-jobs-not-supported",
"server-error-printer-is-deactivated"
};
static cups_lang_t *language = 0; /* Language info */
/*
* See if the error code is a known value...
* Load the localized message file as needed...
*/
if (error >= IPP_OK && error <= IPP_OK_BUT_CANCEL_SUBSCRIPTION)
return (status_oks[error]);
else if (error == IPP_REDIRECTION_OTHER_SITE)
return ("redirection-other-site");
else if (error >= IPP_BAD_REQUEST && error <= IPP_PRINT_SUPPORT_FILE_NOT_FOUND)
return (status_400s[error - IPP_BAD_REQUEST]);
else if (error >= IPP_INTERNAL_ERROR && error <= IPP_PRINTER_IS_DEACTIVATED)
return (status_500s[error - IPP_INTERNAL_ERROR]);
if (!language)
language = cupsLangDefault();
/*
* No, build an "unknown-xxxx" error string...
* Return the appropriate message...
*/
sprintf(unknown, "unknown-%04x", error);
switch (error)
{
case IPP_OK :
case IPP_OK_SUBST :
case IPP_OK_CONFLICT :
return ("OK");
case IPP_BAD_REQUEST :
return (cupsLangString(language, HTTP_BAD_REQUEST));
case IPP_FORBIDDEN :
return (cupsLangString(language, HTTP_FORBIDDEN));
case IPP_NOT_AUTHENTICATED :
case IPP_NOT_AUTHORIZED :
return (cupsLangString(language, HTTP_UNAUTHORIZED));
case IPP_NOT_POSSIBLE :
return (cupsLangString(language, HTTP_METHOD_NOT_ALLOWED));
case IPP_TIMEOUT :
return (cupsLangString(language, HTTP_REQUEST_TIMEOUT));
case IPP_NOT_FOUND :
return (cupsLangString(language, HTTP_NOT_FOUND));
case IPP_GONE :
return (cupsLangString(language, HTTP_GONE));
case IPP_DOCUMENT_FORMAT :
return (cupsLangString(language, HTTP_UNSUPPORTED_MEDIATYPE));
case IPP_CONFLICT :
return (cupsLangString(language, HTTP_CONFLICT));
case IPP_INTERNAL_ERROR :
return (cupsLangString(language, HTTP_SERVER_ERROR));
case IPP_OPERATION_NOT_SUPPORTED :
case IPP_VERSION_NOT_SUPPORTED :
return (cupsLangString(language, HTTP_NOT_SUPPORTED));
case IPP_SERVICE_UNAVAILABLE :
case IPP_DEVICE_ERROR :
case IPP_TEMPORARY_ERROR :
case IPP_PRINTER_BUSY :
return (cupsLangString(language, HTTP_SERVICE_UNAVAILABLE));
case IPP_NOT_ACCEPTING :
return (cupsLangString(language, CUPS_MSG_NOT_ACCEPTING_JOBS));
default :
return ("ERROR");
}
return (unknown);
}
@@ -667,68 +659,29 @@ ippFindAttribute(ipp_t *ipp, /* I - IPP request */
const char *name, /* I - Name of attribute */
ipp_tag_t type) /* I - Type of attribute */
{
ipp_attribute_t *attr; /* Current atttribute */
ipp_tag_t value_tag; /* Value tag */
DEBUG_printf(("ippFindAttribute(%p, \'%s\')\n", ipp, name));
if (ipp == NULL || name == NULL)
return (NULL);
/*
* Reset the current pointer...
*/
ipp->current = NULL;
/*
* Search for the attribute...
*/
return (ippFindNextAttribute(ipp, name, type));
}
/*
* 'ippFindNextAttribute()' - Find the next named attribute in a request...
*/
ipp_attribute_t * /* O - Matching attribute */
ippFindNextAttribute(ipp_t *ipp, /* I - IPP request */
const char *name, /* I - Name of attribute */
ipp_tag_t type) /* I - Type of attribute */
{
ipp_attribute_t *attr; /* Current atttribute */
ipp_tag_t value_tag; /* Value tag */
DEBUG_printf(("ippFindNextAttribute(%p, \'%s\')\n", ipp, name));
if (ipp == NULL || name == NULL)
return (NULL);
if (ipp->current)
attr = ipp->current->next;
else
attr = ipp->attrs;
for (; attr != NULL; attr = attr->next)
for (attr = ipp->attrs; attr != NULL; attr = attr->next)
{
DEBUG_printf(("ippFindAttribute: attr = %p, name = \'%s\'\n", attr,
attr->name));
value_tag = (ipp_tag_t)(attr->value_tag & IPP_TAG_MASK);
value_tag = attr->value_tag & ~IPP_TAG_COPY;
if (attr->name != NULL && strcasecmp(attr->name, name) == 0 &&
(value_tag == type || type == IPP_TAG_ZERO ||
(value_tag == IPP_TAG_TEXTLANG && type == IPP_TAG_TEXT) ||
(value_tag == IPP_TAG_NAMELANG && type == IPP_TAG_NAME)))
{
ipp->current = attr;
return (attr);
}
}
ipp->current = NULL;
return (NULL);
}
@@ -851,7 +804,7 @@ ippNew(void)
ipp_t *temp; /* New IPP request */
if ((temp = (ipp_t *)calloc(1, sizeof(ipp_t))) != NULL)
if ((temp = (ipp_t *)calloc(sizeof(ipp_t), 1)) != NULL)
{
/*
* Default to IPP 1.1...
@@ -1001,32 +954,6 @@ ippRead(http_t *http, /* I - HTTP data */
attr = ipp->current;
/*
* Make sure we aren't adding a new value of a different
* type...
*/
if (attr->value_tag == IPP_TAG_STRING ||
(attr->value_tag >= IPP_TAG_TEXTLANG &&
attr->value_tag <= IPP_TAG_MIMETYPE))
{
/*
* String values can sometimes come across in different
* forms; accept sets of differing values...
*/
if (tag != IPP_TAG_STRING &&
(tag < IPP_TAG_TEXTLANG || tag > IPP_TAG_MIMETYPE))
return (IPP_ERROR);
}
else if (attr->value_tag != tag)
return (IPP_ERROR);
/*
* Finally, make sure we don't have too many elements in the
* attribute array...
*/
if (attr->num_values >= IPP_MAX_VALUES)
return (IPP_ERROR);
}
@@ -1330,8 +1257,7 @@ ippWrite(http_t *http, /* I - HTTP data */
*bufptr++ = attr->group_tag;
}
if ((n = strlen(attr->name)) > (sizeof(buffer) - 3))
return (IPP_ERROR);
n = strlen(attr->name);
DEBUG_printf(("ippWrite: writing value tag = %x\n", attr->value_tag));
DEBUG_printf(("ippWrite: writing name = %d, \'%s\'\n", n, attr->name));
@@ -1348,17 +1274,6 @@ ippWrite(http_t *http, /* I - HTTP data */
case IPP_TAG_ENUM :
for (i = 0; i < attr->num_values; i ++)
{
if ((sizeof(buffer) - (bufptr - buffer)) < 9)
{
if (httpWrite(http, (char *)buffer, bufptr - buffer) < 0)
{
DEBUG_puts("ippWrite: Could not write IPP attribute...");
return (IPP_ERROR);
}
bufptr = buffer;
}
if (i)
{
/*
@@ -1383,17 +1298,6 @@ ippWrite(http_t *http, /* I - HTTP data */
case IPP_TAG_BOOLEAN :
for (i = 0; i < attr->num_values; i ++)
{
if ((sizeof(buffer) - (bufptr - buffer)) < 6)
{
if (httpWrite(http, (char *)buffer, bufptr - buffer) < 0)
{
DEBUG_puts("ippWrite: Could not write IPP attribute...");
return (IPP_ERROR);
}
bufptr = buffer;
}
if (i)
{
/*
@@ -1434,17 +1338,6 @@ ippWrite(http_t *http, /* I - HTTP data */
attr->value_tag));
DEBUG_printf(("ippWrite: writing name = 0, \'\'\n"));
if ((sizeof(buffer) - (bufptr - buffer)) < 3)
{
if (httpWrite(http, (char *)buffer, bufptr - buffer) < 0)
{
DEBUG_puts("ippWrite: Could not write IPP attribute...");
return (IPP_ERROR);
}
bufptr = buffer;
}
*bufptr++ = attr->value_tag;
*bufptr++ = 0;
*bufptr++ = 0;
@@ -1452,9 +1345,6 @@ ippWrite(http_t *http, /* I - HTTP data */
n = strlen(attr->values[i].string.text);
if (n > sizeof(buffer))
return (IPP_ERROR);
DEBUG_printf(("ippWrite: writing string = %d, \'%s\'\n", n,
attr->values[i].string.text));
@@ -1479,17 +1369,6 @@ ippWrite(http_t *http, /* I - HTTP data */
case IPP_TAG_DATE :
for (i = 0; i < attr->num_values; i ++)
{
if ((sizeof(buffer) - (bufptr - buffer)) < 16)
{
if (httpWrite(http, (char *)buffer, bufptr - buffer) < 0)
{
DEBUG_puts("ippWrite: Could not write IPP attribute...");
return (IPP_ERROR);
}
bufptr = buffer;
}
if (i)
{
/*
@@ -1512,17 +1391,6 @@ ippWrite(http_t *http, /* I - HTTP data */
case IPP_TAG_RESOLUTION :
for (i = 0; i < attr->num_values; i ++)
{
if ((sizeof(buffer) - (bufptr - buffer)) < 14)
{
if (httpWrite(http, (char *)buffer, bufptr - buffer) < 0)
{
DEBUG_puts("ippWrite: Could not write IPP attribute...");
return (IPP_ERROR);
}
bufptr = buffer;
}
if (i)
{
/*
@@ -1552,17 +1420,6 @@ ippWrite(http_t *http, /* I - HTTP data */
case IPP_TAG_RANGE :
for (i = 0; i < attr->num_values; i ++)
{
if ((sizeof(buffer) - (bufptr - buffer)) < 13)
{
if (httpWrite(http, (char *)buffer, bufptr - buffer) < 0)
{
DEBUG_puts("ippWrite: Could not write IPP attribute...");
return (IPP_ERROR);
}
bufptr = buffer;
}
if (i)
{
/*
@@ -1599,17 +1456,6 @@ ippWrite(http_t *http, /* I - HTTP data */
* values with a zero-length name...
*/
if ((sizeof(buffer) - (bufptr - buffer)) < 3)
{
if (httpWrite(http, (char *)buffer, bufptr - buffer) < 0)
{
DEBUG_puts("ippWrite: Could not write IPP attribute...");
return (IPP_ERROR);
}
bufptr = buffer;
}
*bufptr++ = attr->value_tag;
*bufptr++ = 0;
*bufptr++ = 0;
@@ -1619,9 +1465,6 @@ ippWrite(http_t *http, /* I - HTTP data */
strlen(attr->values[i].string.text) +
4;
if (n > sizeof(buffer))
return (IPP_ERROR);
if ((sizeof(buffer) - (bufptr - buffer)) < (n + 2))
{
if (httpWrite(http, (char *)buffer, bufptr - buffer) < 0)
@@ -1667,17 +1510,6 @@ ippWrite(http_t *http, /* I - HTTP data */
* values with a zero-length name...
*/
if ((sizeof(buffer) - (bufptr - buffer)) < 3)
{
if (httpWrite(http, (char *)buffer, bufptr - buffer) < 0)
{
DEBUG_puts("ippWrite: Could not write IPP attribute...");
return (IPP_ERROR);
}
bufptr = buffer;
}
*bufptr++ = attr->value_tag;
*bufptr++ = 0;
*bufptr++ = 0;
@@ -1685,9 +1517,6 @@ ippWrite(http_t *http, /* I - HTTP data */
n = attr->values[i].unknown.length;
if (n > sizeof(buffer))
return (IPP_ERROR);
if ((sizeof(buffer) - (bufptr - buffer)) < (n + 2))
{
if (httpWrite(http, (char *)buffer, bufptr - buffer) < 0)
@@ -1896,7 +1725,7 @@ ipp_read(http_t *http, /* I - Client connection */
* Loop until all bytes are read...
*/
for (tbytes = 0, bytes = 0; tbytes < length; tbytes += bytes, buffer += bytes)
for (tbytes = 0; tbytes < length; tbytes += bytes, buffer += bytes)
if ((bytes = httpRead(http, (char *)buffer, length - tbytes)) <= 0)
break;
@@ -1904,10 +1733,7 @@ ipp_read(http_t *http, /* I - Client connection */
* Return the number of bytes read...
*/
if (tbytes == 0 && bytes < 0)
return (-1);
else
return (tbytes);
return (tbytes);
}
+12 -82
Ver Arquivo
@@ -4,7 +4,7 @@
* Internet Printing Protocol definitions for the Common UNIX Printing
* System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products.
* Copyright 1997-2000 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -76,15 +76,13 @@ typedef enum /**** Format tags for attribute formats... ****/
IPP_TAG_END,
IPP_TAG_PRINTER,
IPP_TAG_UNSUPPORTED_GROUP,
IPP_TAG_SUBSCRIPTION,
IPP_TAG_EVENT_NOTIFICATION,
IPP_TAG_UNSUPPORTED_VALUE = 0x10,
IPP_TAG_DEFAULT,
IPP_TAG_UNKNOWN,
IPP_TAG_NOVALUE,
IPP_TAG_NOTSETTABLE = 0x15,
IPP_TAG_DELETEATTR,
IPP_TAG_ADMINDEFINE,
IPP_TAG_ANYVALUE,
IPP_TAG_INTEGER = 0x21,
IPP_TAG_BOOLEAN,
IPP_TAG_ENUM,
@@ -92,10 +90,9 @@ typedef enum /**** Format tags for attribute formats... ****/
IPP_TAG_DATE,
IPP_TAG_RESOLUTION,
IPP_TAG_RANGE,
IPP_TAG_BEGIN_COLLECTION,
IPP_TAG_COLLECTION,
IPP_TAG_TEXTLANG,
IPP_TAG_NAMELANG,
IPP_TAG_END_COLLECTION,
IPP_TAG_TEXT = 0x41,
IPP_TAG_NAME,
IPP_TAG_KEYWORD = 0x44,
@@ -104,9 +101,7 @@ typedef enum /**** Format tags for attribute formats... ****/
IPP_TAG_CHARSET,
IPP_TAG_LANGUAGE,
IPP_TAG_MIMETYPE,
IPP_TAG_MEMBERNAME,
IPP_TAG_MASK = 0x7fffffff, /* Mask for copied attribute values */
IPP_TAG_COPY = -0x7fffffff-1 /* Bitflag for copied attribute values */
IPP_TAG_COPY = 0x80000000
} ipp_tag_t;
typedef enum /**** Resolution units... ****/
@@ -117,34 +112,11 @@ typedef enum /**** Resolution units... ****/
typedef enum /**** Finishings... ****/
{
IPP_FINISHINGS_NONE = 3,
IPP_FINISHINGS_STAPLE,
IPP_FINISHINGS_PUNCH,
IPP_FINISHINGS_COVER,
IPP_FINISHINGS_BIND,
IPP_FINISHINGS_SADDLE_STITCH,
IPP_FINISHINGS_EDGE_STITCH,
IPP_FINISHINGS_FOLD,
IPP_FINISHINGS_TRIM,
IPP_FINISHINGS_BALE,
IPP_FINISHINGS_BOOKLET_MAKER,
IPP_FINISHINGS_JOB_OFFSET,
IPP_FINISHINGS_STAPLE_TOP_LEFT = 20,
IPP_FINISHINGS_STAPLE_BOTTOM_LEFT,
IPP_FINISHINGS_STAPLE_TOP_RIGHT,
IPP_FINISHINGS_STAPLE_BOTTOM_RIGHT,
IPP_FINISHINGS_EDGE_STITCH_LEFT,
IPP_FINISHINGS_EDGE_STITCH_TOP,
IPP_FINISHINGS_EDGE_STITCH_RIGHT,
IPP_FINISHINGS_EDGE_STITCH_BOTTOM,
IPP_FINISHINGS_STAPLE_DUAL_LEFT,
IPP_FINISHINGS_STAPLE_DUAL_TOP,
IPP_FINISHINGS_STAPLE_DUAL_RIGHT,
IPP_FINISHINGS_STAPLE_DUAL_BOTTOM,
IPP_FINISHINGS_BIND_LEFT = 50,
IPP_FINISHINGS_BIND_TOP,
IPP_FINISHINGS_BIND_RIGHT,
IPP_FINISHINGS_BIND_BOTTOM
IPP_FINISH_NONE = 3,
IPP_FINISH_STAPLE,
IPP_FINISH_PUNCH,
IPP_FINISH_COVER,
IPP_FINISH_BIND
} ipp_finish_t;
typedef enum /**** Orientation... ****/
@@ -210,31 +182,6 @@ typedef enum /**** IPP operations... ****/
IPP_SET_PRINTER_ATTRIBUTES,
IPP_SET_JOB_ATTRIBUTES,
IPP_GET_PRINTER_SUPPORTED_VALUES,
IPP_CREATE_PRINTER_SUBSCRIPTION,
IPP_CREATE_JOB_SUBSCRIPTION,
IPP_GET_SUBSCRIPTION_ATTRIBUTES,
IPP_GET_SUBSCRIPTIONS,
IPP_RENEW_SUBSCRIPTION,
IPP_CANCEL_SUBSCRIPTION,
IPP_GET_NOTIFICATIONS,
IPP_SEND_NOTIFICATIONS,
IPP_GET_PRINT_SUPPORT_FILES = 0x0021,
IPP_ENABLE_PRINTER,
IPP_DISABLE_PRINTER,
IPP_PAUSE_PRINTER_AFTER_CURRENT_JOB,
IPP_HOLD_NEW_JOBS,
IPP_RELEASE_HELD_NEW_JOBS,
IPP_DEACTIVATE_PRINTER,
IPP_ACTIVATE_PRINTER,
IPP_RESTART_PRINTER,
IPP_SHUTDOWN_PRINTER,
IPP_STARTUP_PRINTER,
IPP_REPROCESS_JOB,
IPP_CANCEL_CURRENT_JOB,
IPP_SUSPEND_CURRENT_JOB,
IPP_RESUME_JOB,
IPP_PROMOTE_JOB,
IPP_SCHEDULE_JOB_AFTER,
IPP_PRIVATE = 0x4000,
CUPS_GET_DEFAULT,
CUPS_GET_PRINTERS,
@@ -248,9 +195,7 @@ typedef enum /**** IPP operations... ****/
CUPS_SET_DEFAULT,
CUPS_GET_DEVICES,
CUPS_GET_PPDS,
CUPS_MOVE_JOB,
CUPS_ADD_DEVICE,
CUPS_DELETE_DEVICE
CUPS_MOVE_JOB
} ipp_op_t;
typedef enum /**** IPP status codes... ****/
@@ -258,11 +203,6 @@ typedef enum /**** IPP status codes... ****/
IPP_OK = 0x0000,
IPP_OK_SUBST,
IPP_OK_CONFLICT,
IPP_OK_IGNORED_SUBSCRIPTIONS,
IPP_OK_IGNORED_NOTIFICATIONS,
IPP_OK_TOO_MANY_EVENTS,
IPP_OK_BUT_CANCEL_SUBSCRIPTION,
IPP_REDIRECTION_OTHER_SITE = 0x300,
IPP_BAD_REQUEST = 0x0400,
IPP_FORBIDDEN,
IPP_NOT_AUTHENTICATED,
@@ -282,12 +222,6 @@ typedef enum /**** IPP status codes... ****/
IPP_COMPRESSION_ERROR,
IPP_DOCUMENT_FORMAT_ERROR,
IPP_DOCUMENT_ACCESS_ERROR,
IPP_ATTRIBUTES_NOT_SETTABLE,
IPP_IGNORED_ALL_SUBSCRIPTIONS,
IPP_TOO_MANY_SUBSCRIPTIONS,
IPP_IGNORED_ALL_NOTIFICATIONS,
IPP_PRINT_SUPPORT_FILE_NOT_FOUND,
IPP_INTERNAL_ERROR = 0x0500,
IPP_OPERATION_NOT_SUPPORTED,
IPP_SERVICE_UNAVAILABLE,
@@ -297,8 +231,7 @@ typedef enum /**** IPP status codes... ****/
IPP_NOT_ACCEPTING,
IPP_PRINTER_BUSY,
IPP_ERROR_JOB_CANCELLED,
IPP_MULTIPLE_JOBS_NOT_SUPPORTED,
IPP_PRINTER_IS_DEACTIVATED
IPP_MULTIPLE_JOBS_NOT_SUPPORTED
} ipp_status_t;
typedef unsigned char ipp_uchar_t;/**** Unsigned 8-bit integer/character ****/
@@ -403,10 +336,7 @@ extern ipp_attribute_t *ippAddStrings(ipp_t *ipp, ipp_tag_t group, ipp_tag_t typ
extern time_t ippDateToTime(const ipp_uchar_t *date);
extern void ippDelete(ipp_t *ipp);
extern const char *ippErrorString(ipp_status_t error);
extern ipp_attribute_t *ippFindAttribute(ipp_t *ipp, const char *name,
ipp_tag_t type);
extern ipp_attribute_t *ippFindNextAttribute(ipp_t *ipp, const char *name,
ipp_tag_t type);
extern ipp_attribute_t *ippFindAttribute(ipp_t *ipp, const char *name, ipp_tag_t type);
extern size_t ippLength(ipp_t *ipp);
extern ipp_t *ippNew(void);
extern ipp_state_t ippRead(http_t *http, ipp_t *ipp);
+1 -1
Ver Arquivo
@@ -3,7 +3,7 @@
*
* I18N/language support for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products.
* Copyright 1997-2000 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
+1 -1
Ver Arquivo
@@ -3,7 +3,7 @@
*
* Multi-language support for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products.
* Copyright 1997-2000 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
+1 -1
Ver Arquivo
@@ -3,7 +3,7 @@
*
* Option marking routines for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products, all rights reserved.
* Copyright 1997-2000 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
+1 -1
Ver Arquivo
@@ -3,7 +3,7 @@
*
* MD5 password support for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products.
* Copyright 1997-2000 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
+281 -36
Ver Arquivo
@@ -3,7 +3,7 @@
*
* Option routines for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products.
* Copyright 1997-2000 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -23,11 +23,12 @@
*
* Contents:
*
* cupsAddOption() - Add an option to an option array.
* cupsFreeOptions() - Free all memory used by options.
* cupsGetOption() - Get an option value.
* cupsParseOptions() - Parse options from a command-line argument.
* cupsMarkOptions() - Mark command-line options in a PPD file.
* cupsAddOption() - Add an option to an option array.
* cupsEncodeOptions() - Encode printer options into IPP attributes.
* cupsFreeOptions() - Free all memory used by options.
* cupsGetOption() - Get an option value.
* cupsParseOptions() - Parse options from a command-line argument.
* cupsMarkOptions() - Mark command-line options in a PPD file.
*/
/*
@@ -55,9 +56,8 @@ cupsAddOption(const char *name, /* I - Name of option */
cups_option_t *temp; /* Pointer to new option */
if (name == NULL || !name[0] || value == NULL ||
options == NULL || num_options < 0)
return (num_options);
if (name == NULL || value == NULL || options == NULL)
return (0);
/*
* Look for an existing option with the same name...
@@ -102,6 +102,274 @@ cupsAddOption(const char *name, /* I - Name of option */
}
/*
* 'cupsEncodeOptions()' - Encode printer options into IPP attributes.
*/
void
cupsEncodeOptions(ipp_t *ipp, /* I - Request to add to */
int num_options, /* I - Number of options */
cups_option_t *options) /* I - Options */
{
int i, j; /* Looping vars */
int count; /* Number of values */
int n; /* Attribute value */
char *s, /* Pointer into option value */
*val, /* Pointer to option value */
*copy, /* Copy of option value */
*sep; /* Option separator */
ipp_attribute_t *attr; /* IPP job-id attribute */
DEBUG_printf(("cupsEncodeOptions(%p, %d, %p)\n", ipp, num_options, options));
if (ipp == NULL || num_options < 1 || options == NULL)
return;
/*
* Handle the document format stuff first...
*/
if ((val = (char *)cupsGetOption("document-format", num_options, options)) != NULL)
ippAddString(ipp, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE, "document-format",
NULL, val);
else if (cupsGetOption("raw", num_options, options))
ippAddString(ipp, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE, "document-format",
NULL, "application/vnd.cups-raw");
else
ippAddString(ipp, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE, "document-format",
NULL, "application/octet-stream");
/*
* Then add all other options...
*/
for (i = 0; i < num_options; i ++)
{
/*
* Skip document format options - handled above...
*/
if (strcasecmp(options[i].name, "raw") == 0 ||
strcasecmp(options[i].name, "document-format") == 0)
continue;
/*
* Count the number of values...
*/
for (count = 1, sep = options[i].value;
(sep = strchr(sep + 1, ',')) != NULL;
count ++);
DEBUG_printf(("cupsEncodeOptions: option = \'%s\', count = %d\n",
options[i].name, count));
if ((attr = _ipp_add_attr(ipp, count)) == NULL)
{
/*
* Ran out of memory!
*/
DEBUG_puts("cupsEncodeOptions: Ran out of memory for attributes!");
return;
}
attr->group_tag = IPP_TAG_JOB;
if ((attr->name = strdup(options[i].name)) == NULL)
{
/*
* Ran out of memory!
*/
DEBUG_puts("cupsEncodeOptions: Ran out of memory for name!");
return;
}
if (count > 1)
{
/*
* Make a copy of the value we can fiddle with...
*/
if ((copy = strdup(options[i].value)) == NULL)
{
/*
* Ran out of memory!
*/
DEBUG_puts("cupsEncodeOptions: Ran out of memory for value copy!");
return;
}
val = copy;
}
else
{
/*
* Since we have a single value, use the value directly...
*/
val = options[i].value;
copy = NULL;
}
/*
* See what the option value is; for compatibility with older interface
* scripts, we have to support single-argument options as well as
* option=value, option=low-high, option=MxN, and option=val1,val2,...,valN.
*/
if (*val == '\0')
{
/*
* Old-style System V boolean value...
*/
attr->value_tag = IPP_TAG_BOOLEAN;
if (strncasecmp(attr->name, "no", 2) == 0)
{
DEBUG_puts("cupsEncodeOptions: Added boolean false value...");
strcpy(attr->name, attr->name + 2);
attr->values[0].boolean = 0;
}
else
{
DEBUG_puts("cupsEncodeOptions: Added boolean true value...");
attr->values[0].boolean = 1;
}
}
else
{
/*
* Scan the value string for values...
*/
for (j = 0; *val != '\0'; val = sep, j ++)
{
/*
* Find the end of this value and mark it if needed...
*/
if ((sep = strchr(val, ',')) != NULL)
*sep++ = '\0';
else
sep = val + strlen(val);
/*
* See what kind of value it is...
*/
if (strcasecmp(val, "true") == 0 ||
strcasecmp(val, "on") == 0 ||
strcasecmp(val, "yes") == 0)
{
/*
* Boolean value - true...
*/
attr->value_tag = IPP_TAG_BOOLEAN;
attr->values[j].boolean = 1;
DEBUG_puts("cupsEncodeOptions: Added boolean true value...");
}
else if (strcasecmp(val, "false") == 0 ||
strcasecmp(val, "off") == 0 ||
strcasecmp(val, "no") == 0)
{
/*
* Boolean value - false...
*/
attr->value_tag = IPP_TAG_BOOLEAN;
attr->values[j].boolean = 0;
DEBUG_puts("cupsEncodeOptions: Added boolean false value...");
}
else
{
/*
* Number, range, resolution, or string...
*/
n = strtol(val, &s, 0);
if (*s != '\0' && *s != '-' && (*s != 'x' || s == val))
{
/*
* String value(s)...
*/
if ((attr->values[j].string.text = strdup(val)) == NULL)
{
/*
* Ran out of memory!
*/
DEBUG_puts("cupsEncodeOptions: Ran out of memory for string!");
return;
}
attr->value_tag = IPP_TAG_NAME;
DEBUG_printf(("cupsEncodeOptions: Added string value \'%s\'...\n", val));
}
else if (*s == '-')
{
attr->value_tag = IPP_TAG_RANGE;
attr->values[j].range.lower = n;
attr->values[j].range.upper = strtol(s + 1, NULL, 0);
DEBUG_printf(("cupsEncodeOptions: Added range option value %d-%d...\n",
n, attr->values[j].range.upper));
}
else if (*s == 'x')
{
attr->value_tag = IPP_TAG_RESOLUTION;
attr->values[j].resolution.xres = n;
attr->values[j].resolution.yres = strtol(s + 1, &s, 0);
if (strcasecmp(s, "dpc") == 0)
attr->values[j].resolution.units = IPP_RES_PER_CM;
else if (strcasecmp(s, "dpi") == 0)
attr->values[j].resolution.units = IPP_RES_PER_INCH;
else
{
if ((attr->values[j].string.text = strdup(val)) == NULL)
{
/*
* Ran out of memory!
*/
DEBUG_puts("cupsEncodeOptions: Ran out of memory for string!");
return;
}
attr->value_tag = IPP_TAG_NAME;
DEBUG_printf(("cupsEncodeOptions: Added string value \'%s\'...\n", val));
continue;
}
DEBUG_printf(("cupsEncodeOptions: Adding resolution option value %s...\n",
val));
}
else
{
attr->value_tag = IPP_TAG_INTEGER;
attr->values[j].integer = n;
DEBUG_printf(("cupsEncodeOptions: Adding integer option value %d...\n", n));
}
}
}
}
}
}
/*
* 'cupsFreeOptions()' - Free all memory used by options.
*/
@@ -113,7 +381,7 @@ cupsFreeOptions(int num_options, /* I - Number of options */
int i; /* Looping var */
if (num_options <= 0 || options == NULL)
if (num_options == 0 || options == NULL)
return;
for (i = 0; i < num_options; i ++)
@@ -138,7 +406,7 @@ cupsGetOption(const char *name, /* I - Name of option */
int i; /* Looping var */
if (name == NULL || num_options <= 0 || options == NULL)
if (name == NULL || num_options == 0 || options == NULL)
return (NULL);
for (i = 0; i < num_options; i ++)
@@ -164,7 +432,7 @@ cupsParseOptions(const char *arg, /* I - Argument to parse */
*value; /* Pointer to value */
if (arg == NULL || options == NULL || num_options < 0)
if (arg == NULL || options == NULL)
return (0);
/*
@@ -195,13 +463,6 @@ cupsParseOptions(const char *arg, /* I - Argument to parse */
while (!isspace(*ptr) && *ptr != '=' && *ptr != '\0')
ptr ++;
/*
* Avoid an empty name...
*/
if (ptr == name)
break;
/*
* Skip trailing spaces...
*/
@@ -215,12 +476,7 @@ cupsParseOptions(const char *arg, /* I - Argument to parse */
* Start of another option...
*/
if (strncasecmp(name, "no", 2) == 0)
num_options = cupsAddOption(name + 2, "false", num_options,
options);
else
num_options = cupsAddOption(name, "true", num_options, options);
num_options = cupsAddOption(name, "", num_options, options);
continue;
}
@@ -309,17 +565,6 @@ cupsMarkOptions(ppd_file_t *ppd, /* I - PPD file */
s[255]; /* Temporary string */
/*
* Check arguments...
*/
if (ppd == NULL || num_options <= 0 || options == NULL)
return (0);
/*
* Mark options...
*/
conflict = 0;
for (i = num_options; i > 0; i --, options ++)
+1 -1
Ver Arquivo
@@ -3,7 +3,7 @@
*
* Page size functions for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products, all rights reserved.
* Copyright 1997-2000 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
+17 -52
Ver Arquivo
@@ -3,7 +3,7 @@
*
* PPD file routines for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products, all rights reserved.
* Copyright 1997-2000 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -428,17 +428,12 @@ ppdOpen(FILE *fp) /* I - File to read from */
ppd_const_t *constraint; /* Current constraint */
ppd_size_t *size; /* Current page size */
int mask; /* Line data mask */
char keyword[PPD_MAX_NAME],
/* Keyword from file */
name[PPD_MAX_NAME],
/* Option from file */
text[PPD_MAX_TEXT],
/* Human-readable text from file */
char keyword[41], /* Keyword from file */
name[41], /* Option from file */
text[81], /* Human-readable text from file */
*string, /* Code/text from file */
*sptr, /* Pointer into string */
*nameptr, /* Pointer into name */
*temp, /* Temporary string pointer */
**tempfonts; /* Temporary fonts pointer */
*nameptr; /* Pointer into name */
float order; /* Order dependency number */
ppd_section_t section; /* Order dependency section */
ppd_profile_t *profile; /* Pointer to color profile */
@@ -642,13 +637,6 @@ ppdOpen(FILE *fp) /* I - File to read from */
else
filter = realloc(ppd->filters, sizeof(char *) * (ppd->num_filters + 1));
if (filter == NULL)
{
safe_free(filter);
ppdClose(ppd);
return (NULL);
}
ppd->filters = filter;
filter += ppd->num_filters;
ppd->num_filters ++;
@@ -669,19 +657,17 @@ ppdOpen(FILE *fp) /* I - File to read from */
*/
if (ppd->num_fonts == 0)
tempfonts = (char **)malloc(sizeof(char *));
ppd->fonts = (char **)malloc(sizeof(char *));
else
tempfonts = (char **)realloc(ppd->fonts,
sizeof(char *) * (ppd->num_fonts + 1));
ppd->fonts = (char **)realloc(ppd->fonts,
sizeof(char *) * (ppd->num_fonts + 1));
if (tempfonts == NULL)
if (ppd->fonts == NULL)
{
safe_free(string);
ppdClose(ppd);
return (NULL);
}
ppd->fonts = tempfonts;
ppd->fonts[ppd->num_fonts] = strdup(name);
ppd->num_fonts ++;
}
@@ -847,11 +833,8 @@ ppdOpen(FILE *fp) /* I - File to read from */
for (i = 0, sptr = string; i < count; i ++)
{
for (nameptr = ppd->emulations[i].name;
*sptr != '\0' && *sptr != ' ';
sptr ++)
if (nameptr < (ppd->emulations[i].name + sizeof(ppd->emulations[i].name) - 1))
*nameptr++ = *sptr;
for (nameptr = ppd->emulations[i].name; *sptr != '\0' && *sptr != ' ';)
*nameptr ++ = *sptr ++;
*nameptr = '\0';
@@ -890,16 +873,8 @@ ppdOpen(FILE *fp) /* I - File to read from */
}
else
{
temp = realloc(ppd->patches, strlen(ppd->patches) +
strlen(string) + 1);
if (temp == NULL)
{
safe_free(string);
ppdClose(ppd);
return (NULL);
}
ppd->patches = temp;
ppd->patches = realloc(ppd->patches, strlen(ppd->patches) +
strlen(string) + 1);
strcpy(ppd->patches + strlen(ppd->patches), string);
}
@@ -1188,11 +1163,6 @@ ppdOpen(FILE *fp) /* I - File to read from */
break;
case 2 : /* Two options... */
/*
* The following strcpy's are safe, as optionN and
* choiceN are all the same size (size defined by PPD spec...)
*/
if (constraint->option1[0] == '*')
strcpy(constraint->option1, constraint->option1 + 1);
@@ -1206,11 +1176,6 @@ ppdOpen(FILE *fp) /* I - File to read from */
break;
case 3 : /* Two options, one choice... */
/*
* The following strcpy's are safe, as optionN and
* choiceN are all the same size (size defined by PPD spec...)
*/
if (constraint->option1[0] == '*')
strcpy(constraint->option1, constraint->option1 + 1);
@@ -1425,7 +1390,7 @@ ppdOpenFile(const char *filename) /* I - File to read from */
* 'compare_strings()' - Compare two strings.
*/
static int /* O - Result of comparison */
int /* O - Result of comparison */
compare_strings(char *s, /* I - First string */
char *t) /* I - Second string */
{
@@ -1753,7 +1718,7 @@ ppd_read(FILE *fp, /* I - File to read from */
keyptr = keyword;
while (*lineptr != '\0' && *lineptr != ':' && !isspace(*lineptr) &&
(keyptr - keyword) < (PPD_MAX_NAME - 1))
(keyptr - keyword) < 40)
*keyptr++ = *lineptr++;
*keyptr = '\0';
@@ -1788,7 +1753,7 @@ ppd_read(FILE *fp, /* I - File to read from */
textptr = text;
while (*lineptr != '\0' && *lineptr != '\n' && *lineptr != ':' &&
(textptr - text) < (PPD_MAX_TEXT - 1))
(textptr - text) < 80)
*textptr++ = *lineptr++;
*textptr = '\0';
+15 -40
Ver Arquivo
@@ -4,7 +4,7 @@
* PostScript Printer Description definitions for the Common UNIX Printing
* System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products, all rights reserved.
* Copyright 1997-2000 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -58,15 +58,6 @@ extern "C" {
# define PPD_VERSION 4.3 /* Kept in sync with Adobe version number */
/*
* PPD size limits (defined in Adobe spec)
*/
# define PPD_MAX_NAME 41 /* Maximum size of name + 1 for nul */
# define PPD_MAX_TEXT 81 /* Maximum size of text + 1 for nul */
# define PPD_MAX_LINE 256 /* Maximum size of line + 1 for nul */
/*
* Types and structures...
*/
@@ -101,10 +92,8 @@ typedef enum /**** Colorspaces ****/
typedef struct /**** Option choices ****/
{
char marked, /* 0 if not selected, 1 otherwise */
choice[PPD_MAX_NAME],
/* Computer-readable option name */
text[PPD_MAX_TEXT],
/* Human-readable option name */
choice[41], /* Computer-readable option name */
text[81], /* Human-readable option name */
*code; /* Code to send for this option */
void *option; /* Pointer to parent option structure */
} ppd_choice_t;
@@ -112,12 +101,9 @@ typedef struct /**** Option choices ****/
typedef struct /**** Options ****/
{
char conflicted, /* 0 if no conflicts exist, 1 otherwise */
keyword[PPD_MAX_NAME],
/* Option keyword name ("PageSize", etc.) */
defchoice[PPD_MAX_NAME],
/* Default option choice */
text[PPD_MAX_TEXT];
/* Human-readable text */
keyword[41], /* Option keyword name ("PageSize", etc.) */
defchoice[41], /* Default option choice */
text[81]; /* Human-readable text */
ppd_ui_t ui; /* Type of UI option */
ppd_section_t section; /* Section for command */
float order; /* Order number */
@@ -127,8 +113,7 @@ typedef struct /**** Options ****/
typedef struct ppd_group_str /**** Groups ****/
{
char text[PPD_MAX_TEXT];
/* Human-readable group name */
char text[81]; /* Human-readable group name */
int num_options; /* Number of options */
ppd_option_t *options; /* Options */
int num_subgroups; /* Number of sub-groups */
@@ -138,21 +123,16 @@ typedef struct ppd_group_str /**** Groups ****/
typedef struct /**** Constraints ****/
{
char option1[PPD_MAX_NAME],
/* First keyword */
choice1[PPD_MAX_NAME],
/* First option/choice (blank for all) */
option2[PPD_MAX_NAME],
/* Second keyword */
choice2[PPD_MAX_NAME];
/* Second option/choice (blank for all) */
char option1[41], /* First keyword */
choice1[41], /* First option/choice (blank for all) */
option2[41], /* Second keyword */
choice2[41]; /* Second option/choice (blank for all) */
} ppd_const_t;
typedef struct /**** Page Sizes ****/
{
int marked; /* Page size selected? */
char name[PPD_MAX_NAME];
/* Media size option */
char name[41]; /* Media size option */
float width, /* Width of media in points */
length, /* Length of media in points */
left, /* Left printable margin in points */
@@ -163,18 +143,15 @@ typedef struct /**** Page Sizes ****/
typedef struct /**** Emulators ****/
{
char name[PPD_MAX_NAME],
/* Emulator name */
char name[41], /* Emulator name */
*start, /* Code to switch to this emulation */
*stop; /* Code to stop this emulation */
} ppd_emul_t;
typedef struct /**** sRGB Color Profiles ****/
{
char resolution[PPD_MAX_NAME],
/* Resolution or "-" */
media_type[PPD_MAX_NAME];
/* Media type of "-" */
char resolution[41], /* Resolution or "-" */
media_type[41]; /* Media type of "-" */
float density, /* Ink density to use */
gamma, /* Gamma correction to use */
matrix[3][3]; /* Transform matrix */
@@ -237,8 +214,6 @@ extern int ppdEmit(ppd_file_t *ppd, FILE *fp,
ppd_section_t section);
extern int ppdEmitFd(ppd_file_t *ppd, int fd,
ppd_section_t section);
extern int ppdEmitJCL(ppd_file_t *ppd, FILE *fp, int job_id,
const char *user, const char *title);
extern int ppdIsMarked(ppd_file_t *ppd, const char *keyword,
const char *option);
extern void ppdMarkDefaults(ppd_file_t *ppd);
+1 -1
Ver Arquivo
@@ -3,7 +3,7 @@
*
* snprintf functions for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products.
* Copyright 1997-2000 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
+1 -1
Ver Arquivo
@@ -3,7 +3,7 @@
*
* String functions for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products.
* Copyright 1997-2000 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
+2 -9
Ver Arquivo
@@ -3,7 +3,7 @@
*
* String definitions for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products.
* Copyright 1997-2000 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -32,14 +32,7 @@
# include <stdio.h>
# include <stdarg.h>
# include <config.h>
# ifdef HAVE_STRING_H
# include <string.h>
# endif /* HAVE_STRING_H */
# ifdef HAVE_STRINGS_H
# include <strings.h>
# endif /* HAVE_STRINGS_H */
# include <string.h>
/*
-200
Ver Arquivo
@@ -1,200 +0,0 @@
/*
* "$Id$"
*
* Temp file utilities for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 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
*
* Contents:
*
* cupsTempFd() - Create a temporary file.
* cupsTempFile() - Generate a temporary filename.
*/
/*
* Include necessary headers...
*/
#include "cups.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__ */
/*
* 'cupsTempFd()' - Create a temporary file.
*/
int /* O - New file descriptor */
cupsTempFd(char *filename, /* I - Pointer to buffer */
int len) /* I - Size of buffer */
{
int fd; /* File descriptor for temp file */
#ifdef WIN32
char tmpdir[1024]; /* Windows temporary directory */
DWORD curtime; /* Current time */
#else
char *tmpdir; /* TMPDIR environment var */
struct timeval curtime; /* Current time */
#endif /* WIN32 */
static char buf[1024] = ""; /* Buffer if you pass in NULL and 0 */
/*
* See if a filename was specified...
*/
if (filename == NULL)
{
filename = buf;
len = sizeof(buf);
}
/*
* See if TMPDIR is defined...
*/
#ifdef WIN32
GetTempPath(sizeof(tmpdir), tmpdir);
#else
if ((tmpdir = getenv("TMPDIR")) == NULL)
{
/*
* Put root temp files in restricted temp directory...
*/
if (getuid() == 0)
tmpdir = CUPS_REQUESTS "/tmp";
else
tmpdir = "/var/tmp";
}
#endif /* WIN32 */
/*
* Make the temporary name using the specified directory...
*/
do
{
#ifdef WIN32
/*
* Get the current time of day...
*/
curtime = GetTickCount();
/*
* Format a string using the hex time values...
*/
snprintf(filename, len - 1, "%s/%08lx", tmpdir, curtime);
#else
/*
* Get the current time of day...
*/
gettimeofday(&curtime, NULL);
/*
* Format a string using the hex time values...
*/
snprintf(filename, len - 1, "%s/%08lx%05lx", tmpdir,
curtime.tv_sec, curtime.tv_usec);
#endif /* WIN32 */
/*
* Open the file in "exclusive" mode, making sure that we don't
* stomp on an existing file or someone's symlink crack...
*/
#ifdef O_NOFOLLOW
fd = open(filename, O_RDWR | O_CREAT | O_EXCL | O_NOFOLLOW, 0600);
#else
fd = open(filename, O_RDWR | O_CREAT | O_EXCL, 0600);
#endif /* O_NOFOLLOW */
if (fd < 0 && errno == EPERM)
break; /* Stop immediately if permission denied! */
}
while (fd < 0);
/*
* Return the file descriptor...
*/
return (fd);
}
/*
* 'cupsTempFile()' - Generate a temporary filename.
*/
char * /* O - Filename */
cupsTempFile(char *filename, /* I - Pointer to buffer */
int len) /* I - Size of buffer */
{
int fd; /* File descriptor for temp file */
static char buf[1024] = ""; /* Buffer if you pass in NULL and 0 */
/*
* See if a filename was specified...
*/
if (filename == NULL)
{
filename = buf;
len = sizeof(buf);
}
/*
* Create the temporary file...
*/
if ((fd = cupsTempFd(filename, len)) < 0)
return (NULL);
/*
* Close the temp file - it'll be reopened later as needed...
*/
close(fd);
/*
* Return the temp filename...
*/
return (filename);
}
/*
* End of "$Id$".
*/
+19 -34
Ver Arquivo
@@ -3,7 +3,7 @@
*
* HTTP test program for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products.
* Copyright 1997-2000 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -45,20 +45,25 @@ main(int argc, /* I - Number of command-line arguments */
int i; /* Looping var */
http_t *http; /* HTTP connection */
http_status_t status; /* Status of GET command */
char buffer[8192]; /* Input buffer */
char buffer[1024]; /* Input buffer */
long bytes; /* Number of bytes read */
FILE *out; /* Output file */
char host[HTTP_MAX_URI],
method[HTTP_MAX_URI],
username[HTTP_MAX_URI],
resource[HTTP_MAX_URI];
int port;
long length, total;
time_t start, current;
#define HOST "dns.easysw.com"
#define PORT 80
puts("Connecting to " HOST "...");
httpInitialize();
http = httpConnect(HOST, PORT);
if (http == NULL)
{
puts("Unable to connect to " HOST "!");
return (1);
}
puts("Connected to " HOST "...");
http = NULL;
out = stdout;
for (i = 1; i < argc; i ++)
@@ -70,42 +75,22 @@ main(int argc, /* I - Number of command-line arguments */
continue;
}
httpSeparate(argv[i], method, username, host, &port, resource);
http = httpConnect(host, port);
if (http == NULL)
{
perror(host);
continue;
}
printf("Requesting file \"%s\"...\n", resource);
printf("Requesting file \"%s\"...\n", argv[i]);
httpClearFields(http);
httpSetField(http, HTTP_FIELD_ACCEPT_LANGUAGE, "en");
httpGet(http, resource);
while ((status = httpUpdate(http)) == HTTP_CONTINUE);
httpGet(http, argv[i]);
status = httpUpdate(http);
if (status == HTTP_OK)
puts("GET OK:");
else
printf("GET failed with status %d...\n", status);
start = time(NULL);
length = atoi(httpGetField(http, HTTP_FIELD_CONTENT_LENGTH));
total = 0;
while ((bytes = httpRead(http, buffer, sizeof(buffer))) > 0)
{
total += bytes;
fwrite(buffer, bytes, 1, out);
if (out != stdout)
{
current = time(NULL);
if (current == start) current ++;
printf("\r%ld/%ld bytes (%ld bytes/sec) ", total, length,
total / (current - start));
fflush(stdout);
}
printf("Read %ld bytes, %ld total...\n", bytes, ftell(out));
}
}
+1 -1
Ver Arquivo
@@ -3,7 +3,7 @@
*
* PPD test program for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products, all rights reserved.
* Copyright 1997-2000 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
+3 -39
Ver Arquivo
@@ -4,7 +4,7 @@
* User, system, and password routines for the Common UNIX Printing
* System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products.
* Copyright 1997-2000 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -33,7 +33,6 @@
* cupsSetUser() - Set the default user name...
* cupsUser() - Return the current users name.
* cups_get_password() - Get a password from the user...
* cups_get_line() - Get a line from a file...
*/
/*
@@ -51,7 +50,6 @@
*/
static const char *cups_get_password(const char *prompt);
static char *cups_get_line(char *buf, int buflen, FILE *fp);
/*
@@ -120,7 +118,7 @@ cupsEncryption(void)
* Read the config file and look for a ServerName line...
*/
while (cups_get_line(line, sizeof(line), fp) != NULL)
while (fgets(line, sizeof(line), fp) != NULL)
if (strncmp(line, "Encryption ", 11) == 0)
{
/*
@@ -235,7 +233,7 @@ cupsServer(void)
* Read the config file and look for a ServerName line...
*/
while (cups_get_line(line, sizeof(line), fp) != NULL)
while (fgets(line, sizeof(line), fp) != NULL)
if (strncmp(line, "ServerName ", 11) == 0)
{
/*
@@ -408,40 +406,6 @@ cups_get_password(const char *prompt) /* I - Prompt string */
#endif /* WIN32 || __EMX__ */
/*
* 'cups_get_line()' - Get a line from a file.
*/
static char * /* O - Line from file */
cups_get_line(char *buf, /* I - Line buffer */
int buflen, /* I - Size of line buffer */
FILE *fp) /* I - File to read from */
{
char *bufptr; /* Pointer to end of buffer */
/*
* Get the line from a file...
*/
if (fgets(buf, buflen, fp) == NULL)
return (NULL);
/*
* Remove all trailing whitespace...
*/
bufptr = buf + strlen(buf) - 1;
if (bufptr < buf)
return (NULL);
while (isspace(*bufptr) && bufptr >= buf)
*bufptr-- = '\0';
return (buf);
}
/*
* End of "$Id$".
*/
+189 -361
Ver Arquivo
@@ -3,7 +3,7 @@
*
* Printing utilities for the Common UNIX Printing System (CUPS).
*
* Copyright 1997-2001 by Easy Software Products.
* Copyright 1997-2000 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
@@ -25,15 +25,14 @@
*
* cupsCancelJob() - Cancel a print job.
* cupsDoFileRequest() - Do an IPP request...
* cupsFreeJobs() - Free memory used by job data.
* cupsGetClasses() - Get a list of printer classes.
* cupsGetDefault() - Get the default printer or class.
* cupsGetJobs() - Get the jobs from the server.
* cupsGetPPD() - Get the PPD file for a printer.
* cupsGetPrinters() - Get a list of printers.
* cupsLastError() - Return the last IPP error that occurred.
* cupsPrintFile() - Print a file to a printer or class.
* cupsPrintFiles() - Print one or more files to a printer or class.
* cupsTempFile() - Generate a temporary filename.
* cups_connect() - Connect to the specified host...
* cups_local_auth() - Get the local authorization certificate if
* available/applicable...
@@ -177,7 +176,7 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
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 */
encode[255]; /* Encoded username:password */
char prompt[1024]; /* Prompt string */
@@ -190,7 +189,7 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
return (NULL);
}
DEBUG_printf(("cupsDoFileRequest(%p, %08x, \'%s\', \'%s\')\n",
DEBUG_printf(("cupsDoFileRequest(%p, %08s, \'%s\', \'%s\')\n",
http, request, resource, filename ? filename : "(null)"));
/*
@@ -256,15 +255,7 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
DEBUG_puts("cupsDoFileRequest: post...");
if (httpPost(http, resource))
{
if (httpReconnect(http))
{
status = HTTP_ERROR;
break;
}
else
continue;
}
continue;
/*
* Send the IPP data and wait for the response...
@@ -371,22 +362,6 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
else
break;
}
#ifdef HAVE_LIBSSL
else if (status == HTTP_UPGRADE_REQUIRED)
{
/*
* Flush any error message...
*/
httpFlush(http);
/*
* Try again, this time with encryption enabled...
*/
continue;
}
#endif /* HAVE_LIBSSL */
else if (status != HTTP_OK)
{
DEBUG_printf(("cupsDoFileRequest: error %d...\n", status));
@@ -418,6 +393,12 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
response = NULL;
last_error = IPP_SERVICE_UNAVAILABLE;
/*
* Flush any remaining data...
*/
httpFlush(http);
break;
}
}
@@ -430,12 +411,6 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
if (filename != NULL)
fclose(file);
/*
* Flush any remaining data...
*/
httpFlush(http);
/*
* Delete the original request and return the response...
*/
@@ -455,32 +430,6 @@ cupsDoFileRequest(http_t *http, /* I - HTTP connection to server */
}
/*
* 'cupsFreeJobs()' - Free memory used by job data.
*/
void
cupsFreeJobs(int num_jobs,/* I - Number of jobs */
cups_job_t *jobs) /* I - Jobs */
{
int i; /* Looping var */
if (num_jobs <= 0 || jobs == NULL)
return;
for (i = 0; i < num_jobs; i ++)
{
free(jobs[i].dest);
free(jobs[i].user);
free(jobs[i].format);
free(jobs[i].title);
}
free(jobs);
}
/*
* 'cupsGetClasses()' - Get a list of printer classes.
*/
@@ -596,6 +545,9 @@ cupsGetClasses(char ***classes) /* O - Classes */
const char * /* O - Default printer or NULL */
cupsGetDefault(void)
{
FILE *fp; /* cupsd.conf file */
char *printer; /* Pointer to server name */
char line[1024]; /* Line from file */
ipp_t *request, /* IPP Request */
*response; /* IPP Response */
ipp_attribute_t *attr; /* Current attribute */
@@ -616,6 +568,48 @@ cupsGetDefault(void)
else if ((var = getenv("PRINTER")) != NULL && strcmp(var, "lp") != 0)
return (var);
/*
* Next check to see if we have a client.conf file...
*/
if ((var = getenv("CUPS_SERVERROOT")) == NULL)
var = CUPS_SERVERROOT;
snprintf(line, sizeof(line), "%s/client.conf", var);
if ((fp = fopen(line, "r")) != NULL)
{
/*
* Read the client.conf file and look for a DefaultPrinter line...
*/
while (fgets(line, sizeof(line), fp) != NULL)
if (strncmp(line, "DefaultPrinter ", 15) == 0)
{
/*
* Got it! Drop any trailing newline and find the name...
*/
printer = line + strlen(line) - 1;
if (*printer == '\n')
*printer = '\0';
for (printer = line + 15; isspace(*printer); printer ++);
if (*printer)
{
strncpy(def_printer, printer, sizeof(def_printer) - 1);
def_printer[sizeof(def_printer) - 1] = '\0';
fclose(fp);
return (def_printer);
}
}
fclose(fp);
}
/*
* Try to connect to the server...
*/
@@ -672,260 +666,6 @@ cupsGetDefault(void)
}
/*
* 'cupsGetJobs()' - Get the jobs from the server.
*/
int /* O - Number of jobs */
cupsGetJobs(cups_job_t **jobs, /* O - Job data */
const char *mydest, /* I - Only show jobs for dest? */
int myjobs, /* I - Only show my jobs? */
int completed) /* I - Only show completed jobs? */
{
int n; /* Number of jobs */
ipp_t *request, /* IPP Request */
*response; /* IPP Response */
ipp_attribute_t *attr; /* Current attribute */
cups_lang_t *language; /* Default language */
cups_job_t *temp; /* Temporary pointer */
int id, /* job-id */
priority, /* job-priority */
size; /* job-k-octets */
ipp_jstate_t state; /* job-state */
time_t completed_time, /* time-at-completed */
creation_time, /* time-at-creation */
processing_time; /* time-at-processing */
const char *dest, /* job-printer-uri */
*format, /* document-format */
*title, /* job-name */
*user; /* job-originating-user-name */
char uri[HTTP_MAX_URI]; /* URI for jobs */
static const char *attrs[] = /* Requested attributes */
{
"job-id",
"job-priority",
"job-k-octets",
"job-state",
"time-at-completed",
"time-at-creation",
"time-at-processing",
"job-printer-uri",
"document-format",
"job-name",
"job-originating-user-name"
};
if (jobs == NULL)
{
last_error = IPP_INTERNAL_ERROR;
return (0);
}
/*
* Try to connect to the server...
*/
if (!cups_connect("default", NULL, NULL))
{
last_error = IPP_SERVICE_UNAVAILABLE;
return (0);
}
/*
* Build an IPP_GET_JOBS request, which requires the following
* attributes:
*
* attributes-charset
* attributes-natural-language
* printer-uri
* requesting-user-name
* which-jobs
* my-jobs
* requested-attributes
*/
request = ippNew();
request->request.op.operation_id = IPP_GET_JOBS;
request->request.op.request_id = 1;
language = cupsLangDefault();
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
"attributes-charset", NULL, cupsLangEncoding(language));
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
"attributes-natural-language", NULL, language->language);
if (mydest)
snprintf(uri, sizeof(uri), "ipp://localhost/printers/%s", mydest);
else
strcpy(uri, "ipp://localhost/jobs");
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
"printer-uri", NULL, uri);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
"requesting-user-name", NULL, cupsUser());
if (myjobs)
ippAddBoolean(request, IPP_TAG_OPERATION, "my-jobs", 1);
if (completed)
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
"which-jobs", NULL, "completed");
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
"requested-attributes", sizeof(attrs) / sizeof(attrs[0]),
NULL, attrs);
/*
* Do the request and get back a response...
*/
n = 0;
*jobs = NULL;
if ((response = cupsDoRequest(cups_server, request, "/")) != NULL)
{
last_error = response->request.status.status_code;
for (attr = response->attrs; attr != NULL; attr = attr->next)
{
/*
* Skip leading attributes until we hit a job...
*/
while (attr != NULL && attr->group_tag != IPP_TAG_JOB)
attr = attr->next;
if (attr == NULL)
break;
/*
* Pull the needed attributes from this job...
*/
id = 0;
size = 0;
priority = 50;
state = IPP_JOB_PENDING;
user = NULL;
dest = NULL;
format = NULL;
title = NULL;
creation_time = 0;
completed_time = 0;
processing_time = 0;
while (attr != NULL && attr->group_tag == IPP_TAG_JOB)
{
if (strcmp(attr->name, "job-id") == 0 &&
attr->value_tag == IPP_TAG_INTEGER)
id = attr->values[0].integer;
else if (strcmp(attr->name, "job-state") == 0 &&
attr->value_tag == IPP_TAG_ENUM)
state = (ipp_jstate_t)attr->values[0].integer;
else if (strcmp(attr->name, "job-priority") == 0 &&
attr->value_tag == IPP_TAG_INTEGER)
priority = attr->values[0].integer;
else if (strcmp(attr->name, "job-k-octets") == 0 &&
attr->value_tag == IPP_TAG_INTEGER)
size = attr->values[0].integer;
else if (strcmp(attr->name, "time-at-completed") == 0 &&
attr->value_tag == IPP_TAG_INTEGER)
completed_time = attr->values[0].integer;
else if (strcmp(attr->name, "time-at-creation") == 0 &&
attr->value_tag == IPP_TAG_INTEGER)
creation_time = attr->values[0].integer;
else if (strcmp(attr->name, "time-at-processing") == 0 &&
attr->value_tag == IPP_TAG_INTEGER)
processing_time = attr->values[0].integer;
else if (strcmp(attr->name, "job-printer-uri") == 0 &&
attr->value_tag == IPP_TAG_URI)
{
if ((dest = strrchr(attr->values[0].string.text, '/')) != NULL)
dest ++;
}
else if (strcmp(attr->name, "job-originating-user-name") == 0 &&
attr->value_tag == IPP_TAG_NAME)
user = attr->values[0].string.text;
else if (strcmp(attr->name, "document-format") == 0 &&
attr->value_tag == IPP_TAG_MIMETYPE)
format = attr->values[0].string.text;
else if (strcmp(attr->name, "job-name") == 0 &&
attr->value_tag == IPP_TAG_TEXT)
title = attr->values[0].string.text;
attr = attr->next;
}
/*
* See if we have everything needed...
*/
if (dest == NULL || format == NULL || title == NULL || user == NULL ||
id == 0)
{
if (attr == NULL)
break;
else
continue;
}
/*
* Allocate memory for the job...
*/
if (n == 0)
temp = malloc(sizeof(cups_job_t));
else
temp = realloc(*jobs, sizeof(cups_job_t) * (n + 1));
if (temp == NULL)
{
/*
* Ran out of memory!
*/
cupsFreeJobs(n, *jobs);
*jobs = NULL;
ippDelete(response);
return (0);
}
*jobs = temp;
temp += n;
n ++;
/*
* Copy the data over...
*/
temp->dest = strdup(dest);
temp->user = strdup(user);
temp->format = strdup(format);
temp->title = strdup(title);
temp->id = id;
temp->priority = priority;
temp->state = state;
temp->size = size;
temp->completed_time = completed_time;
temp->creation_time = creation_time;
temp->processing_time = processing_time;
}
ippDelete(response);
}
else
last_error = IPP_BAD_REQUEST;
return (n);
}
/*
* 'cupsGetPPD()' - Get the PPD file for a printer.
*/
@@ -938,7 +678,7 @@ cupsGetPPD(const char *name) /* I - Printer name */
*response; /* IPP response */
ipp_attribute_t *attr; /* Current attribute */
cups_lang_t *language; /* Local language */
int fd; /* PPD file */
FILE *fp; /* PPD file */
int bytes; /* Number of bytes read */
char buffer[8192]; /* Buffer for file */
char printer[HTTP_MAX_URI], /* Printer name */
@@ -951,7 +691,7 @@ cupsGetPPD(const char *name) /* I - Printer name */
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 */
encode[255]; /* Encoded username:password */
http_status_t status; /* HTTP status from server */
char prompt[1024]; /* Prompt string */
static char filename[HTTP_MAX_URI]; /* Local filename */
@@ -1081,8 +821,7 @@ cupsGetPPD(const char *name) /* I - Printer name */
{
httpClose(cups_server);
if ((cups_server = httpConnectEncrypt(hostname, ippPort(),
cupsEncryption())) == NULL)
if ((cups_server = httpConnect(hostname, ippPort())) == NULL)
{
last_error = IPP_SERVICE_UNAVAILABLE;
return (NULL);
@@ -1093,17 +832,7 @@ cupsGetPPD(const char *name) /* I - Printer name */
* Get a temp file...
*/
if ((fd = cupsTempFd(filename, sizeof(filename))) < 0)
{
/*
* Can't open file; close the server connection and return NULL...
*/
httpFlush(cups_server);
httpClose(cups_server);
cups_server = NULL;
return (NULL);
}
cupsTempFile(filename, sizeof(filename));
/*
* And send a request to the HTTP server...
@@ -1119,16 +848,8 @@ cupsGetPPD(const char *name) /* I - Printer name */
if (httpGet(cups_server, resource))
{
if (httpReconnect(cups_server))
{
status = HTTP_ERROR;
break;
}
else
{
status = HTTP_UNAUTHORIZED;
continue;
}
status = HTTP_UNAUTHORIZED;
continue;
}
while ((status = httpUpdate(cups_server)) == HTTP_CONTINUE);
@@ -1197,29 +918,28 @@ cupsGetPPD(const char *name) /* I - Printer name */
break;
}
}
while (status == HTTP_UNAUTHORIZED || status == HTTP_UPGRADE_REQUIRED);
while (status == HTTP_UNAUTHORIZED);
/*
* See if we actually got the file or an error...
* OK, we need to copy the file; open the file and copy it...
*/
if (status != HTTP_OK)
if ((fp = fopen(filename, "w")) == NULL)
{
unlink(filename);
/*
* Can't open file; close the server connection and return NULL...
*/
httpFlush(cups_server);
httpClose(cups_server);
cups_server = NULL;
return (NULL);
}
/*
* OK, we need to copy the file...
*/
while ((bytes = httpRead(cups_server, buffer, sizeof(buffer))) > 0)
write(fd, buffer, bytes);
fwrite(buffer, bytes, 1, fp);
close(fd);
fclose(fp);
return (filename);
}
@@ -1356,7 +1076,7 @@ cupsPrintFile(const char *name, /* I - Printer or class name */
cups_option_t *options) /* I - Options */
{
DEBUG_printf(("cupsPrintFile(\'%s\', \'%s\', %d, %p)\n",
name, filename, num_options, options));
printer, filename, num_options, options));
return (cupsPrintFiles(name, 1, &filename, title, num_options, options));
}
@@ -1387,7 +1107,7 @@ cupsPrintFiles(const char *name, /* I - Printer or class name */
DEBUG_printf(("cupsPrintFiles(\'%s\', %d, %p, %d, %p)\n",
name, num_files, files, num_options, options));
printer, num_files, files, num_options, options));
if (name == NULL || num_files < 1 || files == NULL)
return (0);
@@ -1542,6 +1262,115 @@ cupsPrintFiles(const char *name, /* I - Printer or class name */
}
/*
* 'cupsTempFile()' - Generate a temporary filename.
*/
char * /* O - Filename */
cupsTempFile(char *filename, /* I - Pointer to buffer */
int len) /* I - Size of buffer */
{
int fd; /* File descriptor for temp file */
#ifdef WIN32
char tmpdir[1024]; /* Windows temporary directory */
DWORD curtime; /* Current time */
#else
char *tmpdir; /* TMPDIR environment var */
struct timeval curtime; /* Current time */
#endif /* WIN32 */
static char buf[1024] = ""; /* Buffer if you pass in NULL and 0 */
/*
* See if a filename was specified...
*/
if (filename == NULL)
{
filename = buf;
len = sizeof(buf);
}
/*
* See if TMPDIR is defined...
*/
#ifdef WIN32
GetTempPath(sizeof(tmpdir), tmpdir);
#else
if ((tmpdir = getenv("TMPDIR")) == NULL)
{
/*
* Put root temp files in restricted temp directory...
*/
if (getuid() == 0)
tmpdir = CUPS_REQUESTS "/tmp";
else
tmpdir = "/var/tmp";
}
#endif /* WIN32 */
/*
* Make the temporary name using the specified directory...
*/
do
{
#ifdef WIN32
/*
* Get the current time of day...
*/
curtime = GetTickCount();
/*
* Format a string using the hex time values...
*/
snprintf(filename, len - 1, "%s/%08lx", tmpdir, curtime);
#else
/*
* Get the current time of day...
*/
gettimeofday(&curtime, NULL);
/*
* Format a string using the hex time values...
*/
snprintf(filename, len - 1, "%s/%08lx%05lx", tmpdir,
curtime.tv_sec, curtime.tv_usec);
#endif /* WIN32 */
/*
* Open the file in "exclusive" mode, making sure that we don't
* stomp on an existing file or someone's symlink crack...
*/
#ifdef O_NOFOLLOW
fd = open(filename, O_WRONLY | O_CREAT | O_EXCL | O_NOFOLLOW, 0600);
#else
fd = open(filename, O_WRONLY | O_CREAT | O_EXCL, 0600);
#endif /* O_NOFOLLOW */
}
while (fd < 0);
/*
* Close the temp file - it'll be reopened later as needed...
*/
close(fd);
/*
* Return the temp filename...
*/
return (filename);
}
/*
* 'cups_connect()' - Connect to the specified host...
*/
@@ -1551,13 +1380,12 @@ cups_connect(const char *name, /* I - Destination (printer[@host]) */
char *printer, /* O - Printer name [HTTP_MAX_URI] */
char *hostname) /* O - Hostname [HTTP_MAX_URI] */
{
char hostbuf[HTTP_MAX_URI]; /* Name of host */
char hostbuf[HTTP_MAX_URI];
/* Name of host */
static char printerbuf[HTTP_MAX_URI];
/* Name of printer or class */
/* Name of printer or class */
DEBUG_printf(("cups_connect(\"%s\", %p, %p)\n", name, printer, hostname));
if (name == NULL)
{
last_error = IPP_BAD_REQUEST;
@@ -1594,16 +1422,16 @@ cups_connect(const char *name, /* I - Destination (printer[@host]) */
httpClose(cups_server);
}
DEBUG_printf(("connecting to %s on port %d...\n", hostname, ippPort()));
if ((cups_server = httpConnectEncrypt(hostname, ippPort(),
cupsEncryption())) == NULL)
if ((cups_server = httpConnect(hostname, ippPort())) == NULL)
{
last_error = IPP_SERVICE_UNAVAILABLE;
return (NULL);
}
else
{
httpEncryption(cups_server, cupsEncryption());
return (printer);
}
}
+2 -2
Ver Arquivo
@@ -1,6 +1,6 @@
%%BeginResource: procset hpgltops 1.1 0
%
% "$Id: HPGLprolog 1605 2001-03-02 22:34:21Z andy $"
% "$Id: HPGLprolog 932 2000-02-26 20:01:37Z mike $"
%
% HP-GL/2 filter procset for the Common UNIX Printing System (CUPS).
%
@@ -9,7 +9,7 @@
% should be called 'NP' (newpath), but GhostScript uses the 'NP' name
% for 'noaccess put' in some of its font files...
%
% Copyright 1993-2001 Easy Software Products
% Copyright 1993-2000 Easy Software Products
%
% These coded instructions, statements, and computer programs are the
% property of Easy Software Products and are protected by Federal
+2 -2
Ver Arquivo
@@ -3,7 +3,7 @@
#
# Datafile makefile for the Common UNIX Printing System (CUPS).
#
# Copyright 1993-2001 by Easy Software Products.
# Copyright 1993-2000 by Easy Software Products.
#
# These coded instructions, statements, and computer programs are the
# property of Easy Software Products and are protected by Federal
@@ -91,7 +91,7 @@ install:
-$(MKDIR) $(DATADIR)/data
$(CHMOD) ugo+rx $(DATADIR)/data
$(INSTALL_DATA) $(DATAFILES) $(DATADIR)/data
-if test x$(PAMDIR) != x; then \
-if test "$(PAMDIR)" != ""; then \
$(MKDIR) $(PAMDIR); \
$(CHMOD) ugo+rx $(PAMDIR); \
if test -f /lib/security/pam_unix.so; then \
+7 -17
Ver Arquivo
@@ -14,23 +14,13 @@
%
% PostScript banner page for the Common UNIX Printing System ("CUPS").
%
% Copyright 1993-2001 Easy Software Products
% Copyright 1993-2000 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
% These coded instructions, statements, and computer programs contain
% unpublished proprietary information of Easy Software Products, and
% are protected by Federal copyright law. They may not be disclosed
% to third parties or copied or duplicated in any form, in whole or
% in part, without the prior written consent of Easy Software Products.
%
/CENTER { % Draw centered text
% (name) CENTER -
@@ -272,6 +262,6 @@ gsave
grestore
showpage
%
% End of "$Id: classified 1646 2001-03-25 12:42:57Z mike $".
% End of "$Id: classified 1379 2000-09-18 17:12:42Z mike $".
%
%%EOF
+7 -17
Ver Arquivo
@@ -14,23 +14,13 @@
%
% PostScript banner page for the Common UNIX Printing System ("CUPS").
%
% Copyright 1993-2001 Easy Software Products
% Copyright 1993-2000 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
% These coded instructions, statements, and computer programs contain
% unpublished proprietary information of Easy Software Products, and
% are protected by Federal copyright law. They may not be disclosed
% to third parties or copied or duplicated in any form, in whole or
% in part, without the prior written consent of Easy Software Products.
%
/CENTER { % Draw centered text
% (name) CENTER -
@@ -272,6 +262,6 @@ gsave
grestore
showpage
%
% End of "$Id: confidential 1646 2001-03-25 12:42:57Z mike $".
% End of "$Id: confidential 1379 2000-09-18 17:12:42Z mike $".
%
%%EOF
+7 -17
Ver Arquivo
@@ -14,23 +14,13 @@
%
% PostScript banner page for the Common UNIX Printing System ("CUPS").
%
% Copyright 1993-2001 Easy Software Products
% Copyright 1993-2000 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
% These coded instructions, statements, and computer programs contain
% unpublished proprietary information of Easy Software Products, and
% are protected by Federal copyright law. They may not be disclosed
% to third parties or copied or duplicated in any form, in whole or
% in part, without the prior written consent of Easy Software Products.
%
/CENTER { % Draw centered text
% (name) CENTER -
@@ -272,6 +262,6 @@ gsave
grestore
showpage
%
% End of "$Id: secret 1646 2001-03-25 12:42:57Z mike $".
% End of "$Id: secret 1379 2000-09-18 17:12:42Z mike $".
%
%%EOF
+7 -17
Ver Arquivo
@@ -14,23 +14,13 @@
%
% PostScript banner page for the Common UNIX Printing System ("CUPS").
%
% Copyright 1993-2001 Easy Software Products
% Copyright 1993-2000 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
% These coded instructions, statements, and computer programs contain
% unpublished proprietary information of Easy Software Products, and
% are protected by Federal copyright law. They may not be disclosed
% to third parties or copied or duplicated in any form, in whole or
% in part, without the prior written consent of Easy Software Products.
%
/CENTER { % Draw centered text
% (name) CENTER -
@@ -256,6 +246,6 @@ gsave
grestore
showpage
%
% End of "$Id: standard 1646 2001-03-25 12:42:57Z mike $".
% End of "$Id: standard 1379 2000-09-18 17:12:42Z mike $".
%
%%EOF
+8 -18
Ver Arquivo
@@ -14,23 +14,13 @@
%
% PostScript test page for the Common UNIX Printing System ("CUPS").
%
% Copyright 1993-2001 Easy Software Products
% Copyright 1993-2000 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
% These coded instructions, statements, and computer programs contain
% unpublished proprietary information of Easy Software Products, and
% are protected by Federal copyright law. They may not be disclosed
% to third parties or copied or duplicated in any form, in whole or
% in part, without the prior written consent of Easy Software Products.
%
/OCTANT { % Draw a color wheel OCTANT...
% (name) radius r g b OCTANT -
@@ -487,7 +477,7 @@ gsave
pageHeight 2 mul sub % Move down...
2 copy moveto % Position text
smallFont setfont % Font
(Copyright 1993-2001 Easy Software Products, All Rights Reserved.) CENTER
(Copyright 1993-2000 Easy Software Products, All Rights Reserved.) CENTER
pageHeight sub % Move down...
2 copy moveto % Position text
(CUPS, and the CUPS logo are the trademark property of) CENTER
@@ -517,6 +507,6 @@ gsave
grestore
showpage
%
% End of "$Id: testprint.ps 1646 2001-03-25 12:42:57Z mike $".
% End of "$Id: testprint.ps 1379 2000-09-18 17:12:42Z mike $".
%
%%EOF
+7 -17
Ver Arquivo
@@ -14,23 +14,13 @@
%
% PostScript banner page for the Common UNIX Printing System ("CUPS").
%
% Copyright 1993-2001 Easy Software Products
% Copyright 1993-2000 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
% These coded instructions, statements, and computer programs contain
% unpublished proprietary information of Easy Software Products, and
% are protected by Federal copyright law. They may not be disclosed
% to third parties or copied or duplicated in any form, in whole or
% in part, without the prior written consent of Easy Software Products.
%
/CENTER { % Draw centered text
% (name) CENTER -
@@ -272,6 +262,6 @@ gsave
grestore
showpage
%
% End of "$Id: topsecret 1646 2001-03-25 12:42:57Z mike $".
% End of "$Id: topsecret 1379 2000-09-18 17:12:42Z mike $".
%
%%EOF
+7 -17
Ver Arquivo
@@ -14,23 +14,13 @@
%
% PostScript banner page for the Common UNIX Printing System ("CUPS").
%
% Copyright 1993-2001 Easy Software Products
% Copyright 1993-2000 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
% These coded instructions, statements, and computer programs contain
% unpublished proprietary information of Easy Software Products, and
% are protected by Federal copyright law. They may not be disclosed
% to third parties or copied or duplicated in any form, in whole or
% in part, without the prior written consent of Easy Software Products.
%
/CENTER { % Draw centered text
% (name) CENTER -
@@ -272,6 +262,6 @@ gsave
grestore
showpage
%
% End of "$Id: unclassified 1646 2001-03-25 12:42:57Z mike $".
% End of "$Id: unclassified 1379 2000-09-18 17:12:42Z mike $".
%
%%EOF
+2 -2
Ver Arquivo
@@ -3,7 +3,7 @@
#
# Documentation makefile for the Common UNIX Printing System (CUPS).
#
# Copyright 1993-2001 by Easy Software Products.
# Copyright 1993-2000 by Easy Software Products.
#
# These coded instructions, statements, and computer programs are the
# property of Easy Software Products and are protected by Federal
@@ -17,7 +17,7 @@
# 44141 Airport View Drive, Suite 204
# Hollywood, Maryland 20636-3111 USA
#
# Voice: (301) 373-9600
# Voice: (301) 373-9603
# EMail: cups-info@cups.org
# WWW: http://www.cups.org
#
+614 -546
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
BIN
Ver Arquivo
Arquivo binário não exibido.
+3 -3
Ver Arquivo
@@ -1,7 +1,7 @@
<HTML>
<HEAD>
<META NAME="DOCNUMBER" CONTENT="CUPS-CMP-1.1">
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2001, All Rights Reserved">
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2000, All Rights Reserved">
<META NAME="Author" CONTENT="Easy Software Products">
<TITLE>CUPS Configuration Management Plan</TITLE>
</HEAD>
@@ -221,7 +221,7 @@ information is provided by the CVS "&#36;Id$" tag:
*
* Description of file contents.
*
* Copyright 1997-2001 by Easy Software Products, all rights
* Copyright 1997-2000 by Easy Software Products, all rights
* reserved.
*
* These coded instructions, statements, and computer programs are
@@ -236,7 +236,7 @@ information is provided by the CVS "&#36;Id$" tag:
* 44141 Airport View Drive, Suite 204
* Hollywood, Maryland 20636-3111 USA
*
* Voice: (301) 373-9600
* Voice: (301) 373-9603
* EMail: cups-info@cups.org
* WWW: http://www.cups.org
*
+1 -1
Ver Arquivo
@@ -74,7 +74,7 @@ The following documentation for CUPS is available on this server:
<P>The Common UNIX Printing System, CUPS, and the CUPS logo are the
trademark property of <A HREF="http://www.easysw.com">Easy Software
Products</A>. CUPS is copyright 1997-2001 by Easy Software Products,
Products</A>. CUPS is copyright 1997-2000 by Easy Software Products,
All Rights Reserved.
</BODY>
+1112 -953
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
BIN
Ver Arquivo
Arquivo binário não exibido.
+1 -1
Ver Arquivo
@@ -1,6 +1,6 @@
<HTML>
<HEAD>
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2001, All Rights Reserved">
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2000, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-IDD-1.1">
<META NAME="Author" CONTENT="Easy Software Products">
<TITLE>CUPS Interface Design Description</TITLE>
+1 -1
Ver Arquivo
@@ -29,7 +29,7 @@
<P>The Common UNIX Printing System, CUPS, and the CUPS logo are the
trademark property of <A HREF="http://www.easysw.com">Easy Software
Products</A>. CUPS is copyright 1997-2001 by Easy Software Products,
Products</A>. CUPS is copyright 1997-2000 by Easy Software Products,
All Rights Reserved.
</BODY>
+1409 -1229
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
BIN
Ver Arquivo
Arquivo binário não exibido.
+1 -10
Ver Arquivo
@@ -1,6 +1,6 @@
<HTML>
<HEAD>
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2001 All Rights Reserved">
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2000, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-IPP-1.1">
<META NAME="Author" CONTENT="Easy Software Products">
<TITLE>CUPS Implementation of IPP</TITLE>
@@ -1638,15 +1638,6 @@ The default value is 6.
<P>The page-bottom attribute specifies the bottom margin in points (72 points
equals 1 inch). The default value is the device physical margin.
<H3>page-label (text(MAX))</H3>
<P><I>(CUPS 1.1.7 and higher)</I>
<P>The page-label attribute provides a text value to place in
the header and footer on each page. If a classification level is
set on the server, then this classification is printed before
the page label.
<H3>page-left (integer(0:MAX))</H3>
<P>The page-left attribute specifies the left margin in points (72 points
+2 -2
Ver Arquivo
@@ -14,7 +14,7 @@
<P ALIGN="RIGHT">July 10, 2000<BR>
Michael Sweet, Easy Software Products<BR>
Copyright 1998-2001, All Rights Reserved.</P>
Copyright 1998-2000, All Rights Reserved.</P>
</TD>
</TR>
</TABLE>
@@ -413,7 +413,7 @@ on the CUPS bazaar, available at:
</PRE></UL>
<P>Finally, our own ESP Print Pro software uses CUPS to provide drivers
for thousands of printers and can be found at:
for over 2300 printers and can be found at:
<UL><PRE>
<A HREF="http://www.easysw.com/printpro">http://www.easysw.com/printpro</A>
Arquivo binário não exibido.
+4715 -4157
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
BIN
Ver Arquivo
Arquivo binário não exibido.
+37 -362
Ver Arquivo
@@ -1,7 +1,7 @@
<HTML>
<HEAD>
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2001, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-SAM-1.1.8">
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2000, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-SAM-1.1.5">
<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.8.
("CUPS<SUP>TM</SUP>"), version 1.1.5.
<EMBED SRC="system-overview.shtml">
@@ -207,7 +207,6 @@ prior to running configure:
<B>setenv CFLAGS "-I/some/directory" ENTER</B>
<B>setenv CXXFLAGS "-I/some/directory" ENTER</B>
<B>setenv LDFLAGS "-L/some/directory" ENTER</B>
<B>setenv DSOFLAGS "-L/some/directory" ENTER</B>
<B>./configure ... ENTER</B>
</PRE></UL>
@@ -217,7 +216,6 @@ prior to running configure:
<B>CFLAGS="-I/some/directory"; export CFLAGS ENTER</B>
<B>CXXFLAGS="-I/some/directory"; export CXXFLAGS ENTER</B>
<B>LDFLAGS="-L/some/directory"; export LDFLAGS ENTER</B>
<B>DSOFLAGS="-L/some/directory"; export DSOFLAGS ENTER</B>
<B>./configure ... ENTER</B>
</PRE></UL>
@@ -851,12 +849,7 @@ determine how the server operates:
<LI><A HREF="#BrowseShortNames"><CODE>BrowseShortNames</CODE></A>
<LI><A HREF="#BrowseTimeout"><CODE>BrowseTimeout</CODE></A>
<LI><A HREF="#Browsing"><CODE>Browsing</CODE></A>
<LI><A HREF="#Classification"><CODE>Classification</CODE></A>
<LI><A HREF="#DataDir"><CODE>DataDir</CODE></A>
<LI><A HREF="#DefaultCharset"><CODE>DefaultCharset</CODE></A>
<LI><A HREF="#DefaultLanguage"><CODE>DefaultLanguage</CODE></A>
<LI><A HREF="#Deny"><CODE>Deny</CODE></A>
<LI><A HREF="#DocumentRoot"><CODE>DocumentRoot</CODE></A>
</TD>
<TD VALIGN="TOP">
@@ -864,29 +857,24 @@ determine how the server operates:
</TD>
<TD VALIGN="TOP">
<LI><A HREF="#Encryption"><CODE>Encryption</CODE></A>
<LI><A HREF="#DefaultCharset"><CODE>DefaultCharset</CODE></A>
<LI><A HREF="#DefaultLanguage"><CODE>DefaultLanguage</CODE></A>
<LI><A HREF="#Deny"><CODE>Deny</CODE></A>
<LI><A HREF="#DocumentRoot"><CODE>DocumentRoot</CODE></A>
<LI><A HREF="#ErrorLog"><CODE>ErrorLog</CODE></A>
<LI><A HREF="#FilterLimit"><CODE>FilterLimit</CODE></A>
<LI><A HREF="#FontPath"><CODE>FontPath</CODE></A>
<LI><A HREF="#Group"><CODE>Group</CODE></A>
<LI><A HREF="#HostNameLookups"><CODE>HostNameLookups</CODE></A>
<LI><A HREF="#ImplicitClasses"><CODE>ImplicitClasses</CODE></A>
<LI><A HREF="#KeepAliveTimeout"><CODE>KeepAliveTimeout</CODE></A>
<LI><A HREF="#KeepAlive"><CODE>KeepAlive</CODE></A>
<LI><A HREF="#Limit"><CODE>Limit</CODE></A>
<LI><A HREF="#LimitExcept"><CODE>LimitExcept</CODE></A>
<LI><A HREF="#LimitRequestBody"><CODE>LimitRequestBody</CODE></A>
<LI><A HREF="#Listen"><CODE>Listen</CODE></A>
<LI><A HREF="#Location"><CODE>Location</CODE></A>
<LI><A HREF="#LogLevel"><CODE>LogLevel</CODE></A>
<LI><A HREF="#MaxClients"><CODE>MaxClients</CODE></A>
<LI><A HREF="#MaxJobs"><CODE>MaxJobs</CODE></A>
<LI><A HREF="#MaxJobsPerPrinter"><CODE>MaxJobsPerPrinter</CODE></A>
<LI><A HREF="#MaxJobsPerUser"><CODE>MaxJobsPerUser</CODE></A>
<LI><A HREF="#MaxLogSize"><CODE>MaxLogSize</CODE></A>
<LI><A HREF="#MaxRequestSize"><CODE>MaxRequestSize</CODE></A>
<LI><A HREF="#Order"><CODE>Order</CODE></A>
<LI><A HREF="#PageLog"><CODE>PageLog</CODE></A>
</TD>
<TD VALIGN="TOP">
@@ -894,25 +882,19 @@ determine how the server operates:
</TD>
<TD VALIGN="TOP">
<LI><A HREF="#Order"><CODE>Order</CODE></A>
<LI><A HREF="#PageLog"><CODE>PageLog</CODE></A>
<LI><A HREF="#Port"><CODE>Port</CODE></A>
<LI><A HREF="#PreserveJobFiles"><CODE>PreserveJobFiles</CODE></A>
<LI><A HREF="#PreserveJobHistory"><CODE>PreserveJobHistory</CODE></A>
<LI><A HREF="#Printcap"><CODE>Printcap</CODE></A>
<LI><A HREF="#PrintcapFormat"><CODE>PrintcapFormat</CODE></A>
<LI><A HREF="#RemoteRoot"><CODE>RemoteRoot</CODE></A>
<LI><A HREF="#RequestRoot"><CODE>RequestRoot</CODE></A>
<LI><A HREF="#Require"><CODE>Require</CODE></A>
<LI><A HREF="#RIPCache"><CODE>RIPCache</CODE></A>
<LI><A HREF="#RunAsUser"><CODE>RunAsUser</CODE></A>
<LI><A HREF="#Satisfy"><CODE>Satisfy</CODE></A>
<LI><A HREF="#ServerAdmin"><CODE>ServerAdmin</CODE></A>
<LI><A HREF="#ServerBin"><CODE>ServerBin</CODE></A>
<LI><A HREF="#ServerCertificate"><CODE>ServerCertificate</CODE></A>
<LI><A HREF="#ServerKey"><CODE>ServerKey</CODE></A>
<LI><A HREF="#ServerName"><CODE>ServerName</CODE></A>
<LI><A HREF="#ServerRoot"><CODE>ServerRoot</CODE></A>
<LI><A HREF="#SSLListen"><CODE>SSLListen</CODE></A>
<LI><A HREF="#SSLPort"><CODE>SSLPort</CODE></A>
<LI><A HREF="#SystemGroup"><CODE>SystemGroup</CODE></A>
<LI><A HREF="#TempDir"><CODE>TempDir</CODE></A>
<LI><A HREF="#Timeout"><CODE>Timeout</CODE></A>
@@ -1419,28 +1401,6 @@ browsing is enabled. The default setting is <CODE>On</CODE>.
</TR>
</TABLE></CENTER>
<!-- NEED 3in -->
<H3><A NAME="Classification">Classification</A></H3>
<HR>
<H4>Examples</H4>
<UL><PRE>
Classification
Classification classified
Classification confidential
Classification secret
Classification topsecret
Classification unclassified
</PRE></UL>
<H4>Description</H4>
<P>The <CODE>Classification</CODE> directive sets the classification level
on the server. When this option is set, at least one of the banner pages
is forced to the classification level, and the classification is placed
on each page of output. The default is no classification level.
<!-- NEED 3in -->
<H3><A NAME="DataDir">DataDir</A></H3>
<HR>
@@ -1585,26 +1545,6 @@ and then directly under the <CODE>DocumentRoot</CODE> directory
(e.g. <VAR>/usr/share/doc/cups/...</VAR>), so it is possible to localize
the web content by providing subdirectories for each language needed.
<!-- NEED 3in -->
<H3><A NAME="Encryption">Encryption</A></H3>
<HR>
<H4>Examples</H4>
<UL><PRE>
Encryption Never
Encryption IfRequested
Encryption Required
Encryption Always
</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 for that location.
The default setting is <CODE>IfRequested</CODE> for all locations.
<!-- NEED 3in -->
<H3><A NAME="ErrorLog">ErrorLog</A></H3>
<HR>
@@ -1657,23 +1597,6 @@ limit the scheduler to printing a single job at any time.
<P>The default limit is 0.
<!-- NEED 3in -->
<H3><A NAME="FontPath">FontPath</A></H3>
<HR>
<H4>Examples</H4>
<UL><PRE>
FontPath /foo/bar/fonts
FontPath /usr/share/cups/fonts:/foo/bar/fonts
</PRE></UL>
<H4>Description</H4>
<P>The <CODE>FontPath</CODE> directive specifies the font path to use when
searching for fonts. The default font path is
<CODE>/usr/share/cups/fonts</CODE>.
<!-- NEED 3in -->
<H3><A NAME="Group">Group</A></H3>
<HR>
@@ -1702,23 +1625,15 @@ system.
<UL><PRE>
HostNameLookups On
HostNameLookups Off
HostNameLookups Double
</PRE></UL>
<H4>Description</H4>
<P>The <CODE>HostNameLookups</CODE> directive controls whether
or not CUPS looks up the hostname for connecting clients. The
<CODE>Double</CODE> setting causes CUPS to verify that the
hostname resolved from the address matches one of the addresses
returned for that hostname. <CODE>Double</CODE> lookups also
prevent clients with unregistered addresses from connecting
to your server.
The default is <CODE>Off</CODE> to avoid the potential server
performance problems with hostname lookups. Set this option to
<CODE>On</CODE> or <CODE>Double</CODE> only if absolutely
required.
<P>The <CODE>HostNameLookups</CODE> directive controls whether or not
CUPS looks up the hostname for connecting clients. The default is
<CODE>Off</CODE> to avoid the potential server performance problems
with hostname lookups. Turn this option <CODE>On</CODE> only if
absolutely required.
<!-- NEED 3in -->
<H3><A NAME="ImplicitClasses">ImplicitClasses</A></H3>
@@ -1777,74 +1692,6 @@ KeepAliveTimeout 30
persistent HTTP connection will remain open after the last request. The
default is 60 seconds.
<!-- NEED 3in -->
<H3><A NAME="Limit">Limit</A></H3>
<HR>
<H4>Examples</H4>
<UL><PRE>
&lt;Limit GET POST&gt;
...
&lt;/Limit&gt;
&lt;Limit ALL&gt;
...
&lt;/Limit&gt;
</PRE></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 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 type names are case-sensitive for compatibility with Apache.
<!-- NEED 3in -->
<H3><A NAME="LimitExcept">LimitExcept</A></H3>
<HR>
<H4>Examples</H4>
<UL><PRE>
&lt;LimitExcept GET POST&gt;
...
&lt;/LimitExcept&gt;
</PRE></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 access for all requests <I>except</I> those listed on the
<CODE>LimitExcept</CODE> line.
<!-- NEED 3in -->
<H3><A NAME="LimitRequestBody">LimitRequestBody</A></H3>
<HR>
<H4>Examples</H4>
<UL><PRE>
LimitRequestBody 10485760
LimitRequestBody 10m
LimitRequestBody 0
</PRE></UL>
<H4>Description</H4>
<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>Also see the identical
<A HREF="#MaxRequestSize"><CODE>MaxRequestSize</CODE></A> directive.
<!-- NEED 3in -->
<H3><A NAME="Listen">Listen</A></H3>
<HR>
@@ -1862,6 +1709,8 @@ Listen 192.0.2.1:631
to listen for connections. Multiple <CODE>Listen</CODE> directives can be
provided to listen on multiple addresses.
<H4>Description</H4>
<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.
@@ -1900,48 +1749,30 @@ information can be found later in this chapter in
<H4>Examples</H4>
<UL><PRE>
LogLevel none
LogLevel emerg
LogLevel alert
LogLevel crit
LogLevel error
LogLevel warn
LogLevel notice
LogLevel info
LogLevel debug
LogLevel debug2
LogLevel error
LogLevel info
LogLevel none
LogLevel warn
</PRE></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
following values are recognized (each level logs everything under the
preceding levels):
following values are recognized:
<UL>
<LI><CODE>none</CODE> - Log nothing.
<LI><CODE>emerg</CODE> - Log emergency conditions that prevent the
server from running.
<LI><CODE>alert</CODE> - Log alerts that must be handled immediately.
<LI><CODE>crit</CODE> - Log critical errors that don't prevent
the server from running.
<LI><CODE>error</CODE> - Log general errors.
<LI><CODE>warn</CODE> - Log errors and warnings.
<LI><CODE>notice</CODE> - Log temporary error conditions.
<LI><CODE>debug</CODE> - Log everything.
<LI><CODE>info</CODE> - Log all requests and state changes (default).
<LI><CODE>debug</CODE> - Log basic debugging information.
<LI><CODE>warn</CODE> - Log errors and warnings.
<LI><CODE>debug2</CODE> - Log all debugging information.
<LI><CODE>error</CODE> - Log only errors.
<LI><CODE>none</CODE> - Log nothing.
</UL>
@@ -1995,49 +1826,7 @@ oldest completed job is automatically purged from the system to make room
for the new one. If all of the known jobs are still pending or active then
the new job will be rejected.
<P>Setting the maximum to 0 disables this functionality. The default
setting is 0.
<!-- NEED 3in -->
<H3><A NAME="MaxJobsPerPrinter">MaxJobsPerPrinter</A></H3>
<HR>
<H4>Examples</H4>
<UL><PRE>
MaxJobsPerPrinter 100
MaxJobsPerPrinter 9999
MaxJobsPerPrinter 0
</PRE></UL>
<H4>Description</H4>
<P>The <CODE>MaxJobsPerPrinter</CODE> directive controls the maximum number of active jobs
that are allowed for each printer or class. Once a printer or class reaches the limit, new jobs will be
rejected until one of the active jobs is completed, stopped, aborted, or cancelled.
<P>Setting the maximum to 0 disables this functionality. The default
setting is 0.
<!-- NEED 3in -->
<H3><A NAME="MaxJobsPerUser">MaxJobsPerUser</A></H3>
<HR>
<H4>Examples</H4>
<UL><PRE>
MaxJobsPerUser 100
MaxJobsPerUser 9999
MaxJobsPerUser 0
</PRE></UL>
<H4>Description</H4>
<P>The <CODE>MaxJobsPerUser</CODE> directive controls the maximum number of active jobs
that are allowed for each user. Once a user reaches the limit, new jobs will be
rejected until one of the active jobs is completed, stopped, aborted, or cancelled.
<P>Setting the maximum to 0 disables this functionality. The default
<P>Setting the maximum size to 0 disables this functionality. The default
setting is 0.
<!-- NEED 3in -->
@@ -2079,9 +1868,6 @@ MaxRequestSize 0
print files, IPP requests, and HTML form data in HTTP POST requests. The
default limit is 0 which disables the limit check.
<P>Also see the identical
<A HREF="#LimitRequestBody"><CODE>LimitRequestBody</CODE></A> directive.
<!-- NEED 3in -->
<H3><A NAME="Order">Order</A></H3>
<HR>
@@ -2154,6 +1940,13 @@ Port 80
Multiple <CODE>Port</CODE> lines can be specified to listen on multiple
ports. The default port is 631.
<H4>Description</H4>
<P>The <CODE>Port</CODE> directive will listen for connections on all
network interfaces. To limit connections to a single interface use the
<A HREF="#Listen"><CODE>Listen</CODE></A> directive with the interface
address.
<!-- NEED 3in -->
<H3><A NAME="PreserveJobHistory">PreserveJobHistory</A></H3>
<HR>
@@ -2211,7 +2004,6 @@ soon as each job is completed, cancelled, or aborted.
<UL><PRE>
Printcap
Printcap /etc/printcap
Printcap /etc/printers.conf
</PRE></UL>
<H4>Description</H4>
@@ -2227,23 +2019,6 @@ printcap file is written whenever a printer is added or removed. The
printcap file can then be used by applications that are hardcoded to
look at the printcap file for the available printers.
<!-- NEED 3in -->
<H3><A NAME="Printcap">PrintcapFormat</A></H3>
<HR>
<H4>Examples</H4>
<UL><PRE>
PrintcapFormat BSD
PrintcapFormat Solaris
</PRE></UL>
<H4>Description</H4>
<P>The <CODE>PrintcapFormat</CODE> directive controls the output
format of the printcap file. The default is to generate a BSD
printcap file.
<!-- NEED 3in -->
<H3><A NAME="RemoteRoot">RemoteRoot</A></H3>
<HR>
@@ -2301,32 +2076,6 @@ cache used by Raster Image Processor ("RIP") filters such as
be suffixed with a "k" for kilobytes, "m" for megabytes, or
"g" for gigabytes. The default cache size is "8m", or 8 megabytes.
<!-- NEED 3in -->
<H3><A NAME="RunAsUser">RunAsUser</A></H3>
<HR>
<H4>Examples</H4>
<UL><PRE>
RunAsUser Yes
RunAsUser No
</PRE></UL>
<H4>Description</H4>
<P>The <CODE>RunAsUser</CODE> directive controls whether the
scheduler runs as the unpriviledged user account (usually <CODE>lp</CODE>).
The default is <CODE>No</CODE> which leaves the scheduler running as
the <CODE>root</CODE> user.
<P><B>Note:</B> Running as a non-priviledged user may prevent
LPD and locally connected printers from working due to
permission problems. The <CODE>lpd</CODE> backend will
automatically use a non-priviledged mode that is not 100%
compliant with RFC 1179. The <CODE>parallel</CODE>,
<CODE>serial</CODE>, and <CODE>usb</CODE> backends will need
write access to the corresponding device files.
<!-- NEED 3in -->
<H3><A NAME="ServerAdmin">ServerAdmin</A></H3>
<HR>
@@ -2364,42 +2113,6 @@ assumed to be relative to the
default executable directory is <VAR>/usr/lib/cups</VAR> or
<VAR>/usr/lib32/cups</VAR> (IRIX 6.5).
<!-- NEED 3in -->
<H3><A NAME="ServerCertificate">ServerCertificate</A></H3>
<HR>
<H4>Examples</H4>
<UL><PRE>
ServerCertificate /etc/cups/ssl/server.crt
</PRE></UL>
<H4>Description</H4>
<P>The <CODE>ServerCertificate</CODE> directive specifies the
location of the SSL certificate file used by the server when
negotiating encrypted connections. The certificate must not be
encrypted (password protected) since the scheduler normally runs
in the background and will be unable to ask for a password.
The default certificate file is <VAR>/etc/cups/ssl/server.crt</VAR>.
<!-- NEED 3in -->
<H3><A NAME="ServerKey">ServerKey</A></H3>
<HR>
<H4>Examples</H4>
<UL><PRE>
ServerKey /etc/cups/ssl/server.key
</PRE></UL>
<H4>Description</H4>
<P>The <CODE>ServerKey</CODE> directive specifies the location
of the SSL private key file used by the server when negotiating
encrypted connections. The default key file is
<VAR>/etc/cups/ssl/server.crt</VAR>.
<!-- NEED 3in -->
<H3><A NAME="ServerName"></A>ServerName</H3>
<HR>
@@ -2434,44 +2147,6 @@ the server configuration and state files. It is also used to resolve
relative paths in the <VAR>cupsd.conf</VAR> file. The default server
directory is <VAR>/etc/cups</VAR>.
<!-- NEED 3in -->
<H3><A NAME="SSLListen">SSLListen</A></H3>
<HR>
<H4>Examples</H4>
<UL><PRE>
SSLListen 127.0.0.1:443
SSLListen 192.0.2.1:443
</PRE></UL>
<H4>Description</H4>
<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>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 -->
<H3><A NAME="SSLPort">SSLPort</A></H3>
<HR>
<H4>Examples</H4>
<UL><PRE>
SSLPort 443
</PRE></UL>
<H4>Description</H4>
<P>The <CODE>SSLPort</CODE> directive specifies a port to listen
on for secure connections. Multiple <CODE>SSLPort</CODE> lines
can be specified to listen on multiple ports.
<!-- NEED 3in -->
<H3><A NAME="SystemGroup">SystemGroup</A></H3>
<HR>
@@ -3273,7 +2948,7 @@ would look like:
Printer Description:MyPrinter@MyServer:\
:pr=|/usr/bin/lp -d MyPrinter:\
:op=daemon:\
:pd=/etc/cups/ppd/MyPrinter.ppd:
:pd=/etc/cups/ppd/MyPrinter.ppd
</PRE></UL>
<!-- NEED 2in -->
@@ -4155,9 +3830,9 @@ For more information please contact us at:
<LI>WWW: <A HREF="http://www.easysw.com">
<CODE>http://www.easysw.com</CODE></A>
<LI>EMail: <A HREF="mailto:info@easysw.com">info@easysw.com</A>
<LI>EMail: <A HREF="mailto:support@easysw.com">support@easysw.com</A>
<LI>Telephone (M-F, 9-5 EST): +1.301.373.9600
<LI>Telephone (M-F, 9-5 EST): +1.301.373.9603
</UL>
+618 -508
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
BIN
Ver Arquivo
Arquivo binário não exibido.
+1 -1
Ver Arquivo
@@ -1,6 +1,6 @@
<HTML>
<HEAD>
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2001, All Rights Reserved">
<META NAME="COPYRIGHT" CONTENT="Copyright 1997-2000, All Rights Reserved">
<META NAME="DOCNUMBER" CONTENT="CUPS-SDD-1.1">
<META NAME="Author" CONTENT="Easy Software Products">
<TITLE>CUPS Software Design Description</TITLE>
+7900 -7056
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff

Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais