Compare commits

...

No commits in common. 'c9' and 'i10c-beta' have entirely different histories.

2
.gitignore vendored

@ -1 +1 @@
SOURCES/less-590.tar.gz
SOURCES/less-661.tar.gz

@ -1 +1 @@
82188f425b5197c24b834ae80b95ec07be442c78 SOURCES/less-590.tar.gz
04815f4d066f231dce6f7353acd0425ddb308f75 SOURCES/less-661.tar.gz

@ -1,8 +1,7 @@
diff --git a/help.c b/help.c
index 531aa16..0de6f0f 100644
--- a/help.c
+++ b/help.c
@@ -119,7 +119,7 @@ constant char helpdata[] = {
diff -up less-661/help.c.help less-661/help.c
--- less-661/help.c.help 2024-08-05 21:40:34.531327397 +0200
+++ less-661/help.c 2024-08-05 21:40:34.533327418 +0200
@@ -137,7 +137,7 @@ constant char helpdata[] = {
' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','N','u','m','b','e','r',' ','o','f',' ','b','u','f','f','e','r','s','.','\n',
' ',' ','-','B',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','a','u','t','o','-','b','u','f','f','e','r','s','\n',
' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','o','n','\'','t',' ','a','u','t','o','m','a','t','i','c','a','l','l','y',' ','a','l','l','o','c','a','t','e',' ','b','u','f','f','e','r','s',' ','f','o','r',' ','p','i','p','e','s','.','\n',
@ -11,23 +10,10 @@ index 531aa16..0de6f0f 100644
' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','R','e','p','a','i','n','t',' ','b','y',' ','c','l','e','a','r','i','n','g',' ','r','a','t','h','e','r',' ','t','h','a','n',' ','s','c','r','o','l','l','i','n','g','.','\n',
' ',' ','-','d',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','d','u','m','b','\n',
' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','u','m','b',' ','t','e','r','m','i','n','a','l','.','\n',
@@ -151,8 +151,10 @@ constant char helpdata[] = {
' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','I','g','n','o','r','e',' ','t','h','e',' ','L','E','S','S','O','P','E','N',' ','e','n','v','i','r','o','n','m','e','n','t',' ','v','a','r','i','a','b','l','e','.','\n',
' ',' ','-','m',' ',' ','-','M',' ',' ','.','.','.','.',' ',' ','-','-','l','o','n','g','-','p','r','o','m','p','t',' ',' ','-','-','L','O','N','G','-','P','R','O','M','P','T','\n',
' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','e','t',' ','p','r','o','m','p','t',' ','s','t','y','l','e','.','\n',
-' ',' ','-','n',' ',' ','-','N',' ',' ','.','.','.','.',' ',' ','-','-','l','i','n','e','-','n','u','m','b','e','r','s',' ',' ','-','-','L','I','N','E','-','N','U','M','B','E','R','S','\n',
+' ',' ','-','n',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','l','i','n','e','-','n','u','m','b','e','r','s','\n',
' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','o','n','\'','t',' ','u','s','e',' ','l','i','n','e',' ','n','u','m','b','e','r','s','.','\n',
+' ',' ','-','N',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','L','I','N','E','-','N','U','M','B','E','R','S','\n',
+' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','U','s','e',' ','l','i','n','e',' ','n','u','m','b','e','r','s','.','\n',
' ',' ','-','o',' ','[','_','\b','f','_','\b','i','_','\b','l','_','\b','e',']',' ',' ','.',' ',' ','-','-','l','o','g','-','f','i','l','e','=','[','_','\b','f','_','\b','i','_','\b','l','_','\b','e',']','\n',
' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','C','o','p','y',' ','t','o',' ','l','o','g',' ','f','i','l','e',' ','(','s','t','a','n','d','a','r','d',' ','i','n','p','u','t',' ','o','n','l','y',')','.','\n',
' ',' ','-','O',' ','[','_','\b','f','_','\b','i','_','\b','l','_','\b','e',']',' ',' ','.',' ',' ','-','-','L','O','G','-','F','I','L','E','=','[','_','\b','f','_','\b','i','_','\b','l','_','\b','e',']','\n',
diff --git a/less.hlp b/less.hlp
index 15ece5a..186e409 100644
--- a/less.hlp
+++ b/less.hlp
@@ -116,7 +116,7 @@
diff -up less-661/less.hlp.help less-661/less.hlp
--- less-661/less.hlp.help 2024-08-05 21:40:34.532327408 +0200
+++ less-661/less.hlp 2024-08-05 21:40:34.533327418 +0200
@@ -134,7 +134,7 @@
Number of buffers.
-B ........ --auto-buffers
Don't automatically allocate buffers for pipes.
@ -36,15 +22,3 @@ index 15ece5a..186e409 100644
Repaint by clearing rather than scrolling.
-d ........ --dumb
Dumb terminal.
@@ -148,8 +148,10 @@
Ignore the LESSOPEN environment variable.
-m -M .... --long-prompt --LONG-PROMPT
Set prompt style.
- -n -N .... --line-numbers --LINE-NUMBERS
+ -n ........ --line-numbers
Don't use line numbers.
+ -N ........ --LINE-NUMBERS
+ Use line numbers.
-o [_f_i_l_e] . --log-file=[_f_i_l_e]
Copy to log file (standard input only).
-O [_f_i_l_e] . --LOG-FILE=[_f_i_l_e]

@ -2,7 +2,7 @@ diff -upr less-458_orig/lessecho.c less-458_work/lessecho.c
--- less-458_orig/lessecho.c 2013-05-07 14:03:52.091104655 +0200
+++ less-458_work/lessecho.c 2013-05-07 11:21:10.883991862 +0200
@@ -41,7 +41,27 @@ static int num_metachars = 0;
pr_usage(VOID_PARAM)
static void pr_usage(void)
{
fprintf(stderr,
- "usage: lessecho [-ox] [-cx] [-pn] [-dn] [-mx] [-nn] [-ex] [-fn] [-a] file ...\n");
@ -29,5 +29,5 @@ diff -upr less-458_orig/lessecho.c less-458_work/lessecho.c
+ " -?\t- prints this help\n");
}
static void
static void pr_version(void)

@ -2,8 +2,8 @@ diff -upr less-458_orig/lesskey.c less-458_work/lesskey.c
--- less-458_orig/lesskey.c 2013-05-07 14:03:52.062104533 +0200
+++ less-458_work/lesskey.c 2013-05-07 11:21:10.881991855 +0200
@@ -217,7 +217,15 @@ extern char version[];
static void
usage(void)
static void usage(void)
{
- fprintf(stderr, "usage: lesskey [-o output] [input]\n");
+ fprintf(stderr, "usage: lesskey [-o output] [input]\n\n");

@ -19,17 +19,17 @@ diff -ur less-581.2/configure.ac less_fsync/configure.ac
[Define HAVE_FILENO if you have the fileno() macro.])
AH_TEMPLATE([HAVE_ERRNO],
@@ -274,7 +276,7 @@
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[int f(int a) { return a; }]])],[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ANSI_PROTOS)],[AC_MSG_RESULT(no)])
# Checks for library functions.
AC_TYPE_SIGNAL
-AC_CHECK_FUNCS([fchmod fsync nanosleep poll popen realpath _setjmp sigprocmask sigsetmask snprintf stat system ttyname usleep])
+AC_CHECK_FUNCS([fchmod nanosleep poll popen realpath _setjmp sigprocmask sigsetmask snprintf stat system ttyname usleep])
-AC_CHECK_FUNCS([fchmod fsync nanosleep poll popen realpath _setjmp sigprocmask sigsetmask snprintf stat strsignal system ttyname usleep])
+AC_CHECK_FUNCS([fchmod nanosleep poll popen realpath _setjmp sigprocmask sigsetmask snprintf stat strsignal system ttyname usleep])
# AC_CHECK_FUNCS may not work for inline functions, so test these separately.
AC_MSG_CHECKING(for memcpy)
@@ -321,6 +323,16 @@
#endif], [static char *x; x = strerror(0);],
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_STRERROR)], [AC_MSG_RESULT(no)])
#include <errno.h>
#endif]], [[static char *x; x = strerror(0);]])],[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_STRERROR)],[AC_MSG_RESULT(no)])
+AC_MSG_CHECKING(for fsync)
+AC_TRY_RUN([
@ -42,5 +42,5 @@ diff -ur less-581.2/configure.ac less_fsync/configure.ac
+}], [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FSYNC)], [AC_MSG_RESULT(no)])
+
AC_MSG_CHECKING(for sys_errlist)
AC_TRY_LINK(, [extern char *sys_errlist[]; static char **x; x = sys_errlist;],
[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYS_ERRLIST)], [AC_MSG_RESULT(no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[extern char *sys_errlist[]; static char **x; x = sys_errlist;]])],[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYS_ERRLIST)],[AC_MSG_RESULT(no)])

