Home | History | Annotate | Download | only in lprm
History log of /src/usr.sbin/lpr/lprm/lprm.c
RevisionDateAuthorComments
 1.20  03-Feb-2019  mrg - add or adjust /* FALLTHROUGH */ where appropriate
- add __unreachable() after functions that can return but won't in
this case, and thus can't be marked __dead easily
 1.19  21-Jul-2008  lukem branches: 1.19.60;
Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
 1.18  15-Dec-2007  perry branches: 1.18.6;
convert __attribute__s to applicable cdefs.h macros
 1.17  28-Nov-2005  christos branches: 1.17.10;
- WARNS = 4
- factor out commonly used code.
- constify
- use warn/warnx instead of printf
 1.16  30-Oct-2004  dsl Add (unsigned char) cast to ctype functions
Some of this code could usefully be converted to use strtoul() and/or
some small helper functions.
 1.15  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22366, verified by myself.
 1.14  17-May-2003  itojun use strlcpy/strlcat.
[fix off-by-one in displayq.c]
 1.13  14-Jul-2002  wiz Unifdef __STDC__. Remove __P(). ANSIfy.
 1.12  03-Jul-2002  kleink postive -> positive
 1.11  03-Jul-2002  wiz Fix error output for negative argument to '-w'.
Also update usage to include -w.
Patches from Brian Ginsbach in bin/17471.
 1.10  07-Dec-1999  mrg - add timeouts to displayq(), rmremote(), sendfile() and response(),
and use these timeout in the lpq, lpd and lprm programs.

these stop hung remote printers that accept tcp connections but do
not process jobs from hanging the whole system and letting the sysadmin
have a clue about what is going on with this rogue printer.

- add a -r flag to lpd to allow `of' filters for remote jobs.

i know there are ways around this, but i just don't care.

- add a -f flag to lpf to add missing carriage returns.

useful when printing UNIX files to an, eg, LaserWriter that wants CR's
as well as LF's in raw text. stair-stepped text is no fun.

- implement child process accounting: we just have a limit on the number
of children we can have (settable by the sysadmin), and we sleep when
this number is reached. this can reduce malicious not-so-malicious
attacks on the print server by a rogue remote client..

- use setproctitle() where appropriate so the sysadmin has a clue about
what each of the lpd's here are doing.

this was useful to help diagnose a problem (that the above child process
accounting change reduces the lossages of) where a rogue client was
attempting "lpq" operations on one stuck queue in rapid succession,
causing the lpd server to be extremely slow, due to the large number
of lpd processes running.


i have been running these changes in production for about a year.
 1.9  16-Aug-1999  simonb branches: 1.9.4;
Spell "privilege" correctly (correct spelling from Jonathan Stone).
 1.8  06-Jul-1998  mrg - use an array MAXHOSTNAMELEN+1 size to hold hostnames
- ensure hostname from gethostname() is nul-terminated in all cases
- minor KNF
- use MAXHOSTNAMELEN over various other values/defines
- be safe will buffers that hold hostnames
 1.7  05-Oct-1997  mrg - WARNS?=1
- be safe with unlinking files (from freebsd)
- remove register
- clean up $NetBSD$'s.
- use inet_ntoa() in one place (from openbsd)
- nul terminate after a bunch of strncpy()'s
- #ifdef __STDC__ rather than #if (from freebsd)
- be safe with a bunch of string operations (from freebsd)
- use warn()/err() over home grown versions (some from freebsd)
- rename warn() to nodaemon() to remove conflict with above
- check errno from failed kill(2) against ESRCH (from freebsd)
- use getopt() rather than home grown versions (from freebsd)
- clean up a bunch of man pages (some from freebsd)
- check for hostname spoof (from freebsd)
- use POSIX wait() interfaces
- use sysconf(_SC_OPEN_MAX) in preference to NOFILE (from freebsd)
- deal with fork() failure
- index/rindex -> strchr/strrchr (some from freebsd)
- add B57600 and B115200 speeds (from freebsd)
- some KNF
- be safe with files passed in over the network (some from freebsd)
- check return value of malloc(), calloc() and strdup()
 1.6  09-Dec-1996  mrg remove unsafe calls to strcpy(), strcat(), and sprintf(). some KNF.
 1.5  15-Nov-1995  pk branches: 1.5.4;
Add RCSIDs
 1.4  03-Oct-1995  hpeyerl -- convert sgtty to termios. From: Scott Bartram <scottb@iis.net>
-- Use seteuid() to only give lpr, lprm, lpq and lpc root when they
need it from matthew green <mrg@mame.mu.oz.au>
 1.3  18-May-1994  cgd clean up that import. no rcsids yet.
 1.2  01-Aug-1993  mycroft Add RCS identifiers.
 1.1  21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2  18-May-1994  cgd lpr from 4.4-Lite
 1.1.1.1  21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.5.4.1  26-Jan-1997  rat Update from trunk. Fixes security bugs.
 1.9.4.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.17.10.1  09-Jan-2008  matt sync with HEAD
 1.18.6.1  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.19.60.1  10-Jun-2019  christos Sync with HEAD

RSS XML Feed