Common Unix Printing System

Information about Common Unix Printing System

Common Unix Printing System
Author:Michael Sweet
Developer:Apple Inc., who purchased it from Easy Software Products
Initial release:1999-06-09
Latest release:1.3.2 / 2007-09-18
OS:Unix-like
Genre:Print server
License:GNU General Public License, GNU Lesser General Public License
Website:www.cups.org
The Common Unix Printing System (CUPS) is a modular printing system for Unix-like computer operating systems that allows a computer to act as a print server. A computer running CUPS is a host that can accept print jobs from client computers, process them, and send them to the appropriate printer.

CUPS consists of a print spooler and scheduler, a filter system that converts the print data to a format that the printer will understand, and a backend system that sends this data to the print device. CUPS uses the Internet Printing Protocol (IPP) as the basis for managing print jobs and queues. It also provides the traditional command line interfaces for the System V and Berkeley print systems, along with limited support for the server message block (SMB) protocol. The device drivers CUPS supplies can be configured by using text files in Adobe's PostScript Printer Description (PPD) format. There are a number of user interfaces for different platforms that can configure CUPS, and it has a built-in web-based interface. CUPS is free software, provided under the GNU General Public License and GNU Lesser General Public License, Version 2.

History

Michael Sweet, who owns Easy Software Products, started developing CUPS in 1997. The first public betas appeared in 1999 [1]. The original design of CUPS used the LPD protocol, but due to limitations in LPD and vendor incompatibilities the Internet Printing Protocol (IPP) was chosen instead. CUPS was quickly adopted as the default printing system for several Linux distributions, including Red Hat Linux. In March 2002, Apple Inc. adopted CUPS as the printing system for Mac OS X 10.2.[2] In February of 2007, Apple Inc. hired chief developer Michael Sweet and purchased the CUPS source code.[3]

Overview



CUPS provides a mechanism that allows print jobs to be sent to printers in a standard fashion. The data is sent to a scheduler[4] which sends jobs to a filter system that converts the print job into a format the printer will understand.[5] The filter system then passes the data on to a backend—a special filter that sends print data to a device or network connection.[6] The system makes extensive use of PostScript and rasterization of data to convert the data into a format that is suitable for the printer.

The primary advantage of CUPS is that it is a standard and modularised printing system that can process numerous data formats on the print server. Before CUPS, it was difficult to find a standard printer management system that would accommodate the very wide variety of printers on the market using their own printer languages and formats. For instance, the System V and Berkeley printing systems were largely incompatible with each other, and they required complicated scripts and workarounds to convert the program's data format to a printable format. They often could not detect the file format that was being sent to the printer and thus could not automatically and correctly convert the data stream. Additionally, data conversion was performed on individual workstations rather than a central server.

CUPS allows printer manufacturers and printer driver developers to more easily create drivers that work natively on the print server. Processing occurs on the server, allowing for easier network-based printing than with other Unix printing systems. When used with Samba, printers can be used on remote Windows computers and generic PostScript drivers can be used for printing across the network.

Scheduler

The CUPS scheduler implements IPP Internet Printing Protocol over HTTP/1.1. A helper application (cups-lpd) converts LPD Line Printer Daemon protocol requests to IPP. The scheduler also provides a web-based interface for managing print jobs, the configuration of the server, and for documentation about CUPS itself.[6]

An authorization module controls which IPP and HTTP messages can pass through the system.[7] Once the IPP/HTTP packets are authorised they are sent to the client module, which listens for and processes incoming connections. The client module is also responsible for executing external CGI programs as needed to support web-based printers, classes, and job status monitoring and administration.[8] Once this module has processed its requests, it sends them to the IPP module which performs Uniform Resource Identifier (URI) validation to prevent a client from sidestepping any access controls or authentication on the HTTP server.[9] The URI is a text string that indicates a name or address that can be used to refer to an abstract or physical resource on a network.

The scheduler allows for classes of printers. Applications can send requests to groups of printers in a class, allowing the scheduler to direct the job to the first available printer in that class.[10] A jobs module manages print jobs, sending them to the filter and backend processes for final conversion and printing, and monitoring the status messages from those processes.[11]

