This PR claims that MacOSX 10.1 cannot print postscript files to a NetBSD
lpd because the mac will tag the file with an "o" for postscript, which
we do not handle. Rather than simply mapping o -> f as was done in the
PR, or mapping o -> l as was done in FreeBSD, I have implemented full
support for the "o" option. If a postscript filter does not exist in the
printcap file however, it will default to "l" handling.
With this change, you can now specify a "pf" or postscript filter in your
printcap, and have it handle postscript files sent to it with "lpr -o".
The "o" format in lpd is specified in RFC1179 as being a valid format flag.
Lpd has the ability to start on a port other than "printer" but has no
way to connect to a remote lpd on that port. This change adds the
ability to specify port@host in the rm element of printcap(5). Tested to
work with both a standard lpd setup and one running on special ports.
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.
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.
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.
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.