summaryrefslogtreecommitdiffstats
path: root/usr.sbin/lpr/common_source (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Fix the embedded scope hack. They way this was written is buggy since theclaudio2021-01-191-15/+10
| | | | | | | else does not skip enough of the original code. Instead use a temporary sockaddr pointer and adjust it to point to the sin6 one if an embedded scope was detected. OK jca@
* snprintf/vsnprintf return < 0 on error, rather than -1.deraadt2019-07-032-6/+6
|
* 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 ckqueue() to common_source/common.cjca2016-02-292-2/+32
| | | | Patch from Chris Bennett, ok tb@
* Move prototypes of local functions from lp.h to the .c files and maketb2016-01-124-56/+50
| | | | | | | functions static if possible. Move delay() to lpd/printjob.c and fix an annoying typo. ok deraadt@
* Remove support for lpd.pid file. OK deraadt@millert2015-10-281-2/+1
|
* Use AF_UNIX instead of AF_LOCAL.millert2015-10-271-3/+3
|
* Userspace doesn't need to use SUN_LEN(): connect() and bind() must acceptguenther2015-10-111-2/+2
| | | | | | | sizeof(struct sockaddr_un), so do the simple, portable thing. Also convert some strncpy() to strlcpy() ok deraadt@
* stdlib.h is in scope; do not cast malloc/calloc/realloc*deraadt2015-08-202-5/+5
|
* Replace <sys/param.h> with <limits.h> and other less dirty headers wherederaadt2015-01-166-14/+14
| | | | | | | | | 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)
* use nanosleep() instead of select(); ok jsingderaadt2014-11-021-4/+4
|
* reallocarray() obviouslyderaadt2014-10-161-5/+4
|
* Make sure the correct errno is reported by warn* or err* and notguenther2014-07-201-2/+3
| | | | | | the errno of an intervening cleanup operation like close/unlink/etc. Diff from Doug Hogan (doug (at) acyclic.org)
* stat(2) on the spool file needs privileges. Fixes file size reported bypascal2014-05-211-2/+6
| | | | | | lpq -l. ok millert@
* Prevent lpd(8) from looking into hosts.equiv.ajacoutot2014-04-201-2/+1
| | | | | | | | | Access control is now done only using hosts.lpd. See lpd(8) for more information about the format of this file. "seems reasonable" tedu@ "looks good" deraadt@ ok sthen@
* Remove the printcap fc, fs, xc, xs capabilities from lpd that were usednaddy2013-12-102-10/+2
| | | | | | | to configure a tty by poking magic numbers into sgtty. If needed, the ms capability, which uses symbolic stty modes, can be used instead. Better description of ms from FreeBSD. ok beck@, deraadt@, jmc@ (man page)
* more ctype cleanupsderaadt2013-11-242-4/+4
| | | | 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@
* Remove excessive sys/cdefs.h inclusionderaadt2012-12-051-2/+1
| | | | ok guenther millert kettenis
* Change scandir()'s 'select' argument fromguenther2012-11-292-4/+4
| | | | | | | | | int (*)(struct dirent *) to int (*)(const struct dirent *) to match POSIX. ok millert@, ports check by naddy@
* In preparation for getline and getdelim additions to libc, rename getline()fgsch2012-03-044-10/+10
| | | | | 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-275-41/+5
| | | | | | | 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
|
* use calloc() to avoid malloc(n * m) overflows; checked by djm canacar jsgderaadt2007-09-021-3/+3
|
* remove #ifndef SUN_LEN; ok millert@stevesk2007-05-011-5/+2
|
* use warn() vs. perror() for consistency; ok millert@stevesk2007-05-011-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-072-6/+6
|
* remove unused variable; ok millert@stevesk2007-03-161-3/+2
|
* typos in comments; ok millert@stevesk2007-03-131-4/+4
|
* Plug memory leak when nitems == 0.ray2006-04-081-3/+3
| | | | | | From NetBSD from Coverity CID 1752. OK jaredy@
* NI_WITHSCOPEID is no more.itojun2004-11-171-6/+2
|
* Simpler loop to free queue items. OK otto@millert2004-09-281-6/+4
|
* Fix leaks in error paths. from Patrick Latifi. ok millert@otto2004-09-281-10/+17
|
* realloc fixes; ok deraadt millertpvalchev2003-09-261-6/+12
|
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-028-53/+21
| | | | 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@
* kill last strcpy; ok millertderaadt2003-04-071-4/+5
|
* trivial strlcat, tedu@ okavsm2003-04-051-3/+3
|
* Fix loop invariants in rmremote(). Reported by Arne Woerner in PRmillert2003-02-131-11/+24
| | | | | 3084; different fix used. Hopefully this makes the code in question easier to read. deraadt@ henric@ OK
* merge if() and foo = snprintf checks better; millert okderaadt2002-07-271-4/+4
|
* Fixed some lpd bugs while on the plane from Calgary:millert2002-06-132-5/+5
| | | | | | | | | | | | | | | | | o mark fatal() as __dead o add SIGINT to the signal mask when installing abort() as a handler. We can end up in abortpr() due to several different signals and since abortpr() kill()s itself with SIGINT we need to explicately protect against the current process receiving SIGINT while in abortpr() o Don't leak the lock fd to children spawned by lpd o Close the lock file (and thus unlocke immediately in abortpr(). Otherwise, if there is an output filter the lock file only gets closed after we finish waiting for the output filter to die. This causes a race condition in lprm such that the per-printer daemon does not get restarted when lprm kills the active job (noticed during c2k2 with the mp3 printer spool ;-) o Open the printcap file with privs raised just in case it is not world-readable.
* 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
|
* Convert remaining K&R function headers to ANSImillert2002-06-092-13/+8
|
* o Kill "garbage" global (unused)millert2002-06-093-23/+19
| | | | | | | 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()
* use the dirfd macro instead of reaching into the DIR and pulling out dd_fdmillert2002-06-081-3/+3
|