From 02192eab20715e033e5b8ecfb6cf0ef538eab0c5 Mon Sep 17 00:00:00 2001 From: Vincent Mihalkovic Date: Fri, 26 Jul 2024 14:50:48 +0200 Subject: [PATCH] rebase to the newest 1.0.10 version Resolves: RHEL-45981 --- .gitignore | 2 + ksh-1.0.8-fix-strdup-on-null.patch | 62 ------------------------------ ksh.spec | 10 ++--- sources | 2 +- 4 files changed, 8 insertions(+), 68 deletions(-) delete mode 100644 ksh-1.0.8-fix-strdup-on-null.patch diff --git a/.gitignore b/.gitignore index 084bc66..3b7fae6 100644 --- a/.gitignore +++ b/.gitignore @@ -69,3 +69,5 @@ INIT.2010-07-01.tgz /ksh-1.0.6.tar.gz /ksh-1.0.7.tar.gz /ksh-1.0.8.tar.gz +/ksh-1.0.9.tar.gz +/ksh-1.0.10.tar.gz diff --git a/ksh-1.0.8-fix-strdup-on-null.patch b/ksh-1.0.8-fix-strdup-on-null.patch deleted file mode 100644 index 3a2d3f2..0000000 --- a/ksh-1.0.8-fix-strdup-on-null.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 9eb8532ccacf1cfdb7ba18f51eba68776852ef7c Mon Sep 17 00:00:00 2001 -From: Vincent Mihalkovic -Date: Thu, 8 Feb 2024 22:10:58 +0100 -Subject: [PATCH] Re-fix use of strdup on a NULL pointer (re: 9a9da2c2) (#718) - -Thank you @lzaoral for debugging this issue and creating this -reproducer: - -$ tty # check that the shell is connected to a pseudoterminal -/dev/pts/4 -$ mkdir /var/tmp/chroottest -$ dnf --releasever=39 --installroot=/var/tmp/chroottest install ksh -$ echo "/dev/udp/127.0.0.1/514;0;104" | - sudo tee /var/tmp/chroottest/etc/ksh_audit -$ sudo chroot /var/tmp/chroottest /bin/ksh -lic 'exit 0' -(ksh segfaults) - -Analysis: On Linux, ttyname(3)[*] may fail if: - -* EBADF Bad file descriptor. -* ENODEV fd refers to a slave pseudoterminal device but the - corresponding pathname could not be found [...]. -* ENOTTY fd does not refer to a terminal device. - -Calling isatty(3) before ttyname(3) only prevents the first and -third cases. - -src/cmd/ksh93/edit/history.c: sh_histinit(): -- To catch the second case, let's call ttyname(2) directly, check - for NULL and remove the redundant isatty() call. - -[*] https://man7.org/linux/man-pages/man3/ttyname.3.html - -Cherry-picked-by: Lukáš Zaoral -Upstream-commit: 9eb8532ccacf1cfdb7ba18f51eba68776852ef7c - ---- - src/cmd/ksh93/edit/history.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/src/cmd/ksh93/edit/history.c b/src/cmd/ksh93/edit/history.c -index a7b084e5c16f..25832a59265b 100644 ---- a/src/cmd/ksh93/edit/history.c -+++ b/src/cmd/ksh93/edit/history.c -@@ -15,6 +15,7 @@ - * Johnothan King * - * hyenias <58673227+hyenias@users.noreply.github.com> * - * Govind Kamat * -+* Vincent Mihalkovic * - * * - ***********************************************************************/ - /* -@@ -353,7 +354,8 @@ int sh_histinit(void) - if(fd>=0) - { - fcntl(fd,F_SETFD,FD_CLOEXEC); -- hp->tty = sh_strdup(isatty(2)?ttyname(2):"notty"); -+ const char* tty = ttyname(2); -+ hp->tty = sh_strdup(tty?tty:"notty"); - hp->auditfp = sfnew(NULL,NULL,-1,fd,SF_WRITE); - } - } diff --git a/ksh.spec b/ksh.spec index 5cbd1a3..dfbc0af 100644 --- a/ksh.spec +++ b/ksh.spec @@ -3,16 +3,13 @@ Summary: The Original ATT Korn Shell URL: http://www.kornshell.com/ License: EPL-2.0 Epoch: 3 -Version: 1.0.8 -Release: 5%{?dist} +Version: 1.0.10 +Release: 1%{?dist} Source0: https://github.com/ksh93/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz Source1: kshcomp.conf Source2: kshrc.rhs Source3: dotkshrc -# Re-fix use of strdup on a NULL pointer (RHEL-11982) -Patch1: ksh-1.0.8-fix-strdup-on-null.patch - Conflicts: pdksh Requires: coreutils, diffutils BuildRequires: gcc @@ -141,6 +138,9 @@ fi %config(noreplace) %{_sysconfdir}/binfmt.d/kshcomp.conf %changelog +* Mon Aug 05 2024 Vincent Mihalkovic - 3:1.0.10-1 +- new upstream release (RHEL-45981) + * Mon Jun 24 2024 Troy Dawson - 3:1.0.8-5 - Bump release for June 2024 mass rebuild diff --git a/sources b/sources index 492f8c8..723164f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ksh-1.0.8.tar.gz) = 4284ab98f6055877c0715a8b224eb5a75dc7fa022f38c9ee30d50786e997f70b507ee452fc8bbdfa67649a26e0fdfc8051f7e54ff9f6a0f96e44498757080548 +SHA512 (ksh-1.0.10.tar.gz) = 055bd2cf188c825ed684e6f95991a70f8b672e31a94a2294b8791de96be7d9dbf49e2d1eddb3490559c15736a2e0f40839529253481f1217e5e134f046cbe41f