summaryrefslogtreecommitdiffstats
path: root/usr.sbin/lpr
Commit message (Collapse)AuthorAgeFilesLines
* Include <netinet/in.h> to squash one more compile-time warning.gad2002-04-251-0/+2
| | | | MFC after: 3 days
* When using %p to print out pointers to struct's, first cast the valuesgad2002-04-251-7/+8
| | | | | | | | to (void *) to satisfy some stricter warning-level checks in the new gcc (on sparc64). Reviewed by: obrien MFC after: 4 days
* Improve the error message the user sees if the startdaemon routine cannotgad2002-04-231-4/+6
| | | | | | | connect() to the socket for lpd. Tell them this error probably means that the master 'lpd' process is not running. MFC after: 4 days
* Implement new printcap option of "rc" aka "remote.resend_copies".gad2002-04-234-11/+70
| | | | | | | | | | | | 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 'const' to some casts to fix two warnings that are printed by thegad2002-04-222-4/+4
| | | | | | new gcc (on sparc64). MFC after: 4 days
* Add 'const' to some casts to fix two warnings that are printed by thegad2002-04-221-2/+2
| | | | | | new gcc (on sparc64). MFC after: 4 days
* Usage style sweep: spell "usage" with a small 'u'.des2002-04-221-3/+3
| | | | | Also change one case of blatant __progname abuse (several more remain) This commit does not touch anything in src/{contrib,crypto,gnu}/.
* Don't needlessly redefine the afterinstall target.ru2002-04-221-6/+1
|
* Underline the default value for rp=, the same way all the other string-typegad2002-04-221-1/+1
| | | | | | default values are underlined (instead of using fake double-quotes). MFC after: 4 days
* Add description of `mc' (max copies), add short-form to long-form mappinggad2002-04-223-0/+6
| | | | | | | | for `tf' (troff filter), and add a cross-reference to chkprintcap in some lpr-related man pages. Submitted by: dwmalone MFC after: 4 days
* Use `The .Nm utility'charnier2002-04-205-22/+33
|
* 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
* Add another level of checking to 'chkprintcap', which is done bygad2001-12-154-6/+352
| | | | | | | | | | | | | "skimming thru" the printcap file looking for some common mistakes that people make. These are the kinds of mistakes where the printcap file probably looks correct to human eyes, but is wrong in some subtle way which causes a problem in some queue definitions. The program treats these as "warnings" not "errors". Note that I'm flexible on the m.f.c. schedule, if people would rather this waited until after 4.5-release. Reviewed by: no screams from freebsd-audit freebsd-print@bostonradio.org MFC after: 4 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
* My recent changes to add the ctl_renametf routine assumed that print jobgad2001-11-282-21/+38
| | | | | | | | | | | control-files will always start with 'cfA*'. It turns out that some implementations of lpd (such as solaris) may send a control file which starts with 'cfB*', or really 'cf<anyLetter>*'. Although such filenames are very odd, we did used to accept them. This changes ctl_renametf to work correctly with them, and fixes up 'lpc clean' to match. PR: bin/32183 MFC after: 10 days
* Change the recently-added 'o'-processing so it maps to 'l' instead of 'f'.gad2001-11-272-10/+15
| | | | | | | | '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
* Fix one more compile-time warning by renaming a local variable.gad2001-10-091-3/+3
| | | | MFC after: 4 days
* Fix a compile-time warning by declaring 'len' as size_t instead of int.gad2001-10-091-1/+1
| | | | MFC after: 4 days
* Rename the local variable 'person' to 'lpr_username', to avoid compile-timegad2001-10-091-9/+9
| | | | | | warnings about conflict with a global variable used by 'lprm'. MFC after: 4 days
* Get rid of some minor compile-time errors by changing copyright/rcsidgad2001-10-091-3/+6
| | | | | | | definitions to the same format used in other lpr source files, and by adding parenthesis to the right spot in one 'if' statement. MFC after: 4 days
* Fix minor compile-time error in definition of 'copyright'.gad2001-10-091-1/+1
| | | | MFC after: 4 days
* Fix minor compile-time warning that snunk in with changes to sortq() rtn.gad2001-10-091-0/+1
| | | | MFC after: 4 days
* *** empty log message ***obrien2001-10-011-3/+4
|
* Basically rewrite the sortq() routine which is used by 'lpc clean' andgad2001-09-271-20/+126
| | | | | | | | | | 'lpc tclean'. In some obscure cases, the previous version could cause a valid user job to be removed (by 'clean'), due to invalid assumptions in the sort routine. This was a rare problem, unless ctlinfo.c is compiled with 'LEAVE_TMPCF_FILES' turned on (to check what that rtn was doing). Reviewed by: Lack of outcry on -audit and freebsd-print@bostonradio.org MFC after: 10 days
* Add minimal support for "o"-type print-file actions in lpd control files.gad2001-09-202-13/+29
| | | | | | | | | 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
* Fix so that lpc's interactive-mode will not be confused by EditLine processinggad2001-09-171-0/+9
| | | | | | | into thinking that there is a print-queue called 'xterm'... Reviewed by: short discussion on freebsd-stable MFC after: 1 week
* Set BINOWN=root explicitly for setuid root binaries.ru2001-09-133-0/+3
| | | | | | This is not "useless", as one may have non-default setting for BINOWN in make.conf, and we still want these to be installed setuid root in this case.
* Fix buffer overflow in queue file handling.kris2001-08-301-7/+13
| | | | | Submitted by: millert@openbsd.org, gad Reported by: X-Force <xforce@iss.net>
* mdoc(7) police: protect trailing full stops of abbreviationsru2001-08-101-1/+1
| | | | with a trailing zero-width space: `e.g.\&'.
* mdoc(7) police:ru2001-08-072-5/+3
| | | | | | | Avoid using parenthesis enclosure macros (.Pq and .Po/.Pc) with plain text. Not only this slows down the mdoc(7) processing significantly, but it also has an undesired (in this case) effect of disabling hyphenation within the entire enclosed block.
* 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 a compile-time warning by casting to (size_t).gad2001-07-231-1/+1
| | | | MFC after: 1 week
* Get rid of a compile-time warning by casting to (size_t).gad2001-07-231-1/+1
| | | | MFC after: 1 week
* Fix a few more minor compile-time warnings, mainly by using size_t wheregad2001-07-231-10/+15
| | | | | | | appropriate, and using '("%lu", (unsigned long)asizeval)' when printing something of type size_t. MFC after: 1 week
* 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-223-37/+25
| | | | | | 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-2016-43/+65
| | | | | 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 GCC'isms in CFLAGS.obrien2001-07-201-1/+1
|
* Remove whitespace at EOL.dd2001-07-154-8/+8
|
* Change lpd to perform sanity and safety checks on control files as itgad2001-07-154-6/+931
| | | | | | | | | | | | 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
OpenPOWER on IntegriCloud