Commit Graph

27 Commits

Author SHA1 Message Date
Vincent Mihalkovic
05db1c3657 Fix /dev/fd script redirection failure with iomovefd fd range
The original backport of upstream commit aa75399b (RHEL-146564) changed
sh_iomovefd(fd) to sh_iomovefd(fd,10), pushing script-open fds into the
>=10 internal range. On c8s, sh_iomovefd uses recursive dup() rather than
fcntl(F_DUPFD, minfd). dup() always returns the lowest available fd, so
reaching >=10 requires a chain of hops (3->4->5->...->10), each sensitive
to the fd table state at that moment. If another part of ksh opens or
closes an fd between hops, the chain lands somewhere unexpected. Upstream
avoids this with fcntl(F_DUPFD, 10), which jumps directly in one syscall.
This caused fd collisions with the 3-9 user-redirect range tracked by
shp->inuse_bits, resulting in "redirection failed [Bad file descriptor]"
under complex shell environments (set -x + PS4 command substitution +
module load).

Revert the minfd argument from 10 to 3 in path.c (path_opentype, exscript)
and main.c (fdin), restoring the original fd placement behavior while
preserving the /dev/fd $0 fix from RHEL-146564.

Resolves: RHEL-188169
2026-08-12 10:40:54 +02:00
Vincent Mihalkovic
c016a5477f Fix /dev/fd/1 memory fault and $0 for /dev/fd scripts
Resolves: RHEL-92633
Assisted-by: Cursor <cursoragent@cursor.com>
2026-02-16 10:21:59 +01:00
Vincent Mihalkovic
959290d36a Fix arbitrary command execution/code injection bugs
Resolves: RHEL-92629
2025-07-22 09:21:44 +02:00
Lukáš Zaoral
292d2231cb
Further fix long multibyte characters paste issue via ssh
Resolves: RHEL-87334
2025-06-25 15:47:56 +02:00
Vincent Mihalkovic
827e22a8ad Fix long multibyte characters paste issue via ssh
Resolves: RHEL-87334
2025-04-22 12:28:54 +02:00
Lukáš Zaoral
21778eb5a7
tests: add tmt gating test plans 2025-04-08 17:16:51 +02:00
Vincent Mihalkovic
527d78f809 Re-fix segfault in strdup
Resolves: RHEL-11982
2024-02-09 23:49:53 +01:00
Lukáš Zaoral
916efa1a46
fix crashes when interrupting subshells
Resolves: RHEL-11650
2024-01-26 15:25:04 +01:00
Lukáš Zaoral
78ec023ab0
fix spec formatting issues
Related: RHEL-5685
2024-01-25 13:12:50 +01:00
Vincent Mihalkovic
779e1ffa8b Related: RHEL-5685 - version bump 2024-01-24 16:56:38 +01:00
Vincent Mihalkovic
b1187a33ba Resolves: RHEL-5685 - Fix crash on failure to trim ~/.sh_history 2024-01-04 11:01:24 +01:00
Vincent Mihalkovic
6a16730bcb Remove broken monitor patch
Resolves: RHEL-12007
2023-11-29 17:41:32 +01:00
Lukáš Zaoral
eb90e29c72
fix UTF-8 quoting in xtrace
Resolves: RHEL-5684
2023-11-09 13:25:20 +01:00
Lukáš Zaoral
f829dff142
fix segfault in subshell if $PATH contains a .paths directory
Resolves: RHEL-12011
2023-11-08 17:00:51 +01:00
Lukáš Zaoral
505cee0471
Fix segfault in strdup
Resolves: RHEL-11982
2023-11-01 13:19:55 +01:00
Lukáš Zaoral
bf69d0e2dd
gating.yaml: add tier 1 tests 2023-09-18 12:58:38 +02:00
Lukáš Zaoral
5e29b60a5c
Fix set +r so that it cannot unset the restricted option
Resolves: #1948588
2023-09-18 12:49:48 +02:00
Vincent Mihalkovic
cac71b92c8 Resolves: #2013909 - Fix crash on trying a very long command 2023-08-25 14:00:08 +02:00
Vincent Mihalkovic
29db36d4a4 Resolves: #2226653 - disable vmalloc and force use of the operating system's malloc 2023-07-26 15:35:21 +02:00
Adam Samalik
e9d1130015 re-import sources as agreed with the maintainer 2023-07-10 14:23:45 +02:00
Troy Dawson
0d0d2615d0 Bring gating.yaml over from Brew dist-git
Signed-off-by: Troy Dawson <tdawson@redhat.com>
2023-03-10 10:48:02 -08:00
James Antill
e26637d26f Import rpm: c8s 2023-02-27 13:51:52 -05:00
CentOS Sources
24ef83b488 Auto sync2gitlab import of ksh-20120801-257.el8.src.rpm 2022-08-28 16:14:47 +00:00
CentOS Sources
2f1643be58 Auto sync2gitlab import of ksh-20120801-256.el8.src.rpm 2022-08-02 08:12:41 +00:00
James Antill
cd9fd2352b Auto sync2gitlab import of ksh-20120801-255.el8.src.rpm 2022-06-06 22:03:51 -04:00
James Antill
94d304104c Auto sync2gitlab import of ksh-20120801-254.el8.src.rpm 2022-05-26 10:05:36 -04:00
James Antill
24475d3af8 Initial c8s branch. 2022-05-26 10:05:29 -04:00