@ -1,21 +0,0 @@
commit a78e1351113cef564d790a730d657a321624d79c
Author: Mark Nudelman <markn@greenwoodsoftware.com>
Date: Fri Oct 7 19:25:46 2022 -0700
End OSC8 hyperlink on invalid embedded escape sequence.
diff --git a/line.c b/line.c
index 236c49a..cba7bdd 100644
--- a/line.c
+++ b/line.c
@@ -633,8 +633,8 @@ ansi_step(pansi, ch)
/* Hyperlink ends with \7 or ESC-backslash. */
if (ch == '\7')
return ANSI_END;
- if (pansi->prev_esc && ch == '\\')
- return ANSI_END;
+ if (pansi->prev_esc)
+ return (ch == '\\') ? ANSI_END : ANSI_ERR;
pansi->prev_esc = (ch == ESC);
return ANSI_MID;
}

@ -1,41 +0,0 @@
From c6ac6de49698be84d264a0c4c0c40bb870b10144 Mon Sep 17 00:00:00 2001
From: Mark Nudelman <markn@greenwoodsoftware.com>
Date: Sat, 25 Jun 2022 11:54:43 -0700
Subject: [PATCH] Shell-quote filenames when invoking LESSCLOSE.
---
filename.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/filename.c b/filename.c
index 5824e38..dff20c0 100644
--- a/filename.c
+++ b/filename.c
@@ -972,6 +972,8 @@ close_altfile(altfilename, filename)
{
#if HAVE_POPEN
char *lessclose;
+ char *qfilename;
+ char *qaltfilename;
FILE *fd;
char *cmd;
int len;
@@ -986,9 +988,13 @@ close_altfile(altfilename, filename)
error("LESSCLOSE ignored; must contain no more than 2 %%s", NULL_PARG);
return;
}
- len = (int) (strlen(lessclose) + strlen(filename) + strlen(altfilename) + 2);
+ qfilename = shell_quote(filename);
+ qaltfilename = shell_quote(altfilename);
+ len = (int) (strlen(lessclose) + strlen(qfilename) + strlen(qaltfilename) + 2);
cmd = (char *) ecalloc(len, sizeof(char));
- SNPRINTF2(cmd, len, lessclose, filename, altfilename);
+ SNPRINTF2(cmd, len, lessclose, qfilename, qaltfilename);
+ free(qaltfilename);
+ free(qfilename);
fd = shellcmd(cmd);
free(cmd);
if (fd != NULL)
--
2.41.0

