aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/lam/lam.c
Commit message (Collapse)AuthorAgeFilesLines
* lam: fail on I/O errorsCosimo Cecchi2024-06-061-0/+4
| | | | | | | | | | | I/O errors should be reported; however lam currently does not disambiguate between EOF because end-of-file was reached and EOF because an I/O error occurred. This commit changes lam to exit with EX_IOERR when an I/O error occurs. Reviewed by: imp, allanjude Sponsored by: Apple Inc. Differential Revision: https://reviews.freebsd.org/D45437
* Remove copyright strings ifdef'd outWarner Losh2023-11-271-9/+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.bin: Remove ancient SCCS tags.Warner Losh2023-11-271-3/+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 .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* capsicum: use a new capsicum helpers in toolsMariusz Zaborski2018-11-041-2/+1
| | | | | | | Use caph_{rights,ioctls,fcntls}_limit to simplify the code. Notes: svn path=/head/; revision=340138
* Convert `cap_enter() < 0 && errno != ENOSYS` to `caph_enter() < 0`.Mariusz Zaborski2018-06-191-1/+1
| | | | | | | No functional change intended. Notes: svn path=/head/; revision=335395
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-0/+2
| | | | | | | | | | | | | | | | | 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
* Do not die on system built without CAPSICUMBaptiste Daroussin2017-03-151-1/+2
| | | | Notes: svn path=/head/; revision=315309
* 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
* Better fix for r314098Baptiste Daroussin2017-02-221-1/+2
| | | | | | | | | | | | | | | | | The actual issue was the fact that if - was used then some restriction were already set to stdin when we were applying caph_limit_stdio which was failing due to the fact the fd was the fd was already restricted to lower rights. Restricting stdio before actually opening the files prevent trying to raise the right and fixes the issue. And this allows to keep failing the program if restriction failed Approved by: allanjude Differential Revision: https://reviews.freebsd.org/D9723 Notes: svn path=/head/; revision=314099
* lam(1): Failing to restrict stdin/stdout/stderr should not be fatalAllan Jude2017-02-221-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | When fed from a pipe, lam(1) would sometimes fail: lam: unable to limit stdio: Capabilities insufficient fixed regression in portsnap(8) introduced in r313938 This broke portsnap(8), the app that the capsicumization of lam(1) was meant to secure. # portsnap fetch update Looking up portsnap.FreeBSD.org mirrors... 6 mirrors found. Fetching snapshot tag from ec2-eu-west-1.portsnap.freebsd.org... done. Fetching snapshot metadata... done. Updating from Tue Feb 21 16:05:39 MSK 2017 to Tue Feb 21 16:59:30 MSK 2017. Fetching 5 metadata patches.lam: unable to limit stdio: Capabilities insufficient done. Applying metadata patches... done. Fetching 5 metadata files... lam: unable to limit stdio: Capabilities insufficient /usr/sbin/portsnap: cannot open 8c94d2c3f8fcea20eb1fd82021566c99c63a010e6b3702ee11e7a491795bcfb8.gz: No such file or directory metadata is corrupt. Reported by: Vladimir Zakharov <zakharov.vv@gmail.com>, Ben Woods <woodsb02@gmail.com> Notes: svn path=/head/; revision=314098
* Capsicum-ize lam(1)Allan Jude2017-02-191-0/+20
| | | | | | | | | | | lam(1) is used in portsnap(8), so lock it down Reviewed by: emaste, cem, jonathan Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D8076 Notes: svn path=/head/; revision=313938
* Mark global functions and/or variables in lam(1) static where possible.Ed Schouten2011-11-061-5/+5
| | | | | | | This allows compilers and static analyzers to more thorough analysis. Notes: svn path=/head/; revision=227240
* Remove the advertising clause from UCB copyrighted files in usr.bin. 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 Also add $FreeBSD$ to a few files to keep svn happy. Discussed with: imp, rwatson Notes: svn path=/head/; revision=216370
* ANSIfy various tools in usr.bin/.Ed Schouten2010-01-021-1/+1
| | | | | | | | Most of these tools properly build at WARNS=6, except for their K&R function declarations. Fix this, so we can bump WARNS as well. Notes: svn path=/head/; revision=201382
* Call usage() instead of being insolent.Juli Mallett2005-08-051-5/+4
| | | | Notes: svn path=/head/; revision=148713
* Avoid passing negative values to tolower() on machines with signed chars.Tim J. Robbins2004-07-191-1/+1
| | | | Notes: svn path=/head/; revision=132404
* Back out my minorly disputed and possibly not well thought out changes to howJuli Mallett2002-07-011-7/+7
| | | | | | | arguments are processed, at least temporarily. Notes: svn path=/head/; revision=99221
* Consistently use FBSDIDDavid E. O'Brien2002-06-301-2/+2
| | | | Notes: svn path=/head/; revision=99112
* Increment morefiles, balance braces. This should really be using getopt(3).Juli Mallett2002-06-271-2/+3
| | | | Notes: svn path=/head/; revision=98934
* Instead of not using argc and doing other great evil, check for no argumentsJuli Mallett2002-06-271-5/+6
| | | | | | | | in main() and print usage, or if there are too many arguments, handle that there, too. Notes: svn path=/head/; revision=98933
* Constify, staticize, and set WARNS=2.Mike Barcroft2001-08-061-9/+9
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=81222
* Fix style(9) bugs from previous commit: remove space after functionMike Heffner2001-02-081-6/+6
| | | | | | | | | names and revert to char *[]. bde by: bde, imp Notes: svn path=/head/; revision=72178
* De-__P()-ify, convert K&R style declarations to ANSI onesMike Heffner2001-02-081-13/+8
| | | | Notes: svn path=/head/; revision=72153
* Prevent string overflows by using safer string functionsMike Heffner2001-02-081-21/+27
| | | | | | | | | | | | Use tolower() rather than bit or-ing Sanity check user specified printf() format Exit when too many input files are given Remove register from variables Reviewed by: markm, imp Notes: svn path=/head/; revision=72152
* Don't call err() with no format string.Kris Kennaway2000-07-101-1/+1
| | | | Notes: svn path=/head/; revision=62894
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Use err(3) instead of local redefintion. Add usage() as a separatePhilippe Charnier1997-07-181-24/+19
| | | | | | | function. Rewrote man page in mdoc format. Notes: svn path=/head/; revision=27497
* BSD 4.4 Lite Usr.bin SourcesRodney W. Grimes1994-05-271-0/+233
Notes: svn path=/cvs2svn/branches/CHRISTOS/; revision=1590