tail: Fix heap overflow in -F case.The number of events we track can vary over time, but we only allocateenough space for the exact number of events we are tracking when wefirst begin, resulting
tail: Fix heap overflow in -F case.The number of events we track can vary over time, but we only allocateenough space for the exact number of events we are tracking when wefirst begin, resulting in a trivially reproducable heap overflow. Fixthis by allocating enough space for the greatest possible number ofevents (two per file) and clean up the code a bit.Also add a test case which triggers the aforementioned heap overflow,although we don't currently have a way to detect it.MFC after: 1 weekSponsored by: Klara, Inc.Reviewed by: allanjude, markjDifferential Revision: https://reviews.freebsd.org/D42839(cherry picked from commit 621f45532c5887c96b708ce232c52878d0053325)tail: Clean up error messages.MFC after: 1 weekSponsored by: Klara, Inc.Reviewed by: markjDifferential Revision: https://reviews.freebsd.org/D42842(cherry picked from commit b70e57be2cfe83ec9f410e2f317ea38aaac61a98)
show more ...
Remove $FreeBSD$: one-line sh patternRemove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDThe SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catchup to that fact and revert to their recommended match of
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDThe SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catchup to that fact and revert to their recommended match of BSD-2-Clause.Discussed with: pfgMFC After: 3 daysSponsored by: Netflix
tail: Verify correct behavior when input does not end in a newline.Sponsored by: Klara, Inc.Reviewed by: kevansDifferential Revision: https://reviews.freebsd.org/D39116
Improve usability of head(1) and tail(1): - Consistently support -q (quiet) and -v (verbose) - Allow specifying numbers with SI prefixes supported by expand_number(3) - Remove 2^31 limit on lines
Improve usability of head(1) and tail(1): - Consistently support -q (quiet) and -v (verbose) - Allow specifying numbers with SI prefixes supported by expand_number(3) - Remove 2^31 limit on lines for head(1)MFC after: 2 weeksReviewed by: lwhsu, pauamma, gbeRelnotes: yesDifferential Revision: https://reviews.freebsd.org/D35720
tail: Add regression tests for -f and -FMFC after: 1 weekSponsored by: The FreeBSD FoundationDifferential Revision: https://reviews.freebsd.org/D31055
Drop "All rights reserved" from the files I ownAlso, add SPDX tags where needed.MFC after: 2 weeks
tail: fix "tail -r" for piped input that begins with '\n'A subtle logic bug, probably introduced in r311895, caused tail to print thefirst two lines of piped input in forward order, if the very fi
tail: fix "tail -r" for piped input that begins with '\n'A subtle logic bug, probably introduced in r311895, caused tail to print thefirst two lines of piped input in forward order, if the very first characterwas a newline.PR: 222671Reported by: Jim Long <[email protected]>, [email protected]MFC after: 3 weeksSponsored by: Spectra Logic Corp
DIRDEPS_BUILD: Connect new directories.Sponsored by: Dell EMC Isilon
Unbreak :broken_pipe- Capture exit code in pipeline and test in output.- Drop awk use in favor of `sleep 2`. This helps guarantee the EPIPE behavior without the potential race.
Check result of seq call and save output via atf_check -oThis ensures that seq outputting to ints will not fail as silently if there'san error.
tail(1): Do not print bogus errno stringIn the case where write(2) does not return -1, it does not initialize errno.This can happen when a broken pipe causes a short write.I attempted to adapt t
tail(1): Do not print bogus errno stringIn the case where write(2) does not return -1, it does not initialize errno.This can happen when a broken pipe causes a short write.I attempted to adapt the submitted test case to ATF but could not figure outhow to make the test run in the ATF environment. So the aborted test isleft disabled, in case someone would like to run it manually or fix it.PR: 221976Submitted by: <martin AT lispworks.com> (earlier version)Sponsored by: Dell EMC Isilon
Fix memory leaks during "tail -r" of an irregular file* Rewrite r_buf to use standard tail queues instead of a hand-rolled circular linked list. Free dynamic allocations when done.* Remove an op
Fix memory leaks during "tail -r" of an irregular file* Rewrite r_buf to use standard tail queues instead of a hand-rolled circular linked list. Free dynamic allocations when done.* Remove an optimization for the case where the file is a multiple of 128KB in size and there is a scarcity of memory.* Add ATF tests for "tail -r" and its variants.Reported by: ValgrindReviewed by: ngieMFC after: 4 weeksSponsored by: Spectra Logic CorpDifferential Revision: https://reviews.freebsd.org/D9067