summaryrefslogtreecommitdiff
path: root/usr.sbin/lpr/common_source
Commit message (Collapse)AuthorAgeFilesLines
* The printf type checking in gcc wants %qd to be a long long, so addJohn Birrell1998-05-131-2/+2
| | | | | | | a cast in case off_t is not a long long (as on alpha). Notes: svn path=/head/; revision=35998
* Make -Werror i386 specific because -nostinc on alpha spits warningsJohn Birrell1998-05-131-2/+5
| | | | | | | for unused static inline functions in header files. Notes: svn path=/head/; revision=35997
* Fix top-of-form bogon.Garrett Wollman1997-12-271-2/+2
| | | | Notes: svn path=/head/; revision=32031
* Mega lpd/lpd upgrade, part I:Garrett Wollman1997-12-0211-394/+1210
| | | | | | | | | | | | | | | | | | - 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... Notes: svn path=/head/; revision=31492
* Argl! Who's got the pointy hat these days? Hand it over to me, ASAP!Joerg Wunsch1997-11-071-0/+1
| | | | | | | | When setting an alarm that didn't trigger, i gotta clear it again before going on. Hmpf! Notes: svn path=/head/; revision=31020
* One could be surprised how much bugs can still be found here...Joerg Wunsch1997-10-151-2/+3
| | | | | | | | | | | | | | | Properlay clean the global RM variable if cgetstr() failed for it. Otherwise, a connection attempt to a remote machine was made (and a bogus result code printed) if a local printer followed a remote one in printcap, and you did a `lpq -a', since checkremote() falsely assumed the printer to be a remote one. While i was at it, removed a gratuituous newline printed in front of the remote machine's name, thus making the output more consistent (and better machine-parseable) now. Notes: svn path=/head/; revision=30437
* Improve my hack from rev 1.6 of displayq.c, and make the TCPJoerg Wunsch1997-10-145-2/+20
| | | | | | | | | | | 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? Notes: svn path=/head/; revision=30407
* Be more paranoid about unlinking files. From mhpower@MIT.EDU by way ofWarner Losh1997-10-061-4/+6
| | | | | | | | | | Theo de Raadt. Likely 2.2.5R candidate. Obtained from: OpenBSD Notes: svn path=/head/; revision=30143
* Use err(3). Add usage(). Various fixes in man pages.Philippe Charnier1997-09-243-18/+21
| | | | Notes: svn path=/head/; revision=29780
* common_source: staticize private version of warn() so to not conflictJoerg Wunsch1997-08-232-2/+2
| | | | | | | | | | | | with libc's version. lpd: use getopt(3), err(3), add usage(), allow specification of a port # on the command line as the documentation suggested for more than 10 years. PR: docs/3290 Notes: svn path=/head/; revision=28621
* Two minor, pedantic fixes from bde for my last pedantic fixes, plusWarner Losh1997-07-295-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=27757
* Fix boatloads of buffer overflows from the OpenBSD tree.Warner Losh1997-07-294-16/+23
| | | | | | | | Be pedantic about always using sizeof(blah) vs sizeof (blah) or sizeof blah. Obtained from:OpenBSD Notes: svn path=/head/; revision=27748
* index -> strchr and rindex -> strrchr to reduce the number of gratuitousWarner Losh1997-07-231-1/+1
| | | | | | | | | diffes with NetBSD/OpenBSD. These changes seem to predate the NetBSD/OpenBSD split, so it is hard to give proper credit for them. Obtained from: OpenBSD. Notes: svn path=/head/; revision=27635
* Use setuid/seteuid around dangerous operations. Also a few bufferWarner Losh1997-07-234-12/+78
| | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=27618
* Add code to make sure that we don't overflow the buffer that we copyWarner Losh1997-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. Notes: svn path=/head/; revision=27511
* Fix a problem where remote files could be removed by exploiting raceWarner Losh1997-07-181-0/+2
| | | | | | | | conditions similar to those reported in CERT's CA-91:10a advisory. Obtained from: Hiroshi NAKANO <nakano@rins.ryukoku.ac.jp> by way of CERT. Notes: svn path=/head/; revision=27509
* Increase size of tmp hostname buffer.Poul-Henning Kamp1997-07-161-2/+2
| | | | | | | | | PR: 3889 Reviewed by: phk Submitted by: Yujiro MIYATA <miyata@bioele.nuee.nagoya-u.ac.jp> Notes: svn path=/head/; revision=27448
* Imply a 10-second connection timeout when querying remote queues, toJoerg Wunsch1997-06-231-0/+13
| | | | | | | | prevent lpq from hanging indefinately (well, 10 minutes are for sure counting as `indefinately' in this case). Notes: svn path=/head/; revision=26844
* Buffer overflow from OpenBSD:Warner Losh1997-02-091-5/+8
| | | | | | | | | | | | | Rev 1.4 deraadt: (partial from full commit, other files not done yet) proactive bounds checking; help from millert Rev 1.5 millert: Possible buf oflow. Plus minor style nits to keep the style police happy (I hope) Obtained from: OpenBSD Notes: svn path=/head/; revision=22466
* lpc/cmds.c:Warner Losh1996-10-271-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From NetBSD via OpenBSD to fix NetBSD PR #506 More descriptive message for printer status (OpenBSD: 1.2) Various warnings cleaned up (OpenBSD: 1.4) lpc/lpc.c: Various warnings cleaned up (OpenBSD: 1.3) lpd/lpd.c: Remove trailing blank lines (OpenBSD: 1.2) Potential umask problem with creating /dev/printer (OpenBSD: 1.4 and 1.5) Ftp bounce attack (untested on FreeBSD) (OpenBSD: 1.6, 1.8, 1.9) Fencepost in strncpy (OpenBSD: 1.6) lpd/printjob.c: Fix from freebsd for waiting for an exiting filter, that appears not in the FreeBSD CVS tree. (OpenBSD: 1.6) lpd/recvjob.c: Buffer overflow protection: use strncpy rather than strcpy. (OpenBSD: 1.3) lpr/lpr.c: NetBSD change of return type for main() (OpenBSD: 1.2) Restrict time running as root (OpenBSD: 1.7) Use getcwd rather than getwd (from NetBSD) Use snprintf rather than sprintf (OpenBSD: 1.8) Minor tweak to end of loop and buffer overflow sanity. card() overflow already in FreeBSD (OpenBSD: 1.9) lptest/lptest.c: void -> int return type of main, from NetBSD via OpenBSD (OpenBSD: 1.2) pac/pac.c: void -> int return type of main, from NetBSD via OpenBSD (OpenBSD: 1.3) Obtained from: OpenBSD Notes: svn path=/head/; revision=19202
* Cleanup.Joerg Wunsch1996-05-098-1032/+9
| | | | | | | | | | | | The removed files are no longer needed, they are actually labelled as ``Use only if you are not 4.4BSD''. (Yeah, the ol' crufty printcap.c is really gone!) Properly declare all external objects in files ending in .h, as opposed to embed them into files ending in .c. Notes: svn path=/head/; revision=15703
* Pull a bunch of fixes from the 4.4BSD-Lite2 branch. It's reallyJoerg Wunsch1996-05-055-39/+66
| | | | | | | | | | | | | | | 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> Notes: svn path=/head/; revision=15648
* Fix my botched 4.4Lite2 import, and revert these files to their HEADJoerg Wunsch1996-05-052-17/+16
| | | | | | | versions. Notes: svn path=/head/; revision=15646
* This commit was generated by cvs2svn to compensate for changes in r15637,Joerg Wunsch1996-05-055-28/+589
|\ | | | | | | | | | | | | which included commits to RCS files with non-trunk default branches. Notes: svn path=/head/; revision=15638
| * Vendor-branch import of the 4.4BSD-Lite2 code for lpr. There areJoerg Wunsch1996-05-057-0/+2311
| | | | | | | | | | | several bugfixes in it that are worth considering. Don't be alarmed about the import conflicts... Obtained from: 4.4BSD-Lite2 Notes: svn path=/vendor/CSRG/dist/; revision=15637
* Remove definitions and declarations for FS, FC, XS, XC variables, andSean Eric Fagan1996-04-032-8/+2
| | | | | | | | | replace them with MS char* variable. Reviewed by: rgrimes, joerg Notes: svn path=/head/; revision=15031
* Remove trailing whitespace.Rodney W. Grimes1995-05-302-2/+2
| | | | Notes: svn path=/head/; revision=8857
* BSD 4.4 Lite usr.sbin SourcesRodney W. Grimes1994-05-269-0/+2320
Notes: svn path=/cvs2svn/branches/WIN_TUE_NL/; revision=1553