@ -1,65 +0,0 @@
Patch backported from:
commit 007521ac3c95bc76e3d59c6dbfe75d06c8075c33
Author: Mark Nudelman <markn@greenwoodsoftware.com>
Date: Thu Apr 11 17:49:48 2024 -0700
Fix bug when viewing a file whose name contains a newline.
diff -up less-643/filename.c.cve-2024-32487 less-643/filename.c
--- less-643/filename.c.cve-2024-32487 2023-07-21 00:43:14.000000000 +0200
+++ less-643/filename.c 2024-04-23 10:24:17.347269703 +0200
@@ -128,6 +128,15 @@ static char * metachars(void)
}
/*
+ * Must use quotes rather than escape char for this metachar?
+ */
+static int must_quote(char c)
+{
+ /* {{ Maybe the set of must_quote chars should be configurable? }} */
+ return (c == '\n');
+}
+
+/*
* Insert a backslash before each metacharacter in a string.
*/
public char *
@@ -164,6 +173,9 @@ public char * shell_quote(char *s)
* doesn't support escape chars. Use quotes.
*/
use_quotes = 1;
+ } else if (must_quote(*p))
+ {
+ len += 3; /* open quote + char + close quote */
} else
{
/*
@@ -193,15 +205,22 @@ public char * shell_quote(char *s)
{
while (*s != '\0')
{
- if (metachar(*s))
+ if (!metachar(*s))
{
- /*
- * Add the escape char.
- */
+ *p++ = *s++;
+ } else if (must_quote(*s))
+ {
+ /* Surround the char with quotes. */
+ *p++ = openquote;
+ *p++ = *s++;
+ *p++ = closequote;
+ } else
+ {
+ /* Insert an escape char before the char. */
strcpy(p, esc);
p += esclen;
+ *p++ = *s++;
}
- *p++ = *s++;
}
*p = '\0';
}

