]> git.ipfire.org Git - thirdparty/coreutils.git/commit
tail: fix tailing sysfs files where PAGE_SIZE > BUFSIZ
authordann frazier <dann.frazier@canonical.com>
Thu, 30 Nov 2023 01:32:34 +0000 (18:32 -0700)
committerPádraig Brady <P@draigBrady.com>
Fri, 1 Dec 2023 23:01:32 +0000 (23:01 +0000)
commit73d119f4f8052a9fb6cef13cd9e75d5a4e23311a
treecb87887451ea5a0ebde68f0ccc8d311712d4bf6a
parent615167cc4d88ab94c0e6f804ccc0787febf7cd0e
tail: fix tailing sysfs files where PAGE_SIZE > BUFSIZ

* src/tail.c (file_lines): Ensure we use a buffer size >= PAGE_SIZE when
searching backwards to avoid seeking within a file,
which on sysfs files is accepted but also returns no data.
* tests/tail/tail-sysfs.sh: Add a new test.
* tests/local.mk: Reference the new test.
* NEWS: Mention the bug fix.
Fixes https://bugs.gnu.org/67490
NEWS
src/tail.c
tests/local.mk
tests/tail/tail-sysfs.sh [new file with mode: 0755]