summaryrefslogtreecommitdiffstats
path: root/usr.sbin/lpr/common_source/displayq.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Use <fcntl.h> instead of <sys/file.h> for open() and friends.guenther2018-04-261-2/+1
| | | | | | | Delete a bunch of unnecessary #includes and sort to match style(9) while doing the above cleanup. ok deraadt@ krw@
* Switch (non-curses, non-ksh) programs that use COLUMNS to a single idiom.bentley2016-03-171-9/+10
| | | | | | | | Previously behaviors were all over the map. This changes them to use COLUMNS first, and either terminal width or a hardcoded value (typically 80) as appropriate. ok deraadt@; man bits ok jmc@
* Move prototypes of local functions from lp.h to the .c files and maketb2016-01-121-9/+17
| | | | | | | functions static if possible. Move delay() to lpd/printjob.c and fix an annoying typo. ok deraadt@
* stdlib.h is in scope; do not cast malloc/calloc/realloc*deraadt2015-08-201-2/+2
|
* Replace <sys/param.h> with <limits.h> and other less dirty headers wherederaadt2015-01-161-2/+2
| | | | | | | | | possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
* stat(2) on the spool file needs privileges. Fixes file size reported bypascal2014-05-211-2/+6
| | | | | | lpq -l. ok millert@
* more ctype cleanupsderaadt2013-11-241-2/+2
| | | | checked by jca
* If a constant string needs a name, use a static const array instead of aguenther2013-10-271-3/+3
| | | | | | | | pointer or non-const array, as that minimizes the symbols, maximizes the placement into read-only memory, and avoids warnings from gcc -Wformat=2 when they're used as format strings. ok deraadt@
* In preparation for getline and getdelim additions to libc, rename getline()fgsch2012-03-041-2/+2
| | | | | occurrences to get_line(). Based on a diff from Jan Klemkow <j-dot-klemkow-at-wemelug-dot-de> to tech.
* rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andderaadt2009-10-271-9/+1
| | | | | | | unmaintainable). these days, people use source. these id's do not provide any benefit, and do hurt the small install media (the 33,000 line diff is essentially mechanical) ok with the idea millert, ok dms
* spacesstevesk2009-03-031-3/+3
|
* I have an HP LaserJet (P2015dn) whose LPR implementation may not endstevesk2007-04-081-4/+8
| | | | | | | | | | the send queue state command stream with '\n'; check for this case and print '\n' if needed. Without this you may see something like: $ lpq queue empty$ ok millert@
* trailing "\n" not needed in fatal(); ok millert@stevesk2007-04-071-3/+3
|
* Plug memory leak when nitems == 0.ray2006-04-081-3/+3
| | | | | | From NetBSD from Coverity CID 1752. OK jaredy@
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-7/+3
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* Don't reformat output beyond a minimum terminal width (60).pjanzen2003-05-131-2/+4
| | | | millert@ ok
* Do vis()-cleaning when displaying the print queue.pjanzen2003-05-121-3/+9
| | | | ok deraadt@, ian@
* trivial strlcat, tedu@ okavsm2003-04-051-3/+3
|
* Better fix for correct queue printing when things have been moved around.millert2002-06-091-14/+9
|
* Don't print jobs in transit to a remote queue as being "active"millert2002-06-091-4/+9
|
* o Kill "garbage" global (unused)millert2002-06-091-12/+10
| | | | | | | o Kill "rank" global (doesn't need to be global) o Make inform() static (local to displayq.c) o Pass in rank to inform() based on index within sorted mtime array o Simplify compar()
* o Replace some hard-coded octal constants w/ S_I*millert2002-06-081-4/+4
| | | | o Remove some unneeded casts to char * when calling free()
* Remove setuid root from lp*. lpr needs to be setuid daemon so themillert2002-06-081-37/+43
| | | | | | | | | | | | | | | | files it creates are not owned by the user spooling them but the others (lpc, lpq, lprm) can get away with setgid daemon. lpd runs as user daemon for most things, only changing its uid to 0 for things that must be done as root. For the time being, don't require connections to come from a reserved port since lpq/lpr/lprm can't acquire that w/o setuid root. In the near future we will have a mechanism for select non-root processes to grab reserved ports. The upshot of this is that spool directories must be writable by group daemon and the files within the spool dirs must be owned by daemon.
* Remove useless sigaddset()millert2002-05-281-3/+2
|
* Pull in useful bits from NetBSD and make our lp* easier to diff andmillert2002-05-201-55/+62
| | | | | | | | | | | | | | | | do some minor cleanup of my own: o IPv6 support o ANSI function headers o use getopt() o synce usage() with man pages o passes -Wall on both 32bit and 64bit platforms o add an option to set the max number of children lpd will fork off o add an lpd option to bind to specific addresses instead of INADDR_ANY. o allow user to specify how long to wait for a connection to remote servers o more strlcpy() and snprintf() usage o Use FOO_FILENO constants instead of hard-coding 0-2 o Add some keeps to man the page SYNOPSIS to avoid options being split
* displayq to honor the terminal width; millert@ okmickey2001-11-011-12/+25
|
* o kill registermillert2001-08-301-12/+12
| | | | | o add const to rcsid and copyright strings o placate -Wall
* Use NAME_MAX, not MAXPATHLEN for buffer sizes since they are notmillert2001-08-301-4/+4
| | | | full paths (cannot contain a slash). From discussion with drosih@rpi.edu
* Fix buffer oflow reading from queue file. While we are at it, crankmillert2001-08-291-9/+15
| | | | the size of buffers that can hold filenames to MAXPATHLEN.
* use strlcpy vs strncpy+a[len-1]='\0'lebel2001-06-221-4/+3
|
* Fix snprintf return value usage.millert1998-06-231-4/+4
|
* be more paranoid.deraadt1998-02-271-11/+21
| | | | | | | By the way, the lp* tools are in need of a full test sometime in the next two weeks. I want to hear from someone who is running all of them that they work 100% fine. I do not own a printer, so I'm going to rely on someone out there to take care of this..
* 1 byte oflows; millertderaadt1997-07-231-4/+4
|
* Wallderaadt1997-07-171-3/+3
|
* Possible buf oflow.millert1997-01-171-3/+10
|
* proactive bounds checking; help from millertderaadt1996-10-251-3/+4
|
* Integrated 4.4Lite2 sourcetholo1996-07-041-12/+13
| | | | Fixed potential problem pointed out by bitblt
* from netbsd; {} maniaderaadt1995-11-221-4/+5
|
* lprm failed to delete all files; from thomas@cevis.uni-Bremen.de; netbsd pr#1756deraadt1995-11-131-3/+6
|
* initial import of NetBSD treederaadt1995-10-181-0/+470