The CUPS scheduler utilizes a configuration module, this parses configuration files, initializes CUPS data structures, and starts and stops the CUPS program. The configuration module will stop CUPS services during configuration file processing and then restart the service when processing is complete. [12]

A logging module handles scheduler event logging for access, error, and page log files. The main module handles timeouts and dispatch of I/O requests for client connections, watching for signals, handling child process errors and exits, and reloading the server configuration files as needed.[13]

Other modules used by the scheduler are: the MIME module, which handles a Multipurpose Internet Mail Extensions (MIME) type and conversion database that is used in the filtering process that converts print data to a format suitable for a print device;[14] a PPD module that handles a list of Postscript Printer Description (PPD) files;[15] a devices module that manages a list of devices that are available in the system;[16] and a printers module that handles printers and PPDs within CUPS.[17]

Filter system

Enlarge picture
CUPS allows different data to be sent to the CUPS server and have that data converted into a format the printer will understand and be able to print.


One of CUPS' main advantages is that it can process a variety of data formats on the print server. It converts the print job data into the final language/format of the printer via a series of filters.[18][19]It does this using MIME types, as this is an Internet Standard for the format of e-mail but is useful in allowing CUPS to determine the type of file that is being processed.

MIME databases

After the print job has been assigned to the scheduler, it is passed to the CUPS filter system. This converts the data to a format suitable for the printer. During start-up, the CUPS daemon loads two MIME databases: mime.types that defines the known file types that CUPS can accept data for, and mime.convs that defines the programs that process each particular MIME type.[20]

The mime.types file has the syntax:

mimetype { [file-extensions] | [pattern-match] }

For example, to detect an HTML file, the following entry would be applicable:

