aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/lpr
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Move hosts.lpd and printcap to usr.sbin/lpr/lpd/Brad Davis2018-09-203-0/+59
| | | | | | | | | | This leverages CONFS to handle the install Approved by: re (blanket, pkgbase), bapt (mentor) Differential Revision: https://reviews.freebsd.org/D17238 Notes: svn path=/head/; revision=338822
* 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-2711-9/+31
| | | | | | | | | | | | | | | | | 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-2022-21/+63
| | | | | | | | | | | | | | | | | 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-184-4/+12
| | | | | | | | | | | | | | | | | | | | 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
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-3111-11/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Quiesce clang warning while building lpc.Sean Bruno2017-06-161-1/+1
| | | | | | | | | | | | | | | | | | usr.sbin/lpr/lpc/lpc.c Warning passing 'char *[20]' to parameter of type 'const char **' discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers] Fix: Explicitly cast the variable "margv" to const char ** only for it's use as a parameter to suppress the error Submitted by: Aaron Prieger <aprieger@llnw.com> Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D11019 Notes: svn path=/head/; revision=320009
* Fixes to chkprintcap:Garance A Drosehn2017-03-202-2/+12
| | | | | | | | | | | | | | | | - Check the return from a call to malloc() in skim_printcap(), and return a NULL if that fails. - Fix a small memory leak in main() that happens if skim_printcap() returns an error, including the new error-return of NULL. Submitted by: Tom Rix <trix@juniper.net> Reviewed by: pfg, ngie MFC after: 4 weeks Sponsored by: Dell EMC Isilon, Juniper Differential Revision: D9954, D9982 Notes: svn path=/head/; revision=315655
* 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
* Simplify idioms in usr.sbin/lpr MakefilesEnji Cooper2017-03-0111-16/+16
| | | | | | | | | | Use :H instead of .CURDIR-relative pathing to simplify make output, etc. MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=314475
* Renumber copyright clause 4Warner Losh2017-02-2830-30/+30
| | | | | | | | | | | | 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-105-10/+10
| | | | | | | | 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
* Rename getline with get_line to avoid collision with getline(3)Baptiste Daroussin2016-05-101-6/+6
| | | | | | | | 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=299356
* Use MIN macro from sys/param.h.Marcelo Araujo2016-05-021-1/+1
| | | | | | | MFC after: 2 weeks. Notes: svn path=/head/; revision=298910
* usr.sbin: minor spelling fixes on comments.Pedro F. Giffuni2016-05-012-3/+3
| | | | | | | No functional change. Notes: svn path=/head/; revision=298886
* Remove a variable and three lines of code which I should have removed asGarance A Drosehn2016-04-251-5/+1
| | | | | | | | | | part of revision 98776 back on June 24/2002. Noticed by pfg@ trying coccinelle for checking code. MFC after: 3 weeks Notes: svn path=/head/; revision=298592
* lpr: replace 0 with NULL for pointers.Pedro F. Giffuni2016-04-108-23/+23
| | | | | | | | | Found with devel/coccinelle. Reviewed by: gad Notes: svn path=/head/; revision=297795
* Use LIBEXECDIR for /usr/libexec.Bryan Drewery2015-11-261-1/+1
| | | | | | | | MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=291348
* Add more SUBDIR_PARALLEL.Bryan Drewery2015-09-261-1/+3
| | | | | | | | MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=288266
* META_MODE: Remove DEP_MACHINE from Makefile.depend files.Bryan Drewery2015-09-251-2/+0
| | | | | | | | | This has not been needed since r246865 in projects/bmake. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=288228
* META_MODE: Remove DEP_RELDIR from Makefile.depend files.Bryan Drewery2015-09-251-2/+0
| | | | | | | | | This has not been needed since r284171 in projects/bmake. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=288226
* Add META_MODE support.Simon J. Gerraty2015-06-1314-0/+245
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0813-26/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge sync of headSimon J. Gerraty2015-05-279-19/+10
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * Merge from head@274682Simon J. Gerraty2014-11-198-15/+1
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=274683
| * \ Merge head from 7/28Simon J. Gerraty2014-08-199-4/+18
| |\ \ | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=270164
| * | | Updated dependenciesSimon J. Gerraty2014-05-1611-11/+0
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * | | Updated dependenciesSimon J. Gerraty2014-05-1011-0/+22
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * | | Merge from headSimon J. Gerraty2014-05-081-1/+1
| |\ \ \ | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265720
| * \ \ \ Merge headSimon J. Gerraty2014-04-284-3/+4
| |\ \ \ \ | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265044
| * \ \ \ \ Merge from headSimon J. Gerraty2013-09-052-8/+29
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=255263
| * | | | | | Updated dependenciesSimon J. Gerraty2013-03-1111-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * | | | | | Updated dependenciesSimon J. Gerraty2013-02-1613-26/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * | | | | | Sync from headSimon J. Gerraty2012-11-0415-147/+162
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=242545
| * | | | | | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-2214-0/+261
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | | | | | | Adjust printf format specifiers for dev_t and ino_t in user space.Gleb Kurtsou2014-12-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ino_t and dev_t are about to become uint64_t. Reviewed by: kib, mckusick Notes: svn path=/head/; revision=275855
* | | | | | | | Convert usr.sbin to LIBADDBaptiste Daroussin2014-11-258-17/+8
| |_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reduce overlinking Notes: svn path=/head/; revision=275054
* | | | | | | lpr: replace setpgrp(2) with setpgid(2).Pedro F. Giffuni2014-09-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | setpgid(2) is more portable than setpgrp(2). The BSD variant of setpgrp is a wrapper for setpgid(2) anyways. MFC after: 5 weeks Notes: svn path=/head/; revision=271789
* | | | | | | Revert r267233 for now. PIE support needs to be reworked.Bryan Drewery2014-08-197-14/+0
| |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. 50+% of NO_PIE use is fixed by adding -fPIC to INTERNALLIB and other build-only utility libraries. 2. Another 40% is fixed by generating _pic.a variants of various libraries. 3. Some of the NO_PIE use is a bit absurd as it is disabling PIE (and ASLR) where it never would work anyhow, such as csu or loader. This suggests there may be better ways of adding support to the tree. Many of these cases can be fixed such that -fPIE will work but there is really no reason to have it in those cases. 4. Some of the uses are working around hacks done to some Makefiles that are really building libraries but have been using bsd.prog.mk because the code is cleaner. Had they been using bsd.lib.mk then NO_PIE would not have been needed. We likely do want to enable PIE by default (opt-out) for non-tree consumers (such as ports). For in-tree though we probably want to only enable PIE (opt-in) for common attack targets such as remote service daemons and setuid utilities. This is also a great performance compromise since ASLR is expected to reduce performance. As such it does not make sense to enable it in all utilities such as ls(1) that have little benefit to having it enabled. Reported by: kib Notes: svn path=/head/; revision=270168
* | | | | | Replace all uses of libncurses and libtermcap with their wide characterBrooks Davis2014-07-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | variants. This allows usable file system images (i.e. those with both a shell and an editor) to be created with only one copy of the curses library. Exp-run: antoine PR: 189842 Discussed with: bapt Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=268804
* | | | | | use .Mt to mark up email addresses consistently (part2)Baptiste Daroussin2014-06-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR: 191174 Submitted by: Franco Fichtner <franco@lastsummer.de> Notes: svn path=/head/; revision=267668
* | | | | | In preparation for ASLR [1] support add WITH_PIE to support building with -fPIE.Bryan Drewery2014-06-087-0/+14
| |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is currently an opt-in build flag. Once ASLR support is ready and stable it should changed to opt-out and be enabled by default along with ASLR. Each application Makefile uses opt-out to ensure that ASLR will be enabled by default in new directories when the system is compiled with PIE/ASLR. [2] Mark known build failures as NO_PIE for now. The only known runtime failure was rtld. [1] http://www.bsdcan.org/2014/schedule/events/452.en.html Submitted by: Shawn Webb <lattera@gmail.com> Discussed between: des@ and Shawn Webb [2] Notes: svn path=/head/; revision=267233
* | | | | Use src.opts.mk in preference to bsd.own.mk except where we need stuffWarner Losh2014-05-061-1/+1
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | from the latter. Notes: svn path=/head/; revision=265420
* | | | NO_MAN= has been deprecated in favor of MAN= for some time, go aheadWarner Losh2014-04-133-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and finish the job. ncurses is now the only Makefile in the tree that uses it since it wasn't a simple mechanical change, and will be addressed in a future commit. Notes: svn path=/head/; revision=264400
* | | | Add missing description of du (daemon.user) printcap capability.David Malone2014-03-041-0/+1
| |_|/ |/| | | | | | | | Notes: svn path=/head/; revision=262742
* | | 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-257-21/+14
| | | | | | | | | | | | | | | | | | 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-2213-118/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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