Bug 276133 - [patch] less(1) is not able to operate on files residing in pseudo-filesystems
Summary: [patch] less(1) is not able to operate on files residing in pseudo-filesystems
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 14.0-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: Xin LI
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-05 19:44 UTC by Ricardo Branco
Modified: 2024-04-27 07:09 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ricardo Branco 2024-01-05 19:44:09 UTC
To reproduce:

`less /compat/linux/proc/cpuinfo`

Fix: https://github.com/freebsd/freebsd-src/pull/1004
Comment 1 Ricardo Branco 2024-01-05 19:45:16 UTC
Opened issue upstream: https://github.com/gwsw/less/issues/465
Comment 2 Marek Zarychta 2024-01-05 22:37:07 UTC
Please try: cat /compat/linux/proc/cpuinfo | less
Comment 3 Ricardo Branco 2024-01-05 22:50:11 UTC
(In reply to Marek Zarychta from comment #2)

I know, but this could be fixed just like other tools that were fixed for the same bug:
https://github.com/freebsd/freebsd-src/pull/989
https://github.com/freebsd/freebsd-src/pull/990
Comment 4 Warner Losh freebsd_committer freebsd_triage 2024-01-12 18:39:06 UTC
I'll land the PRs
Comment 5 commit-hook freebsd_committer freebsd_triage 2024-04-24 05:34:27 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=cae336280b0d7ad3d49788c5fc0986f91328eb50

commit cae336280b0d7ad3d49788c5fc0986f91328eb50
Merge: feabaf8d5389 e8ec4b5d1202
Author:     Ricardo Branco <rbranco@suse.de>
AuthorDate: 2024-04-24 05:29:46 +0000
Commit:     Xin LI <delphij@FreeBSD.org>
CommitDate: 2024-04-24 05:33:26 +0000

    MFV: less: Do not trust st_size if it equals zero

    This is a smaller version of upstream
    1fafd968b48e5cea6c85f126d77071a8de707a55 to address the
    issue that less not being able to operate on files
    residing in pseudo-filesystems that advertize a zero
    size value.

    PR:             bin/276133
    MFC after:      3 days

 contrib/less/ch.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)
Comment 6 commit-hook freebsd_committer freebsd_triage 2024-04-27 07:08:24 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=5132cb42607bf7e1cc640e7c4ff4a1e9cfa3916d

commit 5132cb42607bf7e1cc640e7c4ff4a1e9cfa3916d
Author:     Ricardo Branco <rbranco@suse.de>
AuthorDate: 2024-04-24 05:29:46 +0000
Commit:     Xin LI <delphij@FreeBSD.org>
CommitDate: 2024-04-27 07:07:32 +0000

    MFV: less: Do not trust st_size if it equals zero

    This is a smaller version of upstream
    1fafd968b48e5cea6c85f126d77071a8de707a55 to address the
    issue that less not being able to operate on files
    residing in pseudo-filesystems that advertize a zero
    size value.

    PR:             bin/276133

    (cherry picked from commit cae336280b0d7ad3d49788c5fc0986f91328eb50)

 contrib/less/ch.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)
Comment 7 commit-hook freebsd_committer freebsd_triage 2024-04-27 07:09:26 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=302d0acea8a0bc18a26b5e0f1a7870b09dc58d16

commit 302d0acea8a0bc18a26b5e0f1a7870b09dc58d16
Author:     Ricardo Branco <rbranco@suse.de>
AuthorDate: 2024-04-24 05:29:46 +0000
Commit:     Xin LI <delphij@FreeBSD.org>
CommitDate: 2024-04-27 07:08:17 +0000

    MFV: less: Do not trust st_size if it equals zero

    This is a smaller version of upstream
    1fafd968b48e5cea6c85f126d77071a8de707a55 to address the
    issue that less not being able to operate on files
    residing in pseudo-filesystems that advertize a zero
    size value.

    PR:             bin/276133

    (cherry picked from commit cae336280b0d7ad3d49788c5fc0986f91328eb50)

 contrib/less/ch.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)