aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/lpr/common_source
Commit message (Collapse)AuthorAgeFilesLines
* Remove residual blank line at start of MakefileWarner Losh2024-07-151-1/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* usr.sbin: Automated cleanup of cdefs and other formattingWarner Losh2023-11-275-15/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* usr.sbin: Remove ancient SCCS tags.Warner Losh2023-11-279-23/+0
| | | | | | | | Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script. Sponsored by: Netflix
* lpr: Remove now unused fallback definition for __FBSDIDJohn Baldwin2023-09-251-14/+0
| | | | | Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D41956
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-162-2/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-169-18/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Remove $FreeBSD$: one-line .h patternWarner Losh2023-08-165-5/+0
| | | | Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* lpr: Fix typosElyes Haouas2023-06-022-2/+2
| | | | | | Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/653
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-125-5/+5
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* lpr: Remove useless return at the end of void functionElyes Haouas2023-03-021-2/+0
| | | | | | Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/656
* lpr(1): Fix a typo in a source code commentGordon Bergling2021-11-191-1/+1
| | | | | | -s /debuging/debugging/ MFC after: 3 days
* Fix `clang -Wcast-qual` issuesEnji Cooper2019-05-041-14/+8
| | | | | | | | | | | | | | | | | Remove unnecessary `char*` casting for arguments passed to `cget*(3)`, and deconst `_PATH_PRINTCAP` before passing it to `cget*` via the `printcapdb` variable. This unblocks ^/projects/runtime-coverage-v2 from building cleanly on universe13a.freebsd.org. I suspect the issue was introduced through some changes to `bsd.*.mk` inclusion on the branch, which I will continue to investigate/isolate. MFC after: 1 week Tested with: clang 8 (arm64) Notes: svn path=/head/; revision=347075
* Fix the resource leak of a 'FILE *' which could happen in routineGarance A Drosehn2018-03-121-1/+3
| | | | | | | | | | ctl_readcf() if a call to malloc failed. PR: 204955 Reported by: David Binderman Notes: svn path=/head/; revision=330787
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-275-4/+14
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. 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. No functional change intended. Notes: svn path=/head/; revision=326276
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-206-6/+16
| | | | | | | | | | | | | | | | | 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
* spdx: initial adoption of licensing ID tags.Pedro F. Giffuni2017-11-183-3/+9
| | | | | | | | | | | | | | | | | | | | 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. Initially, only tag files that use BSD 4-Clause "Original" license. RelNotes: yes Differential Revision: https://reviews.freebsd.org/D13133 Notes: svn path=/head/; revision=325966
* lpr(1): small bounds check with reallocarray(3).Pedro F. Giffuni2017-03-071-4/+6
| | | | | | | | | | | | While here plug a memory leak upon error and postpose a multiplication until after reallocation has succeded. Hinted partially by: OpenBSD Reviewed by: gad MFC after: 2 weeks Notes: svn path=/head/; revision=314877
* Renumber copyright clause 4Warner Losh2017-02-286-6/+6
| | | | | | | | | | | | 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-104-8/+8
| | | | | | | | 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
* usr.sbin: minor spelling fixes on comments.Pedro F. Giffuni2016-05-011-1/+1
| | | | | | | No functional change. Notes: svn path=/head/; revision=298886
* lpr: replace 0 with NULL for pointers.Pedro F. Giffuni2016-04-105-10/+10
| | | | | | | | | Found with devel/coccinelle. Reviewed by: gad Notes: svn path=/head/; revision=297795
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+14
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge from headSimon J. Gerraty2013-09-052-8/+29
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=255263
| * Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * Sync from headSimon J. Gerraty2012-11-046-78/+88
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=242545
| * | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+17
| | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | Change the closeallfds() routine to use closefrom() when it isGarance A Drosehn2013-05-272-8/+29
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | available (closefrom() was added to FreeBSD in 8.0-release). The selection is made at compile-time, as I still compile a FreeBSD-based version of lpr&friends on other platforms. While testing I out that (at least on my system) lpd has been closing 11095 fd's, when there are only 6 fd's open. The old code took 120 times more clocktime than calling closefrom(). (although that was still less than 2/1000-ths of a second!) Reviewed by: jilles MFC after: 2 weeks Notes: svn path=/head/; revision=251044
* | Let lpr build with -Wmissing-variable-declarations.Ed Schouten2012-10-256-10/+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-226-64/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Make sure that arraysz is initialized to a value larger than zero.Jaakko Heinonen2012-07-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | arraysz could get initialized to zero on ZFS because ZFS reports directory sizes differently compared to UFS. PR: bin/169493 Tested by: swills MFC after: 2 weeks Notes: svn path=/head/; revision=238547
* | Remove trailing whitespace.Jaakko Heinonen2012-07-171-4/+4
|/ | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=238546
* Hide DIR definition by making it an opaque struct typedef.Gleb Kurtsou2012-05-191-1/+1
| | | | | | | | | | | | | Introduce dirfd() libc exported symbol replacing macro with same name, preserve _dirfd() macro for internal use. Replace dirp->dd_fd with dirfd() call. Avoid using dirfd as variable name to prevent shadowing global symbol. Sponsored by: Google Summer Of Code 2011 Notes: svn path=/head/; revision=235647
* Spelling fixes for usr.sbin/Ulrich Spörlein2011-12-301-4/+4
| | | | Notes: svn path=/head/; revision=228990
* - Fix the code that matches userids in match_jobspec(). It needs to checkGarance A Drosehn2011-04-133-11/+11
| | | | | | | | | | | | | the username-for-accounting field (P), not the username-for-headerpage (L). These are usually the same value, except that control files do not have the username-for-headerpage field if the user has requested no header page. - Also rename the cji_username field to cji_headruser, to make it clear that the value should only be used for the header page. (aka banner page) MFC after: 3 weeks Notes: svn path=/head/; revision=220586
* Remove the advertising clause from UCB copyrighted files in usr.sbin. ThisJoel Dahl2010-12-116-24/+2
| | | | | | | | 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-042-2/+2
| | | | | | | | | | | | | | | | | | | | | | | 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
* The last big commit: let usr.sbin/ use WARNS=6 by default.Ed Schouten2010-01-021-0/+2
| | | | Notes: svn path=/head/; revision=201390
* Fix end-of-line issues that can come up when `lpq' reads informationGarance A Drosehn2009-06-241-1/+102
| | | | | | | | | | | | | | | | | about a queue from a remote host. That remote host may use \r, \r\n, or \n\r as the line-ending character. In some cases the remote host will write a single line of information without *any* EOL sequence. Translate all the non-unix EOL's to the standard newline, and make sure the final line includes a terminating newline. Logic is also added to translate all unprintable characters to '?', but that is #if-ed out for now. PR: bin/104731 MFC after: 3 weeks Notes: svn path=/head/; revision=194859
* NI_WITHSCOPEID cleanupHajimu UMEMOTO2005-05-131-2/+2
| | | | | | | Reviewed by: gad Notes: svn path=/head/; revision=146188
* Fix so all parts of lpd, lpc, lpq, and lprm will use the same algorithmGarance A Drosehn2004-12-315-37/+79
| | | | | | | | | | | | | | | | | | | | 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
* Do more extensive checking of the userid field which is read in from theGarance A Drosehn2004-12-311-7/+46
| | | | | | | | | | | | | | | | | | | control-file for each print job. This is partially because the previous checks still let through some characters which would cause trouble for other applications which try to process the resulting userid -- such as accounting programs. But the main reason is to handle the case where some remote host sends a print job where the given userid is an uppercase-version of the real userid. For that case, lpd will now check for uppercase letters in the userid. If there are any, it will check to see if the given userid (with the uppercase letters) is a valid one. If it is *not* valid, then lpd will change the userid to all-lowercase right when the job is received. MFC after: 2 weeks Notes: svn path=/head/; revision=139462
* For variables that are only checked with defined(), don't provideRuslan Ermilov2004-10-241-1/+1
| | | | | | | any fake value. Notes: svn path=/head/; revision=136910
* Fix a warning about mismatched pointers. A pointer to "void *" is not thePeter Wemm2003-10-261-1/+1
| | | | | | | same as a pointer to "char *". Tell the compiler this is ok. Notes: svn path=/head/; revision=121525
* Remove a 'From:' that snuck into an sccsid comment line as part of -v1.3Garance A Drosehn2003-08-011-1/+1
| | | | Notes: svn path=/head/; revision=118288
* Get the 'sccsid' lines even closer to correct style(9) form. TheGarance A Drosehn2003-07-145-0/+13
| | | | | | | | | | | '#ifdef lint/#endif' around the lines should not have been removed. Also add blank lines where one (per file) was missing. Reviewed by: First part noticed by bde, blank lines noticed by me MFC after: 15 days Notes: svn path=/head/; revision=117592
* Get the 'sccsid' for this to match the original lines you wouldGarance A Drosehn2003-07-141-2/+6
| | | | | | | | | | | get from '-r CSRG', instead of having that sccsid as a comment. (this is the sccsid from 1996 -- there have been many changes to printcap.c since then!) MFC after: 15 days Notes: svn path=/head/; revision=117590
* Take advantage of the common_source/lp.cdefs.h file to change lprGarance A Drosehn2003-07-1412-42/+26
| | | | | | | | | | | 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