summaryrefslogtreecommitdiffstats
path: root/usr.sbin/lpr/common_source
Commit message (Collapse)AuthorAgeFilesLines
* Fix a warning about mismatched pointers. A pointer to "void *" is not thepeter2003-10-261-1/+1
| | | | same as a pointer to "char *". Tell the compiler this is ok.
* Remove a 'From:' that snuck into an sccsid comment line as part of -v1.3gad2003-08-011-1/+1
|
* Get the 'sccsid' lines even closer to correct style(9) form. Thegad2003-07-145-0/+13
| | | | | | | | '#ifdef lint/#endif' around the lines should not have been removed. Also add blank lines where one (per file) was missing. Reviewed by: First part noticed by bde, blank lines noticed by me MFC after: 15 days
* Get the 'sccsid' for this to match the original lines you wouldgad2003-07-141-2/+6
| | | | | | | | get from '-r CSRG', instead of having that sccsid as a comment. (this is the sccsid from 1996 -- there have been many changes to printcap.c since then!) MFC after: 15 days
* Take advantage of the common_source/lp.cdefs.h file to change lprgad2003-07-1412-42/+26
| | | | | | | | source to use __FBSDID() for setting rcsids. Also fix the format of 'sccsid' lines to consistently match style(9) guidelines. Reviewed by: discussed with bde and obrien MFC after: 15 days
* Introduce a new lp.cdefs.h file, which will be used to make itgad2003-07-141-0/+107
| | | | | | | | | | | | | somewhat easier to build this lpr on other operating systems. This simply includes <sys/cdefs.h> when that is appropriate, and then checks for any cdefs-ish macros that lpr uses, and defines them if they don't already exist. This is only a start at making freebsd's lpr less of a hassle to port. It is mainly added so all of lpr can be changed to use the __FBSDID() macro, without making it *more* of a hassle to build on other OS's. Reviewed by: discussed with bde and obrien MFC after: 15 days
* Minor improvement to some debugging code that is probably used by no onegad2003-06-121-4/+15
| | | | | | but me (it's usually #ifdef-ed out). MFC after: 1 week
* When sanity-checking a variable, it's good to check the correct variable...gad2003-06-121-1/+1
| | | | MFC after: 1 week
* Change DEFMX to 0. This removes the size limit for print jobs by default.eivind2003-03-271-2/+3
| | | | Discussed with: gad (now), arch (a year ago)
* Fix typos; each file has at least one s/seperat/separat/schweikh2002-08-111-1/+1
| | | | | | | | | | (I skipped those in contrib/, gnu/ and crypto/) While I was at it, fixed a lot more found by ispell that I could identify with certainty to be errors. All of these were in comments or text, not in actual code. Suggested by: bde MFC after: 3 days
* Changes which rewrite 'lpc topq', and which add 'lpc bottomq'. Thesegad2002-07-173-2/+688
| | | | | | | | | | | | | reflect much valuable feedback from wollman. More details on the new 'lpc topq' are in the log message for revision 1.2 of lpc/movejobs.c. The previous implementation of 'lpc topq' is available as 'lpc xtopq', in case there are any problems noticed in the new implementation. If there are no problems with this version, a later update will remove the 'lpc xtopq' command. Reviewed by: freebsd-print@bostonradio.org MFC after: 6 days
* Fix set_qstate() so it correctly checks for any error from chmod().gad2002-07-121-1/+1
| | | | | | Note that set_qstate() is only called from several 'lpc' commands. MFC after: 3 days
* Add a SQS_QCHANGED option to set_qstate(). This will soon be used by 'lpc'.gad2002-07-122-1/+11
| | | | | Reviewed by: freebsd-print@bostonradio.org MFC after: 3 days
* Add two variables to struct jobqueue, and change the way that getq()gad2002-07-122-3/+10
| | | | | | | calculates how much space to get for that struct, so it will get the right amount when new variables are added. MFC after: 3 days
* Move prototypes for ctl_readcf and ctl_freeinf from ctlinfo.c to ctlinfo.h,gad2002-07-122-2/+2
| | | | | | so the routines can be called by an upcoming change for 'lpc topq/bottomq'. MFC after: 3 days
* Stop adding ${CWARNFLAGS} to CFLAGS. The standard makefile processing willgad2002-06-231-2/+0
| | | | | | add them automatically, and there is no point in adding them twice. MFC after: 5 days
* 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
OpenPOWER on IntegriCloud