Commit Graph

26 Commits

Author SHA1 Message Date
agc 326b2259b7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22366, verified by myself.
2003-08-07 11:25:11 +00:00
itojun 85da88227f use strlcpy/strlcat.
[fix off-by-one in displayq.c]
2003-05-17 20:46:42 +00:00
wiz 895dc72a69 Unifdef __STDC__. Remove __P(). ANSIfy. 2002-07-14 15:27:58 +00:00
itojun 5da007343b avoid hardcoded octals 2002-06-08 23:37:47 +00:00
itojun 7cdedd5c84 use strlcpy. from openbsd 2001-08-30 00:53:53 +00:00
itojun c9e786ce9e security fix from openbsd:
Fix buffer oflow reading from queue file.  While we are at it, crank
the size of buffers that can hold filenames to MAXPATHLEN.
2001-08-30 00:51:50 +00:00
mrg a062d79672 use DEFLP instead of "lp". 2001-06-25 11:04:51 +00:00
lukem c2aa46e7c2 use %ll_ instead of the less standard %q_ 2001-01-05 03:27:26 +00:00
is d8302e2d73 More format string cleanups by sommerfeld. 2000-10-11 20:23:46 +00:00
mrg 5b6d0e7e39 - 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.
1999-12-07 14:54:44 +00:00
mrg 23b9fac082 delint and other cleanups. 1999-09-26 10:32:27 +00:00
frueauf c548010b99 Fix pr 5071 better after feedback from the Originator Havard Eidnes. 1998-09-14 21:23:07 +00:00
frueauf 988c143116 Add (ugly?) code to prevent core dump as described in pr 5071 by Havard Eidnes.
XXX Maybe someone with more taste and understanding should have a look
XXX at this? At least I prefer this over the solution provided in the pr.
1998-09-14 11:52:21 +00:00
mrg 1bb06f8aab fix alpha compile warnings. 1997-10-05 16:45:43 +00:00
mrg fe7ed7ce37 - 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()
1997-10-05 15:11:58 +00:00
mrg e6a91a0997 merge 4.4 lite2 1997-10-05 11:52:17 +00:00
mikel ad1d686121 make explicit comparisons to NULL (gcc -Wall) 1997-07-10 06:19:53 +00:00
thorpej b6c41d0d18 getc() returns an int, not a char. 1997-04-19 06:33:13 +00:00
mrg 077acf5088 remove unsafe calls to strcpy(), strcat(), and sprintf(). some KNF. 1996-12-09 09:57:40 +00:00
jtc 21908ddbd5 merge in changes from 1.1 release branch 1995-11-28 19:43:04 +00:00
pk 0e9c04fab0 Fix garbled lines (from Thomas Eberhardt; PR#1756).
Add RCSId.
1995-11-15 22:20:33 +00:00
hpeyerl 8e41ca8016 -- 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>
1995-10-03 15:02:17 +00:00
cgd 2847add277 clean up that import. no rcsids yet. 1994-05-18 01:25:21 +00:00
cgd ea2217de0a off_t exp. 1994-03-27 09:13:06 +00:00
mycroft e9d867ef50 Add RCS identifiers. 1993-08-01 17:54:45 +00:00
cgd 61f282557f initial import of 386bsd-0.1 sources 1993-03-21 09:45:37 +00:00