History log of /freebsd-current/usr.sbin/lpr/lpd/printjob.c
Revision Date Author Comments
# 0b8224d1 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

Remove copyright strings ifdef'd out

We've ifdef'd out the copyright strings for some time now. Go ahead and
remove the ifdefs. Plus whatever other detritis was left over from other
recent removals. These copyright strings are present in the comments and
are largely from CSRG's attempt at adding their copyright to every
binary file (which modern interpretations of the license doesn't
require).

Sponsored by: Netflix


# 8a7b6120 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

usr.sbin: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 8a16b7a1 20-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

General further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.


# fbbd9655 28-Feb-2017 Warner Losh <imp@FreeBSD.org>

Renumber copyright clause 4

Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by: Jan Schaumann <jschauma@stevens.edu>
Pull Request: https://github.com/freebsd/freebsd/pull/96


# f03ef840 10-May-2016 Baptiste Daroussin <bapt@FreeBSD.org>

Rename getline with get_line to avoid collision with getline(3)

When getline(3) in 2009 was added a _WITH_GETLINE guard has also been added.
This rename is made in preparation for the removal of this guard


# bc17d12d 10-Apr-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

lpr: replace 0 with NULL for pointers.

Found with devel/coccinelle.

Reviewed by: gad


# 71623478 18-Sep-2014 Pedro F. Giffuni <pfg@FreeBSD.org>

lpr: replace setpgrp(2) with setpgid(2).

setpgid(2) is more portable than setpgrp(2).
The BSD variant of setpgrp is a wrapper for
setpgid(2) anyways.

MFC after: 5 weeks


# 1d1d4a47 21-Oct-2012 Eitan Adler <eadler@FreeBSD.org>

Check the return error of set[ug]id. While this can never fail in the
current version of FreeBSD, this isn't guarenteed by the API. Custom
security modules, or future implementations of the setuid and setgid
may fail.

PR: bin/172289
PR: bin/172290
PR: bin/172291
Submittud by: Erik Cederstrand <erik@cederstrand.dk>
Discussed by: freebsd-security
Approved by: cperciva
MFC after: 1 week


# 3dedcef7 11-Sep-2012 Kevin Lo <kevlo@FreeBSD.org>

Remove unused values


# 3df5ecac 30-Dec-2011 Ulrich Spörlein <uqs@FreeBSD.org>

Spelling fixes for usr.sbin/


# 97fbdc11 17-Dec-2011 Dimitry Andric <dim@FreeBSD.org>

In usr.sbin/lpr/lpd/printjob.c, use the correct printf length modifiers
for off_t (aka int64_t).

MFC after: 1 week


# 914e11a7 11-Dec-2010 Joel Dahl <joel@FreeBSD.org>

Remove the advertising clause from UCB copyrighted files in usr.sbin. This
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# 422605a3 11-Aug-2010 Garance A Drosehn <gad@FreeBSD.org>

- Improve the wait4data() routine so it behaves better when checking
print-jobs which have last-modification times that are in the future.
This shouldn't happen, of course, but it can. And when it did happen,
the previous check could cause completely-spooled jobs to sit in the
queue for 20 minutes per job. The new code waits until the last-modify
time is not changing, instead of making decisions based on the specific
value of last-modify.

MFC after: 2 weeks


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# ae39ffc9 06-Jul-2006 Garance A Drosehn <gad@FreeBSD.org>

Fix checking of the "lock" file in the spool directory for a queue,
so that the checking will wind up with the correct mode-bits in
the case where the initial open() of that lock file will create it.
Due to this bug, the first job ever sent to a queue could leave
that queue in a "printing is disabled" state.

PR: 93469
Submitted by: Michael Szklarski of kco.com.pl
MFC after: 1 week


# a6ed151d 18-Dec-2004 Garance A Drosehn <gad@FreeBSD.org>

Call umask() before opening the lock-file for a queue, to make sure
the file will be created with the right access, if the call to open()
does create it. Also fix the other call to umask() to turn off
"write others", just as a matter of general safety.

PR: 74418
MFC after: 4 days


# bea5945e 16-Dec-2004 Garance A Drosehn <gad@FreeBSD.org>

When printing a data file received from some other host, check to make
sure the data file has been completely transfered before starting to
print it. This is needed because some implementations of lpr will send
the control-file for a print job before sending the matching data-files,
and that can cause problems if the receiving host is a busy print-server.

MFC after: 2 weeks