@ -0,0 +1,12 @@
diff -up less-661/input.c.fix_sast less-661/input.c
--- less-661/input.c.fix_sast 2024-08-05 21:48:33.202257453 +0200
+++ less-661/input.c 2024-08-05 21:49:36.717911621 +0200
@@ -345,7 +345,7 @@ public POSITION back_line(POSITION curr_
{
POSITION base_pos;
POSITION new_pos;
- POSITION edisp_pos;
+ POSITION edisp_pos = NULL_POSITION;
POSITION begin_new_pos;
int c;
lbool endline;

@ -0,0 +1,20 @@
diff -up less-661/os.c.pipefix less-661/os.c
--- less-661/os.c.pipefix 2024-06-29 19:16:08.000000000 +0200
+++ less-661/os.c 2024-08-10 08:06:14.762224766 +0200
@@ -80,6 +80,7 @@ extern int exit_F_on_close;
extern int follow_mode;
extern int scanning_eof;
extern char intr_char;
+extern int is_tty;
#if !MSDOS_COMPILER
extern int tty;
#endif
@@ -237,7 +238,7 @@ start:
}
#endif
#if USE_POLL
- if (fd != tty && use_poll)
+ if (is_tty && fd != tty && use_poll)
{
int ret = check_poll(fd, tty);
if (ret != 0)

@ -63,12 +63,16 @@ case "$1" in
if [ -n "$DECOMPRESSOR" ] && $DECOMPRESSOR -- "$1" | file - | grep -q troff; then
$DECOMPRESSOR -- "$1" | manfilter -
exit $?
fi ;;&
fi
esac
case "$1" in
*.[1-9n]|*.[1-9]x|*.man)
if file "$1" | grep -q troff; then
manfilter "$1"
exit $?
fi ;;&
fi
esac
case "$1" in
*.tar) tar tvvf "$1"; exit $? ;;
*.tgz|*.tar.gz|*.tar.[zZ]) tar tzvvf "$1"; exit $? ;;
*.tar.xz) tar Jtvvf "$1"; exit $? ;;

