Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 94346 - The Printing HOWTO says to set FileDevice=Yes, which doesn't completely work
Summary: The Printing HOWTO says to set FileDevice=Yes, which doesn't completely work
Status: RESOLVED FIXED
Alias: None
Product: [OLD] Docs-user
Classification: Unclassified
Component: Printing HOWTO (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Sven Vermeulen (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-28 21:39 UTC by Norman Yarvin
Modified: 2005-06-29 07:35 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Norman Yarvin 2005-05-28 21:39:00 UTC
The Gentoo printing guide, at

http://www.gentoo.org/doc/en/printing-howto.xml

tells people to edit /etc/cupsd/cups.conf and change the setting of
FileDevice to Yes, then specify the printer as "file:/dev/lp0" (or
whatever device their printer happens to be).  There are a couple of
problems with this:

1. Security.  CUPS warns against using FileDevice=Yes, because someone
could print to, say, "file:/etc/passwd"; to quote from the CUPS system
administrator manual, at:

http://www.cups.org/doc-1.1/sam.html,

        "File devices are managed by the scheduler. Since the scheduler
        normally runs as the root user, file devices can be used to
        overwrite system files and potentially gain unauthorized access
        to the system. If you must create printers using file devices, we
        recommend that you set the FileDevice directive to Yes for only
        as long as you need to add the printers to the system, and then
        reset the directive to No."

2. It doesn't completely work.  With file devices, CUPS doesn't support
raw printing (as in the "-o raw" option to lpr); if you try, it just
silently refuses, presumably for security reasons.  (It'd be more
dangerous to overwrite /etc/passwd with a raw file, which the user can
control completely, than to overwrite it with a file encoded for
printing.)  This means that GIMP cannot print through its gimp-print
module that uses "-o raw" to allow complete control of the printer
(sending the appropriate codes to set print resolution, paper type,
etc.).

What CUPS wants people to do, instead of specifying the printer as a file
device, as in "file:/dev/lp0", is for them to specify it as
"parallel:/dev/lp0" or "serial:/dev/ttyS1?baud=115200" or
"usb:/dev/usb/lp0".  Unfortunately the exact syntax of this doesn't seem
to be well documented, although the following web page has a tolerable
description:

http://www.linuxprinting.org/kpfeifle/LinuxKongress2002/Tutorial/VI.CUPS-Connec!

Essentially the first part of the URI (e.g. "parallel" or "usb")
designates the CUPS "backend" to be used, and the rest of the syntax is
backend-specific.

For USB, device names can also be specified as "usb://make/model" -- for
instance, my printer is "usb://EPSON/Stylus%20COLOR%20860".  I didn't
come up with that string myself; the CUPS web interface gave it as one of
the options.  It is in fact the make and model of my printer, with spaces
replaced by "%20"; but I wouldn't have known what to capitalize.  And
yes, the damn thing IS case-sensitive.  The CUPS web interface gets the
URI string by running the program /usr/lib/cups/backend/usb, which lists
the available USB printers.  You can do that yourself (running the
program as root).

The latter type of naming is useful in the case of multiple connected USB
printers, each of which might end up as /dev/usb/lp0 or /dev/usb/lp1,
depending on the order in which they were plugged in.


Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Sven Vermeulen (RETIRED) gentoo-dev 2005-06-28 02:52:01 UTC
I've done a rewrite on the printing howto; you can view it at
http://www.gentoo.org/doc/en/handbook/draft/printing-howto.xml when the webnodes
synchronise (less than an hour). It doesn't mention the FileDevice hack and uses
the cups way of configuring printers. I've also removed the footmatic stuff
since that is a cause of more confusion than help.
Comment 2 Sven Vermeulen (RETIRED) gentoo-dev 2005-06-29 07:35:15 UTC
Fixed in CVS.