From 909cca65ab3a3c54c7def65a3713bfad63b032a6 Mon Sep 17 00:00:00 2001 From: eabdullin Date: Wed, 5 Nov 2025 07:42:35 +0000 Subject: [PATCH] import OL ksh-1.0.6-7.0.1.el9_6.2 --- SOURCES/RHEL-112564.patch | 80 +++++++++++++++++++++++++++++++++++++++ SPECS/ksh.spec | 12 +++++- 2 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 SOURCES/RHEL-112564.patch diff --git a/SOURCES/RHEL-112564.patch b/SOURCES/RHEL-112564.patch new file mode 100644 index 0000000..a14b7e7 --- /dev/null +++ b/SOURCES/RHEL-112564.patch @@ -0,0 +1,80 @@ +From e8554b5131fc32b26a6a0b0ab5cf24839e30161a Mon Sep 17 00:00:00 2001 +From: Martijn Dekker +Date: Sun, 30 Mar 2025 00:14:35 +0000 +Subject: [PATCH] Fix 'stty -echo' in scripts (re: 41ebb55a) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Vincent Mihalkovič (@vmihalko) reports: +> In ksh versions later than v1.0.0-beta.1, setting stty -echo in a +> script no longer works as expected. This issue did not occur in +> earlier versions. +> +> I performed a git bisect between the last known good tag (reboot) +> and the first known bad tag (v1.0.0-beta.1). The regression was +> introduced in commit 41ebb55a. +> +> Reproducer: +> read a +> stty -echo +> read b +> +> Expected Behavior: +> • Input for a should be visible. +> • Input for b should not be echoed to the terminal. +> +> Actual Behavior: +> • Input for a is visible as expected. +> • Input for b is also visible, despite stty -echo being set. + +Analysis: + +The problem was that the tty_set(-1, 0, NULL) call below, which +invalidates saved terminal attributes, was no longer being executed +when running a script (note that job.jobcontrol is 0/false for +scripts). See edit.c for the tty_set function and what it does. + +src/cmd/ksh93/sh/jobs.c +1423: else if(job.jobcontrol) +1424: { +1425: if(pw->p_pid == tcgetpgrp(JOBTTY)) +1426: { +...skipped for brevity... +1430: } +1431: tty_set(-1, 0, NULL); +1432: } + +So, after running an external command such as stty, terminal +attributes that should have been invalidated were restored upon the +next 'read'. This was undoing the effect of the stty command. + +src/cmd/ksh93/sh/jobs.c: job_wait(): +- Move the test for job.jobcontrol so that saved terminal + attributes are again invalidated after running an external + command when job control for interactive shells is not active. + +Resolves: https://github.com/ksh93/ksh/issues/836 +--- + src/cmd/ksh93/sh/jobs.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/cmd/ksh93/sh/jobs.c b/src/cmd/ksh93/sh/jobs.c +index be333b2..081e73a 100644 +--- a/src/cmd/ksh93/sh/jobs.c ++++ b/src/cmd/ksh93/sh/jobs.c +@@ -1492,9 +1492,9 @@ int job_wait(pid_t pid) + kill(sh.current_pid,SIGTSTP); + } + } +- else if(job.jobcontrol) ++ else + { +- if(pw->p_pid == tcgetpgrp(JOBTTY)) ++ if(job.jobcontrol && pw->p_pid == tcgetpgrp(JOBTTY)) + { + if(pw->p_pgrp==0) + pw->p_pgrp = pw->p_pid; +-- +2.47.3 + diff --git a/SPECS/ksh.spec b/SPECS/ksh.spec index d9536ca..bcafa62 100644 --- a/SPECS/ksh.spec +++ b/SPECS/ksh.spec @@ -4,7 +4,7 @@ URL: http://www.kornshell.com/ License: EPL-1.0 Epoch: 3 Version: 1.0.6 -Release: 7%{?dist}.1 +Release: 7.0.1%{?dist}.2 Source0: https://github.com/ksh93/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz Source1: kshcomp.conf Source2: kshrc.rhs @@ -37,6 +37,7 @@ Patch7: ksh-1.0.11-redir.patch # upstream commit: https://github.com/ksh93/ksh/commit/96d73c08a2786806f3def1fda66641b81e0af988 Patch8: ksh-1.0.11-ssh-multibyte-long-paste.patch +Patch9: RHEL-112564.patch Conflicts: pdksh Requires: coreutils, diffutils @@ -68,7 +69,7 @@ for f in -Wno-unknown-pragmas -Wno-missing-braces -Wno-unused-result -Wno-return do $CC $f -E - /dev/null 2>&1 && XTRAFLAGS="$XTRAFLAGS $f" done -export CCFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing $XTRAFLAGS" +export CCFLAGS="$RPM_OPT_FLAGS $RPM_LD_FLAGS -fno-strict-aliasing $XTRAFLAGS -DSHOPT_AUDIT -D_AST_no_spawnveg=1" export LDFLAGS="$RPM_LD_FLAGS" ./bin/package make @@ -159,6 +160,13 @@ fi %config(noreplace) %{_sysconfdir}/binfmt.d/kshcomp.conf %changelog +* Tue Nov 04 2025 EL Errata - 1.0.6-7.0.1 +- Disable _AST_no_spawnveg for taskset workaround [Orabug: 26754277] + +* Wed Oct 01 2025 RHEL Packaging Agent - 3:1.0.6-7.2 +- Fix 'stty -echo' in scripts +- Resolves: RHEL-112564 + * Tue Apr 22 2025 Vincent Mihalkovic - 3:1.0.6-7 - Fix long multibyte characters paste issue via ssh Resolves: RHEL-87336