summaryrefslogtreecommitdiffstats
path: root/usr.sbin/lpr/lpd
Commit message (Collapse)AuthorAgeFilesLines
* use IPV6_V6ONLY instead of non standard IPV6_BINDV6ONLY.ume2002-07-221-4/+2
| | | | Approved by: gad
* The .Nm utilitycharnier2002-07-141-5/+9
|
* Redo the way that fatal-error messages are done in the chkhost() routine,gad2002-06-241-64/+88
| | | | | | | | mainly so the compiler can correctly do printf-style parameter checking. Some minor improvements to a few of the error messages, but the main goal here is to get rid of a few more compile-time warning messages. MFC after: 5 days
* Stop adding ${CWARNFLAGS} to CFLAGS. The standard makefile processing willgad2002-06-231-1/+1
| | | | | | add them automatically, and there is no point in adding them twice. MFC after: 5 days
* Change some "process id" variables from 'int' to 'pid_t', renaming somegad2002-06-041-28/+31
| | | | | | | | of them to keep better track of which-is-which (multiple variables were named 'pid'). Moved a global pid-variable into the only routine that used it. Net result: fixes two compile-time warnings... MFC after: 2 weeks
* Cosmetic improvements to some of the syslog() calls in here (in some casesgad2002-06-041-35/+44
| | | | | | simply getting the indentation right when the statement wraps). MFC after: 2 weeks
* Fix all the 'return' statements in here to follow style(9).gad2002-06-041-24/+24
| | | | MFC after: 2 weeks
* Avoid checking WIFEXITED and WTERMSIG in some error situations where thegad2002-06-041-3/+6
| | | | | | value in wstatus is not related to the process that we care about. MFC after: 2 weeks
* Stop using the depreciated 'union wait' definitions, moving to a moregad2002-06-032-26/+25
| | | | | | | standard handling of wait()-related routines. Submitted by: mike MFC after: 2 weeks
* Assume __STDC__, remove non-__STDC__ code.alfred2002-05-282-29/+0
|
* Implement new printcap option of "rc" aka "remote.resend_copies".gad2002-04-231-11/+48
| | | | | | | | | | | | This is a boolean option, and if it is specified in a print queue for a remote host, it causes lpd to resend the data file for each copy the user requested on 'lpr -#n'. This is useful for network printers which accept lpd-style jobs, but which ignore the control file (and thus they ignore any request for multiple copies). PR: 25635 Reviewed by: short review on freebsd-audit MFC after: 6 days
* Add description of `mc' (max copies), add short-form to long-form mappinggad2002-04-221-0/+1
| | | | | | | | for `tf' (troff filter), and add a cross-reference to chkprintcap in some lpr-related man pages. Submitted by: dwmalone MFC after: 4 days
* Change lpd to recognize the '-s' parameter as a preferred synonymgad2002-04-192-13/+26
| | | | | | | | | | for what is currently the '-p' parameter. '-s' is what NetBSD used (and they implemented it before I added -p in FreeBSD), and it also matches the '-s' option in syslogd. Someone in OpenBSD land had also talked about adding a '-s' option, but it hasn't happened yet. MFC after: 5 days
* Remove a safety-setting line which is unnecessary now that the previousgad2002-04-191-1/+0
| | | | | | line is using strlcpy instead of strncpy. MFC after: 4 days
* Fix 'deamon' -> 'daemon' in a comment.gad2002-04-191-1/+1
| | | | | Obtained from: NetBSD, OpenBSD MFC after: 4 days
* Add a little detail to the syslog-msg that comes up when lpd can notgad2002-04-191-2/+3
| | | | | | execute a given filter. MFC after: 4 days
* A variable had been unnecessarily assigned a bogus value because gcc wasgad2002-04-071-7/+6
| | | | | | | | | "confused" about it being unassigned. In fact, gcc was right. Fix the real problem by setting that variable before break-ing out of a select statement so gcc is happy, and then remove the unnecessary assignment. Reported by: a user wondering why lpd syslog-ed about "compiler confusion" MFC after: 12 days
* Rename a variable from 'user' to 'userid' to avoid some compiler warnings.gad2002-04-071-5/+5
| | | | MFC after: 12 days
* Rearrange all the error returns from sendfile() to make sure the originalgad2002-04-071-43/+51
| | | | | | | | | input file and any temporary (filter) file are closed upon return, and that is generally done at the end of the routine. This should make it easier for a later update (not yet written) to implement a "resend_copies" option. MFC after: 12 days
* Re-arrange how output filters (of=) are handled for queues going togad2002-04-071-147/+191
| | | | | | | | | | | | | remote machines. Now they really are handled *exactly* the same as input filters (if=) for remote queues, except that they are started with a different set of parameters. This should fix a few subtle bugs in output-filter processing on such queues. It is a pretty significant re-arranging of sendfile(), moving some of it to a new execfilter() routine. PR: 36552 Reviewed by: no screams from freebsd-audit MFC after: 12 days
* Move the checks for '/' a little sooner in the code which receives filesgad2001-12-051-8/+8
| | | | | | | | | | | for a remote print job. This change comes from OpenBSD (who got it from Sebastian Krahmer of SuSE). In OpenBSD this avoids a tiny theoretical security issue, but that security issue does not exist in FreeBSD's lpr due to the changes which added 'ctl_renametf()' just before 4.4-release. This change is still worth doing in our version, but it isn't fixing a security issue. MFC after: 4 days
* Change the recently-added 'o'-processing so it maps to 'l' instead of 'f'.gad2001-11-271-8/+11
| | | | | | | | 'l' ("plain text which includes control characters") is somewhat more appropriate for 'o' ("postscript files"), and in fact some printers treat 'l' as a request to print a postscript file. MFC after: 1 week
* Add minimal support for "o"-type print-file actions in lpd control files.gad2001-09-201-1/+11
| | | | | | | | | This was described in the original RFC wrt lpr, but most lpr's do not actually implement it. There is some indication that MacOS 10.1 will be using this when sending postscript files to print servers (that is what "o"-type was supposed to signify -- postscript files). MFC after: 1 week
* Basically rewrite the dofork() routine, to add more error-checking andgad2001-07-231-14/+55
| | | | | | | | | correct the error-checking that was there. With the old code, an error return from getpwuid(daemon_user) could turn the lpd process into a very effective fork-bomb... Reviewed by: freebsd-audit freebsd-print (a little...) MFC after: 6 days
* Get rid of some compile-time warnings by defining (or casting) variablesgad2001-07-231-19/+20
| | | | | | as size_t where appropriate. MFC after: 1 week
* Fix two compile-time warnings by defining fromlen as socklen_t.gad2001-07-231-2/+2
| | | | MFC after: 1 week
* Replace calls to strncpy with calls to strlcpy, and remove the extra stepgad2001-07-222-31/+22
| | | | | | needed to ensure that the result is null-terminated when using strncpy(). MFC after: 8 days
* Rename the -w option to be -W. The recently-added -w option is differentgad2001-07-222-7/+30
| | | | | | | | than the long-standing -w option in NetBSD, so change it before anyone in FreeBSD gets used to it. For now, -w is still accepted, but prints out some warnings via syslog. MFC after: 1 week
* Change a few read & write calls to use 'STDOUT_FILENO' instead of '1'.gad2001-07-222-7/+7
| | | | | | Submitted by: David Hill <david@phobia.ms> Reviewed by: freebsd-audit (a little) MFC after: 1 week
* Perform a major cleanup of the usr.sbin Makefiles.obrien2001-07-201-1/+3
| | | | | These are not perfectly in agreement with each other style-wise, but they are orders of orders of magnitude more consistent style-wise than before.
* Remove whitespace at EOL.dd2001-07-151-2/+2
|
* Change lpd to perform sanity and safety checks on control files as itgad2001-07-151-4/+7
| | | | | | | | | | | | receives them from other hosts. This is meant to protect from both nefarious users (which maybe broke into some remote host that we accept print jobs from), and broken implementations of lpr on other platforms. This is done by changing recvjob.c to call the new ctl_renametf() routine in the new common_source/ctlinfo.[ch] files. This will not affect jobs coming via lpr on the local machine. Reviewed by: freebsd-print@bostonradio.org & freebsd-audit MFC after: 16 days
* Fix most of the warnings generated by compiling lpr with -Wnon-const-format,gad2001-07-153-10/+15
| | | | | | | | | often by just telling gcc that some internal routine is "__printflike" (work done by Kris Kennaway <kris@FreeBSD.org>). Also fix the new warnings which show up once gcc starts checking the "printf-like parameters" passed to those routines. MFC after: 1 week
* Change signal-handling to reset SIGCHLD to SIGDFLT instead of SIG_IGN.gad2001-07-142-6/+40
| | | | | | | | | | This fixes a problem with using print filters (if=, of=, etc) that showed up in -current around June 20th. That problem initially reported by Georg-W Koltermann <gwk@sgi.com>, while most of the investigation that led to this fix was done by Anton Berezin <tobez@FreeBSD.org>. Reviewed by: freebsd-print@bostonradio.org MFC after: 1 week
* mdoc(7) police: removed HISTORY info from the .Os call.ru2001-07-101-1/+1
|
* Fix the type of the NULL arg to execl()brian2001-07-091-3/+4
| | | | Idea from: Theo de Raadt <deraadt@openbsd.org>
* Add two new options for lpd: -c will log all connection-errors to syslog,gad2001-06-252-32/+168
| | | | | | | | | | | | | | | while -w allows connection from non-reserved ports. Also improves the helpfulness of various connection-error messages. The changes for IPv6 added back in the reserved-port check which was mistakenly dropped from lpd in 1997 (copying a change from openbsd). It is best to have that check in place, but the check breaks lpr's from some implementations of lpr/lpd for Windows. The -w option is for those admins who need to accept jobs from non-reserved ports, the -c option is for admins who would like a print-server machine to log all failed connection-attempts to syslog. Reviewed by: freebsd-audit@FreeBSD.org freebsd-print@bostonradio.org MFC after: 2 weeks
* Get rid of a trigraph ("??>") mistakenly put in an error message.gad2001-06-161-1/+1
| | | | | | One less warning to annoy me... MFC after: 1 week
* *** empty log message ***gad2001-06-151-19/+15
|
* Rename a few global variables which hold hostname-related values to begad2001-06-154-35/+33
| | | | | | | | | | | | | | | more sensible/understandable. 'from'->'from_host' 'host'->'local_host' 'fromb'->'frombuf' 'fromhost'->'origin_host' and a local-variable named 'host'->'hostbuf'. This fixes some compile-time warnings about local variables shadowing global variables. Other than renaming variables, the only actual code changes are to call strlcpy() instead of strncpy() when setting those (renamed) variables, and that 'from_ip' is now a strdup()-created buffer instead of being a static buffer compiled in as 1025 bytes. Reviewed by: freebsd-print@bostonradio.org (an earlier version) MFC after: 1 week
* Rename global variable 'name' to 'progname', thus fixing a number ofgad2001-06-151-1/+1
| | | | | | | | warnings which come up for various routines that have a parameter which is also called 'name'. Reviewed by: freebsd-print@bostonradio.org MFC after: 1 week
* Fix about 90-100 warnings one gets when trying to compile lpr&friendsgad2001-06-125-142/+91
| | | | | | | | | | | | with BDECFLAGS on, mainly by adding 'const' to parameters in a number of routine declarations. While I'm at it, ANSI-fy all of the routine declarations. The resulting object code is exactly the same after this update as before it, with the exception of one unavoidable change to lpd.o on freebsd/alpha. Also added $FreeBSD$ line to lpc/extern.h lpc/lpc.h lptest/lptest.c Reviewed by: /sbin/md5, and no feedback from freebsd-audit
* - Backout botched attempt to introduce MANSECT feature.ru2001-03-261-0/+1
| | | | - MAN[1-9] -> MAN.
* Set the default manual section for usr.sbin/ to 8.ru2001-03-201-1/+0
|
* Fix a number of warnings that come up when compiling with BDECFLAGS.gad2001-03-161-7/+7
|
* Change the usage() message to include the recently-added -4 and -6 options.gad2001-03-121-7/+15
|
* Improve a few error messages wrt if= filters on remote print queues.gad2001-03-121-8/+26
|
* Prepare for mdoc(7)NG.ru2000-12-271-1/+1
|
* IPv6 support for lpr.ume2000-12-162-62/+191
| | | | | Reviewed by: freebsd-current (no objection) Obtained from: KAME
* mdoc(7) police: use the new features of the Nm macro.ru2000-11-201-1/+1
|
OpenPOWER on IntegriCloud