Compare commits
No commits in common. "c8" and "c8s" have entirely different histories.
1
.fmf/version
Normal file
1
.fmf/version
Normal file
@ -0,0 +1 @@
|
||||
1
|
63
.gitignore
vendored
63
.gitignore
vendored
@ -1,2 +1,61 @@
|
||||
SOURCES/INIT.2012-08-01.tgz
|
||||
SOURCES/ast-ksh.2012-08-01.tgz
|
||||
ast-ksh.2010-07-01.tgz
|
||||
INIT.2010-07-01.tgz
|
||||
/ast-ksh.2010-08-11.tgz
|
||||
/INIT.2010-08-11.tgz
|
||||
/ast-ksh.2010-08-26.tgz
|
||||
/INIT.2010-08-26.tgz
|
||||
/ast-ksh.2010-09-24.tgz
|
||||
/INIT.2010-09-24.tgz
|
||||
/ast-ksh.2010-10-10.tgz
|
||||
/INIT.2010-10-10.tgz
|
||||
/ast-ksh.2010-10-26.tgz
|
||||
/INIT.2010-10-26.tgz
|
||||
/ast-ksh.2010-11-22.tgz
|
||||
/INIT.2010-11-22.tgz
|
||||
/ast-ksh.2010-12-01.tgz
|
||||
/INIT.2010-12-01.tgz
|
||||
/ast-ksh.2010-12-12.tgz
|
||||
/INIT.2010-12-12.tgz
|
||||
/ast-ksh.2011-01-04.tgz
|
||||
/INIT.2011-01-04.tgz
|
||||
/ast-ksh.2011-01-18.tgz
|
||||
/INIT.2011-01-18.tgz
|
||||
/ast-ksh.2011-01-27.tgz
|
||||
/INIT.2011-01-27.tgz
|
||||
/ast-ksh.2011-01-31.tgz
|
||||
/INIT.2011-01-31.tgz
|
||||
/ast-ksh.2011-02-02.tgz
|
||||
/INIT.2011-02-02.tgz
|
||||
/ast-ksh.2011-02-08.tgz
|
||||
/INIT.2011-02-08.tgz
|
||||
/ast-ksh.2011-04-15.tgz
|
||||
/INIT.2011-04-15.tgz
|
||||
/ast-ksh.2011-04-28.tgz
|
||||
/INIT.2011-04-28.tgz
|
||||
/ast-ksh.2011-05-05.tgz
|
||||
/INIT.2011-05-05.tgz
|
||||
/ast-ksh.2011-06-30.tgz
|
||||
/INIT.2011-06-30.tgz
|
||||
/ast-ksh.2012-01-01.tgz
|
||||
/INIT.2012-01-01.tgz
|
||||
/ast-ksh.2012-02-02.tgz
|
||||
/INIT.2012-02-02.tgz
|
||||
/ast-ksh.2012-02-14.tgz
|
||||
/INIT.2012-02-14.tgz
|
||||
/ast-ksh.2012-02-29.tgz
|
||||
/INIT.2012-02-29.tgz
|
||||
/ast-ksh.2012-05-31.tgz
|
||||
/INIT.2012-05-31.tgz
|
||||
/ast-ksh.2012-06-12.tgz
|
||||
/INIT.2012-06-12.tgz
|
||||
/ast-ksh.2012-06-20.tgz
|
||||
/INIT.2012-06-20.tgz
|
||||
/ast-ksh.2012-06-26.tgz
|
||||
/INIT.2012-06-26.tgz
|
||||
/ast-ksh.2012-06-28.tgz
|
||||
/INIT.2012-06-28.tgz
|
||||
/ast-ksh.2012-07-27.tgz
|
||||
/INIT.2012-07-27.tgz
|
||||
/ast-ksh.2012-08-01.tgz
|
||||
/INIT.2012-08-01.tgz
|
||||
/ast-ksh.2012-08-01b.tgz
|
||||
|
6
gating.yaml
Normal file
6
gating.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
--- !Policy
|
||||
product_versions:
|
||||
- rhel-8
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: osci.brew-build./plans/tier1-internal.functional}
|
145
ksh-1.0.11-ssh-multibyte-long-paste.patch
Normal file
145
ksh-1.0.11-ssh-multibyte-long-paste.patch
Normal file
@ -0,0 +1,145 @@
|
||||
From 4886463bb6d3df2b827d784a97e13c7765d57178 Mon Sep 17 00:00:00 2001
|
||||
From: Martijn Dekker <martijn@inlv.org>
|
||||
Date: Sat, 12 Feb 2022 21:27:36 +0000
|
||||
Subject: [PATCH] Disable broken KEYBD trap for multibyte characters
|
||||
|
||||
In UTF-8 locales, ksh breaks when a KEYBD trap is active, even a
|
||||
dummy no-op one like 'trap : KEYBD'. Entering multi-byte characters
|
||||
fails (the input is interrupted and a new prompt is displayed) and
|
||||
pasting content with multi-byte characters produces corrupted
|
||||
results.
|
||||
|
||||
The cause is that the KEYBD trap code is not multibyte-ready.
|
||||
Unfortunately nobody yet understands the edit.c code well enough
|
||||
to implement a proper fix. Pending that, this commit implements
|
||||
a workaround that at least avoids breaking the shell.
|
||||
|
||||
src/cmd/ksh93/edit/edit.c: ed_getchar():
|
||||
- When a multi-byte locale is active, do not trigger the the KEYBD
|
||||
trap except for ASCII characters (1-127).
|
||||
|
||||
Resolves: https://github.com/ksh93/ksh/issues/307
|
||||
|
||||
(cherry-picked from 4886463bb6d3df2b827d784a97e13c7765d57178)
|
||||
---
|
||||
src/cmd/ksh93/edit/edit.c | 5 ++++-
|
||||
src/cmd/ksh93/sh.1 | 4 ++++
|
||||
2 files changed, 8 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/cmd/ksh93/edit/edit.c b/src/cmd/ksh93/edit/edit.c
|
||||
index d9933b63bb6a..371f5a9ec8fb 100644
|
||||
--- a/src/cmd/ksh93/edit/edit.c
|
||||
+++ b/src/cmd/ksh93/edit/edit.c
|
||||
@@ -1122,7 +1122,10 @@ int ed_getchar(register Edit_t *ep,int mode)
|
||||
killpg(getpgrp(),SIGINT);
|
||||
siglongjmp(ep->e_env, UINTR);
|
||||
}
|
||||
- if(mode<=0 && ep->sh->st.trap[SH_KEYTRAP])
|
||||
+ if(mode<=0 && ep->sh->st.trap[SH_KEYTRAP]
|
||||
+ /* workaround for <https://github.com/ksh93/ksh/issues/307>:
|
||||
+ * do not trigger KEYBD for non-ASCII in multibyte locale */
|
||||
+ && (CC_NATIVE!=CC_ASCII || !mbwide() || c > -128))
|
||||
{
|
||||
ep->e_keytrap = 1;
|
||||
n=1;
|
||||
diff --git a/src/cmd/ksh93/sh.1 b/src/cmd/ksh93/sh.1
|
||||
index 841c28a43bb8..61f71c2d1698 100644
|
||||
--- a/src/cmd/ksh93/sh.1
|
||||
+++ b/src/cmd/ksh93/sh.1
|
||||
@@ -9062,6 +9062,10 @@ Thus, a trap on
|
||||
.B CHLD
|
||||
won't be executed until the foreground job terminates.
|
||||
.PP
|
||||
+In locales that use a multibyte character set such as UTF-8, the
|
||||
+.B KEYBD
|
||||
+trap is only triggered for ASCII characters (1-127).
|
||||
+.PP
|
||||
It is a good idea to leave a space after the comma operator in
|
||||
arithmetic expressions to prevent the comma from being interpreted
|
||||
as the decimal point character in certain locales.
|
||||
|
||||
From 96d73c08a2786806f3def1fda66641b81e0af988 Mon Sep 17 00:00:00 2001
|
||||
From: SHIMIZU Akifumi <shimizu.akifumi@fujitsu.com>
|
||||
Date: Mon, 7 Apr 2025 19:47:16 +0900
|
||||
Subject: [PATCH] Fix long multibyte characters paste issue via ssh (#840)
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
When I paste long multibyte characters(over 80 byte) to ksh via
|
||||
SSH, the characters are not displayed correctly. For example, the
|
||||
following input demonstrates the issue. ja_JP.UTF-8 encoding is
|
||||
used.
|
||||
|
||||
Expected command line display:
|
||||
$ echo "長い文字列を入れるとkshで文字列が乱れる場合があるようです"
|
||||
|
||||
Actual command line display:
|
||||
$ です"echo "長い文字列を入れるとkshで文字列が乱れる場合がある
|
||||
...with the cursor over the 'e' in 'echo'.
|
||||
|
||||
This issue appears to be caused by the ed_read() function splitting
|
||||
a multibyte character sequence when reading into an 80-byte buffer.
|
||||
This leads to incorrect character interpretation and display.
|
||||
|
||||
Therefore, we edited the code to handle the case where the buffer
|
||||
size is full in the middle of a multi-byte character.
|
||||
|
||||
src/cmd/ksh93/sh/edit.c:
|
||||
- putstack():
|
||||
- Before retrying to interpret a multibyte character in case of a
|
||||
split due to end of buffer, restore the start position 'p'.
|
||||
- Fix zeroing out errno = EILSEQ.
|
||||
- ed_getchar(): Avoid a potential buffer overflow in 'readin';
|
||||
allow for an extra multibyte character, not merely an extra byte.
|
||||
|
||||
Co-authored-by: Martijn Dekker <martijn@inlv.org>
|
||||
---
|
||||
src/cmd/ksh93/edit/edit.c | 12 +++++++-----
|
||||
1 files changed, 7 insertions(+), 5 deletions(-)
|
||||
diff --git a/src/cmd/ksh93/edit/edit.c b/src/cmd/ksh93/edit/edit.c
|
||||
index b0a8de5..d827331 100644
|
||||
--- a/src/cmd/ksh93/edit/edit.c
|
||||
+++ b/src/cmd/ksh93/edit/edit.c
|
||||
@@ -973,6 +973,7 @@ static int putstack(Edit_t *ep,char string[], register int nbyte, int type)
|
||||
}
|
||||
else
|
||||
{
|
||||
+ char *prevp = p;
|
||||
again:
|
||||
if((c=mbchar(p)) >=0)
|
||||
{
|
||||
@@ -980,19 +981,20 @@ static int putstack(Edit_t *ep,char string[], register int nbyte, int type)
|
||||
if(type)
|
||||
c = -c;
|
||||
}
|
||||
-#ifdef EILSEQ
|
||||
- else if(errno == EILSEQ)
|
||||
- errno = 0;
|
||||
-#endif
|
||||
else if((endp-p) < mbmax())
|
||||
{
|
||||
+ if(errno == EILSEQ)
|
||||
+ errno = 0;
|
||||
if ((c=ed_read(ep,ep->e_fd,endp, 1,0)) == 1)
|
||||
{
|
||||
+ p = prevp;
|
||||
*++endp = 0;
|
||||
goto again;
|
||||
}
|
||||
return(c);
|
||||
}
|
||||
+ else if(errno == EILSEQ)
|
||||
+ errno = 0;
|
||||
else
|
||||
{
|
||||
ed_ringbell();
|
||||
@@ -1044,7 +1046,7 @@ static int putstack(Edit_t *ep,char string[], register int nbyte, int type)
|
||||
int ed_getchar(register Edit_t *ep,int mode)
|
||||
{
|
||||
register int n, c;
|
||||
- char readin[LOOKAHEAD+1];
|
||||
+ char *readin = fmtbuf(LOOKAHEAD + mbmax());
|
||||
if(!ep->e_lookahead)
|
||||
{
|
||||
ed_flush(ep);
|
40
ksh-20120801-noexeccdfix.patch
Normal file
40
ksh-20120801-noexeccdfix.patch
Normal file
@ -0,0 +1,40 @@
|
||||
From b8260293a8ed7849a358291faae7b58f4a05dcc9 Mon Sep 17 00:00:00 2001
|
||||
From: Kamil Dudka <kdudka@redhat.com>
|
||||
Date: Mon, 10 Nov 2014 18:23:34 +0100
|
||||
Subject: [PATCH] Resolves: #1160923 - handle failure of fchdir()
|
||||
|
||||
... and chdir()
|
||||
---
|
||||
src/cmd/ksh93/bltins/cd_pwd.c | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/cmd/ksh93/bltins/cd_pwd.c b/src/cmd/ksh93/bltins/cd_pwd.c
|
||||
index a972da6..c20959c 100644
|
||||
--- a/src/cmd/ksh93/bltins/cd_pwd.c
|
||||
+++ b/src/cmd/ksh93/bltins/cd_pwd.c
|
||||
@@ -329,18 +329,20 @@ int b_cd(int argc, char *argv[],Shbltin_t *context)
|
||||
if(newdirfd >=0)
|
||||
{
|
||||
/* chdir for directories on HSM/tapeworms may take minutes */
|
||||
- if(fchdir(newdirfd) >= 0)
|
||||
+ if((rval=fchdir(newdirfd)) >= 0)
|
||||
{
|
||||
if(shp->pwdfd >= 0)
|
||||
sh_close(shp->pwdfd);
|
||||
shp->pwdfd=newdirfd;
|
||||
goto success;
|
||||
}
|
||||
+ else
|
||||
+ sh_close(newdirfd);
|
||||
}
|
||||
#ifndef O_SEARCH
|
||||
else
|
||||
{
|
||||
- if(chdir(dir) >=0)
|
||||
+ if((rval=chdir(dir)) >=0)
|
||||
{
|
||||
if(shp->pwdfd >= 0)
|
||||
{
|
||||
--
|
||||
2.1.0
|
||||
|
@ -6,7 +6,7 @@ Summary: The Original ATT Korn Shell
|
||||
URL: http://www.kornshell.com/
|
||||
License: EPL-1.0
|
||||
Version: %{releasedate}
|
||||
Release: 267%{?dist}
|
||||
Release: 269%{?dist}
|
||||
Source0: http://www.research.att.com/~gsf/download/tgz/ast-ksh.%{release_date}.tgz
|
||||
Source1: http://www.research.att.com/~gsf/download/tgz/INIT.%{release_date}.tgz
|
||||
Source2: kshcomp.conf
|
||||
@ -258,6 +258,11 @@ Patch99: %{name}-1.0.7-history-trim.patch
|
||||
# upstream commit: https://github.com/ksh93/ksh/commit/91a7c2e3e9feb8ac1391146ebcda9e6adfcd3cfb
|
||||
Patch100: ksh-20120801-subshell-interrupt-segv.patch
|
||||
|
||||
# RHEL-87334
|
||||
# upstream commit: https://github.com/ksh93/ksh/commit/4886463bb6d3df2b827d784a97e13c7765d57178
|
||||
# upstream commit: https://github.com/ksh93/ksh/commit/96d73c08a2786806f3def1fda66641b81e0af988
|
||||
Patch101: ksh-1.0.11-ssh-multibyte-long-paste.patch
|
||||
|
||||
Conflicts: pdksh
|
||||
Requires: coreutils, diffutils, chkconfig
|
||||
BuildRequires: bison
|
||||
@ -411,6 +416,14 @@ fi
|
||||
%config(noreplace) %{_sysconfdir}/binfmt.d/kshcomp.conf
|
||||
|
||||
%changelog
|
||||
* Wed Jun 25 2025 Lukáš Zaoral <lzaoral@redhat.com> - 20120801-269
|
||||
- Further fix long multibyte characters paste issue via ssh
|
||||
Resolves: RHEL-87334
|
||||
|
||||
* Tue Apr 22 2025 Vincent Mihalkovic <vmihalko@redhat.com> - 20120801-268
|
||||
- Fix long multibyte characters paste issue via ssh
|
||||
Resolves: RHEL-87334
|
||||
|
||||
* Fri Feb 09 2024 Vincent Mihalkovic <vmihalko@redhat.com> - 20120801-267
|
||||
- Re-fix segfault in strdup
|
||||
Resolves: RHEL-11982
|
27
plans/tier1-internal.fmf
Normal file
27
plans/tier1-internal.fmf
Normal file
@ -0,0 +1,27 @@
|
||||
summary: Internal gating tests plan
|
||||
discover:
|
||||
- name: Internal gating tests plan (bash)
|
||||
how: fmf
|
||||
filter: 'tag: CI-Tier-1 & component: ksh'
|
||||
url: https://pkgs.devel.redhat.com/git/tests/bash
|
||||
- name: Internal gating tests plan (dash)
|
||||
how: fmf
|
||||
filter: 'tag: CI-Tier-1 & component: ksh'
|
||||
url: https://pkgs.devel.redhat.com/git/tests/dash
|
||||
- name: Internal gating tests plan (ksh)
|
||||
how: fmf
|
||||
filter: 'tag: CI-Tier-1 & component: ksh'
|
||||
url: https://pkgs.devel.redhat.com/git/tests/ksh
|
||||
- name: Internal gating tests plan (mksh)
|
||||
how: fmf
|
||||
filter: 'tag: CI-Tier-1 & component: ksh'
|
||||
url: https://pkgs.devel.redhat.com/git/tests/mksh
|
||||
- name: Internal gating tests plan (zsh)
|
||||
how: fmf
|
||||
filter: 'tag: CI-Tier-1 & component: ksh'
|
||||
url: https://pkgs.devel.redhat.com/git/tests/zsh
|
||||
execute:
|
||||
how: tmt
|
||||
adjust:
|
||||
enabled: false
|
||||
when: distro == centos-stream or distro == fedora
|
2
sources
Normal file
2
sources
Normal file
@ -0,0 +1,2 @@
|
||||
SHA512 (ast-ksh.2012-08-01.tgz) = 244df8c4cbcd719da24bfc6e52272488e0a06a7274725cb7490db183a021a7c035a305c2c3682b8cddc84bb14ac7f31903ef46c59ff32bcb19317b3b05fa9353
|
||||
SHA512 (INIT.2012-08-01.tgz) = 4a598e862ecaf9e5bd820f54404f3898b8f3c0fe95f4820a79565ae3c5fc973e3010b7d475dfb762ad716a3e4fb5ab9d184e20bfcec889ce742c3ff30d0233c4
|
Loading…
Reference in New Issue
Block a user