gzip: fix error handling in unxzThe result of fstat() was not checked. Furthermore, there was aredundant check of st.st_size. Fix both.Reported by: CoverityMFC after: 1 weekSponsored by:
gzip: fix error handling in unxzThe result of fstat() was not checked. Furthermore, there was aredundant check of st.st_size. Fix both.Reported by: CoverityMFC after: 1 weekSponsored by: Dell EMC Isilon(cherry picked from commit 58135fbd8b68228678eb0ce38566aaf7ab1aad94)
show more ...
fts_read: Handle error from a NULL return better.This is addressing cases such as fts_read(3) encountering an [EIO]from fchdir(2) when FTS_NOCHDIR is not set. That would otherwise beseen as a su
fts_read: Handle error from a NULL return better.This is addressing cases such as fts_read(3) encountering an [EIO]from fchdir(2) when FTS_NOCHDIR is not set. That would otherwise beseen as a successful traversal in some of these cases while silentlydiscarding expected work.As noted in r264201, fts_read() does not set errno to 0 on a successfulEOF so it needs to be set before calling it. Otherwise we might seea random error from one of the iterations.gzip is ignoring most errors and could be improved separately.Reviewed by: vangyzenSponsored by: Dell EMCDifferential Revision: https://reviews.freebsd.org/D27184
Remove unneeded checks for prelen.In order to determine the type of a compressed file, we have to readin the first four bytes which may also be important for decompressionpurposes, to do that we
Remove unneeded checks for prelen.In order to determine the type of a compressed file, we have to readin the first four bytes which may also be important for decompressionpurposes, to do that we would pass the buffer that we have alreadyread in, along with the size of it.Rename header1 to fourbytes to make that explicit, and remove allchecks for prelen.Reported by: cemReviewed by: cemMFC after: 2 weeksDifferential Revision: https://reviews.freebsd.org/D24034
Update Makefile.depend filesUpdate a bunch of Makefile.depend files asa result of adding Makefile.depend.options filesReviewed by: bdreweryMFC after: 1 weekSponsored by: Juniper NetworksDi
Update Makefile.depend filesUpdate a bunch of Makefile.depend files asa result of adding Makefile.depend.options filesReviewed by: bdreweryMFC after: 1 weekSponsored by: Juniper NetworksDifferential Revision: https://reviews.freebsd.org/D22494
Add Makefile.depend.optionsLeaf directories that have dependencies impactedby options need a Makefile.depend.options fileto avoid churn in Makefile.dependDIRDEPS for cases such as OPENSSL, TCP_
Add Makefile.depend.optionsLeaf directories that have dependencies impactedby options need a Makefile.depend.options fileto avoid churn in Makefile.dependDIRDEPS for cases such as OPENSSL, TCP_WRAPPERS etccan be set in local.dirdeps-options.mkwhich can add to those set in Makefile.depend.optionsSee share/mk/dirdeps-options.mkReviewed by: bdreweryMFC after: 1 weekSponsored by: Juniper NetworksDifferential Revision: https://reviews.freebsd.org/D22469
Correct documentation year.MFC after: 2 weeks
Port NetBSD improvements: - Add -l support for xz files - Add lzip support to gzip based on the example lzip decoder.Obtained from: NetBSDMFC after: 2 weeksRelnotes: yes
Use endian.h le32dec() instead of rolling our own.Suggested by: phkReviewed by: imp, pfgMFC after: 2 weeksDifferential Revision: https://reviews.freebsd.org/D16192
gzip(1): Don't shadow global 'err'Unbreak work build on ppc due to -Werror=shadow. Introduced in r336121.X-MFC-With: r336121
Don't delete outfile unconditionally.MFC after: 1 month
gzip: fix for undefined behavior.Unportable left shift reported with MKSANITIZER=yesUSE_SANITIZER=undefined:# progress -zf ./games.tgz tar -xp -C "./" -f -/public/src.git/usr.bin/gzip/gzip.c:2
gzip: fix for undefined behavior.Unportable left shift reported with MKSANITIZER=yesUSE_SANITIZER=undefined:# progress -zf ./games.tgz tar -xp -C "./" -f -/public/src.git/usr.bin/gzip/gzip.c:2126:33: runtime error: left shift of251 by 24 places cannot be represented in type 'int'100%|****************************************************************************************************************|44500 KiB 119.69 MiB/s 00:00 ETARefactor the following code into something that is more clearand fix signed integer shift, by casting all buf[] elements to(unsigned int):unsigned char buf[8];uint32_t usize;[...]else { usize = buf[4] | buf[5] << 8 | buf[6] << 16 | buf[7] << 24;[...]New version: usize = buf[4]; usize |= (unsigned int)buf[5] << 8; usize |= (unsigned int)buf[6] << 16; usize |= (unsigned int)buf[7] << 24;Only the "<< 24" part needs explicit cast, but for consistency make theinteger promotion explicit and clear to a code reader.Sponsored by <The NetBSD Foundation>Obtained from: NetBSD (CVS rev. 1.113)MFC after: 1 week
Remove "All rights reserved" from my files.See r333391 for the rationale.MFC after: 1 week
Close the correct file descriptor.MFC after: 2 weeks
gzip(1): Remove duplicate close()CID: 1383560Reported by: CoveritySponsored by: Dell EMC Isilon
Create links for xzdiff.MFC after: 2 weeks
various: general adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - error
various: general adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - errorprone - task.The Software Package Data Exchange (SPDX) group provides a specificationto make it easier for automated tools to detect and summarize well knownopensource licenses. We are gradually adopting the specification, notingthat the tags are considered only advisory and do not, in any way,superceed or replace the license texts.No functional change intended.
Set errno to EFTYPE instead of EINVAL to be more consistent with therest of code.MFC after: 1 month
Support SIGINFO.Obtained from: NetBSDMFC after: 2 weeks
General further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 3-Clause license.The Software Package Data Exchange (SPDX) group provides a specificationto make it easier f
General further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 3-Clause license.The Software Package Data Exchange (SPDX) group provides a specificationto make it easier for automated tools to detect and summarize well knownopensource licenses. We are gradually adopting the specification, notingthat 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 ofHighlander" tool: an older (2014) run over FreeBSD tree was useful as astarting point.
DIRDEPS_BUILD: Update dependencies.Sponsored by: Dell EMC Isilon
Add HAS_TESTS to all Makefiles that are currently using the`SUBDIR.${MK_TESTS}+= tests` idiom.This is a follow up to r321912.
Convert traditional ${MK_TESTS} conditional idiom for including testdirectories to SUBDIR.${MK_TESTS} idiomThis is being done to pave the way for future work (and homogenity) in^/projects/make-ch
Convert traditional ${MK_TESTS} conditional idiom for including testdirectories to SUBDIR.${MK_TESTS} idiomThis is being done to pave the way for future work (and homogenity) in^/projects/make-check-sandbox .No functional change intended.MFC after: 1 weeks
Reflect actual NetBSD revision we already have.MFC after: 3 days
Use type-independent formats for printing nlink_t and ino_t.Extracted from: ino64 work by gleb, mckusickDiscussed with: mckusickSponsored by: The FreeBSD FoundationMFC after: 1 week
style(9) indent changes, no actual code change.MFC after: 2 weeks
1234