aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/lpr/common_source/lp.h
Commit message (Collapse)AuthorAgeFilesLines
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-1/+3
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* Renumber copyright clause 4Warner Losh2017-02-281-1/+1
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Rename getline with get_line to avoid collision with getline(3)Baptiste Daroussin2016-05-101-1/+1
| | | | | | | | When getline(3) in 2009 was added a _WITH_GETLINE guard has also been added. This rename is made in preparation for the removal of this guard Notes: svn path=/head/; revision=299357
* Let lpr build with -Wmissing-variable-declarations.Ed Schouten2012-10-251-0/+3
| | | | | | | | | Mark variables static where possible and place the uid/euid variables in lp.h, so that we can compile-time enforce that these variables have the same type. Notes: svn path=/head/; revision=242091
* PRIV_START and PRIV_END were reversed.Eitan Adler2012-10-241-2/+2
| | | | | | | | | Submitted by: KAHO Toshikazu <kaho@elam.kais.kyoto-u.ac.jp> Approved by: secteam (simon) MFC after: 3 days Notes: svn path=/head/; revision=242005
* Check the return error of set[ug]id. While this can never fail in theEitan Adler2012-10-221-0/+11
| | | | | | | | | | | | | | | | | current version of FreeBSD, this isn't guarenteed by the API. Custom security modules, or future implementations of the setuid and setgid may fail. PR: bin/172289 PR: bin/172290 PR: bin/172291 Submittud by: Erik Cederstrand <erik@cederstrand.dk> Discussed by: freebsd-security Approved by: cperciva MFC after: 1 week Notes: svn path=/head/; revision=241852
* Remove the advertising clause from UCB copyrighted files in usr.sbin. ThisJoel Dahl2010-12-111-4/+0
| | | | | | | | is in accordance with the information provided at ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change Notes: svn path=/head/; revision=216372
* Modernize scandir(3) and alphasort(3) interfaces according to the IEEEKonstantin Belousov2010-01-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Std 1003.1-2008. Both Linux and Solaris conforms to the new definitions, so we better follow too (older glibc used old BSDish alphasort prototype and corresponding type of the comparision function for scandir). While there, change the definitions of the functions to ANSI C and fix several style issues nearby. Remove requirement for "sys/types.h" include for functions from manpage. POSIX also requires that alphasort(3) sorts as if strcoll(3) was used, but leave the strcmp(3) call in the function for now. Adapt in-tree callers of scandir(3) to new declaration. The fact that select_sections() from catman(1) could modify supplied struct dirent is a bug. PR: standards/142255 MFC after: 2 weeks Notes: svn path=/head/; revision=201512
* Fix so all parts of lpd, lpc, lpq, and lprm will use the same algorithmGarance A Drosehn2004-12-311-1/+1
| | | | | | | | | | | | | | | | | | | | for calculating the job number for a job based on the control-file name. We might receive cf-files named by other implementations of lpr, where the job number shown by lpq would not match the job number that other commands expected for the same name. This also uses a newer algorithm for determining a job number, to avoid problems caused when a control-file is named using an IP address, instead of the hostname. This also moved the declaration if isowner() from lp.h to rmjob.c. When I went to change the parameters, I noticed that rmjob.c was the only source file which uses it. MFC after: 2 weeks Notes: svn path=/head/; revision=139464
* Take advantage of the common_source/lp.cdefs.h file to change lprGarance A Drosehn2003-07-141-1/+1
| | | | | | | | | | | source to use __FBSDID() for setting rcsids. Also fix the format of 'sccsid' lines to consistently match style(9) guidelines. Reviewed by: discussed with bde and obrien MFC after: 15 days Notes: svn path=/head/; revision=117541
* Add a SQS_QCHANGED option to set_qstate(). This will soon be used by 'lpc'.Garance A Drosehn2002-07-121-0/+1
| | | | | | | | Reviewed by: freebsd-print@bostonradio.org MFC after: 3 days Notes: svn path=/head/; revision=99844
* Add two variables to struct jobqueue, and change the way that getq()Garance A Drosehn2002-07-121-0/+4
| | | | | | | | | | calculates how much space to get for that struct, so it will get the right amount when new variables are added. MFC after: 3 days Notes: svn path=/head/; revision=99842
* Almost complete rewrite of the lpc commands 'abort', 'enable', 'disable',Garance A Drosehn2002-06-131-0/+18
| | | | | | | | | | | | | | | | | | | | 'restart', 'start', 'stop' and 'up'. These are commands which mainly just alter the access bits on the lock-file of a queue, and they all now use a central routine to do that. This reduces the amount of code that is run as the priv userid, and eliminates a number of cases where error messages were written while that priv uid was in effect. As far as users are concerned, there should be no noticable difference in the new versions. In case there *is*, the previous implementations are still there as 'xabort', 'xenable', etc, so they are available for instant fallback. If no one reports a problem after a few weeks, then a later update will remove those x-commands. Reviewed by: freebsd-audit and freebsd-print@bostonradio.org MFC after: 10 days Notes: svn path=/head/; revision=98152
* Implement new printcap option of "rc" aka "remote.resend_copies".Garance A Drosehn2002-04-231-0/+1
| | | | | | | | | | | | | | | This is a boolean option, and if it is specified in a print queue for a remote host, it causes lpd to resend the data file for each copy the user requested on 'lpr -#n'. This is useful for network printers which accept lpd-style jobs, but which ignore the control file (and thus they ignore any request for multiple copies). PR: 25635 Reviewed by: short review on freebsd-audit MFC after: 6 days Notes: svn path=/head/; revision=95293
* Replace three subtly-wrong calls to strncpy with calls to strlcpy, andGarance A Drosehn2001-07-151-1/+1
| | | | | | | | | use (size_t) in a few places to avoid compile-time warnings on alpha. MFC after: 1 week Notes: svn path=/head/; revision=79740
* Fix most of the warnings generated by compiling lpr with -Wnon-const-format,Garance A Drosehn2001-07-151-1/+2
| | | | | | | | | | | | often by just telling gcc that some internal routine is "__printflike" (work done by Kris Kennaway <kris@FreeBSD.org>). Also fix the new warnings which show up once gcc starts checking the "printf-like parameters" passed to those routines. MFC after: 1 week Notes: svn path=/head/; revision=79739
* Rename a few global variables which hold hostname-related values to beGarance A Drosehn2001-06-151-4/+18
| | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=78300
* Rename global variable 'name' to 'progname', thus fixing a number ofGarance A Drosehn2001-06-151-1/+1
| | | | | | | | | | | 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 Notes: svn path=/head/; revision=78280
* Fix about 90-100 warnings one gets when trying to compile lpr&friendsGarance A Drosehn2001-06-121-44/+44
| | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=78146
* IPv6 support for lpr.Hajimu UMEMOTO2000-12-161-2/+3
| | | | | | | | Reviewed by: freebsd-current (no objection) Obtained from: KAME Notes: svn path=/head/; revision=70098
* Cosmetic change of a structure name.Garance A Drosehn2000-11-061-4/+4
| | | | | | | | | | Turn 'struct queue { q_time, q_name }' (loosely-speaking) into 'struct jobqueue { job_time, job_cfname }' Reviewed by: GAWollman Notes: svn path=/head/; revision=68401
* Implement new printcap options of sr= (aka stat.recv) and sr= (aka stat.send)Garance A Drosehn2000-11-021-0/+33
| | | | | | | | | | | 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 Notes: svn path=/head/; revision=68253
* Back out the previous change to the queue(3) interface.Jake Burkholder2000-05-261-6/+6
| | | | | | | | | It was not discussed and should probably not happen. Requested by: msmith and others Notes: svn path=/head/; revision=60938
* Change the way that the queue(3) structures are declared; don't assume thatJake Burkholder2000-05-231-6/+6
| | | | | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd Notes: svn path=/head/; revision=60833
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50479
* lpd tries to be clever and checks if RM == my_hostname.Jordan K. Hubbard1999-04-271-1/+2
| | | | | | | | | | | | However, it doesn't check if the remote printer name it is sending it to is the same as the local printer name, and so chokes 'cos "laser" is not a real printer. PR: 7081 Submitted by: David Malone <dwmalone@maths.tcd.ie> Notes: svn path=/head/; revision=46110
* Mega lpd/lpd upgrade, part I:Garrett Wollman1997-12-021-58/+158
| | | | | | | | | | | | | | | | | | - 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
* Improve my hack from rev 1.6 of displayq.c, and make the TCPJoerg Wunsch1997-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? Notes: svn path=/head/; revision=30407
* common_source: staticize private version of warn() so to not conflictJoerg Wunsch1997-08-231-1/+0
| | | | | | | | | | | | 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
* Cleanup.Joerg Wunsch1996-05-091-0/+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-051-3/+4
| | | | | | | | | | | | | | | 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
* Remove definitions and declarations for FS, FC, XS, XC variables, andSean Eric Fagan1996-04-031-4/+1
| | | | | | | | | replace them with MS char* variable. Reviewed by: rgrimes, joerg Notes: svn path=/head/; revision=15031
* BSD 4.4 Lite usr.sbin SourcesRodney W. Grimes1994-05-261-0/+126
Notes: svn path=/cvs2svn/branches/WIN_TUE_NL/; revision=1553