# 0de95e16 20-Aug-2003 Garance A Drosehn <gad@FreeBSD.org>

Minimal update to make it easier to increase the buffer-size lpd uses
when reading/writing spool files. I intend to do a more elaborate
version, but I want to get this much in before 4.9-release. As written,
this results in no change to the object code.

Submitted by: John-Mark Gurney
Reviewed by: /sbin/md5
MFC after: 4 days


# 53953407 13-Aug-2003 Garance A Drosehn <gad@FreeBSD.org>

Use STDIN_FILENO, STDOUT_FILENO, and STDERR_FILENO in a few more
places (replacing constants 0, 1 & 2).

Noticed by:
Reviewed by: md5
MFC after: 4 days


# a6381ce1 14-Jul-2003 Garance A Drosehn <gad@FreeBSD.org>

Get the 'sccsid' lines even closer to correct style(9) form. The
'#ifdef lint/#endif' around the lines should not have been removed.

Reviewed by: noticed by bde
MFC after: 15 days


# 055c9045 14-Jul-2003 Garance A Drosehn <gad@FreeBSD.org>

More changes to use __FBSDID() for setting rcsids, and fix the
format of 'sccsid' lines so they consistently match style(9)
guidelines. Inspired by recent update to lpd.c by charnier.

Reviewed by: discussed on cvs-src & with bde and obrien
MFC after: 15 days


# 5e127035 03-Jun-2002 Garance A Drosehn <gad@FreeBSD.org>

Change some "process id" variables from 'int' to 'pid_t', renaming some
of them to keep better track of which-is-which (multiple variables were
named 'pid'). Moved a global pid-variable into the only routine that
used it. Net result: fixes two compile-time warnings...

MFC after: 2 weeks


# 0dcfaee0 03-Jun-2002 Garance A Drosehn <gad@FreeBSD.org>

Cosmetic improvements to some of the syslog() calls in here (in some cases
simply getting the indentation right when the statement wraps).

MFC after: 2 weeks


# 60961456 03-Jun-2002 Garance A Drosehn <gad@FreeBSD.org>

Fix all the 'return' statements in here to follow style(9).

MFC after: 2 weeks


# 4a13c4d9 03-Jun-2002 Garance A Drosehn <gad@FreeBSD.org>

Avoid checking WIFEXITED and WTERMSIG in some error situations where the
value in wstatus is not related to the process that we care about.

MFC after: 2 weeks


# 07602870 03-Jun-2002 Garance A Drosehn <gad@FreeBSD.org>

Stop using the depreciated 'union wait' definitions, moving to a more
standard handling of wait()-related routines.

Submitted by: mike
MFC after: 2 weeks


# 16d8455d 28-May-2002 Alfred Perlstein <alfred@FreeBSD.org>

Assume __STDC__, remove non-__STDC__ code.


# 98f6cc54 22-Apr-2002 Garance A Drosehn <gad@FreeBSD.org>

Implement new printcap option of "rc" aka "remote.resend_copies".
This is a boolean option, and if it is specified in a print queue
for a remote host, it causes lpd to resend the data file for each
copy the user requested on 'lpr -#n'. This is useful for network
printers which accept lpd-style jobs, but which ignore the control
file (and thus they ignore any request for multiple copies).

PR: 25635
Reviewed by: short review on freebsd-audit
MFC after: 6 days


# fc747730 19-Apr-2002 Garance A Drosehn <gad@FreeBSD.org>

Remove a safety-setting line which is unnecessary now that the previous
line is using strlcpy instead of strncpy.

MFC after: 4 days


# 150508c6 19-Apr-2002 Garance A Drosehn <gad@FreeBSD.org>

Add a little detail to the syslog-msg that comes up when lpd can not
execute a given filter.

MFC after: 4 days


# 50cf7393 07-Apr-2002 Garance A Drosehn <gad@FreeBSD.org>

A variable had been unnecessarily assigned a bogus value because gcc was
"confused" about it being unassigned. In fact, gcc was right. Fix the
real problem by setting that variable before break-ing out of a select
statement so gcc is happy, and then remove the unnecessary assignment.

Reported by: a user wondering why lpd syslog-ed about "compiler confusion"
MFC after: 12 days


# 6710feea 07-Apr-2002 Garance A Drosehn <gad@FreeBSD.org>

Rename a variable from 'user' to 'userid' to avoid some compiler warnings.

MFC after: 12 days


# 57d49eaa 07-Apr-2002 Garance A Drosehn <gad@FreeBSD.org>

