aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/lam/lam.c
Commit message (Collapse)AuthorAgeFilesLines
* 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