Commit Graph

68 Commits

Author SHA1 Message Date
tron
f4ae533fa6 Really set "MKPRIVATELIB" and not "INTERNALLIB". 2004-05-23 14:05:39 +00:00
lukem
b817247988 Use MKPRIVATELIB=yes instead of providing an empty libinstall:: target and
setting NOLINT, NOPIC, NOPROFILE (etc)
2004-05-23 02:24:50 +00:00
christos
70229c52ba constify printcapdb 2004-04-24 02:59:19 +00:00
lukem
eae82b3d06 #define _PATH_BIN_RCMD in common_source/pathnames.h rather than using
wacky Makefile rules to compile rcmd.c
2003-10-19 05:51:44 +00:00
itojun
686afb7f65 safer use of realloc 2003-10-16 06:22:09 +00:00
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
mycroft
ae627c1271 select() -> nanosleep() 2002-09-18 23:27:25 +00:00
lukem
c52b93f508 minor makefile delint 2002-09-18 13:31:52 +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
tv
8e6f7afb5b MKfoo=no -> NOfoo 2001-12-12 01:48:43 +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
wiz
8a9489155e Fix possible security problem (euid swapout in error handling).
Based on a similar patch in OpenBSD, reported there by
j@ida.interface-business.de.
Fix the second occurrance of a similar problem in that file, too, though.
2001-04-05 13:30:02 +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
itojun
f714bfb0d8 rewrite local address detection code, to use getifaddrs(3), not gethostname(3).
gethostname(3) do not necessarily represent local host addrses.
pointed out by: Chuck Cranor
2000-08-09 14:28:50 +00:00
matt
3ab02a8704 More #include <stdlib.h> string, etc. cleanup 2000-07-04 20:27:35 +00:00
itojun
4be926fbb8 allow lp=port@host again. PR9975 from Andreas Gustafsson. 2000-04-25 02:34:49 +00:00
itojun
e738bb5642 avoid NULL pointer access when rp=<ipv4 numberic address> (no ai_canonname).
From: hiro@takechi.org

XXX checkremote() should be improved.  gethostname -> getaddrinfo is
not the right thing to do, we cannot assume DNS FQDNs is configured
as hostname.  if the goal here is to check if it is really remote or not,
getifaddrs() is the way to go.
2000-04-24 02:53:05 +00:00
mrg
dd28a6c6dd make scandir(3)'s 3rd argument take a function that takes a *const*
struct dirent *, rather than non-const.  this makes scandir(3) the
same as the scandir implementations in libiberty and glibc, and the
select function has no need to modify the dirent.
2000-04-16 14:43:56 +00:00
itojun
0c281f2bda do not sleep on ECONNREFUSED, rather, try the next address first.
the behavior itself has a room for debate.  (why we retry on ECONNREFUSED?)

From: SHIMIZU Ryo <ryo@misakimix.org>
2000-02-18 03:53:16 +00:00
itojun
33ba3a0f18 IPv6 support, using rcmd-family funciton added.
NetBSD PR: 9050
From: Feico Dillema
2000-01-27 05:39:50 +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
jdolecek
b86257129c put fatal() and a some of variables used independantly of other functions
in common.c into separate files - this slighly cuts down size of pac(1)
not that it's really significant, but every bit counts ....
1999-12-05 22:10:57 +00:00
mrg
23b9fac082 delint and other cleanups. 1999-09-26 10:32:27 +00:00
lukem
7e1c62baf8 set MKLINT=no. noted by NAKAJIMA Yoshihiro <nakayosh@kcn.ne.jp> 1999-03-13 23:17:46 +00:00
lukem
dcab0210a0 convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
1999-02-13 02:54:17 +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
lukem
786b86d71b use AF_LOCAL instead of AF_UNIX 1998-07-18 05:04:35 +00:00
msaitoh
4944940fcf Declare ints, too, don't default them. 1998-07-09 18:32:52 +00:00
mrg
c0aa4ce503 oops, missed this in gethostname sweep. 1998-07-07 03:36:53 +00:00
mrg
32f519716b - 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
1998-07-06 06:56:06 +00:00
lukem
fbafdc25f8 use memcmp/memset/memmove instead of bcmp/bzero/bcopy 1997-10-18 08:52:17 +00:00
mycroft
3ec2ebdb68 GC some garbage variables. 1997-10-11 20:25:53 +00:00
veego
e288b27b29 Don't install this libraries, we only this during the build. 1997-10-11 19:42:34 +00:00
lukem
0acf0ef008 only compile common_source/* once (25% faster), remove unused printcap.c 1997-10-10 09:26:35 +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
cf3fe2a0b6 oops; did not mean to import these. 1997-10-05 12:35:50 +00:00
mrg
e6a91a0997 merge 4.4 lite2 1997-10-05 11:52:17 +00:00
mrg
e5d28dbbe3 lite-2 1997-10-05 11:20:29 +00:00
mikel
ad1d686121 make explicit comparisons to NULL (gcc -Wall) 1997-07-10 06:19:53 +00:00
mikel
764d9a9d44 fix typos 1997-07-10 06:18:52 +00:00
thorpej
b6c41d0d18 getc() returns an int, not a char. 1997-04-19 06:33:13 +00:00
mycroft
16cc2efbbd Change _PATH_MASTERLOCK to /var/run/lpd.pid. 1997-03-14 01:17:34 +00:00
cgd
72b0837ae3 fix one more goofup in the buffer safety changes: snprintf() should be
called with enough space for the trailing NUL, because it (unlike strn*())
always NUL-terminates.
1997-03-10 06:13:16 +00:00