Commit Graph

69 Commits

Author SHA1 Message Date
Hajimu UMEMOTO 08829865f6 IPv6 support for lpr.
Reviewed by:	freebsd-current (no objection)
Obtained from:	KAME
2000-12-16 18:06:09 +00:00
Ruslan Ermilov e97407b4f2 mdoc(7) police: use the new features of the Nm macro. 2000-11-20 20:10:44 +00:00
Garance A Drosehn d41a93b658 Eliminate two compile-time warnings. 2000-11-15 06:17:52 +00:00
Garance A Drosehn f6a3be3940 Fix the '-d' option (turns on socket-debugging). Improve startup msgs.
PR:		17178
Submitted by:	Richard <satherrl@dssrg.curtin.edu.au>
2000-11-15 06:00:42 +00:00
Garance A Drosehn 59a09735ef Make sure a few strings will have terminating null characters.
(most of the PR 16186 was already applied, except for these 2 lines)

PR:		16186
Submitted by:	Przemyslaw Frasunek <venglin@lubi.FreeBSD.lublin.pl>
2000-11-15 04:57:22 +00:00
Garance A Drosehn d96ca75758 Minor style improvements. 2000-11-14 22:08:52 +00:00
Garance A Drosehn aa538512da Fix (style) some variable initializations. 2000-11-14 22:03:59 +00:00
Garance A Drosehn a480d5f20e Change 'count' to a more descriptive 'jobcount', and fix the stupid
comments which claim this counter is counting "files", which it is not.
2000-11-14 21:44:47 +00:00
Garance A Drosehn a4803ea103 Get rid of 'exit(-1)' calls. Exit codes are limited to 8 bits under most
Unixes, so -1 becomes 0xFF for 2's complement and 0xFE (?) for 1's
complement.

Reviewed by:	bde@FreeBSD.org
2000-11-14 21:32:52 +00:00
Garance A Drosehn c61c5210be My previous commit removed a line it wasn't supposed to. Add it back. 2000-11-13 16:21:24 +00:00
Garance A Drosehn ca52ea3cc8 Replace call to mktemp() with mkstemp. Also move where that call is
done, so the correct directory is being checked.  The mkstemp() call
is meant to create a temp file for stderrs when running filters.  This
update also fixes log-file processing for remote (rm=) queues which
specify an input filter (if=).  Before, filter-errs were thrown away.
Now they'll be copied to the queue's logfile (lf=).

Reviewed by:	(a little) audit@FreeBSD.ORG & freebsd-print@bostonradio.org
2000-11-13 05:44:50 +00:00
Garance A Drosehn cdd8df463b Fix 'printit()' to ignore some lines it doesn't recognize (most likely
coming from lprNG hosts), and print a more helpful error msg for others.
2000-11-08 00:52:11 +00:00
Garance A Drosehn 30b4b758aa 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
2000-11-06 19:36:38 +00:00
Garance A Drosehn 3aeddf3c1b Cosmetic improvements to a few recvjob-related error messages. 2000-11-06 04:37:56 +00:00
Garance A Drosehn 7c17eaa6a8 Fix a format-code, thus getting rid of a compile-time warning msg. 2000-11-06 04:11:56 +00:00
Garance A Drosehn 19d0f858b4 Fix potential problem processing jobs from hosts with >32 character hostnames.
This may fix a problem reported by Juha Ylitalo <juha.o.ylitalo@nokia.com>
2000-11-05 03:24:26 +00:00
Garance A Drosehn e84ad74c75 In the error-message routine for receiving a job, move the "cleanup" to be
after the error message is printed, because the error message may refer to
variables the "cleanup" routine will zero out.

PR:		21007
2000-11-05 02:24:20 +00:00
Garance A Drosehn 6522ebec87 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
2000-11-02 19:22:06 +00:00
Garrett Wollman 545ed065d2 Set SO_REUSEADDR so that lpd can start while old lpd connections are still
winding down (or timing out).  Also, be slightly more informative in
mcleanup() about why lpd is exiting.

PR:		21595
2000-09-27 19:03:05 +00:00
Mike Pritchard 50545e9e59 Re-implement my fix from rev 1.6 (same rev for both files being committed)
that was lost during the lite-2 merge.  From the original commit message:

Initialize the group list so that any filter programs that are
run by lpd are not run with root's groups.
2000-05-24 11:38:50 +00:00
Sheldon Hearn ba901a111b Add -p option to prevent lpd(8) from opening a listening socket.
PR:		17384
Submitted by:	Niels Endres <niels@b5.nu>
2000-03-29 11:15:54 +00:00
Sheldon Hearn f2e366a105 Remove single-space hard sentence breaks. These degrade the quality
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.
2000-03-01 14:09:25 +00:00
Matthew Dillon b2dc65a8d3 Type-o, change from[...] = 0 to fromb[...] = 0. The incorrect buffer
was having its last element zero'd.  It turns out not to be a security
    hole or to have any real effect on the code because 'from' was previously
    pointing to a buffer of the same size as 'fromb', and the last
    element in fromb is already 0 anyway due to the use of sizeof(fromb)-1
    in the strncpy() call.  But I'm not pressing my luck so only the type-o
    is being fixed.
