Permalink
Browse files

FreeBSD 4.1-RELEASE.

  • Loading branch information...
sumikawa
sumikawa committed Sep 13, 2000
1 parent 7eac836 commit 9efc45bab1e4362ca7b8581331275ae5c514a9af
Showing with 16,955 additions and 0 deletions.
  1. +7 −0 freebsd4/usr.sbin/lpr/Makefile
  2. +11 −0 freebsd4/usr.sbin/lpr/Makefile.inc
  3. +68 −0 freebsd4/usr.sbin/lpr/SMM.doc/0.t
  4. +77 −0 freebsd4/usr.sbin/lpr/SMM.doc/1.t
  5. +141 −0 freebsd4/usr.sbin/lpr/SMM.doc/2.t
  6. +73 −0 freebsd4/usr.sbin/lpr/SMM.doc/3.t
  7. +206 −0 freebsd4/usr.sbin/lpr/SMM.doc/4.t
  8. +116 −0 freebsd4/usr.sbin/lpr/SMM.doc/5.t
  9. +94 −0 freebsd4/usr.sbin/lpr/SMM.doc/6.t
  10. +226 −0 freebsd4/usr.sbin/lpr/SMM.doc/7.t
  11. +12 −0 freebsd4/usr.sbin/lpr/SMM.doc/Makefile
  12. +70 −0 freebsd4/usr.sbin/lpr/SMM.doc/spell.ok
  13. +10 −0 freebsd4/usr.sbin/lpr/chkprintcap/Makefile
  14. +96 −0 freebsd4/usr.sbin/lpr/chkprintcap/chkprintcap.8
  15. +277 −0 freebsd4/usr.sbin/lpr/chkprintcap/chkprintcap.c
  16. +18 −0 freebsd4/usr.sbin/lpr/common_source/Makefile
  17. +307 −0 freebsd4/usr.sbin/lpr/common_source/common.c
  18. +487 −0 freebsd4/usr.sbin/lpr/common_source/displayq.c
  19. +234 −0 freebsd4/usr.sbin/lpr/common_source/lp.h
  20. +81 −0 freebsd4/usr.sbin/lpr/common_source/lp.local.h
  21. +265 −0 freebsd4/usr.sbin/lpr/common_source/net.c
  22. +51 −0 freebsd4/usr.sbin/lpr/common_source/pathnames.h
  23. +444 −0 freebsd4/usr.sbin/lpr/common_source/printcap.c
  24. +375 −0 freebsd4/usr.sbin/lpr/common_source/recvjob.c
  25. +80 −0 freebsd4/usr.sbin/lpr/common_source/request.c
  26. +399 −0 freebsd4/usr.sbin/lpr/common_source/rmjob.c
  27. +110 −0 freebsd4/usr.sbin/lpr/common_source/startdaemon.c
  28. +14 −0 freebsd4/usr.sbin/lpr/filters.ru/Makefile
  29. +2 −0 freebsd4/usr.sbin/lpr/filters.ru/Makefile.inc
  30. +64 −0 freebsd4/usr.sbin/lpr/filters.ru/bjc-240.sh.sample
  31. +6 −0 freebsd4/usr.sbin/lpr/filters.ru/koi2855/Makefile
  32. +102 −0 freebsd4/usr.sbin/lpr/filters.ru/koi2855/koi2855.c
  33. +6 −0 freebsd4/usr.sbin/lpr/filters.ru/koi2alt/Makefile
  34. +101 −0 freebsd4/usr.sbin/lpr/filters.ru/koi2alt/koi2alt.c
  35. +7 −0 freebsd4/usr.sbin/lpr/filters/Makefile
  36. +219 −0 freebsd4/usr.sbin/lpr/filters/lpf.c
  37. +10 −0 freebsd4/usr.sbin/lpr/lp/Makefile
  38. +117 −0 freebsd4/usr.sbin/lpr/lp/lp.1
  39. +75 −0 freebsd4/usr.sbin/lpr/lp/lp.sh
  40. +14 −0 freebsd4/usr.sbin/lpr/lpc/Makefile
  41. +891 −0 freebsd4/usr.sbin/lpr/lpc/cmds.c
  42. +83 −0 freebsd4/usr.sbin/lpr/lpc/cmdtab.c
  43. +61 −0 freebsd4/usr.sbin/lpr/lpc/extern.h
  44. +178 −0 freebsd4/usr.sbin/lpr/lpc/lpc.8
  45. +354 −0 freebsd4/usr.sbin/lpr/lpc/lpc.c
  46. +48 −0 freebsd4/usr.sbin/lpr/lpc/lpc.h
  47. +11 −0 freebsd4/usr.sbin/lpr/lpd/Makefile
  48. +50 −0 freebsd4/usr.sbin/lpr/lpd/extern.h
  49. +271 −0 freebsd4/usr.sbin/lpr/lpd/lpd.8
  50. +643 −0 freebsd4/usr.sbin/lpr/lpd/lpd.c
  51. +1,071 −0 freebsd4/usr.sbin/lpr/lpd/lpdchar.c
  52. +236 −0 freebsd4/usr.sbin/lpr/lpd/modes.c
  53. +1,671 −0 freebsd4/usr.sbin/lpr/lpd/printjob.c
  54. +376 −0 freebsd4/usr.sbin/lpr/lpd/recvjob.c
  55. +13 −0 freebsd4/usr.sbin/lpr/lpq/Makefile
  56. +137 −0 freebsd4/usr.sbin/lpr/lpq/lpq.1
  57. +201 −0 freebsd4/usr.sbin/lpr/lpq/lpq.c
  58. +15 −0 freebsd4/usr.sbin/lpr/lpr/Makefile
  59. +315 −0 freebsd4/usr.sbin/lpr/lpr/lpr.1
  60. +816 −0 freebsd4/usr.sbin/lpr/lpr/lpr.c
  61. +369 −0 freebsd4/usr.sbin/lpr/lpr/printcap.5
  62. +14 −0 freebsd4/usr.sbin/lpr/lprm/Makefile
  63. +146 −0 freebsd4/usr.sbin/lpr/lprm/lprm.1
  64. +165 −0 freebsd4/usr.sbin/lpr/lprm/lprm.c
  65. +5 −0 freebsd4/usr.sbin/lpr/lptest/Makefile
  66. +75 −0 freebsd4/usr.sbin/lpr/lptest/lptest.1
  67. +83 −0 freebsd4/usr.sbin/lpr/lptest/lptest.c
  68. +11 −0 freebsd4/usr.sbin/lpr/pac/Makefile
  69. +107 −0 freebsd4/usr.sbin/lpr/pac/pac.8
  70. +462 −0 freebsd4/usr.sbin/lpr/pac/pac.c
  71. +48 −0 freebsd4/usr.sbin/lpr/runqueue/extern.h
  72. +1,071 −0 freebsd4/usr.sbin/lpr/runqueue/lpdchar.c
  73. +234 −0 freebsd4/usr.sbin/lpr/runqueue/modes.c
  74. +1,652 −0 freebsd4/usr.sbin/lpr/runqueue/printjob.c
