summaryrefslogtreecommitdiff
path: root/usr.sbin/lpr/common_source
AgeCommit message (Collapse)Author
2004-11-17NI_WITHSCOPEID is no more.Jun-ichiro itojun Hagino
2004-09-28Simpler loop to free queue items. OK otto@Todd C. Miller
2004-09-28Fix leaks in error paths. from Patrick Latifi. ok millert@Otto Moerbeek
2003-09-26realloc fixes; ok deraadt millertPeter Valchev
2003-06-02Remove the advertising clause in the UCB license which BerkeleyTodd C. Miller
rescinded 22 July 1999. Proofed by myself and Theo.
2003-05-13Don't reformat output beyond a minimum terminal width (60).Paul Janzen
millert@ ok
2003-05-12Do vis()-cleaning when displaying the print queue.Paul Janzen
ok deraadt@, ian@
2003-04-07kill last strcpy; ok millertTheo de Raadt
2003-04-05trivial strlcat, tedu@ okAnil Madhavapeddy
2003-02-13Fix loop invariants in rmremote(). Reported by Arne Woerner in PRTodd C. Miller
3084; different fix used. Hopefully this makes the code in question easier to read. deraadt@ henric@ OK
2002-07-27merge if() and foo = snprintf checks better; millert okTheo de Raadt
2002-06-13Fixed some lpd bugs while on the plane from Calgary:Todd C. Miller
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.
2002-06-09Better fix for correct queue printing when things have been moved around.Todd C. Miller
2002-06-09Don't print jobs in transit to a remote queue as being "active"Todd C. Miller
2002-06-09Convert remaining K&R function headers to ANSITodd C. Miller
2002-06-09o Kill "garbage" global (unused)Todd C. Miller
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()
2002-06-08o Replace some hard-coded octal constants w/ S_I*Todd C. Miller
o Remove some unneeded casts to char * when calling free()
2002-06-08use the dirfd macro instead of reaching into the DIR and pulling out dd_fdTodd C. Miller
2002-06-08Remove some debugging codeTodd C. Miller
2002-06-08Remove setuid root from lp*. lpr needs to be setuid daemon so theTodd C. Miller
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.
2002-05-28Remove useless sigaddset()Todd C. Miller
2002-05-20Pull in useful bits from NetBSD and make our lp* easier to diff andTodd C. Miller
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
2002-02-19We live in an ANSI C world. Remove lots of gratuitous #ifdef __STDC__ cruft.Todd C. Miller
2002-02-17Manual cleanup of remaining userland __P use (excluding packages maintained ↵Todd C. Miller
outside the tree)
2002-02-16Part one of userland __P removal. Done with a simple regexp with some minor ↵Todd C. Miller
hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.
2001-12-06use err/warn and friends instead of printf/exit.Eric Jackson
also, remove fatal2() which is just errx anyway. millert@ ok
2001-11-23use the same siginterrupt() trick in lpc(1) as in timedc(1). we have to hackTheo de Raadt
a global into the other programs since they share some source.
2001-11-01displayq to honor the terminal width; millert@ okMichael Shalayeff
2001-08-30o kill registerTodd C. Miller
o add const to rcsid and copyright strings o placate -Wall
2001-08-30Better buffer lengths (MAXFOO and FOO_MAX) based on a patch fromTodd C. Miller
ianm@cit.uws.edu.au.
2001-08-30Use NAME_MAX, not MAXPATHLEN for buffer sizes since they are notTodd C. Miller
full paths (cannot contain a slash). From discussion with drosih@rpi.edu
2001-08-29Fix buffer oflow reading from queue file. While we are at it, crankTodd C. Miller
the size of buffers that can hold filenames to MAXPATHLEN.
2001-06-22use strlcpy vs strncpy+a[len-1]='\0'lebel
2001-04-05another euid mixup; wiz@danbala.ifoer.tuwien.ac.atTheo de Raadt
2001-04-04missung euid swapout; j@ida.interface-business.deTheo de Raadt
1998-06-28Treat a printer as remote iff RM is not us or RP is set and it doesn't match theAngelos D. Keromytis
current printer;dwmalone@maths.tcd.ie
1998-06-23Fix snprintf return value usage.Todd C. Miller
1998-04-22buf mishandling; rotel@indigo.ieTheo de Raadt
1998-02-27be more paranoid.Theo de Raadt
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..
1998-02-15Use keepalives as the protocol never notices if a networked printerNiklas Hallqvist
dies.
1997-07-25#if __STDC__ --> #ifdef __STDC__Michael Shalayeff
1997-07-24inet_aton() returns 0 on error, not -1.Todd C. Miller
1997-07-231 byte oflows; millertTheo de Raadt
1997-07-19Wall cleanup; people running lpd should test!Theo de Raadt
1997-07-18Be extra careful when unlinking data file to only remove a file isTodd C. Miller
it is in the current dir and df*. From imp@openbsd.org.
1997-07-17WallTheo de Raadt
1997-06-23It is not a reasonable default behavior to abort a printout because of itskstailey
size now that there's PostScript[tm].
1997-01-17Add OpenBSD tagsTodd C. Miller
1997-01-17Possible buf oflow.Todd C. Miller
1996-11-05lpr suite uses getcap(3) so this is never used!Todd C. Miller