aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/lpr/lpd
Commit message (Collapse)AuthorAgeFilesLines
* lpd: Add timeout optionDag-Erling Smørgrav2026-02-262-12/+26
| | | | | | | | | Set a 120-second receive timeout on all client connections, and add a command-line option to change that value. MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D55400
* lpd: Improve robustnessDag-Erling Smørgrav2026-02-261-102/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Check for integer overflow when receiving file sizes. * Check for buffer overflow when receiving file names, and fully validate the names. * Check for integer overflow when checking for available disk space. * Check for I/O errors when sending status codes. * Enforce one job per connection and one control file per job (see code comments for additional details). * Simplify readfile(), avoiding constructs vulnerable to integer overflow. * Don't delete files we didn't create. * Rename read_number() to read_minfree() since that's all it's used for, and move all the minfree logic into it. * Fix a few style issues. PR: 293278 MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D55399
* lpr: Add deprecation noticeDag-Erling Smørgrav2026-02-211-0/+3
| | | | | | | | | These programs require elevated privileges to work and have not seen regular maintenance in decades. Unless someone steps up and overhauls them, we will have to remove them before 16.0. Better-maintained alternatives are available in ports (print/cups, sysutils/LPRng). MFC after: 3 days
* lpd: Tighten permissions on /var/run/printerStanislav Shalunov2024-10-111-1/+1
| | | | | | | | | | Exclude group read/write permissions as well. Otherwise, group wheel can submit things w/o the normal accounting. While group wheel is generally trusted on the machine, submitting jobs w/o checks is not one of the functions we document for that group. PR: 17289 Differential Revision: https://reviews.freebsd.org/D47040
* 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
* package: move lpr into its own packageLexi Winter2024-04-191-0/+1
| | | | | Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1171
* usr.sbin: Automated cleanup of cdefs and other formattingWarner Losh2023-11-272-6/+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
* Remove copyright strings ifdef'd outWarner Losh2023-11-273-27/+0
| | | | | | | | | | | We've ifdef'd out the copyright strings for some time now. Go ahead and remove the ifdefs. Plus whatever other detritis was left over from other recent removals. These copyright strings are present in the comments and are largely from CSRG's attempt at adding their copyright to every binary file (which modern interpretations of the license doesn't require). Sponsored by: Netflix
* usr.sbin: Remove ancient SCCS tags.Warner Losh2023-11-279-21/+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
* Remove $FreeBSD$: one-line nroff patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-164-4/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-165-10/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Remove $FreeBSD$: one-line .h patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-191-1/+0
|
* lpr: Remove trailing semicolonElyes Haouas2023-03-151-1/+1
| | | | | | Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/654
* Indicate that xrefs to *roff,tbl,eqn et al are found in ports/textproc/groff.Jens Schweikhardt2022-08-151-1/+1
|
* sys/*/conf/*, docs: fix links to handbookCeri Davies2021-05-201-1/+1
| | | | | | | | | | | | While here, fix all links to older en_US.ISO8859-1 documentation in the src/ tree. PR: 255026 Reported by: Michael Büker <freebsd@michael-bueker.de> Reviewed by: dbaio Approved by: blackend (mentor), re (gjb) MFC after: 10 days Differential Revision: https://reviews.freebsd.org/D30265
* lpd: Update SYNOPSIS with new flagChris Rees2021-04-151-1/+1
| | | | Reported by: 0mp
* lpd.8: Chase Dd-- took old value when mergingChris Rees2021-04-151-1/+1
|
* lpd: Add -F flag to prevent daemonizingChris Rees2021-04-152-7/+26
| | | | | | | | | This is necessary for use with supervision, e.g. runit. I chose -F simply because that is what the folks at LPRng use. Approved by: pfg, gad, ngie Differential Revision: https://reviews.freebsd.org/D29566
* lpd(8): Mention the author of a paper in the SEE ALSO sectionGordon Bergling2021-04-091-1/+3
| | | | | Obtained from: OpenBSD MFC after: 1 week
* 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
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-206-5/+17
| | | | | | | | | | | | | | | | | 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
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Simplify idioms in usr.sbin/lpr MakefilesEnji Cooper2017-03-011-1/+1
| | | | | | | | | | 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-287-7/+7
| | | | | | | | | | | | 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-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
* usr.sbin: minor spelling fixes on comments.Pedro F. Giffuni2016-05-011-2/+2
| | | | | | | 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-101-3/+3
| | | | | | | | | Found with devel/coccinelle. Reviewed by: gad Notes: svn path=/head/; revision=297795
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+20
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 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 sync of headSimon J. Gerraty2015-05-271-2/+1
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * Merge from head@274682Simon J. Gerraty2014-11-192-3/+1
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=274683
| * \ Merge head from 7/28Simon J. Gerraty2014-08-191-0/+2
| |\ \ | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=270164
| * | | Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * | | Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * | | Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * | | Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * | | Sync from headSimon J. Gerraty2012-11-042-3/+4
| |\ \ \ | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=242545
| * | | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | | | Convert usr.sbin to LIBADDBaptiste Daroussin2014-11-251-2/+1
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | 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-191-2/+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
* | | In preparation for ASLR [1] support add WITH_PIE to support building with -fPIE.Bryan Drewery2014-06-081-0/+2
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Check the return error of set[ug]id. While this can never fail in theEitan Adler2012-10-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 unused valuesKevin Lo2012-09-111-1/+1
| | | | | | | | Notes: svn path=/head/; revision=240351
* | Correct description of minfree to kilobytes rather than blocks.Warren Block2012-08-131-1/+1
|/ | | | | | | | | PR: 125921 Submitted by: Andre Albsmeier <Andre.Albsmeier@siemens.com> MFC after: 3 days Notes: svn path=/head/; revision=239233
* Spelling fixes for usr.sbin/Ulrich Spörlein2011-12-301-2/+2
| | | | Notes: svn path=/head/; revision=228990
* In usr.sbin/lpr/lpd/printjob.c, use the correct printf length modifiersDimitry Andric2011-12-171-2/+4
| | | | | | | | | for off_t (aka int64_t). MFC after: 1 week Notes: svn path=/head/; revision=228664