diff --git a/Increase-the-pipe-size-in-the-test-case.patch b/Increase-the-pipe-size-in-the-test-case.patch new file mode 100644 index 0000000000000000000000000000000000000000..0afd3b3503ec038369607f5bfa0b0e0e1d2df7bf --- /dev/null +++ b/Increase-the-pipe-size-in-the-test-case.patch @@ -0,0 +1,66 @@ +From 27f4c84c63180c44dfbdfd1c5997066b5276534d Mon Sep 17 00:00:00 2001 +From: hongjinghao +Date: Wed, 15 Mar 2023 17:09:17 +0800 +Subject: [PATCH] Increase the pipe size in the test case + +--- + lesstest/pipeline.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/lesstest/pipeline.c b/lesstest/pipeline.c +index 78cc9e7..8d85d23 100644 +--- a/lesstest/pipeline.c ++++ b/lesstest/pipeline.c +@@ -1,3 +1,4 @@ ++#define _GNU_SOURCE + #include + #include + #include +@@ -20,7 +21,7 @@ static void dup_std(int fd0, int fd1) { + if (fd1 >= 0) dup2(fd1, 1); + } + +-static const char* basename(const char* path) { ++static const char* _basename(const char* path) { + const char* slash = strrchr(path, '/'); + if (slash == NULL) return path; + return slash+1; +@@ -98,7 +99,7 @@ LessPipeline* create_less_pipeline(char* const* argv, int argc, char* const* env + // the named text file to its basename, and run less on the link. + LessPipeline* pipeline = new_pipeline(); + const char* textfile = argv[argc-1]; +- const char* textbase = basename(textfile); ++ const char* textbase = _basename(textfile); + if (textbase != textfile) { + pipeline->tempfile = textbase; + if (link(textfile, textbase) < 0) { +@@ -111,6 +112,8 @@ LessPipeline* create_less_pipeline(char* const* argv, int argc, char* const* env + destroy_less_pipeline(pipeline); + return NULL; + } ++ fcntl(pipeline->screen_in_pipe[0], F_SETPIPE_SZ, 10240); ++ fcntl(pipeline->screen_in_pipe[1], F_SETPIPE_SZ, 10240); + const char* w = get_envp(envp, "COLUMNS"); + const char* h = get_envp(envp, "LINES"); + if (w != NULL) pipeline->screen_width = atoi(w); +@@ -121,6 +124,8 @@ LessPipeline* create_less_pipeline(char* const* argv, int argc, char* const* env + destroy_less_pipeline(pipeline); + return 0; + } ++ fcntl(pipeline->less_in_pipe[0], F_SETPIPE_SZ, 10240); ++ fcntl(pipeline->less_in_pipe[1], F_SETPIPE_SZ, 10240); + if (verbose) fprintf(stderr, "less in pipe %d,%d\n", pipeline->less_in_pipe[RD], pipeline->less_in_pipe[WR]); + char* less = argv[0]; + if (verbose) fprintf(stderr, "testing %s on %s\n", less, textfile); +@@ -139,6 +144,8 @@ LessPipeline* create_less_pipeline(char* const* argv, int argc, char* const* env + destroy_less_pipeline(pipeline); + return NULL; + } ++ fcntl(pipeline->screen_out_pipe[0], F_SETPIPE_SZ, 10240); ++ fcntl(pipeline->screen_out_pipe[1], F_SETPIPE_SZ, 10240); + if (verbose) fprintf(stderr, "screen out pipe %d,%d\n", pipeline->screen_out_pipe[RD], pipeline->screen_out_pipe[WR]); + pipeline->screen_pid = fork(); + if (!pipeline->screen_pid) // child: lt_screen +-- +2.27.0 + diff --git a/less.spec b/less.spec index 3d088ca8ac2cf99e27459e739d2e5f144fa083db..9413f08da76bc2540d05c0b27789d2194f6f1adf 100644 --- a/less.spec +++ b/less.spec @@ -1,6 +1,6 @@ Name: less Version: 608 -Release: 3 +Release: 4 Summary: Less is a pager that displays text files. License: GPLv3+ or BSD URL: http://www.greenwoodsoftware.com/less @@ -52,6 +52,8 @@ Patch6041: backport-makecheck-0041-lesstest-Add-a-couple-more-lt-files.patc Patch6042: backport-makecheck-0042-Make-make-check-work-regardless-of-directory-where-l.patch Patch6043: backport-End-OSC8-hyperlink-on-invalid-embedded-escape-sequen.patch +Patch9000: Increase-the-pipe-size-in-the-test-case.patch + BuildRequires: gcc make ncurses-devel autoconf automake libtool %description @@ -92,6 +94,9 @@ make check %{_mandir}/man1/* %changelog +* Wed Mar 15 2023 hongjinghao - 609-4 +- Increase the pipe size in the test case + * Fri Feb 17 2023 hongjinghao - 608-3 - fix CVE-2022-46663