aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/bsdiff
Commit message (Collapse)AuthorAgeFilesLines
* Remove residual blank line at start of MakefileWarner Losh2024-07-154-4/+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
* bsdiff: Use mmap instead of mallocRicardo Branco2024-04-192-20/+21
| | | | | | | | Note: This follows the current style of the bsdiff.c and bspatch.c files, which is rather far from style(9). Reviewed by: imp, cpervica Pull Request: https://github.com/freebsd/freebsd-src/pull/1076
* usr.bin: Automated cleanup of cdefs and other formattingWarner Losh2023-11-271-1/+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
* bspatch: use C23 overflow checking math now that it is availableEd Maste2023-09-071-8/+2
| | | | | | Reviewed by: des Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41771
* Remove $FreeBSD$: two-line nroff patternWarner Losh2023-08-162-4/+0
| | | | Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-166-6/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-162-4/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-122-2/+2
| | | | | | | | | 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
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-192-2/+0
|
* bspatch.1: fix missing argumentMike Karels2022-12-221-2/+3
| | | | | | | | Fix typo MFC after: 3 days Reviewed by: gbe Differential Revision: https://reviews.freebsd.org/D37727
* bsdiff: fix off-by-one errorMitchell Horne2020-11-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The program reads oldsize bytes from oldfile, and proceeds to initialize a suffix array of oldsize elements using divsufsort(). As per the function's API [1], array indices 0 through n-1 are initialized. Later, search() is called, but with index bounds [0, n]. Depending on the contents of the malloc'd buffer, accessing this uninitialized index at the end of can result in a segmentation fault. Fix this by passing oldsize-1 to search(), limiting the search bounds to [0, n-1]. This bug is a result of r303285, which introduced divsufsort() as an alternate suffix sorting function to the existing qsufsort(). It seems that qsufsort() did initialize the final empty element, meaning it could be safely accessed. This difference in the implementations was missed at the time. [1] https://github.com/y-256/libdivsufsort Discussed with: cperciva MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26911 Notes: svn path=/head/; revision=367734
* bspatch: add integer overflow checksEd Maste2019-09-261-9/+26
| | | | | | | | | | | | | | Introduce a new add_off_t static function that exits with an error message if there's an overflow, otherwise returns their sum. Use this when adding values obtained from the input patch. Reviewed by: delphij, allanjude (earlier) MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7897 Notes: svn path=/head/; revision=352742
* errno.h is no longer needed as of r340239 so remove it.Xin LI2019-07-181-1/+0
| | | | | | | No MFC planned as that revision was not merged. Notes: svn path=/head/; revision=350109
* Remove support for FreeBSD 10.x.Xin LI2019-07-181-7/+3
| | | | | | | MFC after: 1 month Notes: svn path=/head/; revision=350108
* bspatch: simplify capsicumizationMariusz Zaborski2018-11-071-20/+16
| | | | | | | | | | | Assume that user wants to run with capsicum support if he builds the software with HAVE_CAPSICUM. Treat running application without capsicum in the kernel as an error. MFC after: 3 weeks Notes: svn path=/head/; revision=340239
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-272-0/+4
| | | | | | | | | | | | | | | | | 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
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-312-2/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Revert debugging that was accidently committed in r316314Allan Jude2017-03-311-8/+1
| | | | Notes: svn path=/head/; revision=316315
* fix top(1) ZFS compressed ARC supportAllan Jude2017-03-311-1/+8
| | | | | | | | | | | top(1) read the wrong amount of data from sysctl, uint64_t instead of boolean_t, resulting in the stats not showing in many cases. X-MFC-With: r315435 Sponsored by: ScaleEngine Inc. Notes: svn path=/head/; revision=316314
* Adopt SRCTOP in usr.binWarner Losh2017-03-121-2/+2
| | | | | | | | | | | | Prefer ${SRCTOP}/foo over ${.CURDIR}/../../foo and ${SRCTOP}/usr.bin/foo over ${.CURDIR}/../foo for paths in Makefiles. Differential Revision: https://reviews.freebsd.org/D9932 Sponsored by: Netflix Silence on: arch@ (twice) Notes: svn path=/head/; revision=315170
* bspatch: Remove backwards-compatibility sys/capability.h supportEd Maste2016-09-201-4/+1
| | | | | | | | | | | | | | | bspatch previously included sys/capability.h or sys/capsicum.h based on __FreeBSD_version, as FreeBSD is the upstream for bsdiff and we may see this file incorporated into other third-party software. The Capsicum header is now installed as sys/capsicum.h in stable/10 and FreeBSD 10.3, so we can just use sys/capsicum.h and simplify the logic. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D7954 Notes: svn path=/head/; revision=306026
* bspatch: use #define for header size instead of magic numberEd Maste2016-09-151-15/+16
| | | | | | | | | Reviewed by: allanjude, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7861 Notes: svn path=/head/; revision=305822
* bspatch: remove superfluous newlines from errx stringsEd Maste2016-09-121-9/+9
| | | | Notes: svn path=/head/; revision=305737
* bspatch: add sanity checks on sizes to avoid integer overflowEd Maste2016-09-061-6/+11
| | | | | | | | | | | | | | | | | Note that this introduces an explicit 2GB limit, but this was already implicit in variable and function argument types. This is based on the "non-cryptanalytic attacks against freebsd update components" anonymous gist. Further refinement is planned. Reviewed by: allanjude, cem, kib Obtained from: anonymous gist MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7619 Notes: svn path=/head/; revision=305486
* bspatch: remove output file in the case of errorEd Maste2016-08-251-5/+32
| | | | | | | | | Reviewed by: oshogbo Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7644 Notes: svn path=/head/; revision=304821
* Capsicumize bspatchAllan Jude2016-08-251-12/+52
| | | | | | | | | | | | | | | | | | Move all of the fopen() and open() calls to the top of main() Restrict each FD to least privilege (read/seek only, write only, etc) cap_enter(), and make all except the output FD read/seek only. Reviewed by: emaste, ed, oshogbo, delphij Approved by: so MFC after: 3 days Relnotes: yes Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D7358 Notes: svn path=/head/; revision=304807
* bspatch: apply style(9)Ed Maste2016-08-231-52/+60
| | | | | | | | | | | | | Make style changes (and trivial refactoring of open calls) now in order to reduce noise in diffs for future capsicum changes. Reviewed by: oshogbo No objection: cperciva Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7610 Notes: svn path=/head/; revision=304691
* Fix bspatch heap overflow vulnerability.Xin LI2016-07-251-0/+4
| | | | | | | | | Obtained from: Chromium Reported by: Lu Tung-Pin Security: FreeBSD-SA-16:25.bspatch Notes: svn path=/head/; revision=303298
* Change bsdiff to use divsufsort suffix sort library instead of qsufsort,Xin LI2016-07-254-106/+282
| | | | | | | | | | | | | which is more efficient. Note that for now we do not create a separate library for libdivsufsort because it's not used anywhere else. Obtained from: Chromium MFC after: 2 months Notes: svn path=/head/; revision=303285
* Cleanup unnecessary semicolons from utilities we all love.Pedro F. Giffuni2016-04-152-27/+27
| | | | Notes: svn path=/head/; revision=298089
* Check for (old|new)size + 1 overflows off_t.Andrey A. Chernov2015-11-031-2/+4
| | | | | | | | PR: 204230 MFC after: 1 week Notes: svn path=/head/; revision=290336
* Use meaningful errno for ssize_t overflow in read().Andrey A. Chernov2015-11-031-4/+22
| | | | | | | | | | Catch size_t overflow in malloc(). PR: 204230 MFC after: 1 week Notes: svn path=/head/; revision=290329
* Add META_MODE support.Simon J. Gerraty2015-06-132-0/+38
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 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-082-4/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge sync of headSimon J. Gerraty2015-05-272-4/+2
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * Merge head from 7/28Simon J. Gerraty2014-08-192-2/+2
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=270164
| * | Updated dependenciesSimon J. Gerraty2014-05-162-2/+0
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * | Updated dependenciesSimon J. Gerraty2014-05-102-0/+4
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * | Merge headSimon J. Gerraty2014-04-282-2/+20
| |\ \ | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265044
| * | | Updated dependenciesSimon J. Gerraty2013-03-112-0/+2
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * | | Updated dependenciesSimon J. Gerraty2013-02-162-4/+0
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-222-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | | Convert to usr.bin/ to LIBADDBaptiste Daroussin2014-11-252-4/+2
| |_|/ |/| | | | | | | | | | | | | | | | | Reduce overlinking Notes: svn path=/head/; revision=275042
* | | use .Mt to mark up email addresses consistently (part3)Baptiste Daroussin2014-06-232-2/+2
| |/ |/| | | | | | | | | | | | | PR: 191174 Submitted by: Franco Fichtner <franco at lastsummer.de> Notes: svn path=/head/; revision=267773
* | Make usage printing more consistent with other tools.Ed Schouten2014-04-232-2/+20
|/ | | | | | | | | | - Introduce a separate usage() function. - Don't use argv[0]. Directly name the application, as we do elsewhere. - Don't prepend the application name. - Don't print two newlines. Notes: svn path=/head/; revision=264823
* Remove trailing whitespace per mdoc lint warningEitan Adler2012-03-291-1/+1
| | | | | | | | | | Disussed with: gavin No objection from: doc Approved by: joel MFC after: 3 days Notes: svn path=/head/; revision=233648
* Silence bogus warning when compiling with gcc46:Eitan Adler2012-01-101-1/+1
| | | | | | | | | | | error: 'pos' may be used uninitialized in this function Reviewed by: cperciva Approved by: dim MFC after: 3 days Notes: svn path=/head/; revision=229910
* mdoc: move CAVEATS, BUGS and SECURITY CONSIDERATIONS sections to theUlrich Spörlein2010-05-132-4/+4
| | | | | | | | | | | | | | bottom of the manpages and order them consistently. GNU groff doesn't care about the ordering, and doesn't even mention CAVEATS and SECURITY CONSIDERATIONS as common sections and where to put them. Found by: mdocml lint run Reviewed by: ru Notes: svn path=/head/; revision=208027
* Build usr.bin/ with WARNS=6 by default.Ed Schouten2010-01-021-3/+0
| | | | | | | Also add some missing $FreeBSD$ to keep svn happy. Notes: svn path=/head/; revision=201386