summaryrefslogtreecommitdiffstats
path: root/usr.sbin/lpr/common_source
Commit message (Collapse)AuthorAgeFilesLines
* Bah humbug. Fix another typo on the same comment line. It also hadgad2002-06-131-1/+1
| | | | | | an option-space instead of a space... MFC after: 10 days
* Fix a typo in a comment from the previous commit. I had a bullet-charactergad2002-06-131-1/+1
| | | | | | | instead of an asterisk. Noticed by: keramida MFC after: 10 days
* Almost complete rewrite of the lpc commands 'abort', 'enable', 'disable',gad2002-06-132-0/+151
| | | | | | | | | | | | | | | | | 'restart', 'start', 'stop' and 'up'. These are commands which mainly just alter the access bits on the lock-file of a queue, and they all now use a central routine to do that. This reduces the amount of code that is run as the priv userid, and eliminates a number of cases where error messages were written while that priv uid was in effect. As far as users are concerned, there should be no noticable difference in the new versions. In case there *is*, the previous implementations are still there as 'xabort', 'xenable', etc, so they are available for instant fallback. If no one reports a problem after a few weeks, then a later update will remove those x-commands. Reviewed by: freebsd-audit and freebsd-print@bostonradio.org MFC after: 10 days
* Assume __STDC__, remove non-__STDC__ code.alfred2002-05-281-15/+0
|
* Mark all internal libraries with INTERNALLIB.ru2002-05-131-5/+1
|
* 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-232-0/+2
| | | | | | | | | | | | 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-221-2/+2
| | | | | | new gcc (on sparc64). MFC after: 4 days
* My recent changes to add the ctl_renametf routine assumed that print jobgad2001-11-281-8/+16
| | | | | | | | | | | 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-271-2/+4
| | | | | | | | '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-12/+18
| | | | | | | | | 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 buffer overflow in queue file handling.kris2001-08-301-7/+13
| | | | | Submitted by: millert@openbsd.org, gad Reported by: X-Force <xforce@iss.net>
* 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
* Replace calls to strncpy with calls to strlcpy, and remove the extra stepgad2001-07-221-6/+3
| | | | | | needed to ensure that the result is null-terminated when using strncpy(). MFC after: 8 days
* Perform a major cleanup of the usr.sbin Makefiles.obrien2001-07-201-3/+4
| | | | | 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.
* Change lpd to perform sanity and safety checks on control files as itgad2001-07-153-2/+924
| | | | | | | | | | | | 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
* Replace three subtly-wrong calls to strncpy with calls to strlcpy, andgad2001-07-152-15/+13
| | | | | | use (size_t) in a few places to avoid compile-time warnings on alpha. MFC after: 1 week
* Fix most of the warnings generated by compiling lpr with -Wnon-const-format,gad2001-07-152-4/+5
| | | | | | | | | 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
* Rename a few global variables which hold hostname-related values to begad2001-06-155-27/+49
| | | | | | | | | | | | | | | 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-152-3/+3
| | | | | | | | 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-127-173/+125
| | | | | | | | | | | | 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
* Make sure the euid is restored in an obscure error situation.gad2001-04-061-3/+4
| | | | Submitted by: J Wunsch <j@ida.interface-business.de> in freebsd-audit
* Fix "lprm -" (remove all jobs) processing for remote printer queues.gad2001-03-121-10/+17
| | | | PR: bin/25544
* Use macro API to <sys/queue.h>phk2000-12-301-2/+2
| | | | | Submitted by: "Jason" <jsmethers@pdq.net> Reviewed by: /sbin/md5
* IPv6 support for lpr.ume2000-12-162-80/+111
| | | | | Reviewed by: freebsd-current (no objection) Obtained from: KAME
* Reset the seteuid in a few obscure error situations.gad2000-11-151-1/+4
|
* Just some style-related improvements.gad2000-11-151-24/+32
|
* Cosmetic change of a structure name.gad2000-11-063-24/+24
| | | | | | | Turn 'struct queue { q_time, q_name }' (loosely-speaking) into 'struct jobqueue { job_time, job_cfname }' Reviewed by: GAWollman
* Fix 'lprm' processing so is more likely to work correctly when dealinggad2000-11-051-1/+1
| | | | | | | with long (>32 character) hostnames. PR: 14978 Submitted by: Tatsuya Kudoh <cdr@cosmonet.org>
* Implement new printcap options of sr= (aka stat.recv) and sr= (aka stat.send)gad2000-11-024-3/+325
| | | | | | | | 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
* Make the standard 'lpq' output a little more informative when listing jobsgad2000-10-311-12/+39
| | | | | | | which have long names. Instead of just listing '...', try to list some reasonable subset of the name (with a "..." to indicate something missing). Reviewed by: freebsd-print@bostonradio.org (only a little review)
* Fix 'lpq' so it can correctly display jobs which come from hosts usinggad2000-10-311-9/+44
| | | | | | 'lprNG' (which writes control-lines in a different order than our lpr). Reviewed by: freebsd-print@bostonradio.org
* Fix cosmetic error in rmjob message.wollman2000-09-271-2/+0
| | | | PR: 21006
* Back out the previous change to the queue(3) interface.jake2000-05-261-6/+6
| | | | | | It was not discussed and should probably not happen. Requested by: msmith and others
* Change the way that the queue(3) structures are declared; don't assume thatjake2000-05-231-6/+6
| | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd
* This appears to have been repo-copied to lpd a while ago and neverimp2000-05-091-375/+0
| | | | | deleted here. Diff shows there is only one change to this file, which matches the repo histories.
* Print files submitted at the same instant in deterministic order.wollman2000-05-031-5/+20
| | | | | PR: 18361 Submitted by: Garance A Drosehn <gad@freefour.acs.rpi.edu>
* $Id$ -> $FreeBSD$peter1999-08-2810-10/+10
|
* lpd tries to be clever and checks if RM == my_hostname.jkh1999-04-273-3/+25
| | | | | | | | | However, it doesn't check if the remote printer name it is sending it to is the same as the local printer name, and so chokes 'cos "laser" is not a real printer. PR: 7081 Submitted by: David Malone <dwmalone@maths.tcd.ie>
* Fix additional warnings. Remove -Werror, since some people have complainedwollman1998-09-112-5/+4
| | | | | | | about it. PR: 7886 Submitted by: Stefan Eggers <seggers@semyam.dinoco.de> (partially)
* Remove -Werror from CFLAGS on i386 because with -nostdinc gcc spitsjb1998-06-111-4/+1
| | | | | warnings from unused static inline functions in headers if you happen to set CFLAGS without -O.
* The printf type checking in gcc wants %qd to be a long long, so addjb1998-05-131-2/+2
| | | | a cast in case off_t is not a long long (as on alpha).
* Make -Werror i386 specific because -nostinc on alpha spits warningsjb1998-05-131-2/+5
| | | | for unused static inline functions in header files.
* Fix top-of-form bogon.wollman1997-12-271-2/+2
|
* Mega lpd/lpd upgrade, part I:wollman1997-12-0211-394/+1210
| | | | | | | | | | | | | | | - 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...
* Argl! Who's got the pointy hat these days? Hand it over to me, ASAP!joerg1997-11-071-0/+1
| | | | | When setting an alarm that didn't trigger, i gotta clear it again before going on. Hmpf!
* One could be surprised how much bugs can still be found here...joerg1997-10-151-2/+3
| | | | | | | | | | | | Properlay clean the global RM variable if cgetstr() failed for it. Otherwise, a connection attempt to a remote machine was made (and a bogus result code printed) if a local printer followed a remote one in printcap, and you did a `lpq -a', since checkremote() falsely assumed the printer to be a remote one. While i was at it, removed a gratuituous newline printed in front of the remote machine's name, thus making the output more consistent (and better machine-parseable) now.
* Improve my hack from rev 1.6 of displayq.c, and make the TCPjoerg1997-10-145-2/+20
| | | | | | | | 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?
* Be more paranoid about unlinking files. From mhpower@MIT.EDU by way ofimp1997-10-061-4/+6
| | | | | | | Theo de Raadt. Likely 2.2.5R candidate. Obtained from: OpenBSD
OpenPOWER on IntegriCloud