Rearrange all the error returns from sendfile() to make sure the original
input file and any temporary (filter) file are closed upon return, and
that is generally done at the end of the routine. This should make it
easier for a later update (not yet written) to implement a "resend_copies"
option.

MFC after: 12 days


# 197ccef0 06-Apr-2002 Garance A Drosehn <gad@FreeBSD.org>

Re-arrange how output filters (of=) are handled for queues going to
remote machines. Now they really are handled *exactly* the same as
input filters (if=) for remote queues, except that they are started
with a different set of parameters. This should fix a few subtle
bugs in output-filter processing on such queues. It is a pretty
significant re-arranging of sendfile(), moving some of it to a new
execfilter() routine.

PR: 36552
Reviewed by: no screams from freebsd-audit
MFC after: 12 days


# 21ecfd4a 26-Nov-2001 Garance A Drosehn <gad@FreeBSD.org>

Change the recently-added 'o'-processing so it maps to 'l' instead of 'f'.
'l' ("plain text which includes control characters") is somewhat more
appropriate for 'o' ("postscript files"), and in fact some printers treat
'l' as a request to print a postscript file.

MFC after: 1 week


# 626fb2a6 19-Sep-2001 Garance A Drosehn <gad@FreeBSD.org>

Add minimal support for "o"-type print-file actions in lpd control files.
This was described in the original RFC wrt lpr, but most lpr's do not
actually implement it. There is some indication that MacOS 10.1 will
be using this when sending postscript files to print servers (that is
what "o"-type was supposed to signify -- postscript files).

MFC after: 1 week


# ad5fdfbd 23-Jul-2001 Garance A Drosehn <gad@FreeBSD.org>

Basically rewrite the dofork() routine, to add more error-checking and
correct the error-checking that was there. With the old code, an error
return from getpwuid(daemon_user) could turn the lpd process into a very
effective fork-bomb...

Reviewed by: freebsd-audit freebsd-print (a little...)
MFC after: 6 days


# 5d7321f6 22-Jul-2001 Garance A Drosehn <gad@FreeBSD.org>

Replace calls to strncpy with calls to strlcpy, and remove the extra step
needed to ensure that the result is null-terminated when using strncpy().

MFC after: 8 days


# 6d39e1b7 14-Jul-2001 Garance A Drosehn <gad@FreeBSD.org>

Fix most of the warnings generated by compiling lpr with -Wnon-const-format,
often by just telling gcc that some internal routine is "__printflike"
(work done by Kris Kennaway <kris@FreeBSD.org>). Also fix the new warnings
which show up once gcc starts checking the "printf-like parameters" passed
to those routines.

MFC after: 1 week


# bfb9fa63 14-Jul-2001 Garance A Drosehn <gad@FreeBSD.org>

Change signal-handling to reset SIGCHLD to SIGDFLT instead of SIG_IGN.
This fixes a problem with using print filters (if=, of=, etc) that showed
up in -current around June 20th. That problem initially reported by
Georg-W Koltermann <gwk@sgi.com>, while most of the investigation that
led to this fix was done by Anton Berezin <tobez@FreeBSD.org>.

Reviewed by: freebsd-print@bostonradio.org
MFC after: 1 week


# 7bc6d015 09-Jul-2001 Brian Somers <brian@FreeBSD.org>

Fix the type of the NULL arg to execl()

Idea from: Theo de Raadt <deraadt@openbsd.org>


# cc3fd56f 15-Jun-2001 Garance A Drosehn <gad@FreeBSD.org>

Rename a few global variables which hold hostname-related values to be
more sensible/understandable. 'from'->'from_host' 'host'->'local_host'
'fromb'->'frombuf' 'fromhost'->'origin_host' and a local-variable
named 'host'->'hostbuf'. This fixes some compile-time warnings about
local variables shadowing global variables.

Other than renaming variables, the only actual code changes are to call
strlcpy() instead of strncpy() when setting those (renamed) variables,
and that 'from_ip' is now a strdup()-created buffer instead of being a
static buffer compiled in as 1025 bytes.

Reviewed by: freebsd-print@bostonradio.org (an earlier version)
MFC after: 1 week


# ba7a1ad7 12-Jun-2001 Garance A Drosehn <gad@FreeBSD.org>

Fix about 90-100 warnings one gets when trying to compile lpr&friends
with BDECFLAGS on, mainly by adding 'const' to parameters in a number
of routine declarations. While I'm at it, ANSI-fy all of the routine
declarations. The resulting object code is exactly the same after
this update as before it, with the exception of one unavoidable
change to lpd.o on freebsd/alpha.