2000-01-25 01:51:21 +00:00
Andrey A. Chernov d3d56c3d4c Add support for pr's locale 1999-11-30 16:15:22 +00:00
Alexey Zelkin c6d6e7726f Correct spelling : ascii -> ASCII
PR:		docs/13702
Submitted by:	Stephen J. Roznowski <sjr@home.com>
Reviewed by:	mpp
1999-09-20 09:15:23 +00:00
Peter Wemm 97d92980a9 $Id$ -> $FreeBSD$ 1999-08-28 01:35:59 +00:00
Nik Clayton 414a35e60a Add $Id$, to make it simpler for members of the translation teams to
track.

The Id line is normally at the bottom of the main comment block in the
man page, separated from the rest of the manpage by an empty comment,
like so;

     .\"    $Id$
     .\"

If the immediately preceding comment is a @(#) format ID marker than the
the $Id$ will line up underneath it with no intervening blank lines.
Otherwise, an additional blank line is inserted.

Approved by:            bde
1999-07-12 20:12:29 +00:00
Garrett Wollman 90cf373d9b Fix additional warnings. Remove -Werror, since some people have complained
about it.

PR:		7886
Submitted by:	Stefan Eggers <seggers@semyam.dinoco.de> (partially)
1998-09-11 18:49:33 +00:00
Brian Somers b538df1666 Fix ``lp=port@machine'' syntax and mention it in printcap(5). 1998-08-21 18:08:46 +00:00
John Birrell 0793ce314a 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.
1998-06-11 03:53:23 +00:00
John Birrell 84cc0c31af Make -Werror i386 specific because -nostinc on alpha spits warnings
for unused static inline functions in header files.
1998-05-13 06:50:09 +00:00
Bruce Evans 06c779979a Use `foo/bar.a' instead of `-Lfoo -lbar' for linking to static internal
libraries so that `ld -f' in can create correct dependencies for
yet-to-be-built libraries.

Get the default BINDIR correctly (by including ../Makefile.inc recursively.
Override the default it it is wrong.

Don't override defaults when the defaults are correct.
1998-03-07 09:48:14 +00:00
Garrett Wollman 8830deae19 Properly initialize the printer struct.
PR: bin/5519
1998-01-20 14:43:05 +00:00
Bruce Evans b732d6bad5 Fixed DPADD. 1997-12-16 17:53:39 +00:00
Garrett Wollman 4a1a0dbedb 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...
1997-12-02 20:46:22 +00:00
Joerg Wunsch 6d0727f460 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!
1997-11-07 13:18:50 +00:00
Joerg Wunsch 83f31ab169 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?
1997-10-14 16:01:02 +00:00
Warner Losh ed4d1cf9cc Be more paranoid about unlinking files. From mhpower@MIT.EDU by way of
Theo de Raadt.

Likely 2.2.5R candidate.
Obtained from: OpenBSD
1997-10-06 03:58:48 +00:00
Philippe Charnier 9b3fe531b5 Use err(3). Add usage(). Various fixes in man pages. 1997-09-24 06:48:24 +00:00
Joerg Wunsch 36d0e2a3e2 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
1997-08-23 15:53:00 +00:00
Warner Losh 6ee8b26997 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
1997-07-29 13:24:01 +00:00
Warner Losh 5f87a7b6b1 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
1997-07-29 04:17:19 +00:00
Warner Losh f8eb25da54 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.
1997-07-23 20:53:41 +00:00
Warner Losh 360d4ad5ab 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
1997-07-23 00:49:46 +00:00
Brian Somers afd70290e7 Output name of duplicate spool dir.
Submitted by:	Wayne Scott <wscott@ichips.intel.com>
1997-07-21 22:40:04 +00:00
Poul-Henning Kamp 63cfc56271 Increase size of tmp hostname buffer.
PR:		3889
Reviewed by:	phk
Submitted by:	Yujiro MIYATA <miyata@bioele.nuee.nagoya-u.ac.jp>
1997-07-16 11:22:57 +00:00
Brian Somers 6b7e3ca395 Check for duplicate spool dirs.
Submitted by:	eivind
1997-05-17 03:04:43 +00:00
Brian Somers 49c7494bef Support input and output filters with remote printing.
Output filters are executed on a per-file basis as it's
necessary to supply the file size to the "other side".
1997-04-12 04:23:13 +00:00
Peter Wemm 476602a9d0 Revert $FreeBSD$ to $Id$ 1997-02-22 16:15:28 +00:00
Wolfram Schneider bfd34a4a60 Sort cross references. 1997-01-20 00:03:00 +00:00