summaryrefslogtreecommitdiff
path: root/usr.sbin/lpr
AgeCommit message (Collapse)Author
2003-11-08typos from Jonathon Gray;Jason McIntyre
2003-10-16safer realloc. deraadt okJun-ichiro itojun Hagino
2003-09-26realloc fixes; ok deraadt millertPeter Valchev
2003-09-03plug mem leaks, pr3425 from patrick latifi. ok deraadt@Ted Unangst
2003-06-12- section reorderJason McIntyre
- macro fixes - kill whitespace at EOL - new sentence, new line
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-19No longer complain about printing a.out files; this sort of detection reallyPaul Janzen
belongs in lpd filters.
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-03-31ascii -> ASCIIJason McIntyre
2003-03-27Add -q to the getopt() string and document it; Brian GinsbachTodd C. Miller
2003-03-27Fix a bug introduced when getopt() support was added; -h takes anTodd C. Miller
argument but -r does not. These were reversed in the getopt() string. Fix from Carson Harding
2003-03-25Fix last commit; to emulate setuid daemon + PRIV_END we need toTodd C. Miller
set the real & effective uids to the calling user and the saved uid to daemon. Fixes a problem where lpr could not print files that were not world-readable.
2003-03-13lots of sprintf -> snprintf and strcpy -> strlcpy; checked by teduTheo de Raadt
2003-03-11Make lpr and lprm setuid root but drop to daemon very early.Todd C. Miller
Functionally this is the same as when lpr and lprm were setuid daemon but the executable are now owned by root which is safer. deraadt@ OK
2003-03-08Honor the :sh: flag in the local printcap for remote printers tooTodd C. Miller
instead of forcing the user to use lpr's "-h" flag. Adapted from a patch in FreeBSD from Scott James Remnant.
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
2003-02-09typos;Jason McIntyre
2003-01-06Typo: s/to be use if/to be used if/ s/Standford/Stanford/Chad Loder
2002-12-08GNU semantics say that if optstring begins with '-' thenTodd C. Miller
each non-option shall be treated as arguments to option '\1'. BSD getopt match '-' in optstring with a '-' on the command line. This is used to support deprecated options like "su -" that would otherwise prevent the use of getopt(). Resolving this simply requires that the leading '-' be moved somewhere else (I moved it to the end of optstring) since position within optstring is not meaningful.
2002-09-06use more socklen_t; pvalchevTheo de Raadt
2002-07-27merge if() and foo = snprintf checks better; millert okTheo de Raadt
2002-06-23uid_t and gid_t are unsignedTheo de Raadt
2002-06-19stretch some ugly while();Theo de Raadt
2002-06-14spelling; from Brian Poole <raj@cerias.purdue.edu>Todd T. Fries
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-11lprm needs to be setuid daemon after allTodd C. Miller
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-08make this actually compileTodd C. Miller
2002-06-08Force lpd socket to be mode 0660, group daemonTodd 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-28Repair remote printing; maxfd was not set correctly for remote connections.Todd C. Miller
2002-05-28Remove useless sigaddset()Todd C. Miller
2002-05-22unlink lpd.pid if killed by a signalTodd C. Miller
2002-05-22Use O_EXLOCK in open() instead of flock() to eliminate a potential lockingTodd C. Miller
race on the pid file.
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-05-18Update paths from 4.3BSD to 4.4BSD; partially from NetBSDTodd C. Miller
2002-02-24getc, getchar, etc return an int, not a charPeter Valchev
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.
2002-02-13When you give command examples and etc., in a manual page prefix them with:Mike Pechkin
$ command or # command deraadt@ ok