Also added $FreeBSD$ line to lpc/extern.h lpc/lpc.h lptest/lptest.c

Reviewed by: /sbin/md5, and no feedback from freebsd-audit


# 28b05102 11-Mar-2001 Garance A Drosehn <gad@FreeBSD.org>

Improve a few error messages wrt if= filters on remote print queues.


# 59a09735 14-Nov-2000 Garance A Drosehn <gad@FreeBSD.org>

Make sure a few strings will have terminating null characters.
(most of the PR 16186 was already applied, except for these 2 lines)

PR: 16186
Submitted by: Przemyslaw Frasunek <venglin@lubi.FreeBSD.lublin.pl>


# aa538512 14-Nov-2000 Garance A Drosehn <gad@FreeBSD.org>

Fix (style) some variable initializations.


# a480d5f2 14-Nov-2000 Garance A Drosehn <gad@FreeBSD.org>

Change 'count' to a more descriptive 'jobcount', and fix the stupid
comments which claim this counter is counting "files", which it is not.


# a4803ea1 14-Nov-2000 Garance A Drosehn <gad@FreeBSD.org>

Get rid of 'exit(-1)' calls. Exit codes are limited to 8 bits under most
Unixes, so -1 becomes 0xFF for 2's complement and 0xFE (?) for 1's
complement.

Reviewed by: bde@FreeBSD.org


# c61c5210 13-Nov-2000 Garance A Drosehn <gad@FreeBSD.org>

My previous commit removed a line it wasn't supposed to. Add it back.


# ca52ea3c 12-Nov-2000 Garance A Drosehn <gad@FreeBSD.org>

Replace call to mktemp() with mkstemp. Also move where that call is
done, so the correct directory is being checked. The mkstemp() call
is meant to create a temp file for stderrs when running filters. This
update also fixes log-file processing for remote (rm=) queues which
specify an input filter (if=). Before, filter-errs were thrown away.
Now they'll be copied to the queue's logfile (lf=).

Reviewed by: (a little) audit@FreeBSD.ORG & freebsd-print@bostonradio.org


# cdd8df46 07-Nov-2000 Garance A Drosehn <gad@FreeBSD.org>

Fix 'printit()' to ignore some lines it doesn't recognize (most likely
coming from lprNG hosts), and print a more helpful error msg for others.


# 30b4b758 06-Nov-2000 Garance A Drosehn <gad@FreeBSD.org>

Cosmetic change of a structure name.
Turn 'struct queue { q_time, q_name }' (loosely-speaking)
into 'struct jobqueue { job_time, job_cfname }'

Reviewed by: GAWollman


# 7c17eaa6 05-Nov-2000 Garance A Drosehn <gad@FreeBSD.org>

Fix a format-code, thus getting rid of a compile-time warning msg.


# 19d0f858 04-Nov-2000 Garance A Drosehn <gad@FreeBSD.org>

Fix potential problem processing jobs from hosts with >32 character hostnames.
This may fix a problem reported by Juha Ylitalo <juha.o.ylitalo@nokia.com>


# 6522ebec 02-Nov-2000 Garance A Drosehn <gad@FreeBSD.org>

Implement new printcap options of sr= (aka stat.recv) and sr= (aka stat.send)
in lpd. Stat.recv is useful on a printserver, as something of a network
performance-monitoring tool. Stat.send is a minimal accounting record of
sorts for jobs going to tcp/ip based printers.

Reviewed by: freebsd-print@bostonradio.org


# 50545e9e 24-May-2000 Mike Pritchard <mpp@FreeBSD.org>

Re-implement my fix from rev 1.6 (same rev for both files being committed)
that was lost during the lite-2 merge. From the original commit message:

Initialize the group list so that any filter programs that are
run by lpd are not run with root's groups.


# d3d56c3d 30-Nov-1999 Andrey A. Chernov <ache@FreeBSD.org>

Add support for pr's locale


# 97d92980 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# 90cf373d 11-Sep-1998 Garrett Wollman <wollman@FreeBSD.org>

Fix additional warnings. Remove -Werror, since some people have complained
about it.

PR: 7886
Submitted by: Stefan Eggers <seggers@semyam.dinoco.de> (partially)


# b538df16 21-Aug-1998 Brian Somers <brian@FreeBSD.org>

