summaryrefslogtreecommitdiffstats
path: root/usr.sbin/lpr/common_source/displayq.c
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* 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
* Fix most of the warnings generated by compiling lpr with -Wnon-const-format,gad2001-07-151-3/+3
| | | | | | | | | 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-151-7/+7
| | | | | | | | | | | | | | | 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
* Fix about 90-100 warnings one gets when trying to compile lpr&friendsgad2001-06-121-39/+25
| | | | | | | | | | | | 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
* Cosmetic change of a structure name.gad2000-11-061-3/+3
| | | | | | | Turn 'struct queue { q_time, q_name }' (loosely-speaking) into 'struct jobqueue { job_time, job_cfname }' Reviewed by: GAWollman
* 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
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* 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).
* Mega lpd/lpd upgrade, part I:wollman1997-12-021-61/+58
| | | | | | | | | | | | | | | - 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-141-1/+3
| | | | | | | | 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?
* common_source: staticize private version of warn() so to not conflictjoerg1997-08-231-1/+2
| | | | | | | | | 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
* Two minor, pedantic fixes from bde for my last pedantic fixes, plusimp1997-07-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Use setuid/seteuid around dangerous operations. Also a few bufferimp1997-07-231-5/+29
| | | | | | | | | | | | 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
* Imply a 10-second connection timeout when querying remote queues, tojoerg1997-06-231-0/+13
| | | | | prevent lpq from hanging indefinately (well, 10 minutes are for sure counting as `indefinately' in this case).
* Buffer overflow from OpenBSD:imp1997-02-091-5/+8
| | | | | | | | | | Rev 1.4 deraadt: (partial from full commit, other files not done yet) proactive bounds checking; help from millert Rev 1.5 millert: Possible buf oflow. Plus minor style nits to keep the style police happy (I hope) Obtained from: OpenBSD
* Cleanup.joerg1996-05-091-5/+0
| | | | | | | | | The removed files are no longer needed, they are actually labelled as ``Use only if you are not 4.4BSD''. (Yeah, the ol' crufty printcap.c is really gone!) Properly declare all external objects in files ending in .h, as opposed to embed them into files ending in .c.
* Pull a bunch of fixes from the 4.4BSD-Lite2 branch. It's reallyjoerg1996-05-051-12/+13
| | | | | | | | | | | | surprising how many trivial errors there have been... :-) Some more cleanup is needed, but i'd like to separate the Lite2 changes from other work, that's why this goes into a different commit. People with serial printers should see whether i have broken the stty- style printcap options (i hope not). Inspired by: Sergey Shkonda <serg@bcs1.bcs.zaporizhzhe.ua>
* Fix my botched 4.4Lite2 import, and revert these files to their HEADjoerg1996-05-051-14/+13
| | | | versions.
* Vendor-branch import of the 4.4BSD-Lite2 code for lpr. There arejoerg1996-05-051-13/+14
| | | | | | | | several bugfixes in it that are worth considering. Don't be alarmed about the import conflicts... Obtained from: 4.4BSD-Lite2
* BSD 4.4 Lite usr.sbin Sourcesrgrimes1994-05-261-0/+449
OpenPOWER on IntegriCloud