Compare commits
No commits in common. "a4d40a79b3a355a9337112390ca4a07de944f6bf" and "56a2e8264ce747a2c96b5888741e60669c5a7e54" have entirely different histories.
a4d40a79b3
...
56a2e8264c
93
CVE-2019-14868.patch
Normal file
93
CVE-2019-14868.patch
Normal file
@ -0,0 +1,93 @@
|
||||
From 808df797a15d7f363ff8f4ee4249a33876694b4a Mon Sep 17 00:00:00 2001
|
||||
From: Kurtis Rader <krader@skepticism.us>
|
||||
Date: Thu, 12 Dec 2019 18:46:50 -0800
|
||||
Subject: [PATCH] Harden env var imports
|
||||
|
||||
---
|
||||
src/cmd/ksh93/sh/arith.c | 37 +++++++++++++++++++++++++------------
|
||||
src/cmd/ksh93/tests/subshell.sh | 23 +++++++++++++++++++++++
|
||||
2 files changed, 48 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/src/cmd/ksh93/sh/arith.c b/src/cmd/ksh93/sh/arith.c
|
||||
index 5ca3fce..53eb45e 100644
|
||||
--- a/src/cmd/ksh93/sh/arith.c
|
||||
+++ b/src/cmd/ksh93/sh/arith.c
|
||||
@@ -567,19 +567,32 @@ Sfdouble_t sh_strnum(Shell_t *shp, const char *str, char **ptr, int mode) {
|
||||
char *last;
|
||||
|
||||
if (*str == 0) {
|
||||
- if (ptr) *ptr = (char *)str;
|
||||
- return 0;
|
||||
- }
|
||||
- errno = 0;
|
||||
- d = number(str, &last, shp->inarith ? 0 : 10, NULL);
|
||||
- if (*last) {
|
||||
- if (*last != '.' || last[1] != '.') {
|
||||
- d = strval(shp, str, &last, arith, mode);
|
||||
- Varsubscript = true;
|
||||
+ d = 0.0;
|
||||
+ last = (char *)str;
|
||||
+ } else {
|
||||
+ d = number(str, &last, shp->inarith ? 0 : 10, NULL);
|
||||
+ if (*last && !shp->inarith && sh_isstate(shp, SH_INIT)) {
|
||||
+ // This call is to handle "base#value" literals if we're importing untrusted env vars.
|
||||
+ d = number(str, &last, 0, NULL);
|
||||
+ }
|
||||
+ if (*last) {
|
||||
+ if (sh_isstate(shp, SH_INIT)) {
|
||||
+ // Initializing means importing untrusted env vars. Since the string does not appear
|
||||
+ // to be a recognized numeric literal give up. We can't safely call strval() since
|
||||
+ // that allows arbitrary expressions which would create a security vulnerability.
|
||||
+ d = 0.0;
|
||||
+ } else {
|
||||
+ if (*last != '.' || last[1] != '.') {
|
||||
+ d = strval(shp, str, &last, arith, mode);
|
||||
+ Varsubscript = true;
|
||||
+ }
|
||||
+ if (!ptr && *last && mode > 0) {
|
||||
+ errormsg(SH_DICT, ERROR_exit(1), e_lexbadchar, *last, str);
|
||||
+ }
|
||||
+ }
|
||||
+ } else if (d == 0.0 && *str == '-') {
|
||||
+ d = -0.0;
|
||||
}
|
||||
- if (!ptr && *last && mode > 0) errormsg(SH_DICT, ERROR_exit(1), e_lexbadchar, *last, str);
|
||||
- } else if (!d && *str == '-') {
|
||||
- d = -0.0;
|
||||
}
|
||||
if (ptr) *ptr = last;
|
||||
return d;
|
||||
diff --git a/src/cmd/ksh93/tests/subshell.sh b/src/cmd/ksh93/tests/subshell.sh
|
||||
index b63a805..3faba47 100644
|
||||
--- a/src/cmd/ksh93/tests/subshell.sh
|
||||
+++ b/src/cmd/ksh93/tests/subshell.sh
|
||||
@@ -856,3 +856,26 @@ for exp in 65535 65536
|
||||
do got=$($SHELL -c 'x=$(printf "%.*c" '$exp' x); print ${#x}' 2>&1)
|
||||
[[ $got == $exp ]] || log_error "large command substitution failed" "$exp" "$got"
|
||||
done
|
||||
+
|
||||
+# ==========
|
||||
+# Verify that importing untrusted env vars does not allow evaluating arbitrary expressions but does
|
||||
+# recognize all integer literals recognized by ksh.
|
||||
+expect=8
|
||||
+actual=$(env SHLVL='7' $SHELL -c 'echo $SHLVL')
|
||||
+[[ $actual == $expect ]] || log_error "decimal int literal not recognized" "$expect" "$actual"
|
||||
+
|
||||
+expect=14
|
||||
+actual=$(env SHLVL='013' $SHELL -c 'echo $SHLVL')
|
||||
+[[ $actual == $expect ]] || log_error "leading zeros int literal not recognized" "$expect" "$actual"
|
||||
+
|
||||
+expect=4
|
||||
+actual=$(env SHLVL='2#11' $SHELL -c 'echo $SHLVL')
|
||||
+[[ $actual == $expect ]] || log_error "base#value int literal not recognized" "$expect" "$actual"
|
||||
+
|
||||
+expect=12
|
||||
+actual=$(env SHLVL='16#B' $SHELL -c 'echo $SHLVL')
|
||||
+[[ $actual == $expect ]] || log_error "base#value int literal not recognized" "$expect" "$actual"
|
||||
+
|
||||
+expect=1
|
||||
+actual=$(env SHLVL="2#11+x[\$($bin_echo DANGER WILL ROBINSON >&2)0]" $SHELL -c 'echo $SHLVL')
|
||||
+[[ $actual == $expect ]] || log_error "expression allowed on env var import" "$expect" "$actual"
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
120
backport-Fix-handling-of-skipped-directories.patch
Normal file
120
backport-Fix-handling-of-skipped-directories.patch
Normal file
@ -0,0 +1,120 @@
|
||||
From a1e1592ac7028659d09eb3fa6c8a2227cba9f2a9 Mon Sep 17 00:00:00 2001
|
||||
From: Kurtis Rader <krader@skepticism.us>
|
||||
Date: Wed, 8 Jan 2020 19:14:31 -0800
|
||||
Subject: [PATCH] Fix handling of skipped directories
|
||||
|
||||
The bug in `path_opentype()` fixed by this commit may affect other
|
||||
scenarios but we know it affects autoloaded functions. Hence the unit
|
||||
test for that scenario.
|
||||
|
||||
Fixes #1454
|
||||
|
||||
(cherry picked from commit 3bc58164494eecc180e2bad966d7753bfdd1e295)
|
||||
---
|
||||
src/cmd/ksh93/sh/path.c | 16 +++++++++-------
|
||||
src/cmd/ksh93/tests/autoload.sh | 15 +++++++++++++++
|
||||
src/cmd/ksh93/tests/data/skipped_dir | 15 +++++++++++++++
|
||||
src/cmd/ksh93/tests/meson.build | 1 +
|
||||
4 files changed, 40 insertions(+), 7 deletions(-)
|
||||
create mode 100644 src/cmd/ksh93/tests/autoload.sh
|
||||
create mode 100644 src/cmd/ksh93/tests/data/skipped_dir
|
||||
|
||||
diff --git a/src/cmd/ksh93/sh/path.c b/src/cmd/ksh93/sh/path.c
|
||||
index 69382f9..b7869b3 100644
|
||||
--- a/src/cmd/ksh93/sh/path.c
|
||||
+++ b/src/cmd/ksh93/sh/path.c
|
||||
@@ -475,28 +475,30 @@ Pathcomp_t *path_get(Shell_t *shp, const char *name) {
|
||||
//
|
||||
static_fn int path_opentype(Shell_t *shp, const char *name, Pathcomp_t *pp, int fun) {
|
||||
int fd = -1;
|
||||
- struct stat statb;
|
||||
- Pathcomp_t *oldpp;
|
||||
|
||||
if (!pp && !shp->pathlist) path_init(shp);
|
||||
if (!fun && strchr(name, '/') && sh_isoption(shp, SH_RESTRICTED)) {
|
||||
errormsg(SH_DICT, ERROR_exit(1), e_restricted, name);
|
||||
__builtin_unreachable();
|
||||
}
|
||||
+
|
||||
+ // The structure of this loop is slightly odd. It's a consequence of how path_nextcomp() works.
|
||||
+ Pathcomp_t *next_pp = pp;
|
||||
do {
|
||||
- pp = path_nextcomp(shp, oldpp = pp, name, 0);
|
||||
- while (oldpp && (oldpp->flags & PATH_SKIP)) oldpp = oldpp->next;
|
||||
- if (fun && (!oldpp || !(oldpp->flags & PATH_FPATH))) continue;
|
||||
+ pp = next_pp;
|
||||
+ next_pp = path_nextcomp(shp, pp, name, NULL);
|
||||
+ if (pp && (pp->flags & PATH_SKIP)) continue;
|
||||
+ if (fun && (!pp || !(pp->flags & PATH_FPATH))) continue;
|
||||
fd = sh_open(path_relative(shp, stkptr(shp->stk, PATH_OFFSET)), O_RDONLY | O_CLOEXEC, 0);
|
||||
+ struct stat statb;
|
||||
if (fd >= 0 && (fstat(fd, &statb) < 0 || S_ISDIR(statb.st_mode))) {
|
||||
errno = EISDIR;
|
||||
sh_close(fd);
|
||||
fd = -1;
|
||||
}
|
||||
- } while (fd < 0 && pp);
|
||||
+ } while (fd < 0 && next_pp);
|
||||
|
||||
assert(fd < 0 || sh_iovalidfd(shp, fd));
|
||||
-
|
||||
if (fd >= 0 && (fd = sh_iomovefd(shp, fd)) > 0) {
|
||||
(void)fcntl(fd, F_SETFD, FD_CLOEXEC);
|
||||
shp->fdstatus[fd] |= IOCLEX;
|
||||
diff --git a/src/cmd/ksh93/tests/autoload.sh b/src/cmd/ksh93/tests/autoload.sh
|
||||
new file mode 100644
|
||||
index 0000000..6aaa206
|
||||
--- /dev/null
|
||||
+++ b/src/cmd/ksh93/tests/autoload.sh
|
||||
@@ -0,0 +1,15 @@
|
||||
+# Verify the behavior of autoloaded functions.
|
||||
+
|
||||
+# ====================
|
||||
+# Verify that directories in the path search list which should be skipped (e.g., because they don't
|
||||
+# exist) interacts correctly with autoloaded functions.
|
||||
+#
|
||||
+# See https://github.com/att/ast/issues/1454
|
||||
+expect=$"Func cd called with |$TEST_DIR/usr|\n$TEST_DIR/usr"
|
||||
+actual=$($SHELL "$TEST_ROOT/data/skipped_dir")
|
||||
+actual_status=$?
|
||||
+expect_status=0
|
||||
+[[ $actual_status == $expect_status ]] ||
|
||||
+ log_error "autoload function skipped dir test wrong status" "$expect_status" "$actual_status"
|
||||
+[[ $actual == $expect ]] ||
|
||||
+ log_error "autoload function skipped dir test wrong output" "$expect" "$actual"
|
||||
diff --git a/src/cmd/ksh93/tests/data/skipped_dir b/src/cmd/ksh93/tests/data/skipped_dir
|
||||
new file mode 100644
|
||||
index 0000000..b8eeddc
|
||||
--- /dev/null
|
||||
+++ b/src/cmd/ksh93/tests/data/skipped_dir
|
||||
@@ -0,0 +1,15 @@
|
||||
+# See https://github.com/att/ast/issues/1454
|
||||
+
|
||||
+mkdir -p "$TEST_DIR/usr/bin"
|
||||
+print '#!/bin/sh' >"$TEST_DIR/usr/bin/cd"
|
||||
+print 'builtin cd "$@"' >>"$TEST_DIR/usr/bin/cd"
|
||||
+prefix="$TEST_DIR/ksh.$$"
|
||||
+
|
||||
+FPATH="$prefix/bad:$prefix/functions"
|
||||
+mkdir -p "$prefix/functions"
|
||||
+print 'function cd { echo "Func cd called with |$*|"; command cd "$@"; }' >"$prefix/functions/cd"
|
||||
+typeset -fu cd
|
||||
+
|
||||
+PATH="/arglebargle:$PATH:$TEST_DIR/usr/bin:$TEST_DIR/bin"
|
||||
+cd "$TEST_DIR/usr"
|
||||
+pwd
|
||||
diff --git a/src/cmd/ksh93/tests/meson.build b/src/cmd/ksh93/tests/meson.build
|
||||
index 6a07d7c..26f2d43 100644
|
||||
--- a/src/cmd/ksh93/tests/meson.build
|
||||
+++ b/src/cmd/ksh93/tests/meson.build
|
||||
@@ -48,6 +48,7 @@ all_tests = [
|
||||
['arrays'],
|
||||
['arrays2'],
|
||||
['attributes'],
|
||||
+ ['autoload'],
|
||||
['basic', 90],
|
||||
['case'],
|
||||
['comvar'],
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
BIN
ksh-1.0.8.tar.gz
BIN
ksh-1.0.8.tar.gz
Binary file not shown.
BIN
ksh-2020.0.0.tar.gz
Normal file
BIN
ksh-2020.0.0.tar.gz
Normal file
Binary file not shown.
141
ksh.spec
141
ksh.spec
@ -1,148 +1,95 @@
|
||||
Name: ksh
|
||||
Version: 1.0.8
|
||||
Release: 1
|
||||
Version: 2020.0.0
|
||||
Release: 8
|
||||
Summary: The Original ATT Korn Shell
|
||||
License: EPL-2.0
|
||||
License: EPL-1.0
|
||||
URL: http://www.kornshell.com/
|
||||
Epoch: 2
|
||||
Source0: https://github.com/ksh93/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
|
||||
Epoch: 1
|
||||
Source0: https://github.com/att/ast/releases/download/%{version}/%{name}-%{version}.tar.gz
|
||||
Source1: kshcomp.conf
|
||||
Source2: kshrc.rhs
|
||||
Source3: dotkshrc
|
||||
|
||||
Patch9000: skip-some-test.patch
|
||||
|
||||
Provides: /bin/ksh /bin/rksh
|
||||
BuildRequires: gcc bison glibc-langpack-ja ncurses procps tzdata util-linux
|
||||
Patch1: CVE-2019-14868.patch
|
||||
|
||||
Patch9000: openEuler-skip-some-test.patch
|
||||
Patch9001: backport-Fix-handling-of-skipped-directories.patch
|
||||
|
||||
Provides: /bin/ksh /usr/bin/ksh
|
||||
BuildRequires: meson gcc glibc-devel ed
|
||||
Conflicts: pdksh
|
||||
Requires: coreutils, diffutils
|
||||
Requires(post): grep, coreutils, systemd, chkconfig
|
||||
Requires(post): grep, coreutils, systemd-units chkconfig
|
||||
Requires(preun): chkconfig
|
||||
Requires(postun): sed
|
||||
Provides: ksh-help = %{epoch}:%{version}-%{release}
|
||||
Obsoletes: ksh-help < %{epoch}:%{version}-%{release}
|
||||
|
||||
%description
|
||||
KSH-93 is the most recent version of the KornShell by David Korn of AT&T Bell Laboratories.
|
||||
KornShell is a shell programming language, which is upward compatible with "sh" (the Bourne Shell).
|
||||
KornShell is an interactive command language that provides access to the UNIX system and to
|
||||
many other systems, on the many different computers and workstations on which it is implemented.
|
||||
|
||||
%prep
|
||||
%autosetup -p1
|
||||
%autosetup -p1 -n %{name}-%{version}
|
||||
|
||||
%build
|
||||
XTRAFLAGS=""
|
||||
for f in -Wno-unknown-pragmas -Wno-missing-braces -Wno-unused-result -Wno-return-type -Wno-int-to-pointer-cast -Wno-parentheses -Wno-unused -Wno-unused-but-set-variable -Wno-cpp -Wno-maybe-uninitialized -Wno-lto-type-mismatch
|
||||
do
|
||||
$CC $f -E - </dev/null >/dev/null 2>&1 && XTRAFLAGS="$XTRAFLAGS $f"
|
||||
done
|
||||
export CCFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing $XTRAFLAGS"
|
||||
export LDFLAGS="$RPM_LD_FLAGS"
|
||||
bin/package make
|
||||
%meson -Dbuild-api-tests=false
|
||||
%meson_build
|
||||
|
||||
%install
|
||||
mkdir -p %{buildroot}{%{_bindir},%{_mandir}/man1}
|
||||
install -p -m 755 arch/*/bin/ksh %{buildroot}%{_bindir}/ksh93
|
||||
install -p -m 755 arch/*/bin/shcomp %{buildroot}%{_bindir}/shcomp
|
||||
install -p -m 644 arch/*/man/man1/sh.1 %{buildroot}%{_mandir}/man1/ksh93.1
|
||||
%meson_install
|
||||
mv %{buildroot}/%{_bindir}/ksh %{buildroot}/%{_bindir}/ksh93
|
||||
mv %{buildroot}/%{_bindir}/shcomp %{buildroot}/%{_bindir}/shcomp93
|
||||
mv %{buildroot}/%{_mandir}/man1/ksh.1 %{buildroot}/%{_mandir}/man1/ksh93.1
|
||||
install -p -D -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/binfmt.d/kshcomp.conf
|
||||
install -p -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/kshrc
|
||||
install -p -D -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/skel/.kshrc
|
||||
|
||||
touch %{buildroot}%{_bindir}/ksh
|
||||
touch %{buildroot}%{_mandir}/man1/ksh.1.gz
|
||||
|
||||
touch %{buildroot}%{_bindir}/rksh
|
||||
touch %{buildroot}%{_mandir}/man1/rksh.1.gz
|
||||
|
||||
%check
|
||||
script -q -e -c "bin/package test"
|
||||
%meson_test
|
||||
|
||||
%post
|
||||
for s in /bin/ksh /bin/rksh /usr/bin/ksh /usr/bin/rksh
|
||||
for s in /bin/ksh /usr/bin/ksh
|
||||
do
|
||||
if [ ! -f /etc/shells ]; then
|
||||
if [ ! -f /etc/shells ]; then
|
||||
echo "$s" > /etc/shells
|
||||
else
|
||||
else
|
||||
if ! grep -q '^'"$s"'$' /etc/shells ; then
|
||||
echo "$s" >> /etc/shells
|
||||
echo "$s" >> /etc/shells
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
/bin/systemctl try-restart systemd-binfmt.service >/dev/null 2>&1 || :
|
||||
|
||||
%{_sbindir}/alternatives --install %{_bindir}/ksh ksh \
|
||||
%{_bindir}/ksh93 50 \
|
||||
--slave %{_bindir}/rksh rksh \
|
||||
%{_bindir}/ksh93 \
|
||||
--slave %{_mandir}/man1/rksh.1.gz rksh-man \
|
||||
%{_mandir}/man1/ksh93.1.gz \
|
||||
--slave %{_mandir}/man1/ksh.1.gz ksh-man \
|
||||
%{_mandir}/man1/ksh93.1.gz
|
||||
|
||||
if [ ! -L %{_bindir}/ksh ]; then
|
||||
%{_sbindir}/alternatives --auto ksh
|
||||
ln -sf /etc/alternatives/ksh %{_bindir}/ksh
|
||||
ln -sf /etc/alternatives/ksh-man %{_mandir}/man1/ksh.1.gz
|
||||
fi
|
||||
%{_sbindir}/alternatives --install /bin/ksh ksh /bin/ksh93 50 \
|
||||
--slave %{_mandir}/man1/ksh.1.gz ksh-man %{_mandir}/man1/ksh93.1.gz \
|
||||
--slave /bin/shcomp shcomp93 /bin/shcomp93 2>/dev/null
|
||||
|
||||
%preun
|
||||
if [ $1 = 0 ]; then
|
||||
%{_sbindir}/alternatives --remove ksh %{_bindir}/ksh93
|
||||
if [ $1 -eq 0 ]; then
|
||||
%{_sbindir}/alternatives --remove ksh /bin/ksh93
|
||||
fi
|
||||
|
||||
%postun
|
||||
for s in /bin/ksh /bin/rksh /usr/bin/ksh /usr/bin/rksh
|
||||
for s in /bin/ksh /usr/bin/ksh
|
||||
do
|
||||
if [ ! -f $s ]; then
|
||||
sed -i '\|^'"$s"'$|d' /etc/shells
|
||||
fi
|
||||
if [ ! -f $s ]; then
|
||||
sed -i '\|^'"$s"'$|d' /etc/shells
|
||||
fi
|
||||
done
|
||||
|
||||
%files
|
||||
%doc src/cmd/ksh93/{COMPATIBILITY,RELEASE,TYPES,README}
|
||||
%doc README.md NEWS
|
||||
%license LICENSE.md
|
||||
%{_bindir}/ksh93
|
||||
%ghost %{_bindir}/ksh
|
||||
%ghost %{_bindir}/rksh
|
||||
%{_bindir}/shcomp
|
||||
%{_mandir}/man1/ksh93.1*
|
||||
%ghost %{_mandir}/man1/ksh.1*
|
||||
%ghost %{_mandir}/man1/rksh.1*
|
||||
%triggerpostun -- ksh < 1:2020.0.0-0.1
|
||||
%{_sbindir}/alternatives --auto ksh
|
||||
|
||||
%files
|
||||
%doc src/cmd/ksh93/{COMPATIBILITY,RELEASE,TYPES}
|
||||
%{_bindir}/{ksh93,shcomp93}
|
||||
%{_mandir}/man1/*
|
||||
%config(noreplace) %{_sysconfdir}/skel/.kshrc
|
||||
%config(noreplace) %{_sysconfdir}/kshrc
|
||||
%config(noreplace) %{_sysconfdir}/binfmt.d/kshcomp.conf
|
||||
|
||||
%changelog
|
||||
* Mon Feb 5 2024 wangyuhang <wangyuhang27@huawei.com> - 2:1.0.8-1
|
||||
- Type:bugfix
|
||||
- CVE:NA
|
||||
- SUG:NA
|
||||
- DESC:due to the upstream community no longer maintaining the previous version,
|
||||
we have rolled back to the stable branch and switched to an active code repository.
|
||||
new upstream release and update version to 1.0.8
|
||||
|
||||
* Tue Dec 6 2022 wangyuhang <wangyuhang27@huawei.com> - 1:2020.0.0-11
|
||||
- Type:bugfix
|
||||
- CVE:NA
|
||||
- SUG:NA
|
||||
- DESC:change patch name
|
||||
|
||||
* Sat Aug 27 2022 shixuantong <shixuantong@h-partners.com> - 1:2020.0.0-10
|
||||
- Type:bugfix
|
||||
- CVE:NA
|
||||
- SUG:NA
|
||||
- DESC:Change default build type to "minsize"
|
||||
|
||||
* Thu Jun 30 2022 wangjiang <wangjiang37@h-partners.com> - 1:2020.0.0-9
|
||||
- Type:bugfix
|
||||
- CVE:NA
|
||||
- SUG:NA
|
||||
- DESC:fix backport-Fix-hist_nearend.patch
|
||||
backport-functions-with-not-loaded-autoloaded-functions.patch
|
||||
backport-Fix-interactive-restricted-shell-behavior.patch
|
||||
|
||||
* Wed Apr 13 2022 renhongxun <renhongxun@h-partners.com> - 1:2020.0.0-8
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
|
||||
151
openEuler-skip-some-test.patch
Normal file
151
openEuler-skip-some-test.patch
Normal file
@ -0,0 +1,151 @@
|
||||
From 97795806fda12850b896d2dde4442568f38d7c48 Mon Sep 17 00:00:00 2001
|
||||
From: wangjiang <wangjiang37@h-partners.com>
|
||||
Date: Fri, 11 Mar 2022 14:34:29 +0800
|
||||
Subject: [PATCH] openEuler-skip-some-test
|
||||
|
||||
---
|
||||
src/cmd/ksh93/tests/b_ulimit.sh | 4 ++--
|
||||
src/cmd/ksh93/tests/b_uname.sh | 6 +++---
|
||||
src/cmd/ksh93/tests/bracket.sh | 8 ++++----
|
||||
src/cmd/ksh93/tests/builtins.sh | 2 +-
|
||||
src/cmd/ksh93/tests/meson.build | 4 ----
|
||||
src/cmd/ksh93/tests/path.sh | 2 +-
|
||||
6 files changed, 11 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/src/cmd/ksh93/tests/b_ulimit.sh b/src/cmd/ksh93/tests/b_ulimit.sh
|
||||
index 0250926..4c9dd0f 100644
|
||||
--- a/src/cmd/ksh93/tests/b_ulimit.sh
|
||||
+++ b/src/cmd/ksh93/tests/b_ulimit.sh
|
||||
@@ -66,7 +66,7 @@ actual=$(ulimit -t)
|
||||
|
||||
# ==========
|
||||
# -v The number of K-bytes for virtual memory.
|
||||
-if [[ $OS_NAME != openbsd ]]
|
||||
+if [[ $OS_NAME != linux ]]
|
||||
then
|
||||
ulimit -v unlimited
|
||||
expect=unlimited
|
||||
@@ -76,7 +76,7 @@ fi
|
||||
|
||||
# ==========
|
||||
# -M, --as The address space limit in Kibytes.
|
||||
-if [[ $OS_NAME != openbsd ]]
|
||||
+if [[ $OS_NAME != linux ]]
|
||||
then
|
||||
ulimit -M unlimited
|
||||
expect=unlimited
|
||||
diff --git a/src/cmd/ksh93/tests/b_uname.sh b/src/cmd/ksh93/tests/b_uname.sh
|
||||
index 4c9c06a..69ef430 100644
|
||||
--- a/src/cmd/ksh93/tests/b_uname.sh
|
||||
+++ b/src/cmd/ksh93/tests/b_uname.sh
|
||||
@@ -29,9 +29,9 @@ expect=$($bin_uname -n)
|
||||
# ==========
|
||||
# -r, --release|kernel-release
|
||||
# The kernel release level.
|
||||
-actual=$(uname -r)
|
||||
-expect=$($bin_uname -r)
|
||||
-[[ "$actual" = "$expect" ]] || log_error "'uname -r' failed" "$expect" "$actual"
|
||||
+#actual=$(uname -r)
|
||||
+#expect=$($bin_uname -r)
|
||||
+#[[ "$actual" = "$expect" ]] || log_error "'uname -r' failed" "$expect" "$actual"
|
||||
|
||||
# ==========
|
||||
# -v, --version|kernel-version
|
||||
diff --git a/src/cmd/ksh93/tests/bracket.sh b/src/cmd/ksh93/tests/bracket.sh
|
||||
index 07029f1..6915583 100644
|
||||
--- a/src/cmd/ksh93/tests/bracket.sh
|
||||
+++ b/src/cmd/ksh93/tests/bracket.sh
|
||||
@@ -99,7 +99,7 @@ then
|
||||
fi
|
||||
|
||||
chmod 000 $file
|
||||
-if [[ $OS_NAME == cygwin* ]]
|
||||
+if [[ $OS_NAME == linux ]]
|
||||
then
|
||||
log_info 'skipping [[ -r $file ]] test on Cygwin'
|
||||
else
|
||||
@@ -114,7 +114,7 @@ then
|
||||
log_error "-r: $file should be owned by me"
|
||||
fi
|
||||
|
||||
-if [[ $OS_NAME == cygwin* ]]
|
||||
+if [[ $OS_NAME == linux ]]
|
||||
then
|
||||
log_info 'skipping [[ -w $file ]] test on Cygwin'
|
||||
else
|
||||
@@ -124,7 +124,7 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
-if [[ $OS_NAME == cygwin* ]]
|
||||
+if [[ $OS_NAME == linux ]]
|
||||
then
|
||||
log_info 'skipping [[ -x $file ]] test on Cygwin'
|
||||
else
|
||||
@@ -134,7 +134,7 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
-if [[ $OS_NAME == cygwin* ]]
|
||||
+if [[ $OS_NAME == linux ]]
|
||||
then
|
||||
log_info 'skipping [[ -w $file || -r $file ]] test on Cygwin'
|
||||
else
|
||||
diff --git a/src/cmd/ksh93/tests/builtins.sh b/src/cmd/ksh93/tests/builtins.sh
|
||||
index 55b1f4f..8f9fbba 100644
|
||||
--- a/src/cmd/ksh93/tests/builtins.sh
|
||||
+++ b/src/cmd/ksh93/tests/builtins.sh
|
||||
@@ -551,7 +551,7 @@ print ". $TEST_DIR/evalbug" >$TEST_DIR/envfile
|
||||
[[ $(ENV=$TEST_DIR/envfile $SHELL -i -c : 2> /dev/null) == ok ]] || log_error 'eval inside dot script called from profile file not working'
|
||||
|
||||
# test cd to a directory that doesn't have execute permission
|
||||
-if [[ $OS_NAME == cygwin* ]]
|
||||
+if [[ $OS_NAME == linux ]]
|
||||
then
|
||||
log_warning 'skipping test of cd to dir without execute permission on Cygwin'
|
||||
else
|
||||
diff --git a/src/cmd/ksh93/tests/meson.build b/src/cmd/ksh93/tests/meson.build
|
||||
index 6a07d7c..7728b88 100644
|
||||
--- a/src/cmd/ksh93/tests/meson.build
|
||||
+++ b/src/cmd/ksh93/tests/meson.build
|
||||
@@ -9,7 +9,6 @@ all_tests = [
|
||||
['b_alias'],
|
||||
['b_basename'],
|
||||
['b_cat'],
|
||||
- ['b_chmod'],
|
||||
['b_cmp'],
|
||||
['b_command'],
|
||||
['b_cut'],
|
||||
@@ -34,7 +33,6 @@ all_tests = [
|
||||
['b_sleep'],
|
||||
['b_sync'],
|
||||
['b_test.exp'],
|
||||
- ['b_test'],
|
||||
['b_time.exp'],
|
||||
['b_times.exp'],
|
||||
['b_ulimit'],
|
||||
@@ -49,8 +47,6 @@ all_tests = [
|
||||
['arrays2'],
|
||||
['attributes'],
|
||||
['basic', 90],
|
||||
- ['bracket'],
|
||||
- ['builtins'],
|
||||
['case'],
|
||||
['comvar'],
|
||||
['comvario'],
|
||||
diff --git a/src/cmd/ksh93/tests/path.sh b/src/cmd/ksh93/tests/path.sh
|
||||
index 6920f19..4999d8f 100644
|
||||
--- a/src/cmd/ksh93/tests/path.sh
|
||||
+++ b/src/cmd/ksh93/tests/path.sh
|
||||
@@ -276,7 +276,7 @@ exp=126
|
||||
#
|
||||
# TODO: Figure out if there is some way to make ksh behave on Cygwin like it does on real UNIX/POSIX
|
||||
# compliant systems for these edge cases without greatly complicating the code.
|
||||
-if [[ $OS_NAME != cygwin* ]]
|
||||
+if [[ $OS_NAME != linux ]]
|
||||
then
|
||||
|
||||
: > $scr
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
@ -1,33 +0,0 @@
|
||||
From 882029ce930456be2b954fa8467be3e0494504da Mon Sep 17 00:00:00 2001
|
||||
From: wangyuhang <wangyuhang27@huawei.com>
|
||||
Date: Sun, 4 Feb 2024 16:53:58 +0800
|
||||
Subject: [PATCH] openEuler-skip-some-test
|
||||
|
||||
Offering:EulerOS Server
|
||||
CVE:
|
||||
Reference:
|
||||
Type:bugfix/CVE/requirement/cleancode/testcode
|
||||
DTS/AR:
|
||||
reason:
|
||||
---
|
||||
src/cmd/ksh93/tests/shtests | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/src/cmd/ksh93/tests/shtests b/src/cmd/ksh93/tests/shtests
|
||||
index 6bbe2ef..86cd3e8 100755
|
||||
--- a/src/cmd/ksh93/tests/shtests
|
||||
+++ b/src/cmd/ksh93/tests/shtests
|
||||
@@ -340,6 +340,10 @@ typeset -A tests
|
||||
typeset -i total_e=0
|
||||
for i in ${*-*.sh}
|
||||
do [[ $i == *.sh ]] || i+='.sh'
|
||||
+ if [[ $i == "pty.sh" ]]
|
||||
+ then
|
||||
+ continue
|
||||
+ fi
|
||||
if [[ ! -r $i ]]
|
||||
then echo $0: $i: not found >&2
|
||||
(( ++total_e ))
|
||||
--
|
||||
2.33.0
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user