Fix ``lp=port@machine'' syntax and mention it in printcap(5).


# 4a1a0dbe 02-Dec-1997 Garrett Wollman <wollman@FreeBSD.org>

Mega lpd/lpd upgrade, part I:

- Get rid of a lot of the static variables which were shared by
many routines and programs in the suite.
- Create an abstract interface to the printcap database, so that
other retrieval and iteration mechanisms could be developed
(e.g., YP, Hesiod, or automatic retrieval from a trusted server).
- Give each capability a human-readable name in addition to the historic
two-character one.
- Otherwise generally clean up a lot of dark corners. Many still remain.
- When submitting jobs, use the official login name record (from getlogin())
if there is one, rather than reverse-mapping the uid.

More to come...


# 6d0727f4 07-Nov-1997 Joerg Wunsch <joerg@FreeBSD.org>

Argl! Who's got the pointy hat these days? Hand it over to me, ASAP!

When setting an alarm that didn't trigger, i gotta clear it again
before going on. Hmpf!


# 83f31ab1 14-Oct-1997 Joerg Wunsch <joerg@FreeBSD.org>

Improve my hack from rev 1.6 of displayq.c, and make the TCP
connection timeout controllable by a new printcap(5) capability named
`ct' (connectiom timeout), defaulting to 120 seconds (which is the
default TCP connection timeout).

Would anybody see a problem with merging all this into RELENG_2_2?


# 6ee8b269 29-Jul-1997 Warner Losh <imp@FreeBSD.org>

Two minor, pedantic fixes from bde for my last pedantic fixes, plus
the following from recent OpenBSD changes. These changes (and all
I've made) should be merged back into 2.2 when they are vetted in
-current.

common.c:
OpenBSD 1.7: mickey: #if __STDC__ --> #ifdef __STDC__

displayq.c:
OpenBSD 1.8: deraadt: 1 byte oflows; millert

rmjob.c:
OpenBSD 1.8: deraadt: 1 byte oflows; millert

cmds.c:
OpenBSD 1.9: grr: restore traditional "all" keyword option - see lpc(8)
[[ This makes lpc status all work again -- imp ]]

printjob.c:
OpenBSD 1.17: deraadt: use sendmail -t
OpenBSD 1.16: mickey: #if __STDC__ --> #ifdef __STDC__
OpenBSD 1.15: deraadt: 1 byte oflow; Don.Lewis@tsc.tdk.com

recvjob.c:
OpenBSD 1.11: mickey: #if __STDC__ --> #ifdef __STDC__

lpr.c:
OpenBSD 1.19: mickey: #if __STDC__ --> #ifdef __STDC__

Obtained from: OpenBSD


# 5f87a7b6 28-Jul-1997 Warner Losh <imp@FreeBSD.org>

Fix boatloads of buffer overflows from the OpenBSD tree.
Be pedantic about always using sizeof(blah) vs sizeof (blah) or sizeof blah.
Obtained from:OpenBSD


# f8eb25da 23-Jul-1997 Warner Losh <imp@FreeBSD.org>

index -> strchr and rindex -> strrchr to reduce the number of gratuitous
diffes with NetBSD/OpenBSD. These changes seem to predate the NetBSD/OpenBSD
split, so it is hard to give proper credit for them.
Obtained from: OpenBSD.


# 49c7494b 11-Apr-1997 Brian Somers <brian@FreeBSD.org>

Support input and output filters with remote printing.
Output filters are executed on a per-file basis as it's
necessary to supply the file size to the "other side".


# bc407914 26-Oct-1996 Warner Losh <imp@FreeBSD.org>

lpc/cmds.c:
From NetBSD via OpenBSD to fix NetBSD PR #506
More descriptive message for printer status
(OpenBSD: 1.2)

Various warnings cleaned up (OpenBSD: 1.4)

lpc/lpc.c:
Various warnings cleaned up (OpenBSD: 1.3)

lpd/lpd.c:
Remove trailing blank lines (OpenBSD: 1.2)

Potential umask problem with creating /dev/printer
(OpenBSD: 1.4 and 1.5)

Ftp bounce attack (untested on FreeBSD)
(OpenBSD: 1.6, 1.8, 1.9)
Fencepost in strncpy
(OpenBSD: 1.6)

lpd/printjob.c:
Fix from freebsd for waiting for an exiting filter, that
appears not in the FreeBSD CVS tree.
(OpenBSD: 1.6)

lpd/recvjob.c:
Buffer overflow protection: use strncpy rather than strcpy.
(OpenBSD: 1.3)

lpr/lpr.c:
NetBSD change of return type for main()
(OpenBSD: 1.2)

Restrict time running as root
(OpenBSD: 1.7)

Use getcwd rather than getwd (from NetBSD)

Use snprintf rather than sprintf
(OpenBSD: 1.8)

Minor tweak to end of loop and buffer overflow sanity. card()
overflow already in FreeBSD
(OpenBSD: 1.9)

lptest/lptest.c:
void -> int return type of main, from NetBSD via OpenBSD
(OpenBSD: 1.2)

pac/pac.c:
void -> int return type of main, from NetBSD via OpenBSD
(OpenBSD: 1.3)

Obtained from: OpenBSD


# 3b72a1cd 29-Sep-1996 Bruce Evans <bde@FreeBSD.org>

Close files up to getdtablesize(), instead of up to NOFILE.

lpd was one of 3 programs in /usr/src that (mis)used NOFILE.


# 7f72cbba 09-May-1996 Joerg Wunsch <joerg@FreeBSD.org>

Cleanup.

The removed files are no longer needed, they are actually labelled as
``Use only if you are not 4.4BSD''. (Yeah, the ol' crufty printcap.c
is really gone!)

Properly declare all external objects in files ending in .h, as
opposed to embed them into files ending in .c.


# 5458e2f4 05-May-1996 Joerg Wunsch <joerg@FreeBSD.org>

Pull a bunch of fixes from the 4.4BSD-Lite2 branch. It's really
surprising how many trivial errors there have been... :-)

Some more cleanup is needed, but i'd like to separate the Lite2 changes
from other work, that's why this goes into a different commit.

People with serial printers should see whether i have broken the stty-
style printcap options (i hope not).

Inspired by: Sergey Shkonda <serg@bcs1.bcs.zaporizhzhe.ua>


# 0b561052 05-May-1996 Joerg Wunsch <joerg@FreeBSD.org>

Vendor-branch import of the 4.4BSD-Lite2 code for lpr. There are
several bugfixes in it that are worth considering.

Don't be alarmed about the import conflicts...

Obtained from: 4.4BSD-Lite2


# e0048e96 03-Apr-1996 Sean Eric Fagan <sef@FreeBSD.org>

Makefile: Add new modes.c file to list of objects.
printjob.c: Use termios instead of sgtty structs and ioctls; remove
support for fs/fc/xs/xc capabilities, and replace them with the ms
capability (stty-like words, instead of octal bit patterns).
modes.c: Modified from stty's file, parses comma-seperated list of
tty modes (e.g., "cs8,-paren,-opost").

Reviewed by: rgrimes, joerg


# b406e662 02-Sep-1995 Mike Pritchard <mpp@FreeBSD.org>

Initialize the group list so that any filter programs that are
run by lpd are not run with root's groups.


# cca80d1f 31-Jul-1995 Bill Paul <wpaul@FreeBSD.org>

The other day someone brought me an old Apple Laserwriter II with a serial
interface set at 57600 baud, and I found out the hard way that lpd doesn't
know about speeds greater than 38400, even though <sys/ttydev.h> also
permits 57600 and 115200 baud. Fix this by adding B57600 and B115200 to the
'bauds' table. (The Apple printer worked properly once I did this, BTW. :)


# 709e8f9a 29-May-1995 Rodney W. Grimes <rgrimes@FreeBSD.org>

Remove trailing whitespace.


# 9d69574d 26-Apr-1995 Jordan K. Hubbard <jkh@FreeBSD.org>

Close PR:
>Number: 368
>Category: bin
>Synopsis: Lpd doesn't log errors after failed exec
>Description:

If an exec done by lpd fails, nothing is sent to the system log
indicating what went wrong. This is because lpd closes all of
the file descriptors before doing the exec, thus closing the syslog
file descriptor in the process.
[Fix applied]
Submitted by: pritc003@maroon.tc.umn.edu


# 931e5010 08-Jan-1995 Joerg Wunsch <joerg@FreeBSD.org>

Use the "-F" option to /bin/pr now that we have it (thanks to Posix).
This helps for printers that tend to get out of sync. (For the
cautious folks: we used to have it in 1.1.5, too. But GNU pr used
"-f" for it.)


# dea673e9 25-May-1994 Rodney W. Grimes <rgrimes@FreeBSD.org>

BSD 4.4 Lite usr.sbin Sources