summaryrefslogtreecommitdiff
path: root/usr.sbin/lpr/common_source/common.c
AgeCommit message (Collapse)Author
2023-05-13change a typo in sizeof(struct queueue *) to sizeof(nqueue[0])andvar
riastradh recommends using array[0] instead of pointer.
2014-12-20MKINET6=no build fixesprlw1
http://mail-index.netbsd.org/tech-net/2014/12/13/msg004898.html
2013-11-13CID 1125882: Don't use unitialized variable; move code inside conditionalchristos
where it was intended.
2013-10-19use new scopeid functionschristos
2009-07-13Rename internal getline() function to get_line() so it doesroy
conflict with the soon to be added getline(3) libc function.
2009-01-18fix -Wsign-compare issueslukem
2007-12-01Sort queue by time and jobid so that jobs submitted within themlelstv
same second are printed in order. Fixes PR bin/37346
2006-05-25Add missing semicolon.christos
2006-05-25Coverity CID 3322: Fix memory leak.christos
2006-03-21Coverity CID 1750: Add a function to free a queue and use it.christos
2006-03-17free memory on allocation failure.christos
2006-01-20Instead of dealing with port@host in many places, do it where it is needed.christos
It reduces code and complexity and at the same time allows as to use symbolic ports instead of just numeric everywhere.
2006-01-18change return(0) to return(rv). We went to all the trouble to calculate thegarbled
return value, we might as well return it. (fixes lpq -a, and probably lpd)
2006-01-17Fix PR bin/14247garbled
This PR claims that MacOSX 10.1 cannot print postscript files to a NetBSD lpd because the mac will tag the file with an "o" for postscript, which we do not handle. Rather than simply mapping o -> f as was done in the PR, or mapping o -> l as was done in FreeBSD, I have implemented full support for the "o" option. If a postscript filter does not exist in the printcap file however, it will default to "l" handling. With this change, you can now specify a "pf" or postscript filter in your printcap, and have it handle postscript files sent to it with "lpr -o". The "o" format in lpd is specified in RFC1179 as being a valid format flag.
2006-01-17in ckqueue() if "sd" is not an existing capability, than sd will begarbled
uninitialized, causing the free() in out: to explode. Initialize sd to NULL.
2006-01-04Address PR bin/12112garbled
Lpd has the ability to start on a port other than "printer" but has no way to connect to a remote lpd on that port. This change adds the ability to specify port@host in the rm element of printcap(5). Tested to work with both a standard lpd setup and one running on special ports.
2005-11-28- WARNS = 4christos
- factor out commonly used code. - constify - use warn/warnx instead of printf
2004-11-16NI_WITHSCOPEID was not picked up by IETF standardizationitojun
2003-10-16safer use of reallocitojun
2003-08-07Move UCB-licensed code from 4-clause to 3-clause licence.agc
Patches provided by Joel Baker in PR 22366, verified by myself.
2002-09-18select() -> nanosleep()mycroft
2002-07-14Unifdef __STDC__. Remove __P(). ANSIfy.wiz
2001-04-05Fix possible security problem (euid swapout in error handling).wiz
Based on a similar patch in OpenBSD, reported there by j@ida.interface-business.de. Fix the second occurrance of a similar problem in that file, too, though.
2000-08-09rewrite local address detection code, to use getifaddrs(3), not gethostname(3).itojun
gethostname(3) do not necessarily represent local host addrses. pointed out by: Chuck Cranor
2000-04-25allow lp=port@host again. PR9975 from Andreas Gustafsson.itojun
2000-04-24avoid NULL pointer access when rp=<ipv4 numberic address> (no ai_canonname).itojun
From: hiro@takechi.org XXX checkremote() should be improved. gethostname -> getaddrinfo is not the right thing to do, we cannot assume DNS FQDNs is configured as hostname. if the goal here is to check if it is really remote or not, getifaddrs() is the way to go.
2000-02-18do not sleep on ECONNREFUSED, rather, try the next address first.itojun
the behavior itself has a room for debate. (why we retry on ECONNREFUSED?) From: SHIMIZU Ryo <ryo@misakimix.org>
2000-01-27IPv6 support, using rcmd-family funciton added.itojun
NetBSD PR: 9050 From: Feico Dillema
1999-12-05put fatal() and a some of variables used independantly of other functionsjdolecek
in common.c into separate files - this slighly cuts down size of pac(1) not that it's really significant, but every bit counts ....
1999-09-26delint and other cleanups.mrg
1998-07-09Declare ints, too, don't default them.msaitoh
1998-07-06- use an array MAXHOSTNAMELEN+1 size to hold hostnamesmrg
- ensure hostname from gethostname() is nul-terminated in all cases - minor KNF - use MAXHOSTNAMELEN over various other values/defines - be safe will buffers that hold hostnames
1997-10-18use memcmp/memset/memmove instead of bcmp/bzero/bcopylukem
1997-10-05- WARNS?=1mrg
- be safe with unlinking files (from freebsd) - remove register - clean up $NetBSD$'s. - use inet_ntoa() in one place (from openbsd) - nul terminate after a bunch of strncpy()'s - #ifdef __STDC__ rather than #if (from freebsd) - be safe with a bunch of string operations (from freebsd) - use warn()/err() over home grown versions (some from freebsd) - rename warn() to nodaemon() to remove conflict with above - check errno from failed kill(2) against ESRCH (from freebsd) - use getopt() rather than home grown versions (from freebsd) - clean up a bunch of man pages (some from freebsd) - check for hostname spoof (from freebsd) - use POSIX wait() interfaces - use sysconf(_SC_OPEN_MAX) in preference to NOFILE (from freebsd) - deal with fork() failure - index/rindex -> strchr/strrchr (some from freebsd) - add B57600 and B115200 speeds (from freebsd) - some KNF - be safe with files passed in over the network (some from freebsd) - check return value of malloc(), calloc() and strdup()
1997-10-05merge 4.4 lite2mrg
1996-12-09remove unsafe calls to strcpy(), strcat(), and sprintf(). some KNF.mrg
1995-11-28merge in changes from 1.1 release branchjtc
1995-11-15Add RCSIDs.pk
1995-10-03-- convert sgtty to termios. From: Scott Bartram <scottb@iis.net>hpeyerl
-- Use seteuid() to only give lpr, lprm, lpq and lpc root when they need it from matthew green <mrg@mame.mu.oz.au>
1994-05-18clean up that import. no rcsids yet.cgd
1994-05-17copyright foocgd
1993-12-08Upgraded to use <dirent.h>.jtc
1993-08-01Add RCS identifiers.mycroft
1993-03-21initial import of 386bsd-0.1 sourcescgd