Accepting request 102927 from shells
- Update to 2012-02-02 of ksh93u+ which includes some of our patches and fixes for the observerd memory leaks 12-02-02 A bug in the ulimit option table was fixed. 12-01-26 A bug in which a set command that did not change monitor could effect the behavior of the monitor when monitor mode is on is fixed. 12-01-21 +You can now test whether the shell implements a math function using typeset -f .sh.math.name, where name is the name of the function. 12-01-21 A bug in which typeset -L and typeset -R did not handle multibyte characters correctly has been fixed. 12-01-20 A bug that could cause the shell to hang waiting for an incorrect job pid has been fixed. 12-01-19 A memory leak which occured for a nested command subtiution has been fixed. 12-01-17 A bug in which typeset -u PS1 could enable the uppercase attribute for some other variables, for exampe, HISTFILE has been fixed. 12-01-16 A bug in which .sh.match was not correct after a substring match when the replacement string contained a substring match has been fixed. 12-01-12 +Files that are sourced from profile files are now read and executed one command at a time so that alias definitions take effect as they do for profile files. 12-01-12 A bug in which whence -p would find a function if one existed and there was no command of that name on PATH. 12-01-11 Change b_* prototype (int, char**, void*) => (int, char**, Shbltin_t*). 12-01-05 A bug in which read was not terminating for a signal that had a trap set has been fixed. libast: 12-01-31 spawnveg.c: fix transient bug that made invalid setpgid() call 12-01-27 pathpath.c: fix buffer size math when internal allocation requested 12-01-24 malloc.c: fix _vmkeep() bug that did not return previous state 12-01-23 malloc.c: add VMALLOC_OPTIONS=break to try sbrk() block allocator first OBS-URL: https://build.opensuse.org/request/show/102927 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/ksh?expand=0&rev=73
This commit is contained in:
commit
191a01e930
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:654c2f7b3a3166142b47bf60f108b732024c2c7c1bdffc044582f250a0600926
|
|
||||||
size 296293
|
|
3
INIT.2012-02-02.tar.bz2
Normal file
3
INIT.2012-02-02.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:ea89823ade1949c828e6012cf85f58aebcfe8cb9f31052370936e215a9b126a6
|
||||||
|
size 296877
|
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:4620fbd035d3c85d80a1bc8559e464111ebac9fe6beec06fb44d5c8ced20f416
|
|
||||||
size 1571615
|
|
3
ast-ksh.2012-02-02.tar.bz2
Normal file
3
ast-ksh.2012-02-02.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:1ddaab5c6ae873e61e0706024abd57f0363891a8ad5bf026082c0706b7557665
|
||||||
|
size 1573400
|
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:60572e0165faf8bc54ace6e0d3930a52c51b71ea600dae2ee551d017dcf6de6e
|
|
||||||
size 129201
|
|
3
ast-msgcc.2012-02-02.tar.bz2
Normal file
3
ast-msgcc.2012-02-02.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:318716d403b0b0f5be08848235122ab27d4c13f6daceca55cd61a41cd3c8cfb4
|
||||||
|
size 129260
|
@ -2,10 +2,10 @@
|
|||||||
test $(ulimit -l) -lt 64 && exit 1
|
test $(ulimit -l) -lt 64 && exit 1
|
||||||
test $(ulimit -s) -lt 8192 && exit 1
|
test $(ulimit -s) -lt 8192 && exit 1
|
||||||
if test $(getconf LONG_BIT) -le 32 ; then
|
if test $(getconf LONG_BIT) -le 32 ; then
|
||||||
test $(ulimit -m) -lt 6852272 && exit 1
|
test $(ulimit -m) -lt 3145728 && exit 1
|
||||||
test $(ulimit -v) -lt 5010688 && exit 1
|
test $(ulimit -v) -lt 4194304 && exit 1
|
||||||
else
|
else
|
||||||
test $(ulimit -m) -lt 10471232 && exit 1
|
test $(ulimit -m) -lt 4194304 && exit 1
|
||||||
test $(ulimit -v) -lt 6683794 && exit 1
|
test $(ulimit -v) -lt 6683794 && exit 1
|
||||||
fi
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
|
46
ksh.changes
46
ksh.changes
@ -1,3 +1,49 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Feb 6 12:01:10 UTC 2012 - werner@suse.de
|
||||||
|
|
||||||
|
- Update to 2012-02-02 of ksh93u+ which includes some of our patches
|
||||||
|
and fixes for the observerd memory leaks
|
||||||
|
12-02-02 A bug in the ulimit option table was fixed.
|
||||||
|
12-01-26 A bug in which a set command that did not change monitor could
|
||||||
|
effect the behavior of the monitor when monitor mode is on is fixed.
|
||||||
|
12-01-21 +You can now test whether the shell implements a math function using
|
||||||
|
typeset -f .sh.math.name, where name is the name of the function.
|
||||||
|
12-01-21 A bug in which typeset -L and typeset -R did not handle multibyte
|
||||||
|
characters correctly has been fixed.
|
||||||
|
12-01-20 A bug that could cause the shell to hang waiting for an incorrect
|
||||||
|
job pid has been fixed.
|
||||||
|
12-01-19 A memory leak which occured for a nested command subtiution has been
|
||||||
|
fixed.
|
||||||
|
12-01-17 A bug in which typeset -u PS1 could enable the uppercase attribute
|
||||||
|
for some other variables, for exampe, HISTFILE has been fixed.
|
||||||
|
12-01-16 A bug in which .sh.match was not correct after a substring match when
|
||||||
|
the replacement string contained a substring match has been fixed.
|
||||||
|
12-01-12 +Files that are sourced from profile files are now read and executed
|
||||||
|
one command at a time so that alias definitions take effect as they
|
||||||
|
do for profile files.
|
||||||
|
12-01-12 A bug in which whence -p would find a function if one existed and
|
||||||
|
there was no command of that name on PATH.
|
||||||
|
12-01-11 Change b_* prototype (int, char**, void*) => (int, char**, Shbltin_t*).
|
||||||
|
12-01-05 A bug in which read was not terminating for a signal that had a trap
|
||||||
|
set has been fixed.
|
||||||
|
libast:
|
||||||
|
12-01-31 spawnveg.c: fix transient bug that made invalid setpgid() call
|
||||||
|
12-01-27 pathpath.c: fix buffer size math when internal allocation requested
|
||||||
|
12-01-24 malloc.c: fix _vmkeep() bug that did not return previous state
|
||||||
|
12-01-23 malloc.c: add VMALLOC_OPTIONS=break to try sbrk() block allocator first
|
||||||
|
12-01-18 malloc.c: disable multiple regions for tracing or !vmbest or ASO_SIGNAL
|
||||||
|
12-01-12 sfpkrd.c: add __sun I_PEEK+rsh runtime workaround
|
||||||
|
12-01-10 shcmd.h: void* => Shbltin_t*
|
||||||
|
12-01-10 tmxdate.c: handle { n>=1000 } TM_PARTS
|
||||||
|
libcmd:
|
||||||
|
12-01-10 b_* (int, char**, void*) => (int, char**, Shbltin_t*)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Feb 2 11:32:15 UTC 2012 - werner@suse.de
|
||||||
|
|
||||||
|
- Fix an off-by-one error which cause that the builtin ulimit may
|
||||||
|
fail (bnc#744355), patch from Li Bin.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Jan 24 18:42:48 UTC 2012 - werner@suse.de
|
Tue Jan 24 18:42:48 UTC 2012 - werner@suse.de
|
||||||
|
|
||||||
|
64
ksh.spec
64
ksh.spec
@ -27,7 +27,9 @@ BuildRequires: bind-libs libbz2-devel
|
|||||||
BuildRequires: update-alternatives
|
BuildRequires: update-alternatives
|
||||||
%endif
|
%endif
|
||||||
# /bin/ex and /bin/ed required for build
|
# /bin/ex and /bin/ed required for build
|
||||||
|
BuildRequires: awk
|
||||||
BuildRequires: ed
|
BuildRequires: ed
|
||||||
|
BuildRequires: strace
|
||||||
BuildRequires: vim
|
BuildRequires: vim
|
||||||
Url: http://www.research.att.com/~gsf/download/
|
Url: http://www.research.att.com/~gsf/download/
|
||||||
License: CPL-1.0
|
License: CPL-1.0
|
||||||
@ -43,16 +45,19 @@ Version: 93u
|
|||||||
Release: 1
|
Release: 1
|
||||||
Summary: Korn Shell
|
Summary: Korn Shell
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
Source: INIT.2012-01-01.tar.bz2
|
Source: INIT.2012-02-02.tar.bz2
|
||||||
Source1: ast-ksh.2012-01-01.tar.bz2
|
Source1: ast-ksh.2012-02-02.tar.bz2
|
||||||
Source2: ast-msgcc.2012-01-01.tar.bz2
|
Source2: ast-msgcc.2012-02-02.tar.bz2
|
||||||
Source3: CPL
|
Source3: CPL
|
||||||
Source10: leak1.sh
|
Source10: leak1.sh
|
||||||
Source11: leak2.sh
|
Source11: leak2.sh
|
||||||
Source12: ifs-crash.sh
|
Source12: ifs-crash.sh
|
||||||
|
Source13: ulimit.sh
|
||||||
|
Source14: leak3.sh
|
||||||
Source20: Agreement
|
Source20: Agreement
|
||||||
Source21: Warning
|
Source21: Warning
|
||||||
Source30: rpmlintrc
|
Source30: rpmlintrc
|
||||||
|
Source31: vmbalance
|
||||||
Source42: sigexec.c
|
Source42: sigexec.c
|
||||||
Patch: ksh93.dif
|
Patch: ksh93.dif
|
||||||
Patch1: workaround-stupid-build-system.diff
|
Patch1: workaround-stupid-build-system.diff
|
||||||
@ -76,6 +81,7 @@ Patch18: ksh93-jobs.dif
|
|||||||
Patch19: ksh93-reg.dif
|
Patch19: ksh93-reg.dif
|
||||||
Patch20: ksh93-aso.dif
|
Patch20: ksh93-aso.dif
|
||||||
Patch21: ksh93-vm.dif
|
Patch21: ksh93-vm.dif
|
||||||
|
Patch22: ksh93-limit-name-len.dif
|
||||||
Patch42: ksh-locale.patch
|
Patch42: ksh-locale.patch
|
||||||
%global use_suid_exe 0
|
%global use_suid_exe 0
|
||||||
%global use_locale 0
|
%global use_locale 0
|
||||||
@ -116,13 +122,16 @@ Authors:
|
|||||||
Phong Vo <kpv@research.att.com>
|
Phong Vo <kpv@research.att.com>
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
|
chmod +x %{S:31}
|
||||||
%setup -q -n ksh93 -T -c -a 0 -a 1 -a 2
|
%setup -q -n ksh93 -T -c -a 0 -a 1 -a 2
|
||||||
find share/ \( -name chef -o -name fudd -o -name piglatin -o -name valley \) -a -type d |\
|
if test -d share ; then
|
||||||
|
find share/ \( -name chef -o -name fudd -o -name piglatin -o -name valley \) -a -type d |\
|
||||||
xargs -r rm -vrf
|
xargs -r rm -vrf
|
||||||
find share/ ! \( -name libast -o -name libcmd -o -name libdll -o -name libshell \) -a -type f |\
|
find share/ ! \( -name libast -o -name libcmd -o -name libdll -o -name libshell \) -a -type f |\
|
||||||
xargs -r rm -vf
|
xargs -r rm -vf
|
||||||
find share/ -type d -a -empty | xargs -r rm -vrf
|
find share/ -type d -a -empty | xargs -r rm -vrf
|
||||||
find share/ -type d -a -empty | xargs -r rm -vrf
|
find share/ -type d -a -empty | xargs -r rm -vrf
|
||||||
|
fi
|
||||||
%patch
|
%patch
|
||||||
%patch42
|
%patch42
|
||||||
%patch1
|
%patch1
|
||||||
@ -150,8 +159,7 @@ find share/ -type d -a -empty | xargs -r rm -vrf
|
|||||||
%patch19
|
%patch19
|
||||||
%patch20
|
%patch20
|
||||||
%patch21
|
%patch21
|
||||||
find -type f -a -name Mamfile | \
|
%patch22
|
||||||
xargs sed -ri '/exec.*-I-D/{s@(-I)(-D)([^0]*)(0[^[:blank:]]+)@\1\3@}'
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
#
|
#
|
||||||
@ -172,6 +180,7 @@ find -type f -a -name Mamfile | \
|
|||||||
set -- $(readlink $fd)
|
set -- $(readlink $fd)
|
||||||
exec -a $SHELL ./sigexec $SHELL ${1+"$@"}
|
exec -a $SHELL ./sigexec $SHELL ${1+"$@"}
|
||||||
fi
|
fi
|
||||||
|
IGNORED=0x$(ps --no-headers -o ignored $$)
|
||||||
|
|
||||||
AR="ar"
|
AR="ar"
|
||||||
CC=gcc
|
CC=gcc
|
||||||
@ -312,6 +321,12 @@ find -type f -a -name Mamfile | \
|
|||||||
HOSTTYPE=linux.$RPM_ARCH
|
HOSTTYPE=linux.$RPM_ARCH
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
for mm in mmap mmap2 mmap64 munmap munmap2 munmap64 ; do
|
||||||
|
if strace -e $mm /bin/true > /dev/null 2>&1 ; then
|
||||||
|
MEMORY="${MEMORY:+${MEMORY},}$mm"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
MEMORY="${MEMORY:+-e ${MEMORY}}"
|
||||||
RPM_OPT_FLAGS=$(echo "${RPM_OPT_FLAGS}"|sed -r 's/[[:blank:]]+-g[0-9]?/ -g2/g')
|
RPM_OPT_FLAGS=$(echo "${RPM_OPT_FLAGS}"|sed -r 's/[[:blank:]]+-g[0-9]?/ -g2/g')
|
||||||
UNIVERSE=att
|
UNIVERSE=att
|
||||||
LDFLAGS="-lm"
|
LDFLAGS="-lm"
|
||||||
@ -319,13 +334,10 @@ find -type f -a -name Mamfile | \
|
|||||||
cflags -std=gnu99 RPM_OPT_FLAGS
|
cflags -std=gnu99 RPM_OPT_FLAGS
|
||||||
cflags -fPIC RPM_OPT_FLAGS
|
cflags -fPIC RPM_OPT_FLAGS
|
||||||
cflags @$nobuiltin RPM_OPT_FLAGS
|
cflags @$nobuiltin RPM_OPT_FLAGS
|
||||||
cflags -fno-unwind-tables RPM_OPT_FLAGS
|
|
||||||
cflags -fno-strict-aliasing RPM_OPT_FLAGS
|
cflags -fno-strict-aliasing RPM_OPT_FLAGS
|
||||||
cflags -fno-zero-initialized-in-bss RPM_OPT_FLAGS
|
cflags -fno-zero-initialized-in-bss RPM_OPT_FLAGS
|
||||||
cflags -fno-delete-null-pointer-checks RPM_OPT_FLAGS
|
cflags -fno-delete-null-pointer-checks RPM_OPT_FLAGS
|
||||||
cflags -fno-asynchronous-unwind-tables RPM_OPT_FLAGS
|
|
||||||
cflags -fno-unsafe-loop-optimizations RPM_OPT_FLAGS
|
cflags -fno-unsafe-loop-optimizations RPM_OPT_FLAGS
|
||||||
cflags -fno-reorder-blocks-and-partition RPM_OPT_FLAGS
|
|
||||||
cflags -fsigned-bitfields RPM_OPT_FLAGS
|
cflags -fsigned-bitfields RPM_OPT_FLAGS
|
||||||
cflags -fsigned-chars RPM_OPT_FLAGS
|
cflags -fsigned-chars RPM_OPT_FLAGS
|
||||||
cflags -fsigned-zeros RPM_OPT_FLAGS
|
cflags -fsigned-zeros RPM_OPT_FLAGS
|
||||||
@ -431,13 +443,33 @@ find -type f -a -name Mamfile | \
|
|||||||
ln -sf ${root}/lib ${test}/../
|
ln -sf ${root}/lib ${test}/../
|
||||||
rm -f pty.sh
|
rm -f pty.sh
|
||||||
${root}/bin/ksh.test shtests
|
${root}/bin/ksh.test shtests
|
||||||
${root}/bin/ksh.test %{S:10}
|
LANG=POSIX
|
||||||
${root}/bin/ksh.test %{S:11}
|
strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:10} 400
|
||||||
${root}/bin/ksh.test %{S:12}
|
strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:10} 4000
|
||||||
|
strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:11} 400
|
||||||
|
strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:11} 4000
|
||||||
|
strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:12}
|
||||||
|
strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:13} 400
|
||||||
|
strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:13} 4000
|
||||||
|
strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:14} 400
|
||||||
|
strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:14} 4000
|
||||||
if test $((IGNORED & SIGPIPE)) -eq 0 ; then
|
if test $((IGNORED & SIGPIPE)) -eq 0 ; then
|
||||||
# This may fail in current factory (aka next 11.3)
|
|
||||||
${root}/bin/ksh.test -c 'g="false"; trap "print -u2 PIPED; \$g && exit 0 ; g=true" PIPE ; while true ; do echo hello ; done' | head -n 10
|
${root}/bin/ksh.test -c 'g="false"; trap "print -u2 PIPED; \$g && exit 0 ; g=true" PIPE ; while true ; do echo hello ; done' | head -n 10
|
||||||
fi
|
fi
|
||||||
|
LANG=en_US.UTF-8
|
||||||
|
strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:10} 400
|
||||||
|
strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:10} 4000
|
||||||
|
strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:11} 400
|
||||||
|
strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:11} 4000
|
||||||
|
strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:12}
|
||||||
|
strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:13} 400
|
||||||
|
strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:13} 4000
|
||||||
|
strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:14} 400
|
||||||
|
strace $MEMORY -o '!%{S:31}' ${root}/bin/ksh.test %{S:14} 4000
|
||||||
|
if test $((IGNORED & SIGPIPE)) -eq 0 ; then
|
||||||
|
${root}/bin/ksh.test -c 'g="false"; trap "print -u2 PIPED; \$g && exit 0 ; g=true" PIPE ; while true ; do echo hello ; done' | head -n 10
|
||||||
|
fi
|
||||||
|
LANG=POSIX
|
||||||
killall -q -s 9 ${root}/bin/ksh.test || true
|
killall -q -s 9 ${root}/bin/ksh.test || true
|
||||||
popd
|
popd
|
||||||
%endif
|
%endif
|
||||||
|
@ -1,42 +1,50 @@
|
|||||||
--- src/lib/libast/features/aso
|
--- src/lib/libast/features/aso
|
||||||
+++ src/lib/libast/features/aso 2012-01-18 11:31:07.856479000 +0000
|
+++ src/lib/libast/features/aso 2012-02-06 11:25:03.897933168 +0100
|
||||||
@@ -1,12 +1,17 @@
|
@@ -5,7 +5,10 @@ if aso note{ gcc 4.1+ 64 bit memory atom
|
||||||
# ast atomic scalar operations feature tests
|
int main()
|
||||||
|
{
|
||||||
if aso note{ gcc 4.1+ memory atomic operations model }end link{
|
uint64_t i = 0;
|
||||||
|
- return __sync_fetch_and_add(&i,7);
|
||||||
|
+ uint32_t j = 0;
|
||||||
|
+ uint16_t l = 0;
|
||||||
|
+ uint8_t m = 0;
|
||||||
|
+ return __sync_fetch_and_add(&i,7)+__sync_fetch_and_add(&j,7)+__sync_fetch_and_add(&l,7)+__sync_fetch_and_add(&m,7);
|
||||||
|
}
|
||||||
|
}end && {
|
||||||
|
#define _aso_cas8(p,o,n) __sync_val_compare_and_swap(p,o,n)
|
||||||
|
@@ -27,10 +30,13 @@ if aso note{ gcc 4.1+ 64 bit memory atom
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
elif aso note{ gcc 4.1+ 32 bit memory atomic operations model }end link{
|
||||||
+ #include <stdint.h>
|
+ #include <stdint.h>
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
- unsigned int i = 0;
|
- unsigned int i = 0;
|
||||||
- return __sync_fetch_and_add(&i,7);
|
- return __sync_fetch_and_add(&i,7);
|
||||||
+ uint8_t i = 0;
|
+ uint32_t i = 0;
|
||||||
+ uint16_t j = 0;
|
+ uint16_t j = 0;
|
||||||
+ uint32_t l = 0;
|
+ uint8_t l = 0;
|
||||||
+ uint64_t m = 0;
|
+ return __sync_fetch_and_add(&i,7)+__sync_fetch_and_add(&j,7)+__sync_fetch_and_add(&l,7);
|
||||||
+ return __sync_fetch_and_add(&i,7)+__sync_fetch_and_add(&j,7)+__sync_fetch_and_add(&l,7)+__sync_fetch_and_add(&m,7);
|
|
||||||
}
|
}
|
||||||
}end && {
|
}end && {
|
||||||
+ #include <stdint.h>
|
|
||||||
#define _aso_cas8(p,o,n) __sync_val_compare_and_swap(p,o,n)
|
#define _aso_cas8(p,o,n) __sync_val_compare_and_swap(p,o,n)
|
||||||
#define _aso_inc8(p) __sync_fetch_and_add(p,1)
|
@@ -45,6 +51,7 @@ elif aso note{ gcc 4.1+ 32 bit memory at
|
||||||
#define _aso_dec8(p) __sync_fetch_and_sub(p,1)
|
#define _aso_casptr(p,o,n) ((void*)__sync_val_compare_and_swap(p,(uint32_t)o,(uint32_t)n))
|
||||||
@@ -26,6 +31,7 @@ if aso note{ gcc 4.1+ memory atomic oper
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
elif aso note{ <atomic.h> atomic_cas_64 }end link{
|
elif aso note{ <atomic.h> atomic_cas_64 }end link{
|
||||||
+ #include <stdint.h>
|
+ #include <stdint.h>
|
||||||
#include <atomic.h>
|
#include <atomic.h>
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
@@ -34,6 +40,7 @@ elif aso note{ <atomic.h> atomic_cas_64
|
@@ -53,6 +60,7 @@ elif aso note{ <atomic.h> atomic_cas_64
|
||||||
return atomic_cas_64(&i, 0, 1) != 0 || atomic_add_32_nv(&j, 1) != 1;
|
return atomic_cas_64(&i, 0, 1) != 0 || (atomic_add_32_nv(&j, 1) != 1;-1)
|
||||||
}
|
}
|
||||||
}end && {
|
}end && {
|
||||||
+ #include <stdint.h>
|
+ #include <stdint.h>
|
||||||
#include <atomic.h>
|
#include <atomic.h>
|
||||||
#define _aso_cas8(p,o,n) atomic_cas_8(p,o,n)
|
#define _aso_cas8(p,o,n) atomic_cas_8(p,o,n)
|
||||||
#define _aso_inc8(p) atomic_add_8_nv(p,1)
|
#define _aso_inc8(p) (atomic_add_8_nv(p,1)-1)
|
||||||
@@ -54,6 +61,7 @@ elif aso note{ <atomic.h> atomic_cas_64
|
@@ -73,6 +81,7 @@ elif aso note{ <atomic.h> atomic_cas_64
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
elif aso note{ <atomic.h> atomic_cas_32 }end link{
|
elif aso note{ <atomic.h> atomic_cas_32 }end link{
|
||||||
@ -44,15 +52,15 @@
|
|||||||
#include <atomic.h>
|
#include <atomic.h>
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
@@ -61,6 +69,7 @@ elif aso note{ <atomic.h> atomic_cas_32
|
@@ -80,6 +89,7 @@ elif aso note{ <atomic.h> atomic_cas_32
|
||||||
return atomic_cas_32(&i, 0, 1) != 0 || atomic_add_32_nv(&i, 1) != 1;
|
return atomic_cas_32(&i, 0, 1) != 0 || (atomic_add_32_nv(&i, 1) != 1;-1)
|
||||||
}
|
}
|
||||||
}end && {
|
}end && {
|
||||||
+ #include <stdint.h>
|
+ #include <stdint.h>
|
||||||
#include <atomic.h>
|
#include <atomic.h>
|
||||||
#define _aso_cas8(p,o,n) atomic_cas_8(p,o,n)
|
#define _aso_cas8(p,o,n) atomic_cas_8(p,o,n)
|
||||||
#define _aso_inc8(p) atomic_add_8_nv(p,1)
|
#define _aso_inc8(p) (atomic_add_8_nv(p,1)-1)
|
||||||
@@ -74,6 +83,7 @@ elif aso note{ <atomic.h> atomic_cas_32
|
@@ -93,6 +103,7 @@ elif aso note{ <atomic.h> atomic_cas_32
|
||||||
#define _aso_casptr(p,o,n) ((void*)atomic_cas_32((uint32_t*)p,(uint32_t)o,(uint32_t)n))
|
#define _aso_casptr(p,o,n) ((void*)atomic_cas_32((uint32_t*)p,(uint32_t)o,(uint32_t)n))
|
||||||
}
|
}
|
||||||
elif aso -latomic note{ <atomic.h> atomic_cas_64 with -latomic }end link{
|
elif aso -latomic note{ <atomic.h> atomic_cas_64 with -latomic }end link{
|
||||||
@ -60,15 +68,15 @@
|
|||||||
#include <atomic.h>
|
#include <atomic.h>
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
@@ -82,6 +92,7 @@ elif aso -latomic note{ <atomic.h> atomi
|
@@ -101,6 +112,7 @@ elif aso -latomic note{ <atomic.h> atomi
|
||||||
return atomic_cas_64(&i, 0, 1) != 0 || atomic_add_32_nv(&j, 1) != 1;
|
return atomic_cas_64(&i, 0, 1) != 0 || (atomic_add_32_nv(&j, 1) != 1;-1)
|
||||||
}
|
}
|
||||||
}end && {
|
}end && {
|
||||||
+ #include <stdint.h>
|
+ #include <stdint.h>
|
||||||
#include <atomic.h>
|
#include <atomic.h>
|
||||||
#define _REQ_atomic
|
#define _REQ_atomic
|
||||||
#define _aso_cas8(p,o,n) atomic_cas_8(p,o,n)
|
#define _aso_cas8(p,o,n) atomic_cas_8(p,o,n)
|
||||||
@@ -103,6 +114,7 @@ elif aso -latomic note{ <atomic.h> atomi
|
@@ -122,6 +134,7 @@ elif aso -latomic note{ <atomic.h> atomi
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
elif aso note{ <atomic.h> atomic_cas_32 with -latomic }end link{
|
elif aso note{ <atomic.h> atomic_cas_32 with -latomic }end link{
|
||||||
@ -76,15 +84,15 @@
|
|||||||
#include <atomic.h>
|
#include <atomic.h>
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
@@ -110,6 +122,7 @@ elif aso note{ <atomic.h> atomic_cas_32
|
@@ -129,6 +142,7 @@ elif aso note{ <atomic.h> atomic_cas_32
|
||||||
return atomic_cas_32(&i, 0, 1) != 0 || atomic_add_32_nv(&i, 1) != 1;
|
return atomic_cas_32(&i, 0, 1) != 0 || (atomic_add_32_nv(&i, 1) != 1;-1)
|
||||||
}
|
}
|
||||||
}end && {
|
}end && {
|
||||||
+ #include <stdint.h>
|
+ #include <stdint.h>
|
||||||
#include <atomic.h>
|
#include <atomic.h>
|
||||||
#define _REQ_atomic
|
#define _REQ_atomic
|
||||||
#define _aso_cas8(p,o,n) atomic_cas_8(p,o,n)
|
#define _aso_cas8(p,o,n) atomic_cas_8(p,o,n)
|
||||||
@@ -124,6 +137,7 @@ elif aso note{ <atomic.h> atomic_cas_32
|
@@ -143,6 +157,7 @@ elif aso note{ <atomic.h> atomic_cas_32
|
||||||
#define _aso_casptr(p,o,n) ((void*)atomic_cas_32((uint32_t*)p,(uint32_t)o,(uint32_t)n))
|
#define _aso_casptr(p,o,n) ((void*)atomic_cas_32((uint32_t*)p,(uint32_t)o,(uint32_t)n))
|
||||||
}
|
}
|
||||||
elif aso note{ <atomic.h> cas64 }end link{
|
elif aso note{ <atomic.h> cas64 }end link{
|
||||||
@ -92,15 +100,15 @@
|
|||||||
#include <atomic.h>
|
#include <atomic.h>
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
@@ -132,6 +146,7 @@ elif aso note{ <atomic.h> cas64 }end lin
|
@@ -151,6 +166,7 @@ elif aso note{ <atomic.h> cas64 }end lin
|
||||||
return cas64(&i, 0, 1) != 0 || atomic_add_32_nv(&j, 1) != 1;
|
return cas64(&i, 0, 1) != 0 || (atomic_add_32_nv(&j, 1) != 1;-1)
|
||||||
}
|
}
|
||||||
}end && {
|
}end && {
|
||||||
+ #include <stdint.h>
|
+ #include <stdint.h>
|
||||||
#include <atomic.h>
|
#include <atomic.h>
|
||||||
#define _aso_cas8(p,o,n) cas8(p,o,n)
|
#define _aso_cas8(p,o,n) cas8(p,o,n)
|
||||||
#define _aso_inc8(p) atomic_add_8_nv(p,1)
|
#define _aso_inc8(p) (atomic_add_8_nv(p,1)-1)
|
||||||
@@ -152,6 +167,7 @@ elif aso note{ <atomic.h> cas64 }end lin
|
@@ -171,6 +187,7 @@ elif aso note{ <atomic.h> cas64 }end lin
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
elif aso note{ <atomic.h> cas32 }end link{
|
elif aso note{ <atomic.h> cas32 }end link{
|
||||||
@ -108,11 +116,11 @@
|
|||||||
#include <atomic.h>
|
#include <atomic.h>
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
@@ -159,6 +175,7 @@ elif aso note{ <atomic.h> cas32 }end lin
|
@@ -178,6 +195,7 @@ elif aso note{ <atomic.h> cas32 }end lin
|
||||||
return cas32(&i, 0, 1) != 0 || atomic_add_32_nv(&i, 1) != 1;
|
return cas32(&i, 0, 1) != 0 || (atomic_add_32_nv(&i, 1) != 1;-1)
|
||||||
}
|
}
|
||||||
}end && {
|
}end && {
|
||||||
+ #include <stdint.h>
|
+ #include <stdint.h>
|
||||||
#include <atomic.h>
|
#include <atomic.h>
|
||||||
#define _aso_cas8(p,o,n) cas8(p,o,n)
|
#define _aso_cas8(p,o,n) cas8(p,o,n)
|
||||||
#define _aso_inc8(p) atomic_add_8_nv(p,1)
|
#define _aso_inc8(p) (atomic_add_8_nv(p,1)-1)
|
||||||
|
11
ksh93-limit-name-len.dif
Normal file
11
ksh93-limit-name-len.dif
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
--- src/cmd/ksh93/include/ulimit.h
|
||||||
|
+++ src/cmd/ksh93/include/ulimit.h 2012-02-02 11:30:00.242435132 +0000
|
||||||
|
@@ -157,7 +157,7 @@
|
||||||
|
|
||||||
|
typedef struct Limit_s
|
||||||
|
{
|
||||||
|
- const char name[16];
|
||||||
|
+ const char* name;
|
||||||
|
const char* description;
|
||||||
|
int index;
|
||||||
|
const char* conf;
|
@ -326,8 +326,8 @@
|
|||||||
prev cat.c
|
prev cat.c
|
||||||
meta cat.o %.c>%.o cat.c cat
|
meta cat.o %.c>%.o cat.c cat
|
||||||
prev cat.c
|
prev cat.c
|
||||||
-exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I-D${INSTALLROOT}/lib/probe/C/pp/0F689CA5rbincc -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -DUSAGE_LICENSE=\""[-author?Glenn Fowler <gsf@research.att.com>][-author?David Korn <dgk@research.att.com>][-copyright?Copyright (c) 1992-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libcmd]"\" -D_BLD_cmd -D_PACKAGE_ast -D_BLD_DEBUG -c cat.c
|
-exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -DUSAGE_LICENSE=\""[-author?Glenn Fowler <gsf@research.att.com>][-author?David Korn <dgk@research.att.com>][-copyright?Copyright (c) 1992-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libcmd]"\" -D_BLD_cmd -D_PACKAGE_ast -D_BLD_DEBUG -c cat.c
|
||||||
+exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I-D${INSTALLROOT}/lib/probe/C/pp/0F689CA5rbincc -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -DUSAGE_LICENSE=\""[-author?Glenn Fowler <gsf@research.att.com>][-author?David Korn <dgk@research.att.com>][-copyright?Copyright (c) 1992-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libcmd]"\" -D_BLD_cmd -D_PACKAGE_ast -D_BLD_DEBUG -DSHOPT_MULTIBYTE -c cat.c
|
+exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -DUSAGE_LICENSE=\""[-author?Glenn Fowler <gsf@research.att.com>][-author?David Korn <dgk@research.att.com>][-copyright?Copyright (c) 1992-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libcmd]"\" -D_BLD_cmd -D_PACKAGE_ast -D_BLD_DEBUG -DSHOPT_MULTIBYTE -c cat.c
|
||||||
done cat.o generated
|
done cat.o generated
|
||||||
make chgrp.o
|
make chgrp.o
|
||||||
prev chgrp.c
|
prev chgrp.c
|
||||||
|
@ -1,14 +1,15 @@
|
|||||||
--- src/cmd/ksh93/data/signals.c
|
--- src/cmd/ksh93/data/signals.c
|
||||||
+++ src/cmd/ksh93/data/signals.c 2008-09-11 15:49:02.645531304 +0000
|
+++ src/cmd/ksh93/data/signals.c 2012-02-06 11:16:53.970131637 +0100
|
||||||
@@ -18,6 +18,8 @@
|
@@ -18,6 +18,9 @@
|
||||||
* *
|
* *
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
#include <ast.h>
|
#include "defs.h"
|
||||||
+#include <cmd.h>
|
+#include <cmd.h>
|
||||||
+#include <jobs.h>
|
+#include <jobs.h>
|
||||||
#include "shtable.h"
|
+
|
||||||
#include "fault.h"
|
|
||||||
|
|
||||||
|
#if defined(SIGCLD) && !defined(SIGCHLD)
|
||||||
|
# define SIGCHLD SIGCLD
|
||||||
--- src/cmd/ksh93/sh/xec.c
|
--- src/cmd/ksh93/sh/xec.c
|
||||||
+++ src/cmd/ksh93/sh/xec.c 2007-12-21 13:28:04.000000000 +0100
|
+++ src/cmd/ksh93/sh/xec.c 2007-12-21 13:28:04.000000000 +0100
|
||||||
@@ -2894,6 +2894,7 @@ static pid_t sh_ntfork(Shell_t *shp,cons
|
@@ -2894,6 +2894,7 @@ static pid_t sh_ntfork(Shell_t *shp,cons
|
||||||
|
@ -13,8 +13,8 @@
|
|||||||
const char hist_fname[] = "/.sh_history";
|
const char hist_fname[] = "/.sh_history";
|
||||||
const char e_dot[] = ".";
|
const char e_dot[] = ".";
|
||||||
--- src/cmd/ksh93/sh/suid_exec.c
|
--- src/cmd/ksh93/sh/suid_exec.c
|
||||||
+++ src/cmd/ksh93/sh/suid_exec.c 2007-04-02 11:35:09.627236300 +0000
|
+++ src/cmd/ksh93/sh/suid_exec.c 2012-02-03 08:36:40.097933528 +0000
|
||||||
@@ -62,11 +62,21 @@
|
@@ -62,10 +62,24 @@
|
||||||
#define FDVERIFY 12 /* used to validate /tmp process */
|
#define FDVERIFY 12 /* used to validate /tmp process */
|
||||||
#undef BLKSIZE
|
#undef BLKSIZE
|
||||||
#define BLKSIZE sizeof(char*)*1024
|
#define BLKSIZE sizeof(char*)*1024
|
||||||
@ -27,18 +27,21 @@
|
|||||||
+# define DEFSHELL "/bin/sh"
|
+# define DEFSHELL "/bin/sh"
|
||||||
+#endif
|
+#endif
|
||||||
|
|
||||||
#if defined(__linux__)
|
+#if defined(__linux__)
|
||||||
static void error_exit(const char*) __attribute__ ((noreturn));
|
+static void error_exit(const char*) __attribute__ ((noreturn));
|
||||||
+#ifndef _lib_setregid
|
+#ifndef _lib_setregid
|
||||||
+#define _lib_setregid 1
|
+#define _lib_setregid 1
|
||||||
+#endif
|
+#endif
|
||||||
+#ifndef _lib_setreuid
|
+#ifndef _lib_setreuid
|
||||||
+#define _lib_setreuid 1
|
+#define _lib_setreuid 1
|
||||||
+#endif
|
+#endif
|
||||||
#else
|
+#else
|
||||||
static void error_exit(const char*);
|
static void error_exit(const char*);
|
||||||
#endif
|
+#endif
|
||||||
@@ -80,7 +90,7 @@ static int endsh(const char*);
|
static int in_dir(const char*, const char*);
|
||||||
|
static int endsh(const char*);
|
||||||
|
#ifndef _lib_setregid
|
||||||
|
@@ -76,7 +90,7 @@ static int endsh(const char*);
|
||||||
static int mycopy(int, int);
|
static int mycopy(int, int);
|
||||||
static void maketemp(char*);
|
static void maketemp(char*);
|
||||||
#else
|
#else
|
||||||
@ -47,7 +50,7 @@
|
|||||||
#endif /* _lib_setreuid */
|
#endif /* _lib_setreuid */
|
||||||
|
|
||||||
static const char version[] = "\n@(#)$Id: suid_exec "SH_RELEASE" $\n";
|
static const char version[] = "\n@(#)$Id: suid_exec "SH_RELEASE" $\n";
|
||||||
@@ -225,7 +235,7 @@ int main(int argc,char *argv[])
|
@@ -221,7 +235,7 @@ int main(int argc,char *argv[])
|
||||||
if(effuid != ruserid)
|
if(effuid != ruserid)
|
||||||
mode |= S_ISUID;
|
mode |= S_ISUID;
|
||||||
}
|
}
|
||||||
@ -56,7 +59,7 @@
|
|||||||
{
|
{
|
||||||
if(effuid != ruserid || setuid(ruserid) < 0)
|
if(effuid != ruserid || setuid(ruserid) < 0)
|
||||||
mode = S_ISUID;
|
mode = S_ISUID;
|
||||||
@@ -237,13 +247,18 @@ int main(int argc,char *argv[])
|
@@ -233,13 +247,18 @@ int main(int argc,char *argv[])
|
||||||
exec:
|
exec:
|
||||||
#endif /* _lib_setreuid */
|
#endif /* _lib_setreuid */
|
||||||
/* only use SHELL if file is in trusted directory and ends in sh */
|
/* only use SHELL if file is in trusted directory and ends in sh */
|
||||||
@ -76,7 +79,7 @@
|
|||||||
argv[0] = command;
|
argv[0] = command;
|
||||||
argv[1] = (char*)devfd;
|
argv[1] = (char*)devfd;
|
||||||
execv(shell,argv);
|
execv(shell,argv);
|
||||||
@@ -253,7 +268,7 @@ exec:
|
@@ -249,7 +268,7 @@ exec:
|
||||||
/*
|
/*
|
||||||
* return true of shell ends in sh of ksh
|
* return true of shell ends in sh of ksh
|
||||||
*/
|
*/
|
||||||
@ -85,7 +88,7 @@
|
|||||||
static int endsh(register const char *shell)
|
static int endsh(register const char *shell)
|
||||||
{
|
{
|
||||||
while(*shell)
|
while(*shell)
|
||||||
@@ -266,7 +281,20 @@ static int endsh(register const char *sh
|
@@ -262,7 +281,20 @@ static int endsh(register const char *sh
|
||||||
return(1);
|
return(1);
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
@ -107,13 +110,14 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* return true of shell is in <dir> directory
|
* return true of shell is in <dir> directory
|
||||||
@@ -345,16 +373,29 @@ int eaccess(register const char *name, r
|
@@ -341,16 +373,30 @@ int eaccess(register const char *name, r
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _lib_setreuid
|
#ifdef _lib_setreuid
|
||||||
-static void setids(int mode,int owner,int group)
|
-static void setids(int mode,int owner,int group)
|
||||||
+#include <sys/types.h>
|
+#include <sys/types.h>
|
||||||
+#include <pwd.h>
|
+#include <pwd.h>
|
||||||
|
+#include <grp.h>
|
||||||
+static void setids(int mode,uid_t owner,gid_t group)
|
+static void setids(int mode,uid_t owner,gid_t group)
|
||||||
{
|
{
|
||||||
- if(mode & S_ISGID)
|
- if(mode & S_ISGID)
|
||||||
|
16
ksh93-vm.dif
16
ksh93-vm.dif
@ -23,21 +23,7 @@
|
|||||||
|
|
||||||
/* macros to get the data section and size */
|
/* macros to get the data section and size */
|
||||||
#define MMHEAD(file) ROUND(sizeof(Mmvm_t)+strlen(file), ALIGN)
|
#define MMHEAD(file) ROUND(sizeof(Mmvm_t)+strlen(file), ALIGN)
|
||||||
@@ -135,7 +137,12 @@ static Mmvm_t* mmfix(Mmvm_t* mmvm, Mmdis
|
@@ -162,10 +164,18 @@ static int mminit(Mmdisc_t* mmdc)
|
||||||
if(mmdc->proj < 0)
|
|
||||||
{ munmap((Void_t*)mmvm, size);
|
|
||||||
mmvm = (Mmvm_t*)mmap(base, size, (PROT_READ|PROT_WRITE),
|
|
||||||
- (MAP_FIXED|MAP_SHARED), fd, (off_t)0 );
|
|
||||||
+#if (defined(__ia64__) || defined(__s390x__)) && defined(MAP_32BIT)
|
|
||||||
+ (MAP_32BIT|MAP_SHARED),
|
|
||||||
+#else
|
|
||||||
+ (MAP_FIXED|MAP_SHARED),
|
|
||||||
+#endif
|
|
||||||
+ fd, (off_t)0 );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{ shmdt((Void_t*)mmvm);
|
|
||||||
@@ -162,10 +169,18 @@ static int mminit(Mmdisc_t* mmdc)
|
|
||||||
|
|
||||||
if(mmdc->mmvm) /* already done this */
|
if(mmdc->mmvm) /* already done this */
|
||||||
return 0;
|
return 0;
|
||||||
|
62
ksh93.dif
62
ksh93.dif
@ -11,7 +11,7 @@
|
|||||||
+ prdata.options = sh_optecho + 5;
|
+ prdata.options = sh_optecho + 5;
|
||||||
+# endif
|
+# endif
|
||||||
prdata.raw = prdata.echon = 0;
|
prdata.raw = prdata.echon = 0;
|
||||||
prdata.sh = ((Shbltin_t*)extra)->shp;
|
prdata.sh = context->shp;
|
||||||
NOT_USED(argc);
|
NOT_USED(argc);
|
||||||
@@ -99,7 +103,52 @@ static char* nullarg[] = { 0, 0 };
|
@@ -99,7 +103,52 @@ static char* nullarg[] = { 0, 0 };
|
||||||
prdata.sh->universe = 1;
|
prdata.sh->universe = 1;
|
||||||
@ -61,7 +61,7 @@
|
|||||||
+ }
|
+ }
|
||||||
+ out:
|
+ out:
|
||||||
+# endif
|
+# endif
|
||||||
return(b_print(0,argv,&prdata));
|
return(b_print(0,argv,(Shbltin_t*)&prdata));
|
||||||
+ }
|
+ }
|
||||||
prdata.options = sh_optecho;
|
prdata.options = sh_optecho;
|
||||||
prdata.raw = 1;
|
prdata.raw = 1;
|
||||||
@ -148,20 +148,26 @@
|
|||||||
#endif
|
#endif
|
||||||
))
|
))
|
||||||
sh_onoption(SH_RC);
|
sh_onoption(SH_RC);
|
||||||
--- src/cmd/ksh93/sh/suid_exec.c
|
--- src/cmd/ksh93/sh/xec.c
|
||||||
+++ src/cmd/ksh93/sh/suid_exec.c 2007-12-20 18:01:26.000000000 +0000
|
+++ src/cmd/ksh93/sh/xec.c 2012-01-26 12:07:46.463645375 +0000
|
||||||
@@ -65,7 +65,11 @@
|
@@ -922,7 +922,7 @@ int sh_exec(register const Shnode_t *t,
|
||||||
#define THISPROG "/etc/suid_exec"
|
{
|
||||||
#define DEFSHELL "/bin/sh"
|
case TCOM:
|
||||||
|
{
|
||||||
+#if defined(__linux__)
|
- register struct argnod *argp;
|
||||||
+static void error_exit(const char*) __attribute__ ((noreturn));
|
+ volatile struct argnod *argp;
|
||||||
+#else
|
char *trap;
|
||||||
static void error_exit(const char*);
|
Namval_t *np, *nq, *last_table;
|
||||||
+#endif
|
struct ionod *io;
|
||||||
static int in_dir(const char*, const char*);
|
@@ -1027,7 +1027,7 @@ int sh_exec(register const Shnode_t *t,
|
||||||
static int endsh(const char*);
|
comn = com[argn-1];
|
||||||
#ifndef _lib_setregid
|
}
|
||||||
|
io = t->tre.treio;
|
||||||
|
- if(shp->envlist = argp = t->com.comset)
|
||||||
|
+ if((shp->envlist = argp = t->com.comset))
|
||||||
|
{
|
||||||
|
if(argn==0 || (np && nv_isattr(np,(BLT_DCL|BLT_SPC))))
|
||||||
|
{
|
||||||
--- src/cmd/ksh93/tests/attributes.sh
|
--- src/cmd/ksh93/tests/attributes.sh
|
||||||
+++ src/cmd/ksh93/tests/attributes.sh 2009-07-09 13:14:05.000000000 +0000
|
+++ src/cmd/ksh93/tests/attributes.sh 2009-07-09 13:14:05.000000000 +0000
|
||||||
@@ -199,7 +199,7 @@ hello worldhello worldhello world
|
@@ -199,7 +199,7 @@ hello worldhello worldhello world
|
||||||
@ -333,6 +339,30 @@
|
|||||||
_exit(EXIT_NOTFOUND);
|
_exit(EXIT_NOTFOUND);
|
||||||
}
|
}
|
||||||
sleep(2);
|
sleep(2);
|
||||||
|
--- src/lib/libast/port/astwinsize.c
|
||||||
|
+++ src/lib/libast/port/astwinsize.c 2012-02-03 08:58:43.217934605 +0000
|
||||||
|
@@ -29,6 +29,10 @@
|
||||||
|
#include <ast.h>
|
||||||
|
#include <ast_tty.h>
|
||||||
|
|
||||||
|
+#if _sys_ioctl
|
||||||
|
+#include <sys/ioctl.h>
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
#if defined(__STDPP__directive) && defined(__STDPP__hide)
|
||||||
|
__STDPP__directive pragma pp:hide ioctl sleep
|
||||||
|
#else
|
||||||
|
@@ -36,10 +40,6 @@ __STDPP__directive pragma pp:hide ioctl
|
||||||
|
#define sleep ______sleep
|
||||||
|
#endif
|
||||||
|
|
||||||
|
-#if _sys_ioctl
|
||||||
|
-#include <sys/ioctl.h>
|
||||||
|
-#endif
|
||||||
|
-
|
||||||
|
#if defined(TIOCGWINSZ)
|
||||||
|
#if _sys_stream && _sys_ptem
|
||||||
|
#include <sys/stream.h>
|
||||||
--- src/lib/libast/sfio/sfstrtof.h
|
--- src/lib/libast/sfio/sfstrtof.h
|
||||||
+++ src/lib/libast/sfio/sfstrtof.h 2007-12-20 18:01:26.000000000 +0000
|
+++ src/lib/libast/sfio/sfstrtof.h 2007-12-20 18:01:26.000000000 +0000
|
||||||
@@ -54,7 +54,7 @@
|
@@ -54,7 +54,7 @@
|
||||||
|
30
leak1.sh
30
leak1.sh
@ -3,33 +3,43 @@
|
|||||||
PATH=/bin:/usr/bin:/usr/sbin:/sbin
|
PATH=/bin:/usr/bin:/usr/sbin:/sbin
|
||||||
|
|
||||||
getSampleInterval() { return 0; }
|
getSampleInterval() { return 0; }
|
||||||
typeset -ilu times=4000
|
typeset -lui count=${1:-4000}
|
||||||
typeset -ilu leak=0
|
typeset -ilu leak=0
|
||||||
|
|
||||||
|
typeset -a curstate=(0 0 0)
|
||||||
|
typeset -a oldstate=(0 0 0)
|
||||||
|
|
||||||
vm()
|
vm()
|
||||||
{
|
{
|
||||||
typeset size
|
typeset size
|
||||||
typeset key unit result=""
|
typeset key unit result=""
|
||||||
while read key size unit; do
|
while read key size unit; do
|
||||||
case "$key" in
|
case "$key" in
|
||||||
VmSize*) result=${result:+"$result:"}$size ;;
|
VmSize*) result=${result:+"$result "}$size ;;
|
||||||
VmRSS*) result=${result:+"$result:"}$size ;;
|
VmRSS*) result=${result:+"$result "}$size ;;
|
||||||
VmData*) result=${result:+"$result:"}$size ;;
|
VmData*) result=${result:+"$result "}$size ;;
|
||||||
esac
|
esac
|
||||||
done < /proc/$$/status
|
done < /proc/$$/status
|
||||||
echo $result
|
echo $result
|
||||||
}
|
}
|
||||||
|
|
||||||
curstate="XXXX:XXXX:XXXX"
|
lessequal()
|
||||||
oldstate=$(vm)
|
{
|
||||||
|
typeset -i ret=0
|
||||||
|
((${curstate[0]} > ${oldstate[0]})) && let ret=1
|
||||||
|
((${curstate[1]} > ${oldstate[1]})) && let ret=1
|
||||||
|
((${curstate[2]} > ${oldstate[2]})) && let ret=1
|
||||||
|
return $ret
|
||||||
|
}
|
||||||
|
|
||||||
while ((times-- > 0))
|
oldstate=($(vm))
|
||||||
|
while ((count-- > 0))
|
||||||
do
|
do
|
||||||
interval=$(getSampleInterval)
|
interval=$(getSampleInterval)
|
||||||
|
|
||||||
curstate=$(vm)
|
curstate=($(vm))
|
||||||
[ "$curstate" != "$oldstate" ] && let leak++
|
lessequal || let leak++
|
||||||
oldstate="$curstate"
|
oldstate=(${curstate[@]})
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
47
leak2.sh
47
leak2.sh
@ -3,18 +3,21 @@
|
|||||||
foo=0
|
foo=0
|
||||||
LoopCountForMEMSAP=0
|
LoopCountForMEMSAP=0
|
||||||
bla=234
|
bla=234
|
||||||
typeset -lui count=4000
|
typeset -lui count=${1:-4000}
|
||||||
typeset -lui leak=0
|
typeset -lui leak=0
|
||||||
|
|
||||||
|
typeset -a curstate=(0 0 0)
|
||||||
|
typeset -a oldstate=(0 0 0)
|
||||||
|
|
||||||
vm()
|
vm()
|
||||||
{
|
{
|
||||||
typeset size
|
typeset size
|
||||||
typeset key unit result=""
|
typeset key unit result=""
|
||||||
while read key size unit; do
|
while read key size unit; do
|
||||||
case "$key" in
|
case "$key" in
|
||||||
VmSize*) result=${result:+"$result:"}$size ;;
|
VmSize*) result=${result:+"$result "}$size ;;
|
||||||
VmRSS*) result=${result:+"$result:"}$size ;;
|
VmRSS*) result=${result:+"$result "}$size ;;
|
||||||
VmData*) result=${result:+"$result:"}$size ;;
|
VmData*) result=${result:+"$result "}$size ;;
|
||||||
esac
|
esac
|
||||||
done < /proc/$$/status
|
done < /proc/$$/status
|
||||||
echo $result
|
echo $result
|
||||||
@ -22,23 +25,39 @@ vm()
|
|||||||
|
|
||||||
fusub()
|
fusub()
|
||||||
{
|
{
|
||||||
datun=`date +%S`
|
datum=`date +%S`
|
||||||
# datun=$(date +%S)
|
interval=$((10 - datum%10))
|
||||||
interval=$((10 - datun%10))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
curstate="XXXX:XXXX:XXXX"
|
fvsub()
|
||||||
oldstate=$(vm)
|
{
|
||||||
|
datum=$(date +%S)
|
||||||
|
interval=$((10 - datum%10))
|
||||||
|
}
|
||||||
|
|
||||||
|
lessequal()
|
||||||
|
{
|
||||||
|
typeset -i ret=0
|
||||||
|
((${curstate[0]} > ${oldstate[0]})) && let ret=1
|
||||||
|
((${curstate[1]} > ${oldstate[1]})) && let ret=1
|
||||||
|
((${curstate[2]} > ${oldstate[2]})) && let ret=1
|
||||||
|
return $ret
|
||||||
|
}
|
||||||
|
|
||||||
|
oldstate=($(vm))
|
||||||
while ((count-- > 0))
|
while ((count-- > 0))
|
||||||
do
|
do
|
||||||
foo=$((foo+1))
|
foo=$((foo+1))
|
||||||
datum=`fusub`
|
|
||||||
# datum=$(fusub)
|
|
||||||
|
|
||||||
curstate=$(vm)
|
if ((count%2 == 0)) ; then
|
||||||
[ "$curstate" != "$oldstate" ] && let leak++
|
datum=`fusub`
|
||||||
oldstate="$curstate"
|
else
|
||||||
|
datum=$(fvsub)
|
||||||
|
fi
|
||||||
|
|
||||||
|
curstate=($(vm))
|
||||||
|
lessequal || let leak++
|
||||||
|
oldstate=(${curstate[@]})
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
22
leak3.sh
Normal file
22
leak3.sh
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/ksh
|
||||||
|
|
||||||
|
a_sh=$(mktemp ${TMPDIR:-/tmp}/${0##*/}.XXXXXX) || exit 1
|
||||||
|
trap "rm -f $a_sh" EXIT
|
||||||
|
|
||||||
|
(cat > $a_sh) <<-EOF
|
||||||
|
#!$SHELL
|
||||||
|
check_proc_handle ()
|
||||||
|
{
|
||||||
|
handleSoftLimit=$(ulimit -n)
|
||||||
|
echo \$handleSoftLimit > /dev/null
|
||||||
|
}
|
||||||
|
check_proc_handle
|
||||||
|
EOF
|
||||||
|
chmod +x $a_sh
|
||||||
|
|
||||||
|
typeset -lui count=${1:-4000}
|
||||||
|
|
||||||
|
while ((count-- > 0))
|
||||||
|
do
|
||||||
|
$a_sh
|
||||||
|
done
|
17
ulimit.sh
Normal file
17
ulimit.sh
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/ksh
|
||||||
|
|
||||||
|
PATH=/bin:/usr/bin:/usr/sbin:/sbin
|
||||||
|
typeset -lui count=${1:-4000}
|
||||||
|
typeset -ilu err=0
|
||||||
|
|
||||||
|
trap 'echo "[${0##*/}: error count at $err]"' ERR
|
||||||
|
|
||||||
|
while ((count-- > 0))
|
||||||
|
do
|
||||||
|
ulimit -s || let err++
|
||||||
|
ulimit -n || let err++
|
||||||
|
ulimit -q || let err++
|
||||||
|
done > /dev/null
|
||||||
|
|
||||||
|
echo "[${0##*/}: error count at $err]"
|
||||||
|
((err == 0)) || exit 1
|
36
vmbalance
Normal file
36
vmbalance
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
#!/usr/bin/awk -f
|
||||||
|
#
|
||||||
|
# vmblance Awk script to detect endless growing memory alloctions
|
||||||
|
# in endless shell loops using in daemonized shell scripts
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
#
|
||||||
|
# strace -e mmap,mmap2,munmap -o '|./vmbalance' ksh leak1.sh
|
||||||
|
#
|
||||||
|
BEGIN {
|
||||||
|
FS="([[:blank:]]|[[:punct:]])"
|
||||||
|
ignore=""
|
||||||
|
sum=0
|
||||||
|
allocs=0
|
||||||
|
frees=0
|
||||||
|
}
|
||||||
|
/^mmap(2|64)?\(/ {
|
||||||
|
if ($0 !~ /.*MAP_PRIVATE\|MAP_ANONYMOUS.*/) {
|
||||||
|
if (ignore)
|
||||||
|
ignore=ignore "|" $NF
|
||||||
|
else
|
||||||
|
ignore=$NF
|
||||||
|
} else {
|
||||||
|
sum+=$4
|
||||||
|
allocs++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/^munmap(2|64)?\(/ {
|
||||||
|
if ($0 !~ ignore) {
|
||||||
|
sum-=$4
|
||||||
|
frees++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
END {
|
||||||
|
print sum " bytes with " allocs " chunks allocated and " frees " chunks freed"
|
||||||
|
}
|
@ -104,7 +104,7 @@
|
|||||||
setv SILENT
|
setv SILENT
|
||||||
setv TAR tar
|
setv TAR tar
|
||||||
setv YACC yacc
|
setv YACC yacc
|
||||||
@@ -1346,7 +1346,7 @@ prev +ljobs
|
@@ -1337,7 +1337,7 @@ prev +ljobs
|
||||||
prev +li
|
prev +li
|
||||||
prev ${mam_libsocket}
|
prev ${mam_libsocket}
|
||||||
prev ${mam_libsecdb}
|
prev ${mam_libsecdb}
|
||||||
@ -113,7 +113,7 @@
|
|||||||
done ksh generated
|
done ksh generated
|
||||||
make shcomp
|
make shcomp
|
||||||
make shcomp.o
|
make shcomp.o
|
||||||
@@ -1370,7 +1370,7 @@ prev ${mam_libsocket}
|
@@ -1361,7 +1361,7 @@ prev ${mam_libsocket}
|
||||||
prev ${mam_libsecdb}
|
prev ${mam_libsecdb}
|
||||||
setv CC.DLL -UCC.DLL
|
setv CC.DLL -UCC.DLL
|
||||||
setv SH_DICT -DSH_DICT="\"libshell\""
|
setv SH_DICT -DSH_DICT="\"libshell\""
|
||||||
@ -123,7 +123,7 @@
|
|||||||
make suid_exec
|
make suid_exec
|
||||||
make suid_exec.o
|
make suid_exec.o
|
||||||
--- src/lib/libast/Mamfile
|
--- src/lib/libast/Mamfile
|
||||||
+++ src/lib/libast/Mamfile 2010-08-17 15:00:56.000000000 +0000
|
+++ src/lib/libast/Mamfile 2012-02-06 10:05:34.917933005 +0000
|
||||||
@@ -5,7 +5,7 @@ setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS
|
@@ -5,7 +5,7 @@ setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS
|
||||||
setv ARFLAGS rc
|
setv ARFLAGS rc
|
||||||
setv AS as
|
setv AS as
|
||||||
@ -142,7 +142,7 @@
|
|||||||
setv SILENT
|
setv SILENT
|
||||||
setv TAR tar
|
setv TAR tar
|
||||||
setv YACC yacc
|
setv YACC yacc
|
||||||
@@ -1002,7 +1002,7 @@ make lcgen
|
@@ -999,7 +999,7 @@ make lcgen
|
||||||
make port/lcgen.c
|
make port/lcgen.c
|
||||||
prev std/stdio.h implicit
|
prev std/stdio.h implicit
|
||||||
done port/lcgen.c
|
done port/lcgen.c
|
||||||
@ -169,10 +169,9 @@
|
|||||||
exec - then rm -f 1.${COTEMP}.x
|
exec - then rm -f 1.${COTEMP}.x
|
||||||
exec - else mv 1.${COTEMP}.x ${INSTALLROOT}/include/ast/fmtmsg.h
|
exec - else mv 1.${COTEMP}.x ${INSTALLROOT}/include/ast/fmtmsg.h
|
||||||
exec - fi
|
exec - fi
|
||||||
-exec - }
|
exec - }
|
||||||
-exec - ;;
|
-exec - ;;
|
||||||
-exec - esac
|
-exec - esac
|
||||||
+exec - }
|
|
||||||
prev ${INSTALLROOT}/include/prototyped.h implicit
|
prev ${INSTALLROOT}/include/prototyped.h implicit
|
||||||
done ${INSTALLROOT}/include/ast/fmtmsg.h generated
|
done ${INSTALLROOT}/include/ast/fmtmsg.h generated
|
||||||
make ${INSTALLROOT}/include/ast/libgen.h
|
make ${INSTALLROOT}/include/ast/libgen.h
|
||||||
@ -192,10 +191,9 @@
|
|||||||
exec - then rm -f 1.${COTEMP}.x
|
exec - then rm -f 1.${COTEMP}.x
|
||||||
exec - else mv 1.${COTEMP}.x ${INSTALLROOT}/include/ast/libgen.h
|
exec - else mv 1.${COTEMP}.x ${INSTALLROOT}/include/ast/libgen.h
|
||||||
exec - fi
|
exec - fi
|
||||||
-exec - }
|
exec - }
|
||||||
-exec - ;;
|
-exec - ;;
|
||||||
-exec - esac
|
-exec - esac
|
||||||
+exec - }
|
|
||||||
prev ${INSTALLROOT}/include/prototyped.h implicit
|
prev ${INSTALLROOT}/include/prototyped.h implicit
|
||||||
done ${INSTALLROOT}/include/ast/libgen.h generated
|
done ${INSTALLROOT}/include/ast/libgen.h generated
|
||||||
make ${INSTALLROOT}/include/ast/syslog.h
|
make ${INSTALLROOT}/include/ast/syslog.h
|
||||||
@ -215,15 +213,14 @@
|
|||||||
exec - then rm -f 1.${COTEMP}.x
|
exec - then rm -f 1.${COTEMP}.x
|
||||||
exec - else mv 1.${COTEMP}.x ${INSTALLROOT}/include/ast/syslog.h
|
exec - else mv 1.${COTEMP}.x ${INSTALLROOT}/include/ast/syslog.h
|
||||||
exec - fi
|
exec - fi
|
||||||
-exec - }
|
exec - }
|
||||||
-exec - ;;
|
-exec - ;;
|
||||||
-exec - esac
|
-exec - esac
|
||||||
+exec - }
|
|
||||||
prev ast_namval.h implicit
|
prev ast_namval.h implicit
|
||||||
prev ${INSTALLROOT}/include/prototyped.h implicit
|
prev ${INSTALLROOT}/include/prototyped.h implicit
|
||||||
done ${INSTALLROOT}/include/ast/syslog.h generated
|
done ${INSTALLROOT}/include/ast/syslog.h generated
|
||||||
--- src/lib/libcmd/Mamfile
|
--- src/lib/libcmd/Mamfile
|
||||||
+++ src/lib/libcmd/Mamfile 2008-02-14 12:08:37.000000000 +0000
|
+++ src/lib/libcmd/Mamfile 2012-02-06 10:06:34.179552617 +0000
|
||||||
@@ -7,7 +7,7 @@ setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS
|
@@ -7,7 +7,7 @@ setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS
|
||||||
setv ARFLAGS rc
|
setv ARFLAGS rc
|
||||||
setv AS as
|
setv AS as
|
||||||
@ -263,8 +260,8 @@
|
|||||||
setv TAR tar
|
setv TAR tar
|
||||||
setv YACC yacc
|
setv YACC yacc
|
||||||
--- src/lib/libpp/Mamfile
|
--- src/lib/libpp/Mamfile
|
||||||
+++ src/lib/libpp/Mamfile 2012-01-24 18:31:21.979645513 +0000
|
+++ src/lib/libpp/Mamfile 2012-01-24 18:31:22.000000000 +0000
|
||||||
@@ -665,7 +665,7 @@ exec - .
|
@@ -661,7 +661,7 @@ exec - .
|
||||||
exec - w
|
exec - w
|
||||||
exec - q
|
exec - q
|
||||||
exec - !
|
exec - !
|
||||||
@ -273,7 +270,7 @@
|
|||||||
exec - ./${COTEMP}.exe > pp.yacc
|
exec - ./${COTEMP}.exe > pp.yacc
|
||||||
exec - rm -f 1.${COTEMP}.c ${COTEMP}.exe
|
exec - rm -f 1.${COTEMP}.c ${COTEMP}.exe
|
||||||
done pp.yacc generated
|
done pp.yacc generated
|
||||||
@@ -707,7 +707,7 @@ exec - .
|
@@ -703,7 +703,7 @@ exec - .
|
||||||
exec - w
|
exec - w
|
||||||
exec - q
|
exec - q
|
||||||
exec - !
|
exec - !
|
||||||
|
Loading…
x
Reference in New Issue
Block a user