text/html html htm \
printable(0,1024) + (string(0,"") string(0,"


The second line matches the file contents to the specified MIME type by determining that the first kilobyte of text in the file holds printable characters and that those characters include html markup. If the pattern above is matched the filter system would mark the file as the MIME type text/html. [21]

The mime.convs file has the syntax:

source destination cost program

The source field is the MIME type that is determined by looking up the mime.types file, while the destination field lists the type of output requested and determines what program should be used. This is also retrieved from mime.types. The cost field assists in the selection of sets of filters when converting a file. The last field, program, determines which filter program to use to perform the data conversion.[22]

Some examples:

text/plain application/postscript 50 texttops application/vnd.cups-postscript application/vnd.cups-raster 50 pstoraster image/* application/vnd.cups-postscript 50 imagetops image/* application/vnd.cups-raster 50 imagetoraster

Filtering process

The filtering process works by taking input data preformatted with six arguments: the name of the printer queue or print filter, the job ID of the print job, the user-name, the job-name, the number of copies to print, any print options, and the filename (though this is unnecessary if it is has been redirected from standard input).[19] It then determines the type of data that is being input and the filter to be used through the use of the MIME databases, for instance image data will be detected and processed through a particular filter and HTML data detected and processed through another filter.

This data can then be either converted into PostScript data or directly into raster data. If it is converted into postscript data an additional filter is applied called a prefilter, which runs the PostScript data through another PostScript converter so that it can add printer specific options like selecting page ranges to print, setting n-up mode and other device specific things.[23] After the pre-filtering is done, the data can either be sent directly to a CUPS backend if using a PostScript printer, or it can be passed to another filter like Foomatic by linuxprinting.org. Alternatively, it can be passed to Ghostscript, which converts the PostScript into an intermediary CUPS-raster format.[24] The intermediary raster format is then passed onto a final filter which coverts the raster data to a printer specific format. The default filters that are included with CUPS are: raster to PCL, raster to ESC/P or ESC/P2 (an Epson printer language, now largely superseded by their new ESC/P-Raster format) and raster to Dymo (another printer company). Currently other proprietary languages like GDI or SPL (Samsung Printer Language) are supported by Splix, a raster to SPL translator.[25].

However, there are several other alternatives that can be used with CUPS. Easy Software Products (ESP), the creators of CUPS, have released their own CUPS filters; Gutenprint (previously known as Gimp-Print) is a range of high-quality printer drivers for (mostly) inkjet printers, and Turbo-Print for Linux has another range of quality printer drivers for a wide range of printers.

Backends

The backends are the ways in which data is sent to the printer. There are several different backends available for CUPS: parallel, serial, and USB ports, as well as network backends that operate via the IPP, JetDirect (AppSocket), Line Printer Daemon ("LPD") and SMB protocols.

Compatibility

CUPS provides both the System V and Berkeley printing commands so the traditional commands for printing can be used for CUPS. CUPS listens on port 515, which is the traditional LPD port (it treats this as a 'backend'). When CUPS is installed the lp System V printing system command and the lpr Berkeley printing system commands are installed as compatible programs. This allows a standard interface to CUPS and allows maximum compatibility with existing applications that rely on these printing systems.

Apple Computer is using CUPS as printing system in their operating system Mac OS X from Version 10.2 (Jaguar) on.

User interface tools

There are several tools created to help set up CUPS.

CUPS web-based administration interface

Enlarge picture
CUPS web-based interface


CUPS has a web-based administration interface that runs on port 631.[26] It is extremely useful in organisations that need to monitor print jobs and add print queues and printers remotely.

CUPS 1.0 provided a simple class, job, and printer monitoring interface for web browsers. CUPS 1.1 replaced this interface with an enhanced administration interface that allows to add, modify, delete, configure, and control classes, jobs, and printers.

CUPS 1.2 provides a revamped web interface, which features improved readability and design, support for automatically discovered printers and a better access to system logs and advanced setting.

GNOME



The GNOME CUPS Manager can be used to add new CUPS printers, and to manage CUPS printers and queues. (In Debian, FreeBSD and Ubuntu, gnome-cups-manager is the relevant package.) There are other third-party applications to manage printing, for example GtkLP and its associate tool GtkLPQ, or GtkPSproc.

The widget toolkit GTK+, on which GNOME is based, included integrated printing support based on CUPS on its version 2.10, which was released in 2006.

KDE

Enlarge picture
KDEPrint


KDEPrint, for KDE, is a framework containing various GUI-tools that act as CUPS front-ends and allows the administration of classes, print queues and print jobs; it includes a printer wizard to assist with adding new printers amongst other features. It was added in KDE 2.2.

KDEPrint supports several different printing platforms, amongst which CUPS is one of the best supported. It replaced a previous version of printing support in KDE, qtcups and is backwards compatible with this module of KDE. kprinter, a dialogue box program, is now the main tool for sending jobs to the print device; it can also be started from the command line. KDEPrint includes a system to pre-filter any jobs before they are handed over to CUPS, or to handle jobs all on itself (such as converting files to PDF); these filters are described by a pair of Desktop/XML files.

KDEPrint's main components are a Print Dialog box, which allows printer properties to be modified, a Print Manager, which allows management of printers (adding and removing printers), an Add Printer Wizard, and a Job Viewer/Manager, which manages printer jobs (such as hold/release, cancel, move to another printer). There is also a CUPS configuration module that is integrated into KDE.

Mac OS X

Main article: Printer Setup Utility
Enlarge picture
Screenshot of Printer Setup Utility
Mac OS X comes with a printer setup utility that offers many advanced features that are available in other Unix-based distributions. It offers a more in-depth modification than Mac OS X's System Preferences preference pane "Print and Fax".

Mandrake Linux



In Mandrake Linux 10.1 a GUI for printing has been created. It is basically an interface for CUPS and allows users to add, remove and update printers, as well as the control of print jobs. This is done from a centralised configuration program that allows for CUPS server configuration in a centralised set of screens.

Red Hat Linux/Fedora

Enlarge picture
Fedora provides a print manager that can modify CUPS based printers.


Starting with Red Hat Linux 9, an integrated print manager based on CUPS and integrated into GNOME was provided. This allowed adding printers via a similar user interface to Microsoft Windows, where a new printer could be added using an add new printer wizard, along with changing default printer properties in a window containing a list of installed printers. Jobs could also be started and stopped using a print manager and the printer could be paused using a context menu that pops up when the printer icon is right-clicked.

This system was criticised by Eric Raymond in his piece The Luxury of Ignorance. Raymond had attempted to install CUPS using the Fedora Core 1 print manager and found it non-intuitive and criticised the interface designers for not designing with the user's point of view in mind. He found the idea of printer queues was not obvious because users create queues on their local computer but these queues are actually created on the CUPS server.

He also found the plethora of queue type options confusing as he could choose from between networked CUPS (IPP), networked Unix (LPD), networked Windows (SMB), networked Novell (NCP) or networked JetDirect. He found the help file singularly unhelpful and largely irrelevant to a user's needs. Raymond used CUPS as a general topic to show that user interface design on Linux desktops needs rethinking and more careful design. He stated:[27]

The meta-problem here is that the configuration wizard does all the approved rituals (GUI with standardized clicky buttons, help popping up in a browser, etc. etc.) but doesn't have the central attribute these are supposed to achieve: discoverability. That is, the quality that every point in the interface has prompts and actions attached to it from which you can learn what to do next. Does your project have this quality?

ESP Print Pro

Enlarge picture
Screenshot of ESP Print Pro's printer manager


Easy Software Products, the original creators of CUPS, created a GUI, support for many printers and implemented a PostScript RIP. Their software solution ran on Windows, UNIX and Linux.

ESP Print Pro is no longer sold. Existing customers are able to receive support through December 31st, 2007. [28]

ESP Print Pro was based on the Common UNIX Printing System and provided PostScript and image file RIPs to support non-PostScript printers. ESP Print Pro was a complete printing solution that prints international text, Adobe PostScript, PDF, HP-GL/2, GIF(SM), TIFF, PNG, JPEG/JFIF, SGI RGB, Sun Raster, PhotoCD, PBM, PGM, and PPM files transparently to over 5400 printers via serial, parallel, and network connections.

Vulnerabilities

As of November 2005, the current release of CUPS does not contain any known vulnerabilities.

Published 2005-01-08: The latest vulnerability is a denial of service exploit in the way that CUPS processes HTTP GET requests on the server. If CUPS receives a GET request with the string '/..'. then it can cause an error that can be remotely exploited. This issue was introduced in the 1.1.21 release.[29]

On December 23, 2002, security firm iDefense found a security vulnerability in CUPS version 1.1.14-5 (or more specifically, xpdf 2.01). It involved passing an integer larger than 32 bits to CUPS in a PDF file, which is then processed by the pdftops filter (which comes with xpdf). This causes an integer overflow in the pdftops program and could cause CUPS to crash as pdftops tries to access an invalid memory address. An attacker could exploit this to create a denial of service attack. The security advisory also noted that if enough data was sent to CUPS then a buffer overflow attack could be exploited. iDefense successfully created a proof of concept program that exploited the vulnerability.[30] The SecuriTeam portal have also published several proof of concept programs that exploited the bug. They also provided the lines of code that were exploitable in their security advisory.[31]

Notes and references

1. ^ Michael Sweet (June 9, 1999), "A Bright New Future for Printing on Linux", Linux Today & followup from Michael Sweet (June 11, 1999), "The Future Brightens for Linux Printing", Linux Today.
2. ^ Easy Software Products, CUPS Licensed for Use in Apple Operating Systems! (press release), March 1, 2002.
3. ^ "CUPS",CUPS Purchased by Apple Inc. (press release), July 11,2007.
4. ^ Easy Software Products, CUPS Design Description, see section "Scheduler". Last accessed January 9th, 2007
5. ^ Easy Software Products, CUPS Design Description, see section "Filters". Last accessed January 9th, 2007
6. ^ Easy Software Products, CUPS Design Description, see section "Backend". Last accessed January 9th, 2007
7. ^ Easy Software Products. CUPS Software Design, Authorization. Last accessed January 9th, 2007.
8. ^ Easy Software Products. CUPS Software Administrators Manual, Authorisation. Last accessed January 9th, 2007.
9. ^ Easy Software Products. CUPS Software Design, IPP. Last accessed January 9th, 2007.
10. ^ Easy Software Products. CUPS Software Administrators Manual, Classes. Last accessed January 9th, 2007.
11. ^ Easy Software Products. CUPS Software Administrators Manual, Jobs. Last accessed January 9th, 2007.
12. ^ Easy Software Products. CUPS Software Design, Configuration. Last accessed January 9th, 2007.
13. ^ Easy Software Products. CUPS Software Design, Logging. Last accessed January 9th, 2007.
14. ^ Easy Software Products. CUPS Software Design, MIME. Last accessed January 9th, 2007.
15. ^ Easy Software Products. CUPS Software Design, PPD. Last accessed January 9th, 2007.
16. ^ Easy Software Products. CUPS Software Design, Devices. Last accessed January 9th, 2007.
17. ^ Easy Software Products. CUPS Software Design, Printers. Last accessed January 9th, 2007.
18. ^ Easy Software Products. CUPS Software Administrators Manual, Filters. Last accessed January 9th, 2007.
19. ^ Easy Software Products. CUPS Software Design, Filters. Last accessed January 9th, 2007.
20. ^ Easy Software Products. CUPS Software Administrators Manual, File Typing and Filtering. Last accessed January 9th, 2007.
21. ^ Easy Software Products. CUPS Software Administrators Manual, mime.types. Last accessed January 9th, 2007.
22. ^ Easy Software Products. CUPS Software Administrators Manual, mime.convs. Last accessed January 9th, 2007.
23. ^ Easy Software Products. CUPS Software Administrators Manual, pstops. Last accessed January 9th, 2007.
24. ^ The MIME type for the CUPS raster format is application/vnd.cups-raster.
25. ^ Aplix home page [1]
26. ^ CUPS Software Administrators Manual, "Managing Printers from the Web"
27. ^ "The Luxury of Ignorance: An Open-Source Horror Story"
28. ^ Easy Software Products' ESP Print Pro
29. ^ CUPS HTTP GET Denial Of Service Vulnerability, packetAlarm.de & Easy Software Products CUPS HTTP GET Denial Of Service Vulnerability, SecuriTeam
30. ^ iDefense vulnerability notification
31. ^ Multiple Security Vulnerabilities in Common UNIX Printing System (CUPS), SecuriTeam

See also

External links

Software design is a process of problem-solving and planning for a software solution. After the purpose and specifications of software is determined, software developers will design or employ designers to develop a plan for a solution.
..... Click the link for more information.
Michael Sweet is a computer scientist and is the primary developer and architect of Common Unix Printing System, flPhoto, HTMLDOC, and Mini-XML. He was the original developer of the Gimp-Print software (now called Gutenprint) and contributes to many other free software projects
..... Click the link for more information.
Software development is the translation of a user need or marketing goal into a software product.[1][2] Software development is sometimes understood to encompass the processes of software engineering combined with the research and goals of software marketing
..... Click the link for more information.
Apple Inc.

Public (NASDAQ:  AAPL , LSE:  ACP , FWB: APC )
Founded California (April 1 1976, as Apple Computer, Inc.)
Headquarters 1 Infinite Loop, Cupertino, California

Key people Steve Jobs, CEO & Co-founder
Steve Wozniak, Co-founder
..... Click the link for more information.
Easy Software Products is the vendor who originally invented the Common Unix Printing System (CUPS) and HTMLDOC software. It was founded near Washington DC in 1993[1] and is now located in Morgan Hill.
..... Click the link for more information.
20th century - 21st century
1960s  1970s  1980s  - 1990s -  2000s  2010s  2020s
1996 1997 1998 - 1999 - 2000 2001 2002

Year 1999 (MCMXCIX
..... Click the link for more information.
Code complete redirects here. For the Microsoft book, see Code Complete.

A software release is the distribution, whether public or private, of an initial or new and upgraded version of a computer software product.
..... Click the link for more information.
20th century - 21st century - 22nd century
1970s  1980s  1990s  - 2000s -  2010s  2020s  2030s
2004 2005 2006 - 2007 - 2008 2009 2010

2007 by topic:
News by month
Jan - Feb - Mar - Apr - May - Jun
..... Click the link for more information.
An operating system (OS) is the software that manages the sharing of the resources of a computer. An operating system processes system data and user input, and responds by allocating and managing tasks and internal system resources as a service to users and programs of the
..... Click the link for more information.
Unix-like operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the Single UNIX Specification.
..... Click the link for more information.
Computer software can be organized into categories based on common function, type, or field of use. A list follows of common software categories.

Categories of software

  • Applications

..... Click the link for more information.
A print server, or printer server, is a computer or device to which one or more printers are connected, which can accept print jobs from external client computers connected to the print server over a network.
..... Click the link for more information.
A software license comprises the permissions, rights and restrictions imposed on software (whether a component or a free-standing program). Use of software without a license could constitute infringement of the owner's exclusive rights under copyright or, occasionally, patent law
..... Click the link for more information.
GNU General Public License
Author: Free Software Foundation
Version: 3
Copyright on the license: Free Software Foundation, Inc.
Publication date: 29 June 2007
OSI approved: Yes
Debian approved: Yes
Free Software:
..... Click the link for more information.
GNU Lesser General Public License
Author: Free Software Foundation
Version: 3
Copyright on the license: Free Software Foundation, Inc.
Publication date: 2007-06-29
OSI approved: Yes
Debian approved: Yes

..... Click the link for more information.
A website (alternatively, Web site or web site) is a collection of Web pages, images, videos or other digital assets that is hosted on one or several Web server(s), usually accessible via the Internet, cell phone or a LAN.
..... Click the link for more information.
A computer printer, or more commonly a printer, produces a hard copy (permanent human-readable text and/or graphics) of documents stored in electronic form, usually on physical print media such as paper transparencies.
..... Click the link for more information.
Unix-like operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the Single UNIX Specification.
..... Click the link for more information.
An operating system (OS) is the software that manages the sharing of the resources of a computer. An operating system processes system data and user input, and responds by allocating and managing tasks and internal system resources as a service to users and programs of the
..... Click the link for more information.
A print server, or printer server, is a computer or device to which one or more printers are connected, which can accept print jobs from external client computers connected to the print server over a network.
..... Click the link for more information.
Server Computer

The inside/front of a server computer

Connects to:
  • Internet via one of

..... Click the link for more information.
A client is an application or system that accesses a (remote) service on another computer system known as a server by way of a network. The term was first applied to devices that were not capable of running their own stand-alone programs, but could interact with remote computers
..... Click the link for more information.
In computer science, spooling refers to process of communicating data to another program by placing it in a temporary working area, where the other program can access it at some later point in time.
..... Click the link for more information.
The Internet Printing Protocol or IPP, defines a standard protocol for printing as well as managing print jobs, media size, resolution, and so forth.

Like all IP-based protocols, IPP can be used locally or over the Internet to printers hundreds or thousands of miles
..... Click the link for more information.
In computing, a print job is a file or set of files that has been submitted to be printed.

Jobs are typically identified by a unique number, and are assigned to a particular destination, usually a printer.
..... Click the link for more information.
In computer science, spooling refers to process of communicating data to another program by placing it in a temporary working area, where the other program can access it at some later point in time.
..... Click the link for more information.
command line interface or CLI is a method of interacting with an operating system or software using a command line interpreter. This command line interpreter may be a text terminal, terminal emulator, or remote shell client such as PuTTY.
..... Click the link for more information.
The UNIX System V printing system is one of several standard architectures for printing on the UNIX platform, and is typical of commercial System V-based operating systems such as Solaris and SCO OpenServer.
..... Click the link for more information.
The Line Printer Daemon protocol/Line Printer Remote protocol (or LPD, LPR) also known as the Berkeley printing system, is a set of programs that provide printer spooling and network print server functionality for Unix-like systems.
..... Click the link for more information.
Server Message Block (SMB) is an application-level network protocol mainly applied to shared access to files, printers, serial ports, and miscellaneous communications between nodes on a network. It also provides an authenticated Inter-process communication mechanism.
..... Click the link for more information.

This article is copied from an article on Wikipedia.org - the free encyclopedia created and edited by online user community. The text was not checked or edited by anyone on our staff. Although the vast majority of the wikipedia encyclopedia articles provide accurate and timely information please do not assume the accuracy of any particular article. This article is distributed under the terms of GNU Free Documentation License.