@ -1,8 +1,8 @@
Summary: A text file browser similar to more, but better
Name: less
Version: 590
Release: 4%{?dist}
License: GPLv3+ or BSD
Version: 661
Release: 2%{?dist}
License: GPL-3.0-only AND BSD-2-Clause
Source0: https://www.greenwoodsoftware.com/less/%{name}-%{version}.tar.gz
Source1: lesspipe.sh
Source2: less.sh
@ -10,14 +10,15 @@ Source3: less.csh
Patch4: less-394-time.patch
Patch5: less-475-fsync.patch
Patch6: less-436-manpage-add-old-bot-option.patch
Patch7: less-436-help.patch
Patch8: less-458-lessecho-usage.patch
Patch9: less-458-less-filters-man.patch
Patch10: less-458-lesskey-usage.patch
Patch11: less-458-old-bot-in-help.patch
Patch12: less-590-CVE-2022-46663.patch
Patch13: less-590-CVE-2022-48624.patch
Patch14: less-590-CVE-2024-32487.patch
Patch12: less-436-help.patch
Patch13: less-661-fix_sast.patch
# from upstream, for <=661, fixes regression in file-types sanity chack post v590
# https://github.com/gwsw/less/commit/ed454a217da417dc052723ea70da8efde0f2e66c
Patch14: less-661-pipefix.patch
URL: https://www.greenwoodsoftware.com/less/
BuildRequires: ncurses-devel
BuildRequires: autoconf automake libtool
@ -35,17 +36,16 @@ files, and you'll use it frequently.
%prep
%setup -q
%patch4 -p1 -b .time
%patch5 -p1 -b .fsync
%patch6 -p1 -b .manpage-add-old-bot-option
%patch7 -p1 -b .help
%patch8 -p1 -b .lessecho-usage
%patch9 -p1 -b .less-filters-man
%patch10 -p1 -b .lesskey-usage
%patch11 -p1 -b .old-bot
%patch12 -p1 -b .CVE-2022-46663
%patch13 -p1 -b .CVE-2022-48624
%patch14 -p1 -b .CVE-2024-32487
%patch -P 4 -p1 -b .time
%patch -P 5 -p1 -b .fsync
%patch -P 6 -p1 -b .manpage-add-old-bot-option
%patch -P 8 -p1 -b .lessecho-usage
%patch -P 9 -p1 -b .less-filters-man
%patch -P 10 -p1 -b .lesskey-usage
%patch -P 11 -p1 -b .old-bot
%patch -P 12 -p1 -b .help
%patch -P 13 -p1 -b .fix_sast
%patch -P 14 -p1 -b .pipefix
%build
@ -69,29 +69,78 @@ install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT/etc/profile.d
%{_mandir}/man1/*
%changelog
* Tue Apr 23 2024 Matej Mužila <mmuzila@redhat.com> - 590-4
* Tue Nov 26 2024 MSVSphere Packaging Team <packager@msvsphere-os.ru> - 661-2
- Rebuilt for MSVSphere 10
* Sat Aug 10 2024 Michal Hlavinka <mhlavink@redhat.com> - 661-2
- fix post-v590 regression in file-types check
* Fri Jul 26 2024 Michal Hlavinka <mhlavink@redhat.com> - 661-1
- fix static analysis findigs (RHEL-40257)
- updated to 661
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 643-8
- Bump release for June 2024 mass rebuild
* Wed Jun 12 2024 Matej Mužila <mmuzila@redhat.com> - 643-7
- Bump release
- Related: RHEL-32740
* Tue Jun 04 2024 Matej Mužila <mmuzila@redhat.com> - 643-6
- Fix License field
- Related: RHEL-32740
* Tue Apr 23 2024 Matej Mužila <mmuzila@redhat.com> - 643-5
- Fix CVE-2024-32487
- Resolves: RHEL-33773
- Add gating.yaml
- Resolves: RHEL-32740
* Tue Feb 06 2024 Matej Mužila <mmuzila@redhat.com> - 643-4
- migrated to SPDX license
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 643-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 643-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Tue Sep 05 2023 Matej Mužila <mmuzila@redhat.com> - 643-1
- Update to new upstream release
- Resolves: #2231663
* Wed Feb 21 2024 Matej Mužila <mmuzila@redhat.com> 590-3
- Fix CVE-2022-48624
- Resolves: RHEL-26265
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 633-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Thu Apr 20 2023 Matej Mužila <mmuzila@redhat.com> 590-2
- Fix CVE-2022-46663
* Fri May 05 2023 Matej Mužila <mmuzila@redhat.com> - 633-1
- Update to new upstream release
- Resolves: CVE-2022-46663
* Tue Apr 19 2022 Honza Horak <hhorak@redhat.com> - 590-1
- Update to the version 590
- Also solves the "message overlay" in the terminal
Resolves: #2062188
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 608-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Thu Nov 24 2022 Matej Mužila <mmuzila@redhat.com> - 608-1
- Update to new upstream release
* Mon Jul 25 2022 Daan De Meyer <daan.j.demeyer@gmail.com> - 590-5
- Backport patch from upstream to fix memory leak
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 590-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 590-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Sat Oct 02 2021 FeRD (Frank Dana) <ferdnyc@gmail.com> - 590-2
- Backport patch from upstream to fix hyperlinked text bug
* Tue Aug 10 2021 Matej Mužila <mmuzila@redhat.com> - 590-1
- Update to new upstream release
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 575-4
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 581.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 575-3
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Thu May 6 2021 Filip Januš <fjanus@redhat.com> - 581.2-1
- Rebase to 581.2-1
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 575-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

Loading…
Cancel
Save