summaryrefslogtreecommitdiffstats
path: root/usr.sbin/lpr/common_source/common.c
Commit message (Collapse)AuthorAgeFilesLines
* Add 'const' to some casts to fix two warnings that are printed by thegad2002-04-221-2/+2
| | | | | | new gcc (on sparc64). MFC after: 4 days
* Fix a few more minor compile-time warnings, mainly by using size_t wheregad2001-07-231-10/+15
| | | | | | | appropriate, and using '("%lu", (unsigned long)asizeval)' when printing something of type size_t. MFC after: 1 week
* Replace three subtly-wrong calls to strncpy with calls to strlcpy, andgad2001-07-151-14/+12
| | | | | | use (size_t) in a few places to avoid compile-time warnings on alpha. MFC after: 1 week
* Rename a few global variables which hold hostname-related values to begad2001-06-151-2/+3
| | | | | | | | | | | | | | | more sensible/understandable. 'from'->'from_host' 'host'->'local_host' 'fromb'->'frombuf' 'fromhost'->'origin_host' and a local-variable named 'host'->'hostbuf'. This fixes some compile-time warnings about local variables shadowing global variables. Other than renaming variables, the only actual code changes are to call strlcpy() instead of strncpy() when setting those (renamed) variables, and that 'from_ip' is now a strdup()-created buffer instead of being a static buffer compiled in as 1025 bytes. Reviewed by: freebsd-print@bostonradio.org (an earlier version) MFC after: 1 week
* Rename global variable 'name' to 'progname', thus fixing a number ofgad2001-06-151-2/+2
| | | | | | | | warnings which come up for various routines that have a parameter which is also called 'name'. Reviewed by: freebsd-print@bostonradio.org MFC after: 1 week
* Fix about 90-100 warnings one gets when trying to compile lpr&friendsgad2001-06-121-40/+17
| | | | | | | | | | | | with BDECFLAGS on, mainly by adding 'const' to parameters in a number of routine declarations. While I'm at it, ANSI-fy all of the routine declarations. The resulting object code is exactly the same after this update as before it, with the exception of one unavoidable change to lpd.o on freebsd/alpha. Also added $FreeBSD$ line to lpc/extern.h lpc/lpc.h lptest/lptest.c Reviewed by: /sbin/md5, and no feedback from freebsd-audit
* Make sure the euid is restored in an obscure error situation.gad2001-04-061-3/+4
| | | | Submitted by: J Wunsch <j@ida.interface-business.de> in freebsd-audit
* Reset the seteuid in a few obscure error situations.gad2000-11-151-1/+4
|
* Just some style-related improvements.gad2000-11-151-24/+32
|
* Cosmetic change of a structure name.gad2000-11-061-17/+17
| | | | | | | Turn 'struct queue { q_time, q_name }' (loosely-speaking) into 'struct jobqueue { job_time, job_cfname }' Reviewed by: GAWollman
* Implement new printcap options of sr= (aka stat.recv) and sr= (aka stat.send)gad2000-11-021-0/+285
| | | | | | | | in lpd. Stat.recv is useful on a printserver, as something of a network performance-monitoring tool. Stat.send is a minimal accounting record of sorts for jobs going to tcp/ip based printers. Reviewed by: freebsd-print@bostonradio.org
* Print files submitted at the same instant in deterministic order.wollman2000-05-031-5/+20
| | | | | PR: 18361 Submitted by: Garance A Drosehn <gad@freefour.acs.rpi.edu>
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Fix additional warnings. Remove -Werror, since some people have complainedwollman1998-09-111-2/+2
| | | | | | | about it. PR: 7886 Submitted by: Stefan Eggers <seggers@semyam.dinoco.de> (partially)
* Mega lpd/lpd upgrade, part I:wollman1997-12-021-174/+80
| | | | | | | | | | | | | | | - Get rid of a lot of the static variables which were shared by many routines and programs in the suite. - Create an abstract interface to the printcap database, so that other retrieval and iteration mechanisms could be developed (e.g., YP, Hesiod, or automatic retrieval from a trusted server). - Give each capability a human-readable name in addition to the historic two-character one. - Otherwise generally clean up a lot of dark corners. Many still remain. - When submitting jobs, use the official login name record (from getlogin()) if there is one, rather than reverse-mapping the uid. More to come...
* Improve my hack from rev 1.6 of displayq.c, and make the TCPjoerg1997-10-141-0/+1
| | | | | | | | connection timeout controllable by a new printcap(5) capability named `ct' (connectiom timeout), defaulting to 120 seconds (which is the default TCP connection timeout). Would anybody see a problem with merging all this into RELENG_2_2?
* Two minor, pedantic fixes from bde for my last pedantic fixes, plusimp1997-07-291-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the following from recent OpenBSD changes. These changes (and all I've made) should be merged back into 2.2 when they are vetted in -current. common.c: OpenBSD 1.7: mickey: #if __STDC__ --> #ifdef __STDC__ displayq.c: OpenBSD 1.8: deraadt: 1 byte oflows; millert rmjob.c: OpenBSD 1.8: deraadt: 1 byte oflows; millert cmds.c: OpenBSD 1.9: grr: restore traditional "all" keyword option - see lpc(8) [[ This makes lpc status all work again -- imp ]] printjob.c: OpenBSD 1.17: deraadt: use sendmail -t OpenBSD 1.16: mickey: #if __STDC__ --> #ifdef __STDC__ OpenBSD 1.15: deraadt: 1 byte oflow; Don.Lewis@tsc.tdk.com recvjob.c: OpenBSD 1.11: mickey: #if __STDC__ --> #ifdef __STDC__ lpr.c: OpenBSD 1.19: mickey: #if __STDC__ --> #ifdef __STDC__ Obtained from: OpenBSD
* Fix boatloads of buffer overflows from the OpenBSD tree.imp1997-07-291-2/+2
| | | | | Be pedantic about always using sizeof(blah) vs sizeof (blah) or sizeof blah. Obtained from:OpenBSD
* Use setuid/seteuid around dangerous operations. Also a few bufferimp1997-07-231-1/+9
| | | | | | | | | | | | overflow patches that were "near" to where these operations are taking place. The buffer overflows are from OpenBSD. The setuid/seteuid patches are from NetBSD by way of OpenBSD (they changed them a little), at least from my read of the tree. This is the first of a series of OpenBSD lpr/et al merges. It (and them) should be merged back into 2.2 and/or 2.1 (if requested) branches when they have been shaken out in -current. Obtained from: OpenBSD
* Add code to make sure that we don't overflow the buffer that we copyimp1997-07-181-1/+4
| | | | | | | | | the hostname into. In theory the bind library should do this, but in practice the limites between system defines and bind defines make an attack using this vector possible. These patches have been in use on my systems for three months now, so I am fairly confident about them. I plan on commiting this to 2.2 and 2.1 in the near future, as well as many other patches of this nature.
* Pull a bunch of fixes from the 4.4BSD-Lite2 branch. It's reallyjoerg1996-05-051-19/+44
| | | | | | | | | | | | surprising how many trivial errors there have been... :-) Some more cleanup is needed, but i'd like to separate the Lite2 changes from other work, that's why this goes into a different commit. People with serial printers should see whether i have broken the stty- style printcap options (i hope not). Inspired by: Sergey Shkonda <serg@bcs1.bcs.zaporizhzhe.ua>
* Remove definitions and declarations for FS, FC, XS, XC variables, andsef1996-04-031-4/+1
| | | | | | replace them with MS char* variable. Reviewed by: rgrimes, joerg
* Remove trailing whitespace.rgrimes1995-05-301-1/+1
|
* BSD 4.4 Lite usr.sbin Sourcesrgrimes1994-05-261-0/+352
OpenPOWER on IntegriCloud