History log of /freebsd-10.1-release/usr.sbin/lpr/common_source/
Revision Date Author Comments
272461 03-Oct-2014 gjb

Copy stable/10@r272459 to releng/10.1 as part of
the 10.1-RELEASE process.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


251044 27-May-2013 gad

Change the closeallfds() routine to use closefrom() when it is
available (closefrom() was added to FreeBSD in 8.0-release).
The selection is made at compile-time, as I still compile a
FreeBSD-based version of lpr&friends on other platforms.

While testing I out that (at least on my system) lpd has been
closing 11095 fd's, when there are only 6 fd's open. The old
code took 120 times more clocktime than calling closefrom().
(although that was still less than 2/1000-ths of a second!)

Reviewed by: jilles
MFC after: 2 weeks


242091 25-Oct-2012 ed

Let lpr build with -Wmissing-variable-declarations.

Mark variables static where possible and place the uid/euid variables in
lp.h, so that we can compile-time enforce that these variables have the
same type.


242005 24-Oct-2012 eadler

PRIV_START and PRIV_END were reversed.

Submitted by: KAHO Toshikazu <kaho@elam.kais.kyoto-u.ac.jp>
Approved by: secteam (simon)
MFC after: 3 days


241852 22-Oct-2012 eadler

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


238547 17-Jul-2012 jh

Make sure that arraysz is initialized to a value larger than zero.
arraysz could get initialized to zero on ZFS because ZFS reports
directory sizes differently compared to UFS.

PR: bin/169493
Tested by: swills
MFC after: 2 weeks


238546 17-Jul-2012 jh

Remove trailing whitespace.

MFC after: 2 weeks


235647 19-May-2012 gleb

Hide DIR definition by making it an opaque struct typedef.

Introduce dirfd() libc exported symbol replacing macro with same name,
preserve _dirfd() macro for internal use.

Replace dirp->dd_fd with dirfd() call. Avoid using dirfd as variable
name to prevent shadowing global symbol.

Sponsored by: Google Summer Of Code 2011


228990 30-Dec-2011 uqs

Spelling fixes for usr.sbin/


220586 13-Apr-2011 gad

- Fix the code that matches userids in match_jobspec(). It needs to check
the username-for-accounting field (P), not the username-for-headerpage (L).
These are usually the same value, except that control files do not have
the username-for-headerpage field if the user has requested no header page.
- Also rename the cji_username field to cji_headruser, to make it clear that
the value should only be used for the header page. (aka banner page)

MFC after: 3 weeks


216372 11-Dec-2010 joel

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


201512 04-Jan-2010 kib

Modernize scandir(3) and alphasort(3) interfaces according to the IEEE
Std 1003.1-2008. Both Linux and Solaris conforms to the new definitions,
so we better follow too (older glibc used old BSDish alphasort prototype
and corresponding type of the comparision function for scandir). While
there, change the definitions of the functions to ANSI C and fix several
style issues nearby.

Remove requirement for "sys/types.h" include for functions from manpage.

POSIX also requires that alphasort(3) sorts as if strcoll(3) was used,
but leave the strcmp(3) call in the function for now.

Adapt in-tree callers of scandir(3) to new declaration. The fact that
select_sections() from catman(1) could modify supplied struct dirent is
a bug.

PR: standards/142255
MFC after: 2 weeks


201390 02-Jan-2010 ed

The last big commit: let usr.sbin/ use WARNS=6 by default.


194859 24-Jun-2009 gad