@@ -0,0 +1,7 @@
# $FreeBSD: src/usr.sbin/lpr/Makefile,v 1.5 1999/08/28 01:16:45 peter Exp $
SUBDIR= common_source chkprintcap lp lpc lpd lpq lpr lprm lptest pac \
filters filters.ru SMM.doc
.include <bsd.subdir.mk>
@@ -0,0 +1,11 @@
# $FreeBSD: src/usr.sbin/lpr/Makefile.inc,v 1.5 1999/08/28 01:16:45 peter Exp $
CWARNFLAGS= -Wall -Wnested-externs -Wmissing-prototypes -Wno-unused -Wredundant-decls -Wstrict-prototypes
.if exists(${.OBJDIR}/../common_source)
LIBLPR= ${.OBJDIR}/../common_source/liblpr.a
.else
LIBLPR= ${.CURDIR}/../common_source/liblpr.a
.endif
.include "../Makefile.inc"
@@ -0,0 +1,68 @@
.\" Copyright (c) 1983, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by the University of
.\" California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" @(#)0.t 8.1 (Berkeley) 6/8/93
.\"
.if n .ND
.TL
4.3BSD Line Printer Spooler Manual
.EH 'SMM:7-%''4.3BSD Line Printer Spooler Manual'
.OH '4.3BSD Line Printer Spooler Manual''SMM:7-%'
.AU
Ralph Campbell
.AI
Computer Systems Research Group
Computer Science Division
Department of Electrical Engineering and Computer Science
University of California, Berkeley
Berkeley, CA 94720
.AB
.FS
* UNIX is a trademark of Bell Laboratories.
.FE
This document describes the structure and installation procedure
for the line printer spooling system
developed for the 4.3BSD version
of the UNIX* operating system.
.de D?
.ie \\n(.$>1 Revised \\$1 \\$2 \\$3
.el DRAFT of \n(mo/\n(dy/\n(yr
..
.sp 2
.LP
.D? June 8, 1993
.AE
.de IR
\fI\\$1\fP\\$2
..
.de DT
.TA 8 16 24 32 40 48 56 64 72 80
..
@@ -0,0 +1,77 @@
.\" Copyright (c) 1983, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by the University of
.\" California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" @(#)1.t 8.1 (Berkeley) 6/8/93
.\"
.NH 1
Overview
.PP
The line printer system supports:
.IP \(bu 3
multiple printers,
.IP \(bu 3
multiple spooling queues,
.IP \(bu 3
both local and remote
printers, and
.IP \(bu 3
printers attached via serial lines that require
line initialization such as the baud rate.
.LP
Raster output devices
such as a Varian or Versatec, and laser printers such as an Imagen,
are also supported by the line printer system.
.PP
The line printer system consists mainly of the
following files and commands:
.DS
.TS
l l.
/etc/printcap printer configuration and capability data base
/usr/lib/lpd line printer daemon, does all the real work
/usr/ucb/lpr program to enter a job in a printer queue
/usr/ucb/lpq spooling queue examination program
/usr/ucb/lprm program to delete jobs from a queue
/etc/lpc program to administer printers and spooling queues
/dev/printer socket on which lpd listens
.TE
.DE
The file /etc/printcap is a master data base describing line
printers directly attached to a machine and, also, printers
accessible across a network. The manual page entry
.IR printcap (5)
provides the authoritative definition of
the format of this data base, as well as
specifying default values for important items
such as the directory in which spooling is performed.
This document introduces some of the
information that may be placed
.IR printcap .
@@ -0,0 +1,141 @@
.\" Copyright (c) 1983, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by the University of
.\" California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" @(#)2.t 8.1 (Berkeley) 6/8/93
.\"
.NH 1
Commands
.NH 2
lpd \- line printer daemon
.PP
The program
.IR lpd (8),
usually invoked at boot time from the /etc/rc file, acts as
a master server for coordinating and controlling
the spooling queues configured in the printcap file.
When
.I lpd
is started it makes a single pass through the
.I printcap
database restarting any printers that have jobs.
In normal operation
.I lpd
listens for service requests on multiple sockets,
one in the UNIX domain (named ``/dev/printer'') for
local requests, and one in the Internet domain
(under the ``printer'' service specification)
for requests for printer access from off machine;
see \fIsocket\fP\|(2) and \fIservices\fP\|(5)
for more information on sockets and service
specifications, respectively.
.I Lpd
spawns a copy of itself to process the request; the master daemon
continues to listen for new requests.
.PP
Clients communicate with
.I lpd
using a simple transaction oriented protocol.
Authentication of remote clients is done based
on the ``privilege port'' scheme employed by
\fIrshd\fP\|(8C) and \fIrcmd\fP\|(3X).
The following table shows the requests
understood by
.IR lpd .
In each request the first byte indicates the
``meaning'' of the request, followed by the name
of the printer to which it should be applied. Additional
qualifiers may follow, depending on the request.
.DS
.TS
l l.
Request Interpretation
_
^Aprinter\en check the queue for jobs and print any found
^Bprinter\en receive and queue a job from another machine
^Cprinter [users ...] [jobs ...]\en return short list of current queue state
^Dprinter [users ...] [jobs ...]\en return long list of current queue state
^Eprinter person [users ...] [jobs ...]\en remove jobs from a queue
.TE
.DE
.PP
The \fIlpr\fP\|(1) command
is used by users to enter a print job in a local queue and to notify
the local
.I lpd
that there are new jobs in the spooling area.
.I Lpd
either schedules the job to be printed locally, or if
printing remotely, attempts to forward
the job to the appropriate machine.
If the printer cannot be opened or the destination
machine is unreachable, the job will remain queued until it is
possible to complete the work.
.NH 2
lpq \- show line printer queue
.PP
The \fIlpq\fP\|(1)
program works recursively backwards displaying the queue of the machine with
the printer and then the queue(s) of the machine(s) that lead to it.
.I Lpq
has two forms of output: in the default, short, format it
gives a single line of output per queued job; in the long
format it shows the list of files, and their sizes, that
comprise a job.
.NH 2
lprm \- remove jobs from a queue
.PP
The \fIlprm\fP\|(1) command deletes jobs from a spooling
queue. If necessary, \fIlprm\fP will first kill off a
running daemon that is servicing the queue and restart
it after the required files are removed. When removing
jobs destined for a remote printer, \fIlprm\fP acts
similarly to \fIlpq\fP except it first checks locally
for jobs to remove and then
tries to remove files in queues off-machine.
.NH 2
lpc \- line printer control program
.PP
The
.IR lpc (8)
program is used by the system administrator to control the
operation of the line printer system.
For each line printer configured in /etc/printcap,
.I lpc
may be used to:
.IP \(bu
disable or enable a printer,
.IP \(bu
disable or enable a printer's spooling queue,
.IP \(bu
rearrange the order of jobs in a spooling queue,
.IP \(bu
find the status of printers, and their associated
spooling queues and printer daemons.
@@ -0,0 +1,73 @@
.\" Copyright (c) 1983, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by the University of
.\" California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" @(#)3.t 8.1 (Berkeley) 6/8/93
.\"
.NH 1
Access control
.PP
The printer system maintains protected spooling areas so that
users cannot circumvent printer accounting or
remove files other than their own.
The strategy used to maintain protected
spooling areas is as follows:
.IP \(bu 3
The spooling area is writable only by a \fIdaemon\fP user
and \fIdaemon\fP group.
.IP \(bu 3
The \fIlpr\fP program runs set-user-id to \fIroot\fP and
set-group-id to group \fIdaemon\fP. The \fIroot\fP access permits
reading any file required. Accessibility is verified
with an \fIaccess\fP\|(2) call. The group ID
is used in setting up proper ownership of files
in the spooling area for \fIlprm\fP.
.IP \(bu 3
Control files in a spooling area are made with \fIdaemon\fP
ownership and group ownership \fIdaemon\fP. Their mode is 0660.
This insures control files are not modified by a user
and that no user can remove files except through \fIlprm\fP.
.IP \(bu 3
The spooling programs,
\fIlpd\fP, \fIlpq\fP, and \fIlprm\fP run set-user-id to \fIroot\fP
and set-group-id to group \fIdaemon\fP to access spool files and printers.
.IP \(bu 3
The printer server, \fIlpd\fP,
uses the same verification procedures as \fIrshd\fP\|(8C)
in authenticating remote clients. The host on which a client
resides must be present in the file /etc/hosts.equiv or /etc/hosts.lpd and
the request message must come from a reserved port number.
.PP
In practice, none of \fIlpd\fP, \fIlpq\fP, or
\fIlprm\fP would have to run as user \fIroot\fP if remote
spooling were not supported. In previous incarnations of
the printer system \fIlpd\fP ran set-user-id to \fIdaemon\fP,
set-group-id to group \fIspooling\fP, and \fIlpq\fP and \fIlprm\fP ran
set-group-id to group \fIspooling\fP.
Oops, something went wrong.

0 comments on commit 9efc45b

Please sign in to comment.