Fix end-of-line issues that can come up when `lpq' reads information
about a queue from a remote host. That remote host may use \r, \r\n,
or \n\r as the line-ending character. In some cases the remote host
will write a single line of information without *any* EOL sequence.

Translate all the non-unix EOL's to the standard newline, and make
sure the final line includes a terminating newline. Logic is also
added to translate all unprintable characters to '?', but that is
#if-ed out for now.

PR: bin/104731
MFC after: 3 weeks


146188 13-May-2005 ume

NI_WITHSCOPEID cleanup

Reviewed by: gad


139464 31-Dec-2004 gad

Fix so all parts of lpd, lpc, lpq, and lprm will use the same algorithm
for calculating the job number for a job based on the control-file name.
We might receive cf-files named by other implementations of lpr, where
the job number shown by lpq would not match the job number that other
commands expected for the same name.

This also uses a newer algorithm for determining a job number, to avoid
problems caused when a control-file is named using an IP address, instead
of the hostname.

This also moved the declaration if isowner() from lp.h to rmjob.c. When I
went to change the parameters, I noticed that rmjob.c was the only source
file which uses it.

MFC after: 2 weeks


139462 31-Dec-2004 gad

Do more extensive checking of the userid field which is read in from the
control-file for each print job. This is partially because the previous
checks still let through some characters which would cause trouble for
other applications which try to process the resulting userid -- such as
accounting programs.

But the main reason is to handle the case where some remote host sends a
print job where the given userid is an uppercase-version of the real userid.
For that case, lpd will now check for uppercase letters in the userid. If
there are any, it will check to see if the given userid (with the uppercase
letters) is a valid one. If it is *not* valid, then lpd will change the
userid to all-lowercase right when the job is received.

MFC after: 2 weeks


136910 24-Oct-2004 ru

For variables that are only checked with defined(), don't provide
any fake value.


121525 26-Oct-2003 peter

Fix a warning about mismatched pointers. A pointer to "void *" is not the
same as a pointer to "char *". Tell the compiler this is ok.


118288 01-Aug-2003 gad

Remove a 'From:' that snuck into an sccsid comment line as part of -v1.3


117592 14-Jul-2003 gad

Get the 'sccsid' lines even closer to correct style(9) form. The
'#ifdef lint/#endif' around the lines should not have been removed.
Also add blank lines where one (per file) was missing.

Reviewed by: First part noticed by bde, blank lines noticed by me
MFC after: 15 days


117590 14-Jul-2003 gad

Get the 'sccsid' for this to match the original lines you would
get from '-r CSRG', instead of having that sccsid as a comment.
(this is the sccsid from 1996 -- there have been many changes to
printcap.c since then!)

MFC after: 15 days


117541 14-Jul-2003 gad

Take advantage of the common_source/lp.cdefs.h file to change lpr
source to use __FBSDID() for setting rcsids. Also fix the format
of 'sccsid' lines to consistently match style(9) guidelines.

Reviewed by: discussed with bde and obrien
MFC after: 15 days


117540 14-Jul-2003 gad

Introduce a new lp.cdefs.h file, which will be used to make it
somewhat easier to build this lpr on other operating systems.
This simply includes <sys/cdefs.h> when that is appropriate,
and then checks for any cdefs-ish macros that lpr uses, and
defines them if they don't already exist. This is only a start
at making freebsd's lpr less of a hassle to port. It is mainly
added so all of lpr can be changed to use the __FBSDID() macro,
without making it *more* of a hassle to build on other OS's.

Reviewed by: discussed with bde and obrien
MFC after: 15 days


116234 12-Jun-2003 gad

Minor improvement to some debugging code that is probably used by no one
but me (it's usually #ifdef-ed out).

MFC after: 1 week


116230 12-Jun-2003 gad

When sanity-checking a variable, it's good to check the correct variable...

MFC after: 1 week


112701 27-Mar-2003 eivind

Change DEFMX to 0. This removes the size limit for print jobs by default.

Discussed with: gad (now), arch (a year ago)


101677 11-Aug-2002 schweikh

Fix typos; each file has at least one s/seperat/separat/
(I skipped those in contrib/, gnu/ and crypto/)
While I was at it, fixed a lot more found by ispell that I
could identify with certainty to be errors. All of these
were in comments or text, not in actual code.

Suggested by: bde
MFC after: 3 days


100203 17-Jul-2002 gad

Changes which rewrite 'lpc topq', and which add 'lpc bottomq'. These
reflect much valuable feedback from wollman. More details on the new
'lpc topq' are in the log message for revision 1.2 of lpc/movejobs.c.

The previous implementation of 'lpc topq' is available as 'lpc xtopq',
in case there are any problems noticed in the new implementation. If
there are no problems with this version, a later update will remove the
'lpc xtopq' command.

Reviewed by: freebsd-print@bostonradio.org
MFC after: 6 days


99845 12-Jul-2002 gad

Fix set_qstate() so it correctly checks for any error from chmod().
Note that set_qstate() is only called from several 'lpc' commands.

MFC after: 3 days


99844 12-Jul-2002 gad

Add a SQS_QCHANGED option to set_qstate(). This will soon be used by 'lpc'.

Reviewed by: freebsd-print@bostonradio.org
MFC after: 3 days


99842 12-Jul-2002 gad

Add two variables to struct jobqueue, and change the way that getq()
calculates how much space to get for that struct, so it will get the
right amount when new variables are added.

MFC after: 3 days


99840 12-Jul-2002 gad

Move prototypes for ctl_readcf and ctl_freeinf from ctlinfo.c to ctlinfo.h,
so the routines can be called by an upcoming change for 'lpc topq/bottomq'.

MFC after: 3 days


98702 23-Jun-2002 gad

Stop adding ${CWARNFLAGS} to CFLAGS. The standard makefile processing will
add them automatically, and there is no point in adding them twice.

MFC after: 5 days


98154 13-Jun-2002 gad

Bah humbug. Fix another typo on the same comment line. It also had
an option-space instead of a space...

MFC after: 10 days


98153 13-Jun-2002 gad

Fix a typo in a comment from the previous commit. I had a bullet-character
instead of an asterisk.

Noticed by: keramida
MFC after: 10 days


98152 13-Jun-2002 gad

Almost complete rewrite of the lpc commands 'abort', 'enable', 'disable',
'restart', 'start', 'stop' and 'up'. These are commands which mainly
just alter the access bits on the lock-file of a queue, and they all
now use a central routine to do that. This reduces the amount of code
that is run as the priv userid, and eliminates a number of cases where
error messages were written while that priv uid was in effect.

As far as users are concerned, there should be no noticable difference
in the new versions. In case there *is*, the previous implementations
are still there as 'xabort', 'xenable', etc, so they are available for
instant fallback. If no one reports a problem after a few weeks, then
a later update will remove those x-commands.

Reviewed by: freebsd-audit and freebsd-print@bostonradio.org
MFC after: 10 days


97421 28-May-2002 alfred

Assume __STDC__, remove non-__STDC__ code.


96514 13-May-2002 ru

Mark all internal libraries with INTERNALLIB.


95429 25-Apr-2002 gad

When using %p to print out pointers to struct's, first cast the values
to (void *) to satisfy some stricter warning-level checks in the new
gcc (on sparc64).

Reviewed by: obrien
MFC after: 4 days


95299 23-Apr-2002 gad

Improve the error message the user sees if the startdaemon routine cannot
connect() to the socket for lpd. Tell them this error probably means that
the master 'lpd' process is not running.

MFC after: 4 days


95293 23-Apr-2002 gad

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


95290 22-Apr-2002 gad

Add 'const' to some casts to fix two warnings that are printed by the
new gcc (on sparc64).

MFC after: 4 days


87034 28-Nov-2001 gad

My recent changes to add the ctl_renametf routine assumed that print job
control-files will always start with 'cfA*'. It turns out that some
implementations of lpd (such as solaris) may send a control file which
starts with 'cfB*', or really 'cf<anyLetter>*'. Although such filenames
are very odd, we did used to accept them. This changes ctl_renametf to
work correctly with them, and fixes up 'lpc clean' to match.

PR: bin/32183
MFC after: 10 days


86935 27-Nov-2001 gad

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


83684 20-Sep-2001 gad

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


82557 30-Aug-2001 kris

Fix buffer overflow in queue file handling.

Submitted by: millert@openbsd.org, gad
Reported by: X-Force <xforce@iss.net>


80172 23-Jul-2001 gad

Fix a few more minor compile-time warnings, mainly by using size_t where
appropriate, and using '("%lu", (unsigned long)asizeval)' when printing
something of type size_t.

MFC after: 1 week


80133 22-Jul-2001 gad

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


80029 20-Jul-2001 obrien

Perform a major cleanup of the usr.sbin Makefiles.
These are not perfectly in agreement with each other style-wise, but they
are orders of orders of magnitude more consistent style-wise than before.


79746 15-Jul-2001 gad

Change lpd to perform sanity and safety checks on control files as it
receives them from other hosts. This is meant to protect from both
nefarious users (which maybe broke into some remote host that we accept
print jobs from), and broken implementations of lpr on other platforms.
This is done by changing recvjob.c to call the new ctl_renametf()
routine in the new common_source/ctlinfo.[ch] files. This will not
affect jobs coming via lpr on the local machine.

Reviewed by: freebsd-print@bostonradio.org & freebsd-audit
MFC after: 16 days


79740 15-Jul-2001 gad

Replace three subtly-wrong calls to strncpy with calls to strlcpy, and
use (size_t) in a few places to avoid compile-time warnings on alpha.

MFC after: 1 week


79739 15-Jul-2001 gad

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


78300 15-Jun-2001 gad

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


78280 15-Jun-2001 gad

Rename global variable 'name' to 'progname', thus fixing a number of
warnings which come up for various routines that have a parameter which
is also called 'name'.

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


78146 12-Jun-2001 gad

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


75253 06-Apr-2001 gad

Make sure the euid is restored in an obscure error situation.

Submitted by: J Wunsch <j@ida.interface-business.de> in freebsd-audit


74126 12-Mar-2001 gad

Fix "lprm -" (remove all jobs) processing for remote printer queues.

PR: bin/25544


70520 30-Dec-2000 phk

Use macro API to <sys/queue.h>

Submitted by: "Jason" <jsmethers@pdq.net>
Reviewed by: /sbin/md5


70098 16-Dec-2000 ume

IPv6 support for lpr.

Reviewed by: freebsd-current (no objection)
Obtained from: KAME


68740 15-Nov-2000 gad

Reset the seteuid in a few obscure error situations.


68739 15-Nov-2000 gad

Just some style-related improvements.


68401 06-Nov-2000 gad

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


68342 05-Nov-2000 gad

Fix 'lprm' processing so is more likely to work correctly when dealing
with long (>32 character) hostnames.

PR: 14978
Submitted by: Tatsuya Kudoh <cdr@cosmonet.org>


68253 02-Nov-2000 gad

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


68101 31-Oct-2000 gad

Make the standard 'lpq' output a little more informative when listing jobs
which have long names. Instead of just listing '...', try to list some
reasonable subset of the name (with a "..." to indicate something missing).

Reviewed by: freebsd-print@bostonradio.org (only a little review)


68100 31-Oct-2000 gad

Fix 'lpq' so it can correctly display jobs which come from hosts using
'lprNG' (which writes control-lines in a different order than our lpr).

Reviewed by: freebsd-print@bostonradio.org


66415 27-Sep-2000 wollman

Fix cosmetic error in rmjob message.

PR: 21006


60938 26-May-2000 jake

Back out the previous change to the queue(3) interface.
It was not discussed and should probably not happen.

Requested by: msmith and others


60833 23-May-2000 jake

Change the way that the queue(3) structures are declared; don't assume that
the type argument to *_HEAD and *_ENTRY is a struct.

Suggested by: phk
Reviewed by: phk
Approved by: mdodd


60282 09-May-2000 imp

This appears to have been repo-copied to lpd a while ago and never
deleted here. Diff shows there is only one change to this file, which
matches the repo histories.


59920 03-May-2000 wollman

Print files submitted at the same instant in deterministic order.

PR: 18361
Submitted by: Garance A Drosehn <gad@freefour.acs.rpi.edu>


50479 28-Aug-1999 peter

$Id$ -> $FreeBSD$


46110 27-Apr-1999 jkh

lpd tries to be clever and checks if RM == my_hostname.
However, it doesn't check if the remote printer name it
is sending it to is the same as the local printer name,
and so chokes 'cos "laser" is not a real printer.

PR: 7081
Submitted by: David Malone <dwmalone@maths.tcd.ie>


39084 11-Sep-1998 wollman

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

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


36881 11-Jun-1998 jb

Remove -Werror from CFLAGS on i386 because with -nostdinc gcc spits
warnings from unused static inline functions in headers if you happen
to set CFLAGS without -O.


35998 13-May-1998 jb

The printf type checking in gcc wants %qd to be a long long, so add
a cast in case off_t is not a long long (as on alpha).


35997 13-May-1998 jb

Make -Werror i386 specific because -nostinc on alpha spits warnings
for unused static inline functions in header files.


32031 27-Dec-1997 wollman

Fix top-of-form bogon.


31492 02-Dec-1997 wollman

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...


31020 07-Nov-1997 joerg

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!


30437 15-Oct-1997 joerg

One could be surprised how much bugs can still be found here...

Properlay clean the global RM variable if cgetstr() failed for it.
Otherwise, a connection attempt to a remote machine was made (and a
bogus result code printed) if a local printer followed a remote one in
printcap, and you did a `lpq -a', since checkremote() falsely assumed
the printer to be a remote one.

While i was at it, removed a gratuituous newline printed in front of
the remote machine's name, thus making the output more consistent (and
better machine-parseable) now.


30407 14-Oct-1997 joerg

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?


30143 06-Oct-1997 imp

Be more paranoid about unlinking files. From mhpower@MIT.EDU by way of
Theo de Raadt.

Likely 2.2.5R candidate.
Obtained from: OpenBSD


29780 24-Sep-1997 charnier

Use err(3). Add usage(). Various fixes in man pages.


28621 23-Aug-1997 joerg

common_source: staticize private version of warn() so to not conflict
with libc's version.

lpd: use getopt(3), err(3), add usage(), allow specification of a port #
on the command line as the documentation suggested for more than 10 years.

PR: docs/3290


27757 29-Jul-1997 imp

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


27748 29-Jul-1997 imp

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


27635 23-Jul-1997 imp

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.


27618 23-Jul-1997 imp

Use setuid/seteuid around dangerous operations. Also a few buffer
overflow patches that were "near" to where these operations are taking
place. The buffer overflows are from OpenBSD. The setuid/seteuid patches
are from NetBSD by way of OpenBSD (they changed them a little), at least from
my read of the tree.

This is the first of a series of OpenBSD lpr/et al merges. It (and them)
should be merged back into 2.2 and/or 2.1 (if requested) branches when they
have been shaken out in -current.
Obtained from: OpenBSD


27511 18-Jul-1997 imp

Add code to make sure that we don't overflow the buffer that we copy
the hostname into. In theory the bind library should do this, but
in practice the limites between system defines and bind defines make
an attack using this vector possible. These patches have been in
use on my systems for three months now, so I am fairly confident about
them. I plan on commiting this to 2.2 and 2.1 in the near future,
as well as many other patches of this nature.


27509 18-Jul-1997 imp

Fix a problem where remote files could be removed by exploiting race
conditions similar to those reported in CERT's CA-91:10a advisory.
Obtained from: Hiroshi NAKANO <nakano@rins.ryukoku.ac.jp> by way of CERT.


27448 16-Jul-1997 phk

Increase size of tmp hostname buffer.
PR: 3889
Reviewed by: phk
Submitted by: Yujiro MIYATA <miyata@bioele.nuee.nagoya-u.ac.jp>


26844 23-Jun-1997 joerg

Imply a 10-second connection timeout when querying remote queues, to
prevent lpq from hanging indefinately (well, 10 minutes are for sure
counting as `indefinately' in this case).


22466 09-Feb-1997 imp

Buffer overflow from OpenBSD:
Rev 1.4 deraadt: (partial from full commit, other files not done yet)
proactive bounds checking; help from millert
Rev 1.5 millert:
Possible buf oflow.

Plus minor style nits to keep the style police happy (I hope)
Obtained from: OpenBSD


19202 27-Oct-1996 imp

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


15703 09-May-1996 joerg

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.


15648 05-May-1996 joerg

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>


15646 05-May-1996 joerg

Fix my botched 4.4Lite2 import, and revert these files to their HEAD
versions.


15638 05-May-1996 joerg

This commit was generated by cvs2svn to compensate for changes in r15637,
which included commits to RCS files with non-trunk default branches.


15031 03-Apr-1996 sef

Remove definitions and declarations for FS, FC, XS, XC variables, and
replace them with MS char* variable.

Reviewed by: rgrimes, joerg


8857 30-May-1995 rgrimes

Remove trailing whitespace.


1554 26-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1553,
which included commits to RCS files with non-trunk default branches.


1553 26-May-1994 rgrimes

BSD 4.4 Lite usr.sbin Sources