From 7482ea2e122bbae19ce94720097748745dc0d86de708738a3b18da7ff11457a6 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Mon, 28 Jun 2010 15:37:15 +0000 Subject: [PATCH 1/6] . OBS-URL: https://build.opensuse.org/package/show/shells/ksh?expand=0&rev=36 --- CPL | 245 ++++++++++++++++++++++++++++ INIT.2010-03-09.tar.bz2 | 3 - INIT.2010-06-21.tar.bz2 | 3 + ast-ksh.2010-03-09.tar.bz2 | 3 - ast-ksh.2010-06-21.tar.bz2 | 3 + ksh.changes | 153 +++++++++++++++++ ksh.spec | 20 ++- ksh93-shift_ijs.dif | 36 ++-- ksh93-sigchld.dif | 26 --- ksh93-sigpipe.dif | 30 ++++ ksh93-tty.dif | 37 ----- ksh93-whence-deadlock.dif | 34 ---- workaround-stupid-build-system.diff | 20 +-- 13 files changed, 479 insertions(+), 134 deletions(-) create mode 100644 CPL delete mode 100644 INIT.2010-03-09.tar.bz2 create mode 100644 INIT.2010-06-21.tar.bz2 delete mode 100644 ast-ksh.2010-03-09.tar.bz2 create mode 100644 ast-ksh.2010-06-21.tar.bz2 delete mode 100644 ksh93-sigchld.dif create mode 100644 ksh93-sigpipe.dif delete mode 100644 ksh93-tty.dif delete mode 100644 ksh93-whence-deadlock.dif diff --git a/CPL b/CPL new file mode 100644 index 0000000..04afe02 --- /dev/null +++ b/CPL @@ -0,0 +1,245 @@ ++------------------------------------------------------------------------------+ +| This license covers all software that refers to the URL | +| http://www.opensource.org/licenses/cpl1.0.txt | ++------------------------------------------------------------------------------+ + +Common Public License Version 1.0 + + THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON + PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF + THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + + 1. DEFINITIONS + + "Contribution" means: + + a) in the case of the initial Contributor, the initial code and + documentation distributed under this Agreement, and + + b) in the case of each subsequent Contributor: + + i) changes to the Program, and + + ii) additions to the Program; + + where such changes and/or additions to the Program originate from + and are distributed by that particular Contributor. A Contribution + 'originates' from a Contributor if it was added to the Program by + such Contributor itself or anyone acting on such Contributor's + behalf. Contributions do not include additions to the Program + which: (i) are separate modules of software distributed in + conjunction with the Program under their own license agreement, and + (ii) are not derivative works of the Program. + + "Contributor" means any person or entity that distributes the Program. + + "Licensed Patents " mean patent claims licensable by a Contributor + which are necessarily infringed by the use or sale of its Contribution + alone or when combined with the Program. + + "Program" means the Contributions distributed in accordance with this + Agreement. + + "Recipient" means anyone who receives the Program under this + Agreement, including all Contributors. + + 2. GRANT OF RIGHTS + + a) Subject to the terms of this Agreement, each Contributor hereby + grants Recipient a non-exclusive, worldwide, royalty-free copyright + license to reproduce, prepare derivative works of, publicly + display, publicly perform, distribute and sublicense the + Contribution of such Contributor, if any, and such derivative + works, in source code and object code form. + + b) Subject to the terms of this Agreement, each Contributor hereby + grants Recipient a non-exclusive, worldwide, royalty-free patent + license under Licensed Patents to make, use, sell, offer to sell, + import and otherwise transfer the Contribution of such Contributor, + if any, in source code and object code form. This patent license + shall apply to the combination of the Contribution and the Program + if, at the time the Contribution is added by the Contributor, such + addition of the Contribution causes such combination to be covered + by the Licensed Patents. The patent license shall not apply to any + other combinations which include the Contribution. No hardware per + se is licensed hereunder. + + c) Recipient understands that although each Contributor grants the + licenses to its Contributions set forth herein, no assurances are + provided by any Contributor that the Program does not infringe the + patent or other intellectual property rights of any other entity. + Each Contributor disclaims any liability to Recipient for claims + brought by any other entity based on infringement of intellectual + property rights or otherwise. As a condition to exercising the + rights and licenses granted hereunder, each Recipient hereby + assumes sole responsibility to secure any other intellectual + property rights needed, if any. For example, if a third party + patent license is required to allow Recipient to distribute the + Program, it is Recipient's responsibility to acquire that license + before distributing the Program. + + d) Each Contributor represents that to its knowledge it has + sufficient copyright rights in its Contribution, if any, to grant + the copyright license set forth in this Agreement. + + 3. REQUIREMENTS + + A Contributor may choose to distribute the Program in object code form + under its own license agreement, provided that: + + a) it complies with the terms and conditions of this Agreement; and + + b) its license agreement: + + i) effectively disclaims on behalf of all Contributors all + warranties and conditions, express and implied, including + warranties or conditions of title and non-infringement, and implied + warranties or conditions of merchantability and fitness for a + particular purpose; + + ii) effectively excludes on behalf of all Contributors all + liability for damages, including direct, indirect, special, + incidental and consequential damages, such as lost profits; + + iii) states that any provisions which differ from this Agreement + are offered by that Contributor alone and not by any other party; + and + + iv) states that source code for the Program is available from such + Contributor, and informs licensees how to obtain it in a reasonable + manner on or through a medium customarily used for software + exchange. + + When the Program is made available in source code form: + + a) it must be made available under this Agreement; and + + b) a copy of this Agreement must be included with each copy of the + Program. + + Contributors may not remove or alter any copyright notices contained + within the Program. + + Each Contributor must identify itself as the originator of its + Contribution, if any, in a manner that reasonably allows subsequent + Recipients to identify the originator of the Contribution. + + 4. COMMERCIAL DISTRIBUTION + + Commercial distributors of software may accept certain + responsibilities with respect to end users, business partners and the + like. While this license is intended to facilitate the commercial use + of the Program, the Contributor who includes the Program in a + commercial product offering should do so in a manner which does not + create potential liability for other Contributors. Therefore, if a + Contributor includes the Program in a commercial product offering, + such Contributor ("Commercial Contributor") hereby agrees to defend + and indemnify every other Contributor ("Indemnified Contributor") + against any losses, damages and costs (collectively "Losses") arising + from claims, lawsuits and other legal actions brought by a third party + against the Indemnified Contributor to the extent caused by the acts + or omissions of such Commercial Contributor in connection with its + distribution of the Program in a commercial product offering. The + obligations in this section do not apply to any claims or Losses + relating to any actual or alleged intellectual property infringement. + In order to qualify, an Indemnified Contributor must: a) promptly + notify the Commercial Contributor in writing of such claim, and b) + allow the Commercial Contributor to control, and cooperate with the + Commercial Contributor in, the defense and any related settlement + negotiations. The Indemnified Contributor may participate in any such + claim at its own expense. + + For example, a Contributor might include the Program in a commercial + product offering, Product X. That Contributor is then a Commercial + Contributor. If that Commercial Contributor then makes performance + claims, or offers warranties related to Product X, those performance + claims and warranties are such Commercial Contributor's responsibility + alone. Under this section, the Commercial Contributor would have to + defend claims against the other Contributors related to those + performance claims and warranties, and if a court requires any other + Contributor to pay any damages as a result, the Commercial Contributor + must pay those damages. + + 5. NO WARRANTY + + EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS + PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY + WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY + OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely + responsible for determining the appropriateness of using and + distributing the Program and assumes all risks associated with its + exercise of rights under this Agreement, including but not limited to + the risks and costs of program errors, compliance with applicable + laws, damage to or loss of data, programs or equipment, and + unavailability or interruption of operations. + + 6. DISCLAIMER OF LIABILITY + + EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR + ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING + WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR + DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED + HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + + 7. GENERAL + + If any provision of this Agreement is invalid or unenforceable under + applicable law, it shall not affect the validity or enforceability of + the remainder of the terms of this Agreement, and without further + action by the parties hereto, such provision shall be reformed to the + minimum extent necessary to make such provision valid and enforceable. + + If Recipient institutes patent litigation against a Contributor with + respect to a patent applicable to software (including a cross-claim or + counterclaim in a lawsuit), then any patent licenses granted by that + Contributor to such Recipient under this Agreement shall terminate as + of the date such litigation is filed. In addition, if Recipient + institutes patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Program + itself (excluding combinations of the Program with other software or + hardware) infringes such Recipient's patent(s), then such Recipient's + rights granted under Section 2(b) shall terminate as of the date such + litigation is filed. + + All Recipient's rights under this Agreement shall terminate if it + fails to comply with any of the material terms or conditions of this + Agreement and does not cure such failure in a reasonable period of + time after becoming aware of such noncompliance. If all Recipient's + rights under this Agreement terminate, Recipient agrees to cease use + and distribution of the Program as soon as reasonably practicable. + However, Recipient's obligations under this Agreement and any licenses + granted by Recipient relating to the Program shall continue and + survive. + + Everyone is permitted to copy and distribute copies of this Agreement, + but in order to avoid inconsistency the Agreement is copyrighted and + may only be modified in the following manner. The Agreement Steward + reserves the right to publish new versions (including revisions) of + this Agreement from time to time. No one other than the Agreement + Steward has the right to modify this Agreement. IBM is the initial + Agreement Steward. IBM may assign the responsibility to serve as the + Agreement Steward to a suitable separate entity. Each new version of + the Agreement will be given a distinguishing version number. The + Program (including Contributions) may always be distributed subject to + the version of the Agreement under which it was received. In addition, + after a new version of the Agreement is published, Contributor may + elect to distribute the Program (including its Contributions) under + the new version. Except as expressly stated in Sections 2(a) and 2(b) + above, Recipient receives no rights or licenses to the intellectual + property of any Contributor under this Agreement, whether expressly, + by implication, estoppel or otherwise. All rights in the Program not + expressly granted under this Agreement are reserved. + + This Agreement is governed by the laws of the State of New York and + the intellectual property laws of the United States of America. No + party to this Agreement will bring a legal action under this Agreement + more than one year after the cause of action arose. Each party waives + its rights to a jury trial in any resulting litigation. + +Copyright (c) 2004 by the Open Source Initiative +This is a copy of the license posted on 2004-10-06 at: + http://www.opensource.org/licenses/cpl diff --git a/INIT.2010-03-09.tar.bz2 b/INIT.2010-03-09.tar.bz2 deleted file mode 100644 index c5a3cf4..0000000 --- a/INIT.2010-03-09.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fd938331f03103fb4af57af4f6bd6e217d2473c0c6aa52a18e69bb9054687005 -size 276029 diff --git a/INIT.2010-06-21.tar.bz2 b/INIT.2010-06-21.tar.bz2 new file mode 100644 index 0000000..00aeaf0 --- /dev/null +++ b/INIT.2010-06-21.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ac7d3b11cec48ba51550c828e79b87d8b9e4747a533dd33dccf5146a304a5583 +size 279614 diff --git a/ast-ksh.2010-03-09.tar.bz2 b/ast-ksh.2010-03-09.tar.bz2 deleted file mode 100644 index 2d5e0a7..0000000 --- a/ast-ksh.2010-03-09.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:03ef4e181f2f1039371f827d44f1c3cb7cf8f57f3e23df6a85541e72216db2b4 -size 1475684 diff --git a/ast-ksh.2010-06-21.tar.bz2 b/ast-ksh.2010-06-21.tar.bz2 new file mode 100644 index 0000000..799b334 --- /dev/null +++ b/ast-ksh.2010-06-21.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:579eefa2beb40721f39261028107526f175e83c3ee6f10e7335b393ff40cc81a +size 1494273 diff --git a/ksh.changes b/ksh.changes index 93d7288..5b452d5 100644 --- a/ksh.changes +++ b/ksh.changes @@ -1,3 +1,156 @@ +------------------------------------------------------------------- +Mon Jun 28 17:33:29 CEST 2010 - werner@suse.de + +- Update to 2010-06-21 of ksh93t+ bug fix version + ksh: + 10-06-21 The next release this directory will be renamed ksh93t and will + install as ksh93t and ksh93u will become the default ksh. + 10-05-27 Rewrote the subshell code to avoid using pipes in many cases. + +------------------------------------------------------------------- +Fri May 28 13:21:46 CEST 2010 - werner@suse.de + +- Update to 2010-05-27 of ksh93t+ bug fix version + ksh: + 10-05-24 --- Release ksh93t+ --- + 10-05-24 Fixed a bug which cause an exception when both -s and -s were + specified with typeset -i. + 10-05-21 Inputting of three dimensional indexed arrays with ( ( (...)...)...) + was not working and has been fixed. + 10-05-21 A bug in which adding the attributes -Ai to a variable via a name + reference could cause the value to display incorrectly has been fixed. + 10-05-21 A bug in which using $var inside ((...)) did not work when var was + a hex float variable. + 10-05-20 A bug which caused an exception when multiple levels of composite + functions in arithemtic expressions has been fixed. + 10-05-19 <<< with an empty string no longer gives an error. + 10-05-19 A bug in arithmetic evaluation when a name reference to an array + instance was used has been fixed. + 10-05-14 A bug in which the shell treats a valid index array assignment, + typeset -a x=(foo (x=3;y=4) bar) as a syntax error has been fixed. + 10-05-13 A bug in creating name references to assocative array variable + after a lookup of one of its elements has been fixed. + 10-05-12 Two bugs in the handling of function static type variables in + subshells have been fixed. One could cause an exception and the + other would leave side effects in the parent shell. + 10-05-10 A bug in which static variables in functions were not being saved and + restored properly when running subshells has been fixed. + 10-05-05 A bug in which print -v did not work correctly when an operand was an + indexed array element refering to a compound variable has been fixed. + 10-05-05 A change to improve performace by special casing empty string + assignments to avoid repeated malloc() and free(). + 10-05-05 A bug in which creating a name reference to a non-existant associative + array element would create the array element has been fixed. + 10-05-04 A bug in which name references to static variables in the static + scope were not found has been fixed. + 10-04-30 Do not use socketpair() on systems that implement ioctl(I_PEEK) on pipes. + 10-04-28 A type defined with a member foo that is an associative array without + elements followed by an expansion ${bar.foo[a]} and an assignment + bar.foo[a]=b, no longer indicates that ${#bar.foo[@]} has 0 members. + 10-04-27 Another bug in which a nested command substitution could hang if it + generated too much data has been fixed. + 10-04-26 A type defined with a member that is an indexed array without elements + would behave as if the 0th element of each instance was defined after + a non-zero element was specified and this has been fixed. + 10-04-26 A bug in which types defined in a subshell were not undefined when + the subshell completed has been fixed. + 10-04-23 For file completion in commmand line editing, file names starting + with # are now escaped so that they are not treated as comments. + 10-04-23 A bug in which ${t.var:=value}, where t is an instance of a type + variable, could assign value to the type variable rather than to + the type instance has been fixed. + 10-04-22 A bug in which a nested command substitution could hang if it + generated too much data has been fixed. + 10-04-20 A bug which corrupted one byte of memory when read was called with + reads that did not use a delimiter has been fixed. + 10-04-19 The display of a compound variable with an embedded array with + attributes was sometimes not working correctly and has been fixed. + 10-04-16 A bug in which attributes were not be propogated to elements in + an associative array has been fixed. + 10-04-15 A bug which caused scripts containing user defined math functions to + fail to compile with shcomp has been fixed. + 10-04-14 A bug in which a coprocess connection could terminate prematurely + when running a nested subshell has been fixed. + 10-04-07 On Darwin on Mac/OS a bug has been fixed which generated an + inappropriate error message when continuing a background job. + 10-04-07 A bug in which setting the trap on CHLD to ignore could cause + an incorrect exit status has been fixed. + 10-04-06 A bug in which LINENO was not incremented for a here-document when + the here-document word was followed by a comment has been fixed. + 10-04-06 The optimization that execs the last process of a script rather + than creating a new process has been removed when a trap on + interrupt has been set. + 10-04-06 Unsetting the 'C', 'A' or 'a' typeset attribute now produces an + error message rather than generating an exception. + 10-04-06 A bug in which .sh.name contained the subscript and .sh.subscript + was empty in some cases with discipline functions on array instances + has been fixed. + 10-04-05 A bug in the edit modes where preceding the interrupt character with + the literal next character did not work has been fixed. + 10-04-05 A bug in the creation of type instances of arrays which could cause + an exception has been fixed. + 10-03-30 A bug in the display of a compound variable containing an indexed + array of compound variables has been fixed. + 10-03-24 A bug in which integer division was mistakenly used when the + numerator was a binary operator with the first operand floating + point and the second integer, e.g. (.1**3)/3, has been fixed. + 10-03-24 The >; file operator was modified so that the temporary file is + created in the same physical directory as file. + 10-03-23 A warning message was added to sh -n when $var was used inside + ((...)) instead of var. + 10-03-19 fmin was added to the list of math function on the man page. + 10-03-19 Fixed the return value for unalias when the alias did not exist. + 10-03-19 A bug in which the SHLVL variable exported the value it had on + input rather than the incremented value has been fixed. + 10-03-19 A bug which causes whence -q to go into an infinite loop has been fixed. + 10-03-19 Removed space between Stopped message and (SIGTTIN) and (SIGTTOUT). + 10-03-17 Modified profile shell execution so that when builtins that + correspond to executable have extended attributes, they are + executed by pfksh instead of being treated as built-ins. + 10-03-16 A bug in whence -a which produced duplicate lines of output has been fixed. + 10-03-16 A bug in the handling of process groups in monitor mode for + command substitutions has been fixed. + 10-03-12 A bug in which a here-document containing command substitutions + that contained here-documents did not process correctly has been fixed. + 10-03-12 A bug in which the terminal is not restored to cannonical mode + after read times out when in a multibyte locale with no edit mode + enabled has been fixed. + libast: + 10-05-25 include/sfhdr.h: adjust SF_NMAP according to _ptr_bits + 10-05-25 include/shcmd.h: add sh_builtin() macro for lib_init() table initialization + 10-05-21 misc/optget.c: --html \bfoo::bar([[:digit:]][[:upper:]]*) => foo-bar.html + 10-05-15 include/proc.h,misc/procopen.c: add PROC_ORPHAN + 10-05-09 misc/optget.c: add --???MAN[section] --???SECTION + 10-05-07 sfio,stdio: fix all snprintf() variants to handle buf==0 and/or n==0 + 10-05-04 string/fmtesc.c: add mb iswsoace() and iswcntrl() quoting checks + 10-05-03 fix LC_MESSAGES catalog lookup bugs, check for $set==3, accept $set==1 + 10-04-30 string/chresc.c: add chrexp() for FMT_EXP_* + 10-04-30 string/stresc.c: add strexp() for FMT_EXP_* + 10-04-30 string/chresc.c: fix \uXXXXY bug that consumed Y + 10-04-22 misc/optget.c: check for html entities in + 10-04-22 misc/getcwd.c: add features/syscall check for SYSGETCWD() { linux solaris } + 10-04-22 string/stresc.c: wide chars absent locale guidance default to UTF-8 + 10-04-12 port/mnt.c: favor bsd getfsstat() over getmntinfo() + 10-04-11 string/strtoi.h: k (1000) and ki (1024) now differentiated + 10-04-10 misc/recstr.c: fix 'd[delimiter]' parse + 10-04-08 include/vmalloc.h,vmalloc/vmstat.c: add Vmstat_t.mode region mode bits + 10-04-05 misc/fts.c: drop 1997-01-07 fts_open()=0 is one file and stat() fails + 10-04-05 misc/optget.c,optlib.h: add Optpass_t.release for --nroff .TH + 10-04-02 misc/optget.c: fix $'[-n?\n...]' --version bug + 10-04-02 regex/regcomp.c: ~(X) => REG_EXTENDED|REG_AUGMENTED, ~(PU) instead of ~(U) + 10-03-24 misc/procopen.c: add PROC_FD_CTTY(fd) + 10-03-24 path/pathtemp.c: fix pointer => int casts + 10-03-15 regex/regcache.c: fix 1 byte buffer overflow (didn't count trailing \0) + libcmd: + 10-05-09 tail.c: fix -0f bug that inially listed the entire file + 10-05-06 basename.c: add { -a,--all -s,--suffux=suffix } from BSD + 10-04-12 cat.c: fix -v bug that dumped core and make consistent with cmp --print-chars + 10-04-11 cmp.c: add --print-bytes, --count=n, --differences=n + 10-04-08 vmstate.c: add { method flags } vars for Vmstat_t.mode + 10-04-08 mkdir.c: fix check for { S_ISUID S_ISGID S_ISVTX } after successful mkdir(2) + 10-04-01 stty.c: add --fd=fd option + 10-03-23 tail.c: fix -f large initial offset bug that didn't copy all data + ------------------------------------------------------------------- Mon May 3 14:47:52 CEST 2010 - werner@suse.de diff --git a/ksh.spec b/ksh.spec index f00f9ce..cea46c8 100644 --- a/ksh.spec +++ b/ksh.spec @@ -40,9 +40,10 @@ Version: 93t Release: 23 Summary: Korn Shell BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source: INIT.2010-03-09.tar.bz2 -Source1: ast-ksh.2010-03-09.tar.bz2 +Source: INIT.2010-06-21.tar.bz2 +Source1: ast-ksh.2010-06-21.tar.bz2 Source2: ast-ksh-locale.2010-02-02.tar.bz2 +Source3: CPL Source10: leak1.sh Source11: leak2.sh Source20: Agreement @@ -62,11 +63,9 @@ Patch9: ksh93-compat.dif Patch10: ksh93-suid_exec.dif Patch11: ksh93-signals.dif Patch12: ksh93-limits.dif -Patch13: ksh93-tty.dif +Patch13: ksh93-sigpipe.dif Patch14: ksh93-ia64.dif Patch15: ksh93-s390.dif -Patch16: ksh93-sigchld.dif -Patch17: ksh93-whence-deadlock.dif %global use_suid_exe 0 %global use_locale 1 %global debug_memleak 0 @@ -133,8 +132,6 @@ find share/ -type d -a -empty | xargs -r rm -vrf %patch14 %endif %patch15 -%patch16 -%patch17 %build typeset -i IGNORED=0x$(ps --no-headers -o ignored $$) @@ -417,6 +414,9 @@ find share/ -type d -a -empty | xargs -r rm -vrf ln -sf /%{_lib}/ast/$so %{buildroot}%{_libdir}/ast/${so%%%%.*}.so done rm -f %{buildroot}%{_libdir}/ast/*.so.* + for man in man/man[13]/*.[13] ; do + sed -i 's/\\f5/\\fB/g;s/^\.H/\.P\n\.H/g' $man + done install -m 0644 lib/*.a %{buildroot}%{_libdir}/ast/ %if %suse_version > 1120 install -m 0644 man/man1/sh.1 %{buildroot}%{_mandir}/man1/ksh93.1 @@ -448,7 +448,11 @@ find share/ -type d -a -empty | xargs -r rm -vrf %else > ksh.lang %endif - cp lib/package/LICENSES/ast LICENSE + if test -s lib/package/LICENSES/ast ; then + cp lib/package/LICENSES/ast LICENSE + else + cp %{S:3} LICENSE + fi mv src/cmd/ksh93/OBSOLETE src/cmd/ksh93/OBSOLETE.mm cat src/cmd/ksh93/builtins.mm | sed 's/\\f5/\\fB/g;s/^\.H/\.P\n\.H/g' | troff -Tascii8 -t -mm | grotty -bou > Builtins cat src/cmd/ksh93/PROMO.mm | sed 's/\\f5/\\fB/g;s/^\.H/\.P\n\.H/g' | troff -Tascii8 -t -mm | grotty -bou > PROMO diff --git a/ksh93-shift_ijs.dif b/ksh93-shift_ijs.dif index 0b71655..00e2819 100644 --- a/ksh93-shift_ijs.dif +++ b/ksh93-shift_ijs.dif @@ -107,6 +107,15 @@ static int _ismetach(int); --- src/cmd/ksh93/sh/macro.c +++ src/cmd/ksh93/sh/macro.c 2007-12-20 17:50:28.000000000 +0000 +@@ -2079,7 +2079,7 @@ + lastc = 0; + } + newlines = nextnewlines; +- if(++c < bufsize) ++ if(c++ < bufsize) + str[c] = 0; + else + { @@ -2167,13 +2167,13 @@ static void mac_copy(register Mac_t *mp, if(mp->pattern) { @@ -183,16 +192,16 @@ +export LANG=ja_JP.SJIS + +for second in $(seq 64 126); do -+ : $((chr++)) ++ let chr++ + second=$(printf '%x' ${second}) + mbchar="$(printf "\x81\x${second}")" + if test -z "${mbchar}" ; then -+ : $((err++)) # ERROR in builtin printf ++ let err++ # ERROR in builtin printf + continue + fi + if test -x "${printf}" ; then + if test $(${printf} "\x81\x${second}") != ${mbchar} ; then -+ : $((err++)) # ERROR in builtin printf ++ let err++ # ERROR in builtin printf + continue + fi + fi @@ -266,23 +275,30 @@ extern int fwprintf(FILE*, const wchar_t*, ...); extern int fwscanf(FILE*, const wchar_t*, ...); --- src/lib/libast/include/ast.h -+++ src/lib/libast/include/ast.h 2007-12-20 17:50:28.000000000 +0000 -@@ -176,13 +176,16 @@ typedef struct ++++ src/lib/libast/include/ast.h 2010-06-25 12:35:11.542927316 +0200 +@@ -186,14 +186,23 @@ typedef struct #define mbcoll() (ast.mb_xfrm!=0) #define mbwide() (mbmax()>1) -#define mbchar(p) (mbwide()?((ast.tmp_int=(*ast.mb_towc)(&ast.tmp_wchar,(char*)(p),mbmax()))>0?((p+=ast.tmp_int),ast.tmp_wchar):(p+=ast.mb_sync+1,ast.tmp_int)):(*(unsigned char*)(p++))) +-#define mbnchar(p,n) (mbwide()?((ast.tmp_int=(*ast.mb_towc)(&ast.tmp_wchar,(char*)(p),n))>0?((p+=ast.tmp_int),ast.tmp_wchar):(p+=ast.mb_sync+1,ast.tmp_int)):(*(unsigned char*)(p++))) #define mbinit() (mbwide()?(*ast.mb_towc)((wchar_t*)0,(char*)0,mbmax()):0) #define mbsize(p) (mbwide()?(*ast.mb_len)((char*)(p),mbmax()):((p),1)) #define mbconv(s,w) (ast.mb_conv?(*ast.mb_conv)(s,w):((*(s)=(w)),1)) #define mbwidth(w) (ast.mb_width&&((ast.tmp_int=(*ast.mb_width)(w))>=0||(w)>UCHAR_MAX)?ast.tmp_int:1) #define mbxfrm(t,f,n) (mbcoll()?(*ast.mb_xfrm)((char*)(t),(char*)(f),n):0) -- -+#define mbchar(p) ((mbsize(p)>1) ? \ + ++#define mbchar(p) (mbwide() ? \ + (((ast.tmp_int=(*ast.mb_towc)(&ast.tmp_wchar,(char*)(p),mbmax()))>0) ? \ + ({p+=ast.tmp_int;ast.tmp_wchar;}) : \ + ({ast.tmp_int=*(unsigned char*)p;p+=ast.mb_sync+1;ast.tmp_int;})) : \ + (*(unsigned char*)(p++))) ++#define mbnchar(p,n) (mbwide(p) ? \ ++ (((ast.tmp_int=(*ast.mb_towc)(&ast.tmp_wchar,(char*)(p),n))>0) ? \ ++ ({p+=ast.tmp_int;ast.tmp_wchar;}) : \ ++ ({ast.tmp_int=*(unsigned char*)p;p+=ast.mb_sync+1;ast.tmp_int;})) : \ ++ (*(unsigned char*)(p++))) ++ /* * common macros */ @@ -297,10 +313,10 @@ #include --- src/lib/libcmd/Mamfile -+++ src/lib/libcmd/Mamfile 2007-12-20 17:51:50.000000000 +0000 -@@ -479,7 +479,7 @@ make cat.o ++++ src/lib/libcmd/Mamfile 2007-12-20 18:51:50.000000000 +0100 +@@ -496,7 +496,7 @@ make cat.o prev cat.c - meta cat.o %.c>%.o cat.c cat + meta cat.o %.c>%.o ${PACKAGEROOT}/src/lib/libcmd/cat.c cat prev cat.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -DUSAGE_LICENSE=\""[-author?Glenn Fowler ][-author?David Korn ][-copyright?Copyright (c) 1992-2010 AT&T Intellectual Property][-license?http://www.opensource.org/licenses/cpl1.0.txt][--catalog?libcmd]"\" -D_BLD_cmd -D_PACKAGE_ast -c cat.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -DUSAGE_LICENSE=\""[-author?Glenn Fowler ][-author?David Korn ][-copyright?Copyright (c) 1992-2010 AT&T Intellectual Property][-license?http://www.opensource.org/licenses/cpl1.0.txt][--catalog?libcmd]"\" -D_BLD_cmd -D_PACKAGE_ast -DSHOPT_MULTIBYTE -c cat.c diff --git a/ksh93-sigchld.dif b/ksh93-sigchld.dif deleted file mode 100644 index 8b120dd..0000000 --- a/ksh93-sigchld.dif +++ /dev/null @@ -1,26 +0,0 @@ -cc: gsf@research.att.com zpetrova@novell.com -Subject: Re: [ast-users] Bug in SIGCHLD handling (Version JM 93t+ 2010-02-14) --------- - -I was finally able to reproduce the problem and I have fixed the bug. - -Here is a patch. Let me know if this resolves this. - -====================cut here========================== -*** src/cmd/ksh93/sh/xec.c Fri Feb 12 11:48:56 2010 ---- src/cmd/ksh93/sh/xec.c Wed Apr 7 10:40:53 2010 -*************** -*** 2946,2951 **** ---- 2946,2953 ---- - register int sig=sh.st.trapmax; - while(sig-- > 0) - { -+ if(sig==SIGCHLD) -+ continue; - if((trap=sh.st.trapcom[sig]) && *trap==0) - signal(sig,mode?sh_fault:SIG_IGN); - } -====================cut here========================== - -David Korn -dgk@research.att.com diff --git a/ksh93-sigpipe.dif b/ksh93-sigpipe.dif new file mode 100644 index 0000000..cdbe526 --- /dev/null +++ b/ksh93-sigpipe.dif @@ -0,0 +1,30 @@ +--- src/cmd/ksh93/sh/fault.c ++++ src/cmd/ksh93/sh/fault.c 2010-06-28 14:04:13.858925163 +0000 +@@ -418,8 +418,25 @@ void sh_chktrap(void) + if(trap=sh.st.trapcom[sig]) + { + Sfio_t *fp; +- if(sig==SIGPIPE && (fp=sfpool((Sfio_t*)0,sh.outpool,SF_WRITE)) && sferror(fp)) +- sfclose(fp); ++ if(sig==SIGPIPE) { ++ sh.lastsig=SIGPIPE; ++#if 0 ++ if ((fp=sfpool((Sfio_t*)0,sh.outpool,SF_WRITE)) && sferror(fp)) ++ sfclose(fp); ++#else ++ int fd; ++ for(fd = 0; fd < sh.lim.open_max; fd++) ++ { ++ if (sh.fdstatus[fd] == IOCLOSE) ++ continue; ++ if ((sh.fdstatus[fd]&IOWRITE) == 0) ++ continue; ++ if (sferror(sh.sftable[fd]) == 0) ++ continue; ++ sh_close(fd); ++ } ++#endif ++ } + sh.oldexit = SH_EXITSIG|sig; + sh_trap(trap,0); + } diff --git a/ksh93-tty.dif b/ksh93-tty.dif deleted file mode 100644 index 9b062c4..0000000 --- a/ksh93-tty.dif +++ /dev/null @@ -1,37 +0,0 @@ -> Hi, -> -> one our user has reported an issue with wrong tty state after timed out read, -> when using utf-8 locale. The reproducer is: -> -> cat >test.sh < #!/bin/ksh -> TMOUT=5 -> read -> EOF -> -> chmod +x test.sh -> ./test.sh -> -> Actual result (after letting read to time out) is tty does not echo any input -> until terminal is reset. Reporter provided a patch (attached) to fix this. -> - -A work around is to out - set -o vi -or - set -g emacs -before the read. - -I have enclosed the change that I made to fixe this problem below. - ---- src/cmd/ksh93/sh/fault.c 2010-01-18 11:11:18.000000000 +0000 -+++ src/cmd/ksh93/sh/fault.c 2010-03-12 16:18:41.000000000 +0000 -@@ -614,7 +614,7 @@ void sh_done(void *ptr, register int sig - sh_accend(); - #endif /* SHOPT_ACCT */ - #if SHOPT_VSH || SHOPT_ESH -- if(sh_isoption(SH_EMACS)||sh_isoption(SH_VI)||sh_isoption(SH_GMACS)) -+ if(mbwide()||sh_isoption(SH_EMACS)||sh_isoption(SH_VI)||sh_isoption(SH_GMACS)) - tty_cooked(-1); - #endif - #ifdef JOBS diff --git a/ksh93-whence-deadlock.dif b/ksh93-whence-deadlock.dif deleted file mode 100644 index 226ca54..0000000 --- a/ksh93-whence-deadlock.dif +++ /dev/null @@ -1,34 +0,0 @@ -|Hi, -| -|I've got another bug report from one Fedora user. When whence builtin is used -|with -q option it hangs. Whence was modified a lot between 2008-02-02 and -|2008-07-25. New version uses while(pp) loop but for Q_FLAG pp never changes -|causing ksh loop forever. I've just added pp = 0 to Q_FLAG if-section and it -|seems working fine: -| ---- src/cmd/ksh93/bltins/whence.c -+++ src/cmd/ksh93/bltins/whence.c 2010-04-29 12:03:22.744013139 -+0200 -@@ -234,7 +234,10 @@ static int whence(Shell_t *shp,char **ar - } - } - if(flags&Q_FLAG) -+ { - r |= !cp; -+ pp = 0; -+ } - else if(cp) - { - if(flags&V_FLAG) - - -|Btw, when looking in the code it seems tofree variable is never checked when -|Q_FLAG is used and also in the loop this value is sometimes set to 1, but -|never zeroed once it is set, is it expected? -| -|Regards, -|Michal Hlavinka -|_______________________________________________ -|ast-developers mailing list -|ast-developers@research.att.com -|https://mailman.research.att.com/mailman/listinfo/ast-developers diff --git a/workaround-stupid-build-system.diff b/workaround-stupid-build-system.diff index d60278b..e5fd205 100644 --- a/workaround-stupid-build-system.diff +++ b/workaround-stupid-build-system.diff @@ -123,7 +123,7 @@ make suid_exec make suid_exec.o --- src/lib/libast/Mamfile -+++ src/lib/libast/Mamfile 2008-02-14 12:08:37.000000000 +0000 ++++ src/lib/libast/Mamfile 2010-06-28 15:41:28.482925307 +0200 @@ -5,7 +5,7 @@ setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS setv ARFLAGS -cr setv AS as @@ -142,7 +142,7 @@ setv SILENT setv TAR tar setv YACC yacc -@@ -954,7 +954,7 @@ make lcgen +@@ -961,7 +961,7 @@ make lcgen make port/lcgen.c prev std/stdio.h implicit done port/lcgen.c @@ -151,8 +151,8 @@ done lcgen generated make port/lc.tab done port/lc.tab -@@ -7131,64 +7131,37 @@ done ${INSTALLROOT}/lib/file/magic gener - make ${INSTALLROOT}/include/ast/fmtmsg.h +@@ -7165,58 +7165,31 @@ exec - test '' = 'misc/magic.tab' || ${S + done ${INSTALLROOT}/lib/file/magic generated prev comp/fmtmsg.h prev ast_lib.h -exec - case ${mam_cc_HOSTTYPE} in @@ -173,9 +173,6 @@ -exec - ;; -exec - esac +exec - } - prev ${INSTALLROOT}/include/prototyped.h implicit - done ${INSTALLROOT}/include/ast/fmtmsg.h generated - make ${INSTALLROOT}/include/ast/libgen.h prev comp/libgen.h prev ast_lib.h -exec - case ${mam_cc_HOSTTYPE} in @@ -196,9 +193,6 @@ -exec - ;; -exec - esac +exec - } - prev ${INSTALLROOT}/include/prototyped.h implicit - done ${INSTALLROOT}/include/ast/libgen.h generated - make ${INSTALLROOT}/include/ast/syslog.h prev comp/syslog.h prev ast_lib.h -exec - case ${mam_cc_HOSTTYPE} in @@ -219,9 +213,9 @@ -exec - ;; -exec - esac +exec - } - prev ast_namval.h implicit - prev ${INSTALLROOT}/include/prototyped.h implicit - done ${INSTALLROOT}/include/ast/syslog.h generated + make ${INSTALLROOT}/include/ast/prototyped.h + prev ${INSTALLROOT}/include/ast + exec - echo "#include <../prototyped.h>" > 1.${COTEMP}.x --- src/lib/libcmd/Mamfile +++ src/lib/libcmd/Mamfile 2008-02-14 12:08:37.000000000 +0000 @@ -7,7 +7,7 @@ setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS From e778f7baf4b0dda0f770617c7a37ca996e4caacd0a0496e53444b039bd5d9813 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Tue, 29 Jun 2010 08:14:24 +0000 Subject: [PATCH 2/6] . OBS-URL: https://build.opensuse.org/package/show/shells/ksh?expand=0&rev=37 --- ksh93-shift_ijs.dif | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ksh93-shift_ijs.dif b/ksh93-shift_ijs.dif index 00e2819..1279f5c 100644 --- a/ksh93-shift_ijs.dif +++ b/ksh93-shift_ijs.dif @@ -105,6 +105,16 @@ # endif static int _isalph(int); static int _ismetach(int); +--- src/cmd/ksh93/sh/io.c ++++ src/cmd/ksh93/sh/io.c 2010-06-28 16:09:09.174925785 +0200 +@@ -1367,6 +1367,7 @@ static int io_heredoc(Shell_t *shp,regis + if(traceon) + sfprintf(sfstderr,"< %s\n",name); + sfputr(outfile,name,'\n'); ++ off = 0; + } + else + { --- src/cmd/ksh93/sh/macro.c +++ src/cmd/ksh93/sh/macro.c 2007-12-20 17:50:28.000000000 +0000 @@ -2079,7 +2079,7 @@ From fde6d58b460f81abf901dd6e7524650fc3c512030bde11be55daba41647f5102 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Tue, 29 Jun 2010 14:10:04 +0000 Subject: [PATCH 3/6] . OBS-URL: https://build.opensuse.org/package/show/shells/ksh?expand=0&rev=38 --- ksh.changes | 5 +++++ ksh.spec | 2 ++ ksh93-leak.dif | 11 +++++++++++ 3 files changed, 18 insertions(+) create mode 100644 ksh93-leak.dif diff --git a/ksh.changes b/ksh.changes index 5b452d5..84f18ec 100644 --- a/ksh.changes +++ b/ksh.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Jun 29 16:09:17 CEST 2010 - werner@suse.de + +- Avoid memory leak as reported on mailing list + ------------------------------------------------------------------- Mon Jun 28 17:33:29 CEST 2010 - werner@suse.de diff --git a/ksh.spec b/ksh.spec index cea46c8..15096a9 100644 --- a/ksh.spec +++ b/ksh.spec @@ -66,6 +66,7 @@ Patch12: ksh93-limits.dif Patch13: ksh93-sigpipe.dif Patch14: ksh93-ia64.dif Patch15: ksh93-s390.dif +Patch16: ksh93-leak.dif %global use_suid_exe 0 %global use_locale 1 %global debug_memleak 0 @@ -132,6 +133,7 @@ find share/ -type d -a -empty | xargs -r rm -vrf %patch14 %endif %patch15 +%patch16 %build typeset -i IGNORED=0x$(ps --no-headers -o ignored $$) diff --git a/ksh93-leak.dif b/ksh93-leak.dif new file mode 100644 index 0000000..6588c5f --- /dev/null +++ b/ksh93-leak.dif @@ -0,0 +1,11 @@ +--- src/cmd/ksh93/sh/nvdisc.c ++++ src/cmd/ksh93/sh/nvdisc.c 2010-06-29 14:07:19.578925435 +0000 +@@ -1347,7 +1347,7 @@ Dt_t *nv_dict(Namval_t* np) + Namval_t *nv_mount(Namval_t *np, const char *name, Dt_t *dict) + { + Namval_t *mp, *pp=0; +- struct table *tp = newof((struct table*)0, struct table,1,0); ++ struct table *tp; + if(name) + { + if(nv_istable(np)) From 84eadbfe0a63f33433fdddeb188f27726ca58a9305efd6906240c610de5cc011 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Fri, 8 Oct 2010 12:55:02 +0000 Subject: [PATCH 4/6] . OBS-URL: https://build.opensuse.org/package/show/shells/ksh?expand=0&rev=39 --- ksh.changes | 5 +++++ ksh.spec | 7 +++++-- ksh93-ifs.dif | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 ksh93-ifs.dif diff --git a/ksh.changes b/ksh.changes index 84f18ec..bd523bc 100644 --- a/ksh.changes +++ b/ksh.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Oct 8 14:50:56 CEST 2010 - werner@suse.de + +- Fix crash on unset on local IFS within shell functions (bnc#636389) + ------------------------------------------------------------------- Tue Jun 29 16:09:17 CEST 2010 - werner@suse.de diff --git a/ksh.spec b/ksh.spec index 15096a9..d3a01f1 100644 --- a/ksh.spec +++ b/ksh.spec @@ -67,6 +67,7 @@ Patch13: ksh93-sigpipe.dif Patch14: ksh93-ia64.dif Patch15: ksh93-s390.dif Patch16: ksh93-leak.dif +Patch17: ksh93-ifs.dif %global use_suid_exe 0 %global use_locale 1 %global debug_memleak 0 @@ -134,6 +135,7 @@ find share/ -type d -a -empty | xargs -r rm -vrf %endif %patch15 %patch16 +%patch17 %build typeset -i IGNORED=0x$(ps --no-headers -o ignored $$) @@ -249,10 +251,10 @@ find share/ -type d -a -empty | xargs -r rm -vrf rm -f ./test64 case "$RPM_ARCH" in ia64) RPM_OPT_FLAGS="${RPM_OPT_FLAGS//-O[s0-9]/-O}" ;; - s390) RPM_OPT_FLAGS="${RPM_OPT_FLAGS//-O[s0-9]/-O}" ;; + s390*) RPM_OPT_FLAGS="${RPM_OPT_FLAGS//-O[s0-9]/-O}" ;; ppc*) RPM_OPT_FLAGS="${RPM_OPT_FLAGS//-O[s0-9]/-O}" ;; esac - RPM_OPT_FLAGS=$(echo "${RPM_OPT_FLAGS}"|sed -r 's/[[:blank:]]+-g[0-9]?//g') + RPM_OPT_FLAGS=$(echo "${RPM_OPT_FLAGS}"|sed -r 's/[[:blank:]]+-g[0-9]?//g2') UNIVERSE=att LDFLAGS="-lm" LDSOFLG="" @@ -261,6 +263,7 @@ find share/ -type d -a -empty | xargs -r rm -vrf cflags @$nobuiltin RPM_OPT_FLAGS cflags -fno-strict-aliasing RPM_OPT_FLAGS cflags -fno-zero-initialized-in-bss RPM_OPT_FLAGS + cflags -fno-delete-null-pointer-checks RPM_OPT_FLAGS cflags -g RPM_OPT_FLAGS cflags -pipe RPM_OPT_FLAGS cflags -Wl,-O2 LDFLAGS diff --git a/ksh93-ifs.dif b/ksh93-ifs.dif new file mode 100644 index 0000000..724e766 --- /dev/null +++ b/ksh93-ifs.dif @@ -0,0 +1,37 @@ +--- src/cmd/ksh93/sh/init.c ++++ src/cmd/ksh93/sh/init.c 2010-10-08 12:43:27.123926224 +0000 +@@ -456,6 +456,8 @@ static void put_cdpath(register Namval_t + } + #endif /* _hdr_locale */ + ++static const void* ifs_hdr; ++ + /* Trap for IFS assignment and invalidates state table */ + static void put_ifs(register Namval_t* np,const char *val,int flags,Namfun_t *fp) + { +@@ -464,9 +466,14 @@ static void put_ifs(register Namval_t* n + ip->ifsnp = 0; + if(!val) + { +- fp = nv_stack(np, NIL(Namfun_t*)); +- if(fp && !fp->nofree) +- free((void*)fp); ++ Namfun_t *xp = nv_stack(np, NIL(Namfun_t*)); ++ if(xp) ++ { ++ if(xp == ifs_hdr) ++ xp->nofree = 1; ++ if(xp->nofree == 0) ++ free((void*)xp); ++ } + } + if(val != np->nvalue.cp) + nv_putv(np, val, flags, fp); +@@ -1597,6 +1604,7 @@ static Init_t *nv_init(Shell_t *shp) + ip->LANG_init.nofree = 1; + #endif /* _hdr_locale */ + nv_stack(IFSNOD, &ip->IFS_init.hdr); ++ ifs_hdr = (IFSNOD)->nvfun; + nv_stack(PATHNOD, &ip->PATH_init); + nv_stack(FPATHNOD, &ip->FPATH_init); + nv_stack(CDPNOD, &ip->CDPATH_init); From 0c86064ca17022f0c82a4a364262bf832be27c2dd60bd10be3e91aae4bd7b984 Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Mon, 11 Oct 2010 12:37:46 +0000 Subject: [PATCH 5/6] Accepting request 50094 from shells checked in (request 50094) OBS-URL: https://build.opensuse.org/request/show/50094 OBS-URL: https://build.opensuse.org/package/show/shells/ksh?expand=0&rev=40 --- CPL | 245 ---------------------------- INIT.2010-03-09.tar.bz2 | 3 + INIT.2010-06-21.tar.bz2 | 3 - ast-ksh.2010-03-09.tar.bz2 | 3 + ast-ksh.2010-06-21.tar.bz2 | 3 - ksh.changes | 163 ------------------ ksh.spec | 25 +-- ksh93-ifs.dif | 37 ----- ksh93-leak.dif | 11 -- ksh93-shift_ijs.dif | 46 ++---- ksh93-sigchld.dif | 26 +++ ksh93-sigpipe.dif | 30 ---- ksh93-tty.dif | 37 +++++ ksh93-whence-deadlock.dif | 34 ++++ workaround-stupid-build-system.diff | 20 ++- 15 files changed, 134 insertions(+), 552 deletions(-) delete mode 100644 CPL create mode 100644 INIT.2010-03-09.tar.bz2 delete mode 100644 INIT.2010-06-21.tar.bz2 create mode 100644 ast-ksh.2010-03-09.tar.bz2 delete mode 100644 ast-ksh.2010-06-21.tar.bz2 delete mode 100644 ksh93-ifs.dif delete mode 100644 ksh93-leak.dif create mode 100644 ksh93-sigchld.dif delete mode 100644 ksh93-sigpipe.dif create mode 100644 ksh93-tty.dif create mode 100644 ksh93-whence-deadlock.dif diff --git a/CPL b/CPL deleted file mode 100644 index 04afe02..0000000 --- a/CPL +++ /dev/null @@ -1,245 +0,0 @@ -+------------------------------------------------------------------------------+ -| This license covers all software that refers to the URL | -| http://www.opensource.org/licenses/cpl1.0.txt | -+------------------------------------------------------------------------------+ - -Common Public License Version 1.0 - - THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON - PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF - THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - - 1. DEFINITIONS - - "Contribution" means: - - a) in the case of the initial Contributor, the initial code and - documentation distributed under this Agreement, and - - b) in the case of each subsequent Contributor: - - i) changes to the Program, and - - ii) additions to the Program; - - where such changes and/or additions to the Program originate from - and are distributed by that particular Contributor. A Contribution - 'originates' from a Contributor if it was added to the Program by - such Contributor itself or anyone acting on such Contributor's - behalf. Contributions do not include additions to the Program - which: (i) are separate modules of software distributed in - conjunction with the Program under their own license agreement, and - (ii) are not derivative works of the Program. - - "Contributor" means any person or entity that distributes the Program. - - "Licensed Patents " mean patent claims licensable by a Contributor - which are necessarily infringed by the use or sale of its Contribution - alone or when combined with the Program. - - "Program" means the Contributions distributed in accordance with this - Agreement. - - "Recipient" means anyone who receives the Program under this - Agreement, including all Contributors. - - 2. GRANT OF RIGHTS - - a) Subject to the terms of this Agreement, each Contributor hereby - grants Recipient a non-exclusive, worldwide, royalty-free copyright - license to reproduce, prepare derivative works of, publicly - display, publicly perform, distribute and sublicense the - Contribution of such Contributor, if any, and such derivative - works, in source code and object code form. - - b) Subject to the terms of this Agreement, each Contributor hereby - grants Recipient a non-exclusive, worldwide, royalty-free patent - license under Licensed Patents to make, use, sell, offer to sell, - import and otherwise transfer the Contribution of such Contributor, - if any, in source code and object code form. This patent license - shall apply to the combination of the Contribution and the Program - if, at the time the Contribution is added by the Contributor, such - addition of the Contribution causes such combination to be covered - by the Licensed Patents. The patent license shall not apply to any - other combinations which include the Contribution. No hardware per - se is licensed hereunder. - - c) Recipient understands that although each Contributor grants the - licenses to its Contributions set forth herein, no assurances are - provided by any Contributor that the Program does not infringe the - patent or other intellectual property rights of any other entity. - Each Contributor disclaims any liability to Recipient for claims - brought by any other entity based on infringement of intellectual - property rights or otherwise. As a condition to exercising the - rights and licenses granted hereunder, each Recipient hereby - assumes sole responsibility to secure any other intellectual - property rights needed, if any. For example, if a third party - patent license is required to allow Recipient to distribute the - Program, it is Recipient's responsibility to acquire that license - before distributing the Program. - - d) Each Contributor represents that to its knowledge it has - sufficient copyright rights in its Contribution, if any, to grant - the copyright license set forth in this Agreement. - - 3. REQUIREMENTS - - A Contributor may choose to distribute the Program in object code form - under its own license agreement, provided that: - - a) it complies with the terms and conditions of this Agreement; and - - b) its license agreement: - - i) effectively disclaims on behalf of all Contributors all - warranties and conditions, express and implied, including - warranties or conditions of title and non-infringement, and implied - warranties or conditions of merchantability and fitness for a - particular purpose; - - ii) effectively excludes on behalf of all Contributors all - liability for damages, including direct, indirect, special, - incidental and consequential damages, such as lost profits; - - iii) states that any provisions which differ from this Agreement - are offered by that Contributor alone and not by any other party; - and - - iv) states that source code for the Program is available from such - Contributor, and informs licensees how to obtain it in a reasonable - manner on or through a medium customarily used for software - exchange. - - When the Program is made available in source code form: - - a) it must be made available under this Agreement; and - - b) a copy of this Agreement must be included with each copy of the - Program. - - Contributors may not remove or alter any copyright notices contained - within the Program. - - Each Contributor must identify itself as the originator of its - Contribution, if any, in a manner that reasonably allows subsequent - Recipients to identify the originator of the Contribution. - - 4. COMMERCIAL DISTRIBUTION - - Commercial distributors of software may accept certain - responsibilities with respect to end users, business partners and the - like. While this license is intended to facilitate the commercial use - of the Program, the Contributor who includes the Program in a - commercial product offering should do so in a manner which does not - create potential liability for other Contributors. Therefore, if a - Contributor includes the Program in a commercial product offering, - such Contributor ("Commercial Contributor") hereby agrees to defend - and indemnify every other Contributor ("Indemnified Contributor") - against any losses, damages and costs (collectively "Losses") arising - from claims, lawsuits and other legal actions brought by a third party - against the Indemnified Contributor to the extent caused by the acts - or omissions of such Commercial Contributor in connection with its - distribution of the Program in a commercial product offering. The - obligations in this section do not apply to any claims or Losses - relating to any actual or alleged intellectual property infringement. - In order to qualify, an Indemnified Contributor must: a) promptly - notify the Commercial Contributor in writing of such claim, and b) - allow the Commercial Contributor to control, and cooperate with the - Commercial Contributor in, the defense and any related settlement - negotiations. The Indemnified Contributor may participate in any such - claim at its own expense. - - For example, a Contributor might include the Program in a commercial - product offering, Product X. That Contributor is then a Commercial - Contributor. If that Commercial Contributor then makes performance - claims, or offers warranties related to Product X, those performance - claims and warranties are such Commercial Contributor's responsibility - alone. Under this section, the Commercial Contributor would have to - defend claims against the other Contributors related to those - performance claims and warranties, and if a court requires any other - Contributor to pay any damages as a result, the Commercial Contributor - must pay those damages. - - 5. NO WARRANTY - - EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS - PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY - WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY - OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely - responsible for determining the appropriateness of using and - distributing the Program and assumes all risks associated with its - exercise of rights under this Agreement, including but not limited to - the risks and costs of program errors, compliance with applicable - laws, damage to or loss of data, programs or equipment, and - unavailability or interruption of operations. - - 6. DISCLAIMER OF LIABILITY - - EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR - ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING - WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR - DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED - HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - - 7. GENERAL - - If any provision of this Agreement is invalid or unenforceable under - applicable law, it shall not affect the validity or enforceability of - the remainder of the terms of this Agreement, and without further - action by the parties hereto, such provision shall be reformed to the - minimum extent necessary to make such provision valid and enforceable. - - If Recipient institutes patent litigation against a Contributor with - respect to a patent applicable to software (including a cross-claim or - counterclaim in a lawsuit), then any patent licenses granted by that - Contributor to such Recipient under this Agreement shall terminate as - of the date such litigation is filed. In addition, if Recipient - institutes patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Program - itself (excluding combinations of the Program with other software or - hardware) infringes such Recipient's patent(s), then such Recipient's - rights granted under Section 2(b) shall terminate as of the date such - litigation is filed. - - All Recipient's rights under this Agreement shall terminate if it - fails to comply with any of the material terms or conditions of this - Agreement and does not cure such failure in a reasonable period of - time after becoming aware of such noncompliance. If all Recipient's - rights under this Agreement terminate, Recipient agrees to cease use - and distribution of the Program as soon as reasonably practicable. - However, Recipient's obligations under this Agreement and any licenses - granted by Recipient relating to the Program shall continue and - survive. - - Everyone is permitted to copy and distribute copies of this Agreement, - but in order to avoid inconsistency the Agreement is copyrighted and - may only be modified in the following manner. The Agreement Steward - reserves the right to publish new versions (including revisions) of - this Agreement from time to time. No one other than the Agreement - Steward has the right to modify this Agreement. IBM is the initial - Agreement Steward. IBM may assign the responsibility to serve as the - Agreement Steward to a suitable separate entity. Each new version of - the Agreement will be given a distinguishing version number. The - Program (including Contributions) may always be distributed subject to - the version of the Agreement under which it was received. In addition, - after a new version of the Agreement is published, Contributor may - elect to distribute the Program (including its Contributions) under - the new version. Except as expressly stated in Sections 2(a) and 2(b) - above, Recipient receives no rights or licenses to the intellectual - property of any Contributor under this Agreement, whether expressly, - by implication, estoppel or otherwise. All rights in the Program not - expressly granted under this Agreement are reserved. - - This Agreement is governed by the laws of the State of New York and - the intellectual property laws of the United States of America. No - party to this Agreement will bring a legal action under this Agreement - more than one year after the cause of action arose. Each party waives - its rights to a jury trial in any resulting litigation. - -Copyright (c) 2004 by the Open Source Initiative -This is a copy of the license posted on 2004-10-06 at: - http://www.opensource.org/licenses/cpl diff --git a/INIT.2010-03-09.tar.bz2 b/INIT.2010-03-09.tar.bz2 new file mode 100644 index 0000000..c5a3cf4 --- /dev/null +++ b/INIT.2010-03-09.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd938331f03103fb4af57af4f6bd6e217d2473c0c6aa52a18e69bb9054687005 +size 276029 diff --git a/INIT.2010-06-21.tar.bz2 b/INIT.2010-06-21.tar.bz2 deleted file mode 100644 index 00aeaf0..0000000 --- a/INIT.2010-06-21.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ac7d3b11cec48ba51550c828e79b87d8b9e4747a533dd33dccf5146a304a5583 -size 279614 diff --git a/ast-ksh.2010-03-09.tar.bz2 b/ast-ksh.2010-03-09.tar.bz2 new file mode 100644 index 0000000..2d5e0a7 --- /dev/null +++ b/ast-ksh.2010-03-09.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:03ef4e181f2f1039371f827d44f1c3cb7cf8f57f3e23df6a85541e72216db2b4 +size 1475684 diff --git a/ast-ksh.2010-06-21.tar.bz2 b/ast-ksh.2010-06-21.tar.bz2 deleted file mode 100644 index 799b334..0000000 --- a/ast-ksh.2010-06-21.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:579eefa2beb40721f39261028107526f175e83c3ee6f10e7335b393ff40cc81a -size 1494273 diff --git a/ksh.changes b/ksh.changes index bd523bc..93d7288 100644 --- a/ksh.changes +++ b/ksh.changes @@ -1,166 +1,3 @@ -------------------------------------------------------------------- -Fri Oct 8 14:50:56 CEST 2010 - werner@suse.de - -- Fix crash on unset on local IFS within shell functions (bnc#636389) - -------------------------------------------------------------------- -Tue Jun 29 16:09:17 CEST 2010 - werner@suse.de - -- Avoid memory leak as reported on mailing list - -------------------------------------------------------------------- -Mon Jun 28 17:33:29 CEST 2010 - werner@suse.de - -- Update to 2010-06-21 of ksh93t+ bug fix version - ksh: - 10-06-21 The next release this directory will be renamed ksh93t and will - install as ksh93t and ksh93u will become the default ksh. - 10-05-27 Rewrote the subshell code to avoid using pipes in many cases. - -------------------------------------------------------------------- -Fri May 28 13:21:46 CEST 2010 - werner@suse.de - -- Update to 2010-05-27 of ksh93t+ bug fix version - ksh: - 10-05-24 --- Release ksh93t+ --- - 10-05-24 Fixed a bug which cause an exception when both -s and -s were - specified with typeset -i. - 10-05-21 Inputting of three dimensional indexed arrays with ( ( (...)...)...) - was not working and has been fixed. - 10-05-21 A bug in which adding the attributes -Ai to a variable via a name - reference could cause the value to display incorrectly has been fixed. - 10-05-21 A bug in which using $var inside ((...)) did not work when var was - a hex float variable. - 10-05-20 A bug which caused an exception when multiple levels of composite - functions in arithemtic expressions has been fixed. - 10-05-19 <<< with an empty string no longer gives an error. - 10-05-19 A bug in arithmetic evaluation when a name reference to an array - instance was used has been fixed. - 10-05-14 A bug in which the shell treats a valid index array assignment, - typeset -a x=(foo (x=3;y=4) bar) as a syntax error has been fixed. - 10-05-13 A bug in creating name references to assocative array variable - after a lookup of one of its elements has been fixed. - 10-05-12 Two bugs in the handling of function static type variables in - subshells have been fixed. One could cause an exception and the - other would leave side effects in the parent shell. - 10-05-10 A bug in which static variables in functions were not being saved and - restored properly when running subshells has been fixed. - 10-05-05 A bug in which print -v did not work correctly when an operand was an - indexed array element refering to a compound variable has been fixed. - 10-05-05 A change to improve performace by special casing empty string - assignments to avoid repeated malloc() and free(). - 10-05-05 A bug in which creating a name reference to a non-existant associative - array element would create the array element has been fixed. - 10-05-04 A bug in which name references to static variables in the static - scope were not found has been fixed. - 10-04-30 Do not use socketpair() on systems that implement ioctl(I_PEEK) on pipes. - 10-04-28 A type defined with a member foo that is an associative array without - elements followed by an expansion ${bar.foo[a]} and an assignment - bar.foo[a]=b, no longer indicates that ${#bar.foo[@]} has 0 members. - 10-04-27 Another bug in which a nested command substitution could hang if it - generated too much data has been fixed. - 10-04-26 A type defined with a member that is an indexed array without elements - would behave as if the 0th element of each instance was defined after - a non-zero element was specified and this has been fixed. - 10-04-26 A bug in which types defined in a subshell were not undefined when - the subshell completed has been fixed. - 10-04-23 For file completion in commmand line editing, file names starting - with # are now escaped so that they are not treated as comments. - 10-04-23 A bug in which ${t.var:=value}, where t is an instance of a type - variable, could assign value to the type variable rather than to - the type instance has been fixed. - 10-04-22 A bug in which a nested command substitution could hang if it - generated too much data has been fixed. - 10-04-20 A bug which corrupted one byte of memory when read was called with - reads that did not use a delimiter has been fixed. - 10-04-19 The display of a compound variable with an embedded array with - attributes was sometimes not working correctly and has been fixed. - 10-04-16 A bug in which attributes were not be propogated to elements in - an associative array has been fixed. - 10-04-15 A bug which caused scripts containing user defined math functions to - fail to compile with shcomp has been fixed. - 10-04-14 A bug in which a coprocess connection could terminate prematurely - when running a nested subshell has been fixed. - 10-04-07 On Darwin on Mac/OS a bug has been fixed which generated an - inappropriate error message when continuing a background job. - 10-04-07 A bug in which setting the trap on CHLD to ignore could cause - an incorrect exit status has been fixed. - 10-04-06 A bug in which LINENO was not incremented for a here-document when - the here-document word was followed by a comment has been fixed. - 10-04-06 The optimization that execs the last process of a script rather - than creating a new process has been removed when a trap on - interrupt has been set. - 10-04-06 Unsetting the 'C', 'A' or 'a' typeset attribute now produces an - error message rather than generating an exception. - 10-04-06 A bug in which .sh.name contained the subscript and .sh.subscript - was empty in some cases with discipline functions on array instances - has been fixed. - 10-04-05 A bug in the edit modes where preceding the interrupt character with - the literal next character did not work has been fixed. - 10-04-05 A bug in the creation of type instances of arrays which could cause - an exception has been fixed. - 10-03-30 A bug in the display of a compound variable containing an indexed - array of compound variables has been fixed. - 10-03-24 A bug in which integer division was mistakenly used when the - numerator was a binary operator with the first operand floating - point and the second integer, e.g. (.1**3)/3, has been fixed. - 10-03-24 The >; file operator was modified so that the temporary file is - created in the same physical directory as file. - 10-03-23 A warning message was added to sh -n when $var was used inside - ((...)) instead of var. - 10-03-19 fmin was added to the list of math function on the man page. - 10-03-19 Fixed the return value for unalias when the alias did not exist. - 10-03-19 A bug in which the SHLVL variable exported the value it had on - input rather than the incremented value has been fixed. - 10-03-19 A bug which causes whence -q to go into an infinite loop has been fixed. - 10-03-19 Removed space between Stopped message and (SIGTTIN) and (SIGTTOUT). - 10-03-17 Modified profile shell execution so that when builtins that - correspond to executable have extended attributes, they are - executed by pfksh instead of being treated as built-ins. - 10-03-16 A bug in whence -a which produced duplicate lines of output has been fixed. - 10-03-16 A bug in the handling of process groups in monitor mode for - command substitutions has been fixed. - 10-03-12 A bug in which a here-document containing command substitutions - that contained here-documents did not process correctly has been fixed. - 10-03-12 A bug in which the terminal is not restored to cannonical mode - after read times out when in a multibyte locale with no edit mode - enabled has been fixed. - libast: - 10-05-25 include/sfhdr.h: adjust SF_NMAP according to _ptr_bits - 10-05-25 include/shcmd.h: add sh_builtin() macro for lib_init() table initialization - 10-05-21 misc/optget.c: --html \bfoo::bar([[:digit:]][[:upper:]]*) => foo-bar.html - 10-05-15 include/proc.h,misc/procopen.c: add PROC_ORPHAN - 10-05-09 misc/optget.c: add --???MAN[section] --???SECTION - 10-05-07 sfio,stdio: fix all snprintf() variants to handle buf==0 and/or n==0 - 10-05-04 string/fmtesc.c: add mb iswsoace() and iswcntrl() quoting checks - 10-05-03 fix LC_MESSAGES catalog lookup bugs, check for $set==3, accept $set==1 - 10-04-30 string/chresc.c: add chrexp() for FMT_EXP_* - 10-04-30 string/stresc.c: add strexp() for FMT_EXP_* - 10-04-30 string/chresc.c: fix \uXXXXY bug that consumed Y - 10-04-22 misc/optget.c: check for html entities in - 10-04-22 misc/getcwd.c: add features/syscall check for SYSGETCWD() { linux solaris } - 10-04-22 string/stresc.c: wide chars absent locale guidance default to UTF-8 - 10-04-12 port/mnt.c: favor bsd getfsstat() over getmntinfo() - 10-04-11 string/strtoi.h: k (1000) and ki (1024) now differentiated - 10-04-10 misc/recstr.c: fix 'd[delimiter]' parse - 10-04-08 include/vmalloc.h,vmalloc/vmstat.c: add Vmstat_t.mode region mode bits - 10-04-05 misc/fts.c: drop 1997-01-07 fts_open()=0 is one file and stat() fails - 10-04-05 misc/optget.c,optlib.h: add Optpass_t.release for --nroff .TH - 10-04-02 misc/optget.c: fix $'[-n?\n...]' --version bug - 10-04-02 regex/regcomp.c: ~(X) => REG_EXTENDED|REG_AUGMENTED, ~(PU) instead of ~(U) - 10-03-24 misc/procopen.c: add PROC_FD_CTTY(fd) - 10-03-24 path/pathtemp.c: fix pointer => int casts - 10-03-15 regex/regcache.c: fix 1 byte buffer overflow (didn't count trailing \0) - libcmd: - 10-05-09 tail.c: fix -0f bug that inially listed the entire file - 10-05-06 basename.c: add { -a,--all -s,--suffux=suffix } from BSD - 10-04-12 cat.c: fix -v bug that dumped core and make consistent with cmp --print-chars - 10-04-11 cmp.c: add --print-bytes, --count=n, --differences=n - 10-04-08 vmstate.c: add { method flags } vars for Vmstat_t.mode - 10-04-08 mkdir.c: fix check for { S_ISUID S_ISGID S_ISVTX } after successful mkdir(2) - 10-04-01 stty.c: add --fd=fd option - 10-03-23 tail.c: fix -f large initial offset bug that didn't copy all data - ------------------------------------------------------------------- Mon May 3 14:47:52 CEST 2010 - werner@suse.de diff --git a/ksh.spec b/ksh.spec index d3a01f1..f00f9ce 100644 --- a/ksh.spec +++ b/ksh.spec @@ -40,10 +40,9 @@ Version: 93t Release: 23 Summary: Korn Shell BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source: INIT.2010-06-21.tar.bz2 -Source1: ast-ksh.2010-06-21.tar.bz2 +Source: INIT.2010-03-09.tar.bz2 +Source1: ast-ksh.2010-03-09.tar.bz2 Source2: ast-ksh-locale.2010-02-02.tar.bz2 -Source3: CPL Source10: leak1.sh Source11: leak2.sh Source20: Agreement @@ -63,11 +62,11 @@ Patch9: ksh93-compat.dif Patch10: ksh93-suid_exec.dif Patch11: ksh93-signals.dif Patch12: ksh93-limits.dif -Patch13: ksh93-sigpipe.dif +Patch13: ksh93-tty.dif Patch14: ksh93-ia64.dif Patch15: ksh93-s390.dif -Patch16: ksh93-leak.dif -Patch17: ksh93-ifs.dif +Patch16: ksh93-sigchld.dif +Patch17: ksh93-whence-deadlock.dif %global use_suid_exe 0 %global use_locale 1 %global debug_memleak 0 @@ -251,10 +250,10 @@ find share/ -type d -a -empty | xargs -r rm -vrf rm -f ./test64 case "$RPM_ARCH" in ia64) RPM_OPT_FLAGS="${RPM_OPT_FLAGS//-O[s0-9]/-O}" ;; - s390*) RPM_OPT_FLAGS="${RPM_OPT_FLAGS//-O[s0-9]/-O}" ;; + s390) RPM_OPT_FLAGS="${RPM_OPT_FLAGS//-O[s0-9]/-O}" ;; ppc*) RPM_OPT_FLAGS="${RPM_OPT_FLAGS//-O[s0-9]/-O}" ;; esac - RPM_OPT_FLAGS=$(echo "${RPM_OPT_FLAGS}"|sed -r 's/[[:blank:]]+-g[0-9]?//g2') + RPM_OPT_FLAGS=$(echo "${RPM_OPT_FLAGS}"|sed -r 's/[[:blank:]]+-g[0-9]?//g') UNIVERSE=att LDFLAGS="-lm" LDSOFLG="" @@ -263,7 +262,6 @@ find share/ -type d -a -empty | xargs -r rm -vrf cflags @$nobuiltin RPM_OPT_FLAGS cflags -fno-strict-aliasing RPM_OPT_FLAGS cflags -fno-zero-initialized-in-bss RPM_OPT_FLAGS - cflags -fno-delete-null-pointer-checks RPM_OPT_FLAGS cflags -g RPM_OPT_FLAGS cflags -pipe RPM_OPT_FLAGS cflags -Wl,-O2 LDFLAGS @@ -419,9 +417,6 @@ find share/ -type d -a -empty | xargs -r rm -vrf ln -sf /%{_lib}/ast/$so %{buildroot}%{_libdir}/ast/${so%%%%.*}.so done rm -f %{buildroot}%{_libdir}/ast/*.so.* - for man in man/man[13]/*.[13] ; do - sed -i 's/\\f5/\\fB/g;s/^\.H/\.P\n\.H/g' $man - done install -m 0644 lib/*.a %{buildroot}%{_libdir}/ast/ %if %suse_version > 1120 install -m 0644 man/man1/sh.1 %{buildroot}%{_mandir}/man1/ksh93.1 @@ -453,11 +448,7 @@ find share/ -type d -a -empty | xargs -r rm -vrf %else > ksh.lang %endif - if test -s lib/package/LICENSES/ast ; then - cp lib/package/LICENSES/ast LICENSE - else - cp %{S:3} LICENSE - fi + cp lib/package/LICENSES/ast LICENSE mv src/cmd/ksh93/OBSOLETE src/cmd/ksh93/OBSOLETE.mm cat src/cmd/ksh93/builtins.mm | sed 's/\\f5/\\fB/g;s/^\.H/\.P\n\.H/g' | troff -Tascii8 -t -mm | grotty -bou > Builtins cat src/cmd/ksh93/PROMO.mm | sed 's/\\f5/\\fB/g;s/^\.H/\.P\n\.H/g' | troff -Tascii8 -t -mm | grotty -bou > PROMO diff --git a/ksh93-ifs.dif b/ksh93-ifs.dif deleted file mode 100644 index 724e766..0000000 --- a/ksh93-ifs.dif +++ /dev/null @@ -1,37 +0,0 @@ ---- src/cmd/ksh93/sh/init.c -+++ src/cmd/ksh93/sh/init.c 2010-10-08 12:43:27.123926224 +0000 -@@ -456,6 +456,8 @@ static void put_cdpath(register Namval_t - } - #endif /* _hdr_locale */ - -+static const void* ifs_hdr; -+ - /* Trap for IFS assignment and invalidates state table */ - static void put_ifs(register Namval_t* np,const char *val,int flags,Namfun_t *fp) - { -@@ -464,9 +466,14 @@ static void put_ifs(register Namval_t* n - ip->ifsnp = 0; - if(!val) - { -- fp = nv_stack(np, NIL(Namfun_t*)); -- if(fp && !fp->nofree) -- free((void*)fp); -+ Namfun_t *xp = nv_stack(np, NIL(Namfun_t*)); -+ if(xp) -+ { -+ if(xp == ifs_hdr) -+ xp->nofree = 1; -+ if(xp->nofree == 0) -+ free((void*)xp); -+ } - } - if(val != np->nvalue.cp) - nv_putv(np, val, flags, fp); -@@ -1597,6 +1604,7 @@ static Init_t *nv_init(Shell_t *shp) - ip->LANG_init.nofree = 1; - #endif /* _hdr_locale */ - nv_stack(IFSNOD, &ip->IFS_init.hdr); -+ ifs_hdr = (IFSNOD)->nvfun; - nv_stack(PATHNOD, &ip->PATH_init); - nv_stack(FPATHNOD, &ip->FPATH_init); - nv_stack(CDPNOD, &ip->CDPATH_init); diff --git a/ksh93-leak.dif b/ksh93-leak.dif deleted file mode 100644 index 6588c5f..0000000 --- a/ksh93-leak.dif +++ /dev/null @@ -1,11 +0,0 @@ ---- src/cmd/ksh93/sh/nvdisc.c -+++ src/cmd/ksh93/sh/nvdisc.c 2010-06-29 14:07:19.578925435 +0000 -@@ -1347,7 +1347,7 @@ Dt_t *nv_dict(Namval_t* np) - Namval_t *nv_mount(Namval_t *np, const char *name, Dt_t *dict) - { - Namval_t *mp, *pp=0; -- struct table *tp = newof((struct table*)0, struct table,1,0); -+ struct table *tp; - if(name) - { - if(nv_istable(np)) diff --git a/ksh93-shift_ijs.dif b/ksh93-shift_ijs.dif index 1279f5c..0b71655 100644 --- a/ksh93-shift_ijs.dif +++ b/ksh93-shift_ijs.dif @@ -105,27 +105,8 @@ # endif static int _isalph(int); static int _ismetach(int); ---- src/cmd/ksh93/sh/io.c -+++ src/cmd/ksh93/sh/io.c 2010-06-28 16:09:09.174925785 +0200 -@@ -1367,6 +1367,7 @@ static int io_heredoc(Shell_t *shp,regis - if(traceon) - sfprintf(sfstderr,"< %s\n",name); - sfputr(outfile,name,'\n'); -+ off = 0; - } - else - { --- src/cmd/ksh93/sh/macro.c +++ src/cmd/ksh93/sh/macro.c 2007-12-20 17:50:28.000000000 +0000 -@@ -2079,7 +2079,7 @@ - lastc = 0; - } - newlines = nextnewlines; -- if(++c < bufsize) -+ if(c++ < bufsize) - str[c] = 0; - else - { @@ -2167,13 +2167,13 @@ static void mac_copy(register Mac_t *mp, if(mp->pattern) { @@ -202,16 +183,16 @@ +export LANG=ja_JP.SJIS + +for second in $(seq 64 126); do -+ let chr++ ++ : $((chr++)) + second=$(printf '%x' ${second}) + mbchar="$(printf "\x81\x${second}")" + if test -z "${mbchar}" ; then -+ let err++ # ERROR in builtin printf ++ : $((err++)) # ERROR in builtin printf + continue + fi + if test -x "${printf}" ; then + if test $(${printf} "\x81\x${second}") != ${mbchar} ; then -+ let err++ # ERROR in builtin printf ++ : $((err++)) # ERROR in builtin printf + continue + fi + fi @@ -285,30 +266,23 @@ extern int fwprintf(FILE*, const wchar_t*, ...); extern int fwscanf(FILE*, const wchar_t*, ...); --- src/lib/libast/include/ast.h -+++ src/lib/libast/include/ast.h 2010-06-25 12:35:11.542927316 +0200 -@@ -186,14 +186,23 @@ typedef struct ++++ src/lib/libast/include/ast.h 2007-12-20 17:50:28.000000000 +0000 +@@ -176,13 +176,16 @@ typedef struct #define mbcoll() (ast.mb_xfrm!=0) #define mbwide() (mbmax()>1) -#define mbchar(p) (mbwide()?((ast.tmp_int=(*ast.mb_towc)(&ast.tmp_wchar,(char*)(p),mbmax()))>0?((p+=ast.tmp_int),ast.tmp_wchar):(p+=ast.mb_sync+1,ast.tmp_int)):(*(unsigned char*)(p++))) --#define mbnchar(p,n) (mbwide()?((ast.tmp_int=(*ast.mb_towc)(&ast.tmp_wchar,(char*)(p),n))>0?((p+=ast.tmp_int),ast.tmp_wchar):(p+=ast.mb_sync+1,ast.tmp_int)):(*(unsigned char*)(p++))) #define mbinit() (mbwide()?(*ast.mb_towc)((wchar_t*)0,(char*)0,mbmax()):0) #define mbsize(p) (mbwide()?(*ast.mb_len)((char*)(p),mbmax()):((p),1)) #define mbconv(s,w) (ast.mb_conv?(*ast.mb_conv)(s,w):((*(s)=(w)),1)) #define mbwidth(w) (ast.mb_width&&((ast.tmp_int=(*ast.mb_width)(w))>=0||(w)>UCHAR_MAX)?ast.tmp_int:1) #define mbxfrm(t,f,n) (mbcoll()?(*ast.mb_xfrm)((char*)(t),(char*)(f),n):0) - -+#define mbchar(p) (mbwide() ? \ +- ++#define mbchar(p) ((mbsize(p)>1) ? \ + (((ast.tmp_int=(*ast.mb_towc)(&ast.tmp_wchar,(char*)(p),mbmax()))>0) ? \ + ({p+=ast.tmp_int;ast.tmp_wchar;}) : \ + ({ast.tmp_int=*(unsigned char*)p;p+=ast.mb_sync+1;ast.tmp_int;})) : \ + (*(unsigned char*)(p++))) -+#define mbnchar(p,n) (mbwide(p) ? \ -+ (((ast.tmp_int=(*ast.mb_towc)(&ast.tmp_wchar,(char*)(p),n))>0) ? \ -+ ({p+=ast.tmp_int;ast.tmp_wchar;}) : \ -+ ({ast.tmp_int=*(unsigned char*)p;p+=ast.mb_sync+1;ast.tmp_int;})) : \ -+ (*(unsigned char*)(p++))) -+ /* * common macros */ @@ -323,10 +297,10 @@ #include --- src/lib/libcmd/Mamfile -+++ src/lib/libcmd/Mamfile 2007-12-20 18:51:50.000000000 +0100 -@@ -496,7 +496,7 @@ make cat.o ++++ src/lib/libcmd/Mamfile 2007-12-20 17:51:50.000000000 +0000 +@@ -479,7 +479,7 @@ make cat.o prev cat.c - meta cat.o %.c>%.o ${PACKAGEROOT}/src/lib/libcmd/cat.c cat + meta cat.o %.c>%.o cat.c cat prev cat.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -DUSAGE_LICENSE=\""[-author?Glenn Fowler ][-author?David Korn ][-copyright?Copyright (c) 1992-2010 AT&T Intellectual Property][-license?http://www.opensource.org/licenses/cpl1.0.txt][--catalog?libcmd]"\" -D_BLD_cmd -D_PACKAGE_ast -c cat.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -DUSAGE_LICENSE=\""[-author?Glenn Fowler ][-author?David Korn ][-copyright?Copyright (c) 1992-2010 AT&T Intellectual Property][-license?http://www.opensource.org/licenses/cpl1.0.txt][--catalog?libcmd]"\" -D_BLD_cmd -D_PACKAGE_ast -DSHOPT_MULTIBYTE -c cat.c diff --git a/ksh93-sigchld.dif b/ksh93-sigchld.dif new file mode 100644 index 0000000..8b120dd --- /dev/null +++ b/ksh93-sigchld.dif @@ -0,0 +1,26 @@ +cc: gsf@research.att.com zpetrova@novell.com +Subject: Re: [ast-users] Bug in SIGCHLD handling (Version JM 93t+ 2010-02-14) +-------- + +I was finally able to reproduce the problem and I have fixed the bug. + +Here is a patch. Let me know if this resolves this. + +====================cut here========================== +*** src/cmd/ksh93/sh/xec.c Fri Feb 12 11:48:56 2010 +--- src/cmd/ksh93/sh/xec.c Wed Apr 7 10:40:53 2010 +*************** +*** 2946,2951 **** +--- 2946,2953 ---- + register int sig=sh.st.trapmax; + while(sig-- > 0) + { ++ if(sig==SIGCHLD) ++ continue; + if((trap=sh.st.trapcom[sig]) && *trap==0) + signal(sig,mode?sh_fault:SIG_IGN); + } +====================cut here========================== + +David Korn +dgk@research.att.com diff --git a/ksh93-sigpipe.dif b/ksh93-sigpipe.dif deleted file mode 100644 index cdbe526..0000000 --- a/ksh93-sigpipe.dif +++ /dev/null @@ -1,30 +0,0 @@ ---- src/cmd/ksh93/sh/fault.c -+++ src/cmd/ksh93/sh/fault.c 2010-06-28 14:04:13.858925163 +0000 -@@ -418,8 +418,25 @@ void sh_chktrap(void) - if(trap=sh.st.trapcom[sig]) - { - Sfio_t *fp; -- if(sig==SIGPIPE && (fp=sfpool((Sfio_t*)0,sh.outpool,SF_WRITE)) && sferror(fp)) -- sfclose(fp); -+ if(sig==SIGPIPE) { -+ sh.lastsig=SIGPIPE; -+#if 0 -+ if ((fp=sfpool((Sfio_t*)0,sh.outpool,SF_WRITE)) && sferror(fp)) -+ sfclose(fp); -+#else -+ int fd; -+ for(fd = 0; fd < sh.lim.open_max; fd++) -+ { -+ if (sh.fdstatus[fd] == IOCLOSE) -+ continue; -+ if ((sh.fdstatus[fd]&IOWRITE) == 0) -+ continue; -+ if (sferror(sh.sftable[fd]) == 0) -+ continue; -+ sh_close(fd); -+ } -+#endif -+ } - sh.oldexit = SH_EXITSIG|sig; - sh_trap(trap,0); - } diff --git a/ksh93-tty.dif b/ksh93-tty.dif new file mode 100644 index 0000000..9b062c4 --- /dev/null +++ b/ksh93-tty.dif @@ -0,0 +1,37 @@ +> Hi, +> +> one our user has reported an issue with wrong tty state after timed out read, +> when using utf-8 locale. The reproducer is: +> +> cat >test.sh < #!/bin/ksh +> TMOUT=5 +> read +> EOF +> +> chmod +x test.sh +> ./test.sh +> +> Actual result (after letting read to time out) is tty does not echo any input +> until terminal is reset. Reporter provided a patch (attached) to fix this. +> + +A work around is to out + set -o vi +or + set -g emacs +before the read. + +I have enclosed the change that I made to fixe this problem below. + +--- src/cmd/ksh93/sh/fault.c 2010-01-18 11:11:18.000000000 +0000 ++++ src/cmd/ksh93/sh/fault.c 2010-03-12 16:18:41.000000000 +0000 +@@ -614,7 +614,7 @@ void sh_done(void *ptr, register int sig + sh_accend(); + #endif /* SHOPT_ACCT */ + #if SHOPT_VSH || SHOPT_ESH +- if(sh_isoption(SH_EMACS)||sh_isoption(SH_VI)||sh_isoption(SH_GMACS)) ++ if(mbwide()||sh_isoption(SH_EMACS)||sh_isoption(SH_VI)||sh_isoption(SH_GMACS)) + tty_cooked(-1); + #endif + #ifdef JOBS diff --git a/ksh93-whence-deadlock.dif b/ksh93-whence-deadlock.dif new file mode 100644 index 0000000..226ca54 --- /dev/null +++ b/ksh93-whence-deadlock.dif @@ -0,0 +1,34 @@ +|Hi, +| +|I've got another bug report from one Fedora user. When whence builtin is used +|with -q option it hangs. Whence was modified a lot between 2008-02-02 and +|2008-07-25. New version uses while(pp) loop but for Q_FLAG pp never changes +|causing ksh loop forever. I've just added pp = 0 to Q_FLAG if-section and it +|seems working fine: +| +--- src/cmd/ksh93/bltins/whence.c ++++ src/cmd/ksh93/bltins/whence.c 2010-04-29 12:03:22.744013139 ++0200 +@@ -234,7 +234,10 @@ static int whence(Shell_t *shp,char **ar + } + } + if(flags&Q_FLAG) ++ { + r |= !cp; ++ pp = 0; ++ } + else if(cp) + { + if(flags&V_FLAG) + + +|Btw, when looking in the code it seems tofree variable is never checked when +|Q_FLAG is used and also in the loop this value is sometimes set to 1, but +|never zeroed once it is set, is it expected? +| +|Regards, +|Michal Hlavinka +|_______________________________________________ +|ast-developers mailing list +|ast-developers@research.att.com +|https://mailman.research.att.com/mailman/listinfo/ast-developers diff --git a/workaround-stupid-build-system.diff b/workaround-stupid-build-system.diff index e5fd205..d60278b 100644 --- a/workaround-stupid-build-system.diff +++ b/workaround-stupid-build-system.diff @@ -123,7 +123,7 @@ make suid_exec make suid_exec.o --- src/lib/libast/Mamfile -+++ src/lib/libast/Mamfile 2010-06-28 15:41:28.482925307 +0200 ++++ src/lib/libast/Mamfile 2008-02-14 12:08:37.000000000 +0000 @@ -5,7 +5,7 @@ setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS setv ARFLAGS -cr setv AS as @@ -142,7 +142,7 @@ setv SILENT setv TAR tar setv YACC yacc -@@ -961,7 +961,7 @@ make lcgen +@@ -954,7 +954,7 @@ make lcgen make port/lcgen.c prev std/stdio.h implicit done port/lcgen.c @@ -151,8 +151,8 @@ done lcgen generated make port/lc.tab done port/lc.tab -@@ -7165,58 +7165,31 @@ exec - test '' = 'misc/magic.tab' || ${S - done ${INSTALLROOT}/lib/file/magic generated +@@ -7131,64 +7131,37 @@ done ${INSTALLROOT}/lib/file/magic gener + make ${INSTALLROOT}/include/ast/fmtmsg.h prev comp/fmtmsg.h prev ast_lib.h -exec - case ${mam_cc_HOSTTYPE} in @@ -173,6 +173,9 @@ -exec - ;; -exec - esac +exec - } + prev ${INSTALLROOT}/include/prototyped.h implicit + done ${INSTALLROOT}/include/ast/fmtmsg.h generated + make ${INSTALLROOT}/include/ast/libgen.h prev comp/libgen.h prev ast_lib.h -exec - case ${mam_cc_HOSTTYPE} in @@ -193,6 +196,9 @@ -exec - ;; -exec - esac +exec - } + prev ${INSTALLROOT}/include/prototyped.h implicit + done ${INSTALLROOT}/include/ast/libgen.h generated + make ${INSTALLROOT}/include/ast/syslog.h prev comp/syslog.h prev ast_lib.h -exec - case ${mam_cc_HOSTTYPE} in @@ -213,9 +219,9 @@ -exec - ;; -exec - esac +exec - } - make ${INSTALLROOT}/include/ast/prototyped.h - prev ${INSTALLROOT}/include/ast - exec - echo "#include <../prototyped.h>" > 1.${COTEMP}.x + prev ast_namval.h implicit + prev ${INSTALLROOT}/include/prototyped.h implicit + done ${INSTALLROOT}/include/ast/syslog.h generated --- src/lib/libcmd/Mamfile +++ src/lib/libcmd/Mamfile 2008-02-14 12:08:37.000000000 +0000 @@ -7,7 +7,7 @@ setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS From be2f0ad606d4bd743e07d3dad6968e2c7c07b3a32d133984fed2fc38fd37fd3e Mon Sep 17 00:00:00 2001 From: OBS User buildservice-autocommit Date: Mon, 11 Oct 2010 12:37:47 +0000 Subject: [PATCH 6/6] Updating link to change in openSUSE:Factory/ksh revision 45.0 OBS-URL: https://build.opensuse.org/package/show/shells/ksh?expand=0&rev=4fe973bbf9f615b1e470f8bb4cae0326 --- CPL | 245 ++++++++++++++++++++++++++++ INIT.2010-03-09.tar.bz2 | 3 - INIT.2010-06-21.tar.bz2 | 3 + ast-ksh.2010-03-09.tar.bz2 | 3 - ast-ksh.2010-06-21.tar.bz2 | 3 + ksh.changes | 163 ++++++++++++++++++ ksh.spec | 27 ++- ksh93-ifs.dif | 37 +++++ ksh93-leak.dif | 11 ++ ksh93-shift_ijs.dif | 46 ++++-- ksh93-sigchld.dif | 26 --- ksh93-sigpipe.dif | 30 ++++ ksh93-tty.dif | 37 ----- ksh93-whence-deadlock.dif | 34 ---- workaround-stupid-build-system.diff | 20 +-- 15 files changed, 553 insertions(+), 135 deletions(-) create mode 100644 CPL delete mode 100644 INIT.2010-03-09.tar.bz2 create mode 100644 INIT.2010-06-21.tar.bz2 delete mode 100644 ast-ksh.2010-03-09.tar.bz2 create mode 100644 ast-ksh.2010-06-21.tar.bz2 create mode 100644 ksh93-ifs.dif create mode 100644 ksh93-leak.dif delete mode 100644 ksh93-sigchld.dif create mode 100644 ksh93-sigpipe.dif delete mode 100644 ksh93-tty.dif delete mode 100644 ksh93-whence-deadlock.dif diff --git a/CPL b/CPL new file mode 100644 index 0000000..04afe02 --- /dev/null +++ b/CPL @@ -0,0 +1,245 @@ ++------------------------------------------------------------------------------+ +| This license covers all software that refers to the URL | +| http://www.opensource.org/licenses/cpl1.0.txt | ++------------------------------------------------------------------------------+ + +Common Public License Version 1.0 + + THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON + PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF + THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + + 1. DEFINITIONS + + "Contribution" means: + + a) in the case of the initial Contributor, the initial code and + documentation distributed under this Agreement, and + + b) in the case of each subsequent Contributor: + + i) changes to the Program, and + + ii) additions to the Program; + + where such changes and/or additions to the Program originate from + and are distributed by that particular Contributor. A Contribution + 'originates' from a Contributor if it was added to the Program by + such Contributor itself or anyone acting on such Contributor's + behalf. Contributions do not include additions to the Program + which: (i) are separate modules of software distributed in + conjunction with the Program under their own license agreement, and + (ii) are not derivative works of the Program. + + "Contributor" means any person or entity that distributes the Program. + + "Licensed Patents " mean patent claims licensable by a Contributor + which are necessarily infringed by the use or sale of its Contribution + alone or when combined with the Program. + + "Program" means the Contributions distributed in accordance with this + Agreement. + + "Recipient" means anyone who receives the Program under this + Agreement, including all Contributors. + + 2. GRANT OF RIGHTS + + a) Subject to the terms of this Agreement, each Contributor hereby + grants Recipient a non-exclusive, worldwide, royalty-free copyright + license to reproduce, prepare derivative works of, publicly + display, publicly perform, distribute and sublicense the + Contribution of such Contributor, if any, and such derivative + works, in source code and object code form. + + b) Subject to the terms of this Agreement, each Contributor hereby + grants Recipient a non-exclusive, worldwide, royalty-free patent + license under Licensed Patents to make, use, sell, offer to sell, + import and otherwise transfer the Contribution of such Contributor, + if any, in source code and object code form. This patent license + shall apply to the combination of the Contribution and the Program + if, at the time the Contribution is added by the Contributor, such + addition of the Contribution causes such combination to be covered + by the Licensed Patents. The patent license shall not apply to any + other combinations which include the Contribution. No hardware per + se is licensed hereunder. + + c) Recipient understands that although each Contributor grants the + licenses to its Contributions set forth herein, no assurances are + provided by any Contributor that the Program does not infringe the + patent or other intellectual property rights of any other entity. + Each Contributor disclaims any liability to Recipient for claims + brought by any other entity based on infringement of intellectual + property rights or otherwise. As a condition to exercising the + rights and licenses granted hereunder, each Recipient hereby + assumes sole responsibility to secure any other intellectual + property rights needed, if any. For example, if a third party + patent license is required to allow Recipient to distribute the + Program, it is Recipient's responsibility to acquire that license + before distributing the Program. + + d) Each Contributor represents that to its knowledge it has + sufficient copyright rights in its Contribution, if any, to grant + the copyright license set forth in this Agreement. + + 3. REQUIREMENTS + + A Contributor may choose to distribute the Program in object code form + under its own license agreement, provided that: + + a) it complies with the terms and conditions of this Agreement; and + + b) its license agreement: + + i) effectively disclaims on behalf of all Contributors all + warranties and conditions, express and implied, including + warranties or conditions of title and non-infringement, and implied + warranties or conditions of merchantability and fitness for a + particular purpose; + + ii) effectively excludes on behalf of all Contributors all + liability for damages, including direct, indirect, special, + incidental and consequential damages, such as lost profits; + + iii) states that any provisions which differ from this Agreement + are offered by that Contributor alone and not by any other party; + and + + iv) states that source code for the Program is available from such + Contributor, and informs licensees how to obtain it in a reasonable + manner on or through a medium customarily used for software + exchange. + + When the Program is made available in source code form: + + a) it must be made available under this Agreement; and + + b) a copy of this Agreement must be included with each copy of the + Program. + + Contributors may not remove or alter any copyright notices contained + within the Program. + + Each Contributor must identify itself as the originator of its + Contribution, if any, in a manner that reasonably allows subsequent + Recipients to identify the originator of the Contribution. + + 4. COMMERCIAL DISTRIBUTION + + Commercial distributors of software may accept certain + responsibilities with respect to end users, business partners and the + like. While this license is intended to facilitate the commercial use + of the Program, the Contributor who includes the Program in a + commercial product offering should do so in a manner which does not + create potential liability for other Contributors. Therefore, if a + Contributor includes the Program in a commercial product offering, + such Contributor ("Commercial Contributor") hereby agrees to defend + and indemnify every other Contributor ("Indemnified Contributor") + against any losses, damages and costs (collectively "Losses") arising + from claims, lawsuits and other legal actions brought by a third party + against the Indemnified Contributor to the extent caused by the acts + or omissions of such Commercial Contributor in connection with its + distribution of the Program in a commercial product offering. The + obligations in this section do not apply to any claims or Losses + relating to any actual or alleged intellectual property infringement. + In order to qualify, an Indemnified Contributor must: a) promptly + notify the Commercial Contributor in writing of such claim, and b) + allow the Commercial Contributor to control, and cooperate with the + Commercial Contributor in, the defense and any related settlement + negotiations. The Indemnified Contributor may participate in any such + claim at its own expense. + + For example, a Contributor might include the Program in a commercial + product offering, Product X. That Contributor is then a Commercial + Contributor. If that Commercial Contributor then makes performance + claims, or offers warranties related to Product X, those performance + claims and warranties are such Commercial Contributor's responsibility + alone. Under this section, the Commercial Contributor would have to + defend claims against the other Contributors related to those + performance claims and warranties, and if a court requires any other + Contributor to pay any damages as a result, the Commercial Contributor + must pay those damages. + + 5. NO WARRANTY + + EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS + PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY + WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY + OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely + responsible for determining the appropriateness of using and + distributing the Program and assumes all risks associated with its + exercise of rights under this Agreement, including but not limited to + the risks and costs of program errors, compliance with applicable + laws, damage to or loss of data, programs or equipment, and + unavailability or interruption of operations. + + 6. DISCLAIMER OF LIABILITY + + EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR + ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING + WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR + DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED + HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + + 7. GENERAL + + If any provision of this Agreement is invalid or unenforceable under + applicable law, it shall not affect the validity or enforceability of + the remainder of the terms of this Agreement, and without further + action by the parties hereto, such provision shall be reformed to the + minimum extent necessary to make such provision valid and enforceable. + + If Recipient institutes patent litigation against a Contributor with + respect to a patent applicable to software (including a cross-claim or + counterclaim in a lawsuit), then any patent licenses granted by that + Contributor to such Recipient under this Agreement shall terminate as + of the date such litigation is filed. In addition, if Recipient + institutes patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Program + itself (excluding combinations of the Program with other software or + hardware) infringes such Recipient's patent(s), then such Recipient's + rights granted under Section 2(b) shall terminate as of the date such + litigation is filed. + + All Recipient's rights under this Agreement shall terminate if it + fails to comply with any of the material terms or conditions of this + Agreement and does not cure such failure in a reasonable period of + time after becoming aware of such noncompliance. If all Recipient's + rights under this Agreement terminate, Recipient agrees to cease use + and distribution of the Program as soon as reasonably practicable. + However, Recipient's obligations under this Agreement and any licenses + granted by Recipient relating to the Program shall continue and + survive. + + Everyone is permitted to copy and distribute copies of this Agreement, + but in order to avoid inconsistency the Agreement is copyrighted and + may only be modified in the following manner. The Agreement Steward + reserves the right to publish new versions (including revisions) of + this Agreement from time to time. No one other than the Agreement + Steward has the right to modify this Agreement. IBM is the initial + Agreement Steward. IBM may assign the responsibility to serve as the + Agreement Steward to a suitable separate entity. Each new version of + the Agreement will be given a distinguishing version number. The + Program (including Contributions) may always be distributed subject to + the version of the Agreement under which it was received. In addition, + after a new version of the Agreement is published, Contributor may + elect to distribute the Program (including its Contributions) under + the new version. Except as expressly stated in Sections 2(a) and 2(b) + above, Recipient receives no rights or licenses to the intellectual + property of any Contributor under this Agreement, whether expressly, + by implication, estoppel or otherwise. All rights in the Program not + expressly granted under this Agreement are reserved. + + This Agreement is governed by the laws of the State of New York and + the intellectual property laws of the United States of America. No + party to this Agreement will bring a legal action under this Agreement + more than one year after the cause of action arose. Each party waives + its rights to a jury trial in any resulting litigation. + +Copyright (c) 2004 by the Open Source Initiative +This is a copy of the license posted on 2004-10-06 at: + http://www.opensource.org/licenses/cpl diff --git a/INIT.2010-03-09.tar.bz2 b/INIT.2010-03-09.tar.bz2 deleted file mode 100644 index c5a3cf4..0000000 --- a/INIT.2010-03-09.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fd938331f03103fb4af57af4f6bd6e217d2473c0c6aa52a18e69bb9054687005 -size 276029 diff --git a/INIT.2010-06-21.tar.bz2 b/INIT.2010-06-21.tar.bz2 new file mode 100644 index 0000000..00aeaf0 --- /dev/null +++ b/INIT.2010-06-21.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ac7d3b11cec48ba51550c828e79b87d8b9e4747a533dd33dccf5146a304a5583 +size 279614 diff --git a/ast-ksh.2010-03-09.tar.bz2 b/ast-ksh.2010-03-09.tar.bz2 deleted file mode 100644 index 2d5e0a7..0000000 --- a/ast-ksh.2010-03-09.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:03ef4e181f2f1039371f827d44f1c3cb7cf8f57f3e23df6a85541e72216db2b4 -size 1475684 diff --git a/ast-ksh.2010-06-21.tar.bz2 b/ast-ksh.2010-06-21.tar.bz2 new file mode 100644 index 0000000..799b334 --- /dev/null +++ b/ast-ksh.2010-06-21.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:579eefa2beb40721f39261028107526f175e83c3ee6f10e7335b393ff40cc81a +size 1494273 diff --git a/ksh.changes b/ksh.changes index 93d7288..bd523bc 100644 --- a/ksh.changes +++ b/ksh.changes @@ -1,3 +1,166 @@ +------------------------------------------------------------------- +Fri Oct 8 14:50:56 CEST 2010 - werner@suse.de + +- Fix crash on unset on local IFS within shell functions (bnc#636389) + +------------------------------------------------------------------- +Tue Jun 29 16:09:17 CEST 2010 - werner@suse.de + +- Avoid memory leak as reported on mailing list + +------------------------------------------------------------------- +Mon Jun 28 17:33:29 CEST 2010 - werner@suse.de + +- Update to 2010-06-21 of ksh93t+ bug fix version + ksh: + 10-06-21 The next release this directory will be renamed ksh93t and will + install as ksh93t and ksh93u will become the default ksh. + 10-05-27 Rewrote the subshell code to avoid using pipes in many cases. + +------------------------------------------------------------------- +Fri May 28 13:21:46 CEST 2010 - werner@suse.de + +- Update to 2010-05-27 of ksh93t+ bug fix version + ksh: + 10-05-24 --- Release ksh93t+ --- + 10-05-24 Fixed a bug which cause an exception when both -s and -s were + specified with typeset -i. + 10-05-21 Inputting of three dimensional indexed arrays with ( ( (...)...)...) + was not working and has been fixed. + 10-05-21 A bug in which adding the attributes -Ai to a variable via a name + reference could cause the value to display incorrectly has been fixed. + 10-05-21 A bug in which using $var inside ((...)) did not work when var was + a hex float variable. + 10-05-20 A bug which caused an exception when multiple levels of composite + functions in arithemtic expressions has been fixed. + 10-05-19 <<< with an empty string no longer gives an error. + 10-05-19 A bug in arithmetic evaluation when a name reference to an array + instance was used has been fixed. + 10-05-14 A bug in which the shell treats a valid index array assignment, + typeset -a x=(foo (x=3;y=4) bar) as a syntax error has been fixed. + 10-05-13 A bug in creating name references to assocative array variable + after a lookup of one of its elements has been fixed. + 10-05-12 Two bugs in the handling of function static type variables in + subshells have been fixed. One could cause an exception and the + other would leave side effects in the parent shell. + 10-05-10 A bug in which static variables in functions were not being saved and + restored properly when running subshells has been fixed. + 10-05-05 A bug in which print -v did not work correctly when an operand was an + indexed array element refering to a compound variable has been fixed. + 10-05-05 A change to improve performace by special casing empty string + assignments to avoid repeated malloc() and free(). + 10-05-05 A bug in which creating a name reference to a non-existant associative + array element would create the array element has been fixed. + 10-05-04 A bug in which name references to static variables in the static + scope were not found has been fixed. + 10-04-30 Do not use socketpair() on systems that implement ioctl(I_PEEK) on pipes. + 10-04-28 A type defined with a member foo that is an associative array without + elements followed by an expansion ${bar.foo[a]} and an assignment + bar.foo[a]=b, no longer indicates that ${#bar.foo[@]} has 0 members. + 10-04-27 Another bug in which a nested command substitution could hang if it + generated too much data has been fixed. + 10-04-26 A type defined with a member that is an indexed array without elements + would behave as if the 0th element of each instance was defined after + a non-zero element was specified and this has been fixed. + 10-04-26 A bug in which types defined in a subshell were not undefined when + the subshell completed has been fixed. + 10-04-23 For file completion in commmand line editing, file names starting + with # are now escaped so that they are not treated as comments. + 10-04-23 A bug in which ${t.var:=value}, where t is an instance of a type + variable, could assign value to the type variable rather than to + the type instance has been fixed. + 10-04-22 A bug in which a nested command substitution could hang if it + generated too much data has been fixed. + 10-04-20 A bug which corrupted one byte of memory when read was called with + reads that did not use a delimiter has been fixed. + 10-04-19 The display of a compound variable with an embedded array with + attributes was sometimes not working correctly and has been fixed. + 10-04-16 A bug in which attributes were not be propogated to elements in + an associative array has been fixed. + 10-04-15 A bug which caused scripts containing user defined math functions to + fail to compile with shcomp has been fixed. + 10-04-14 A bug in which a coprocess connection could terminate prematurely + when running a nested subshell has been fixed. + 10-04-07 On Darwin on Mac/OS a bug has been fixed which generated an + inappropriate error message when continuing a background job. + 10-04-07 A bug in which setting the trap on CHLD to ignore could cause + an incorrect exit status has been fixed. + 10-04-06 A bug in which LINENO was not incremented for a here-document when + the here-document word was followed by a comment has been fixed. + 10-04-06 The optimization that execs the last process of a script rather + than creating a new process has been removed when a trap on + interrupt has been set. + 10-04-06 Unsetting the 'C', 'A' or 'a' typeset attribute now produces an + error message rather than generating an exception. + 10-04-06 A bug in which .sh.name contained the subscript and .sh.subscript + was empty in some cases with discipline functions on array instances + has been fixed. + 10-04-05 A bug in the edit modes where preceding the interrupt character with + the literal next character did not work has been fixed. + 10-04-05 A bug in the creation of type instances of arrays which could cause + an exception has been fixed. + 10-03-30 A bug in the display of a compound variable containing an indexed + array of compound variables has been fixed. + 10-03-24 A bug in which integer division was mistakenly used when the + numerator was a binary operator with the first operand floating + point and the second integer, e.g. (.1**3)/3, has been fixed. + 10-03-24 The >; file operator was modified so that the temporary file is + created in the same physical directory as file. + 10-03-23 A warning message was added to sh -n when $var was used inside + ((...)) instead of var. + 10-03-19 fmin was added to the list of math function on the man page. + 10-03-19 Fixed the return value for unalias when the alias did not exist. + 10-03-19 A bug in which the SHLVL variable exported the value it had on + input rather than the incremented value has been fixed. + 10-03-19 A bug which causes whence -q to go into an infinite loop has been fixed. + 10-03-19 Removed space between Stopped message and (SIGTTIN) and (SIGTTOUT). + 10-03-17 Modified profile shell execution so that when builtins that + correspond to executable have extended attributes, they are + executed by pfksh instead of being treated as built-ins. + 10-03-16 A bug in whence -a which produced duplicate lines of output has been fixed. + 10-03-16 A bug in the handling of process groups in monitor mode for + command substitutions has been fixed. + 10-03-12 A bug in which a here-document containing command substitutions + that contained here-documents did not process correctly has been fixed. + 10-03-12 A bug in which the terminal is not restored to cannonical mode + after read times out when in a multibyte locale with no edit mode + enabled has been fixed. + libast: + 10-05-25 include/sfhdr.h: adjust SF_NMAP according to _ptr_bits + 10-05-25 include/shcmd.h: add sh_builtin() macro for lib_init() table initialization + 10-05-21 misc/optget.c: --html \bfoo::bar([[:digit:]][[:upper:]]*) => foo-bar.html + 10-05-15 include/proc.h,misc/procopen.c: add PROC_ORPHAN + 10-05-09 misc/optget.c: add --???MAN[section] --???SECTION + 10-05-07 sfio,stdio: fix all snprintf() variants to handle buf==0 and/or n==0 + 10-05-04 string/fmtesc.c: add mb iswsoace() and iswcntrl() quoting checks + 10-05-03 fix LC_MESSAGES catalog lookup bugs, check for $set==3, accept $set==1 + 10-04-30 string/chresc.c: add chrexp() for FMT_EXP_* + 10-04-30 string/stresc.c: add strexp() for FMT_EXP_* + 10-04-30 string/chresc.c: fix \uXXXXY bug that consumed Y + 10-04-22 misc/optget.c: check for html entities in + 10-04-22 misc/getcwd.c: add features/syscall check for SYSGETCWD() { linux solaris } + 10-04-22 string/stresc.c: wide chars absent locale guidance default to UTF-8 + 10-04-12 port/mnt.c: favor bsd getfsstat() over getmntinfo() + 10-04-11 string/strtoi.h: k (1000) and ki (1024) now differentiated + 10-04-10 misc/recstr.c: fix 'd[delimiter]' parse + 10-04-08 include/vmalloc.h,vmalloc/vmstat.c: add Vmstat_t.mode region mode bits + 10-04-05 misc/fts.c: drop 1997-01-07 fts_open()=0 is one file and stat() fails + 10-04-05 misc/optget.c,optlib.h: add Optpass_t.release for --nroff .TH + 10-04-02 misc/optget.c: fix $'[-n?\n...]' --version bug + 10-04-02 regex/regcomp.c: ~(X) => REG_EXTENDED|REG_AUGMENTED, ~(PU) instead of ~(U) + 10-03-24 misc/procopen.c: add PROC_FD_CTTY(fd) + 10-03-24 path/pathtemp.c: fix pointer => int casts + 10-03-15 regex/regcache.c: fix 1 byte buffer overflow (didn't count trailing \0) + libcmd: + 10-05-09 tail.c: fix -0f bug that inially listed the entire file + 10-05-06 basename.c: add { -a,--all -s,--suffux=suffix } from BSD + 10-04-12 cat.c: fix -v bug that dumped core and make consistent with cmp --print-chars + 10-04-11 cmp.c: add --print-bytes, --count=n, --differences=n + 10-04-08 vmstate.c: add { method flags } vars for Vmstat_t.mode + 10-04-08 mkdir.c: fix check for { S_ISUID S_ISGID S_ISVTX } after successful mkdir(2) + 10-04-01 stty.c: add --fd=fd option + 10-03-23 tail.c: fix -f large initial offset bug that didn't copy all data + ------------------------------------------------------------------- Mon May 3 14:47:52 CEST 2010 - werner@suse.de diff --git a/ksh.spec b/ksh.spec index f00f9ce..19169ae 100644 --- a/ksh.spec +++ b/ksh.spec @@ -37,12 +37,13 @@ Requires(preun): update-alternatives %endif AutoReqProv: on Version: 93t -Release: 23 +Release: 179 Summary: Korn Shell BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source: INIT.2010-03-09.tar.bz2 -Source1: ast-ksh.2010-03-09.tar.bz2 +Source: INIT.2010-06-21.tar.bz2 +Source1: ast-ksh.2010-06-21.tar.bz2 Source2: ast-ksh-locale.2010-02-02.tar.bz2 +Source3: CPL Source10: leak1.sh Source11: leak2.sh Source20: Agreement @@ -62,11 +63,11 @@ Patch9: ksh93-compat.dif Patch10: ksh93-suid_exec.dif Patch11: ksh93-signals.dif Patch12: ksh93-limits.dif -Patch13: ksh93-tty.dif +Patch13: ksh93-sigpipe.dif Patch14: ksh93-ia64.dif Patch15: ksh93-s390.dif -Patch16: ksh93-sigchld.dif -Patch17: ksh93-whence-deadlock.dif +Patch16: ksh93-leak.dif +Patch17: ksh93-ifs.dif %global use_suid_exe 0 %global use_locale 1 %global debug_memleak 0 @@ -250,10 +251,10 @@ find share/ -type d -a -empty | xargs -r rm -vrf rm -f ./test64 case "$RPM_ARCH" in ia64) RPM_OPT_FLAGS="${RPM_OPT_FLAGS//-O[s0-9]/-O}" ;; - s390) RPM_OPT_FLAGS="${RPM_OPT_FLAGS//-O[s0-9]/-O}" ;; + s390*) RPM_OPT_FLAGS="${RPM_OPT_FLAGS//-O[s0-9]/-O}" ;; ppc*) RPM_OPT_FLAGS="${RPM_OPT_FLAGS//-O[s0-9]/-O}" ;; esac - RPM_OPT_FLAGS=$(echo "${RPM_OPT_FLAGS}"|sed -r 's/[[:blank:]]+-g[0-9]?//g') + RPM_OPT_FLAGS=$(echo "${RPM_OPT_FLAGS}"|sed -r 's/[[:blank:]]+-g[0-9]?//g2') UNIVERSE=att LDFLAGS="-lm" LDSOFLG="" @@ -262,6 +263,7 @@ find share/ -type d -a -empty | xargs -r rm -vrf cflags @$nobuiltin RPM_OPT_FLAGS cflags -fno-strict-aliasing RPM_OPT_FLAGS cflags -fno-zero-initialized-in-bss RPM_OPT_FLAGS + cflags -fno-delete-null-pointer-checks RPM_OPT_FLAGS cflags -g RPM_OPT_FLAGS cflags -pipe RPM_OPT_FLAGS cflags -Wl,-O2 LDFLAGS @@ -417,6 +419,9 @@ find share/ -type d -a -empty | xargs -r rm -vrf ln -sf /%{_lib}/ast/$so %{buildroot}%{_libdir}/ast/${so%%%%.*}.so done rm -f %{buildroot}%{_libdir}/ast/*.so.* + for man in man/man[13]/*.[13] ; do + sed -i 's/\\f5/\\fB/g;s/^\.H/\.P\n\.H/g' $man + done install -m 0644 lib/*.a %{buildroot}%{_libdir}/ast/ %if %suse_version > 1120 install -m 0644 man/man1/sh.1 %{buildroot}%{_mandir}/man1/ksh93.1 @@ -448,7 +453,11 @@ find share/ -type d -a -empty | xargs -r rm -vrf %else > ksh.lang %endif - cp lib/package/LICENSES/ast LICENSE + if test -s lib/package/LICENSES/ast ; then + cp lib/package/LICENSES/ast LICENSE + else + cp %{S:3} LICENSE + fi mv src/cmd/ksh93/OBSOLETE src/cmd/ksh93/OBSOLETE.mm cat src/cmd/ksh93/builtins.mm | sed 's/\\f5/\\fB/g;s/^\.H/\.P\n\.H/g' | troff -Tascii8 -t -mm | grotty -bou > Builtins cat src/cmd/ksh93/PROMO.mm | sed 's/\\f5/\\fB/g;s/^\.H/\.P\n\.H/g' | troff -Tascii8 -t -mm | grotty -bou > PROMO diff --git a/ksh93-ifs.dif b/ksh93-ifs.dif new file mode 100644 index 0000000..724e766 --- /dev/null +++ b/ksh93-ifs.dif @@ -0,0 +1,37 @@ +--- src/cmd/ksh93/sh/init.c ++++ src/cmd/ksh93/sh/init.c 2010-10-08 12:43:27.123926224 +0000 +@@ -456,6 +456,8 @@ static void put_cdpath(register Namval_t + } + #endif /* _hdr_locale */ + ++static const void* ifs_hdr; ++ + /* Trap for IFS assignment and invalidates state table */ + static void put_ifs(register Namval_t* np,const char *val,int flags,Namfun_t *fp) + { +@@ -464,9 +466,14 @@ static void put_ifs(register Namval_t* n + ip->ifsnp = 0; + if(!val) + { +- fp = nv_stack(np, NIL(Namfun_t*)); +- if(fp && !fp->nofree) +- free((void*)fp); ++ Namfun_t *xp = nv_stack(np, NIL(Namfun_t*)); ++ if(xp) ++ { ++ if(xp == ifs_hdr) ++ xp->nofree = 1; ++ if(xp->nofree == 0) ++ free((void*)xp); ++ } + } + if(val != np->nvalue.cp) + nv_putv(np, val, flags, fp); +@@ -1597,6 +1604,7 @@ static Init_t *nv_init(Shell_t *shp) + ip->LANG_init.nofree = 1; + #endif /* _hdr_locale */ + nv_stack(IFSNOD, &ip->IFS_init.hdr); ++ ifs_hdr = (IFSNOD)->nvfun; + nv_stack(PATHNOD, &ip->PATH_init); + nv_stack(FPATHNOD, &ip->FPATH_init); + nv_stack(CDPNOD, &ip->CDPATH_init); diff --git a/ksh93-leak.dif b/ksh93-leak.dif new file mode 100644 index 0000000..6588c5f --- /dev/null +++ b/ksh93-leak.dif @@ -0,0 +1,11 @@ +--- src/cmd/ksh93/sh/nvdisc.c ++++ src/cmd/ksh93/sh/nvdisc.c 2010-06-29 14:07:19.578925435 +0000 +@@ -1347,7 +1347,7 @@ Dt_t *nv_dict(Namval_t* np) + Namval_t *nv_mount(Namval_t *np, const char *name, Dt_t *dict) + { + Namval_t *mp, *pp=0; +- struct table *tp = newof((struct table*)0, struct table,1,0); ++ struct table *tp; + if(name) + { + if(nv_istable(np)) diff --git a/ksh93-shift_ijs.dif b/ksh93-shift_ijs.dif index 0b71655..1279f5c 100644 --- a/ksh93-shift_ijs.dif +++ b/ksh93-shift_ijs.dif @@ -105,8 +105,27 @@ # endif static int _isalph(int); static int _ismetach(int); +--- src/cmd/ksh93/sh/io.c ++++ src/cmd/ksh93/sh/io.c 2010-06-28 16:09:09.174925785 +0200 +@@ -1367,6 +1367,7 @@ static int io_heredoc(Shell_t *shp,regis + if(traceon) + sfprintf(sfstderr,"< %s\n",name); + sfputr(outfile,name,'\n'); ++ off = 0; + } + else + { --- src/cmd/ksh93/sh/macro.c +++ src/cmd/ksh93/sh/macro.c 2007-12-20 17:50:28.000000000 +0000 +@@ -2079,7 +2079,7 @@ + lastc = 0; + } + newlines = nextnewlines; +- if(++c < bufsize) ++ if(c++ < bufsize) + str[c] = 0; + else + { @@ -2167,13 +2167,13 @@ static void mac_copy(register Mac_t *mp, if(mp->pattern) { @@ -183,16 +202,16 @@ +export LANG=ja_JP.SJIS + +for second in $(seq 64 126); do -+ : $((chr++)) ++ let chr++ + second=$(printf '%x' ${second}) + mbchar="$(printf "\x81\x${second}")" + if test -z "${mbchar}" ; then -+ : $((err++)) # ERROR in builtin printf ++ let err++ # ERROR in builtin printf + continue + fi + if test -x "${printf}" ; then + if test $(${printf} "\x81\x${second}") != ${mbchar} ; then -+ : $((err++)) # ERROR in builtin printf ++ let err++ # ERROR in builtin printf + continue + fi + fi @@ -266,23 +285,30 @@ extern int fwprintf(FILE*, const wchar_t*, ...); extern int fwscanf(FILE*, const wchar_t*, ...); --- src/lib/libast/include/ast.h -+++ src/lib/libast/include/ast.h 2007-12-20 17:50:28.000000000 +0000 -@@ -176,13 +176,16 @@ typedef struct ++++ src/lib/libast/include/ast.h 2010-06-25 12:35:11.542927316 +0200 +@@ -186,14 +186,23 @@ typedef struct #define mbcoll() (ast.mb_xfrm!=0) #define mbwide() (mbmax()>1) -#define mbchar(p) (mbwide()?((ast.tmp_int=(*ast.mb_towc)(&ast.tmp_wchar,(char*)(p),mbmax()))>0?((p+=ast.tmp_int),ast.tmp_wchar):(p+=ast.mb_sync+1,ast.tmp_int)):(*(unsigned char*)(p++))) +-#define mbnchar(p,n) (mbwide()?((ast.tmp_int=(*ast.mb_towc)(&ast.tmp_wchar,(char*)(p),n))>0?((p+=ast.tmp_int),ast.tmp_wchar):(p+=ast.mb_sync+1,ast.tmp_int)):(*(unsigned char*)(p++))) #define mbinit() (mbwide()?(*ast.mb_towc)((wchar_t*)0,(char*)0,mbmax()):0) #define mbsize(p) (mbwide()?(*ast.mb_len)((char*)(p),mbmax()):((p),1)) #define mbconv(s,w) (ast.mb_conv?(*ast.mb_conv)(s,w):((*(s)=(w)),1)) #define mbwidth(w) (ast.mb_width&&((ast.tmp_int=(*ast.mb_width)(w))>=0||(w)>UCHAR_MAX)?ast.tmp_int:1) #define mbxfrm(t,f,n) (mbcoll()?(*ast.mb_xfrm)((char*)(t),(char*)(f),n):0) -- -+#define mbchar(p) ((mbsize(p)>1) ? \ + ++#define mbchar(p) (mbwide() ? \ + (((ast.tmp_int=(*ast.mb_towc)(&ast.tmp_wchar,(char*)(p),mbmax()))>0) ? \ + ({p+=ast.tmp_int;ast.tmp_wchar;}) : \ + ({ast.tmp_int=*(unsigned char*)p;p+=ast.mb_sync+1;ast.tmp_int;})) : \ + (*(unsigned char*)(p++))) ++#define mbnchar(p,n) (mbwide(p) ? \ ++ (((ast.tmp_int=(*ast.mb_towc)(&ast.tmp_wchar,(char*)(p),n))>0) ? \ ++ ({p+=ast.tmp_int;ast.tmp_wchar;}) : \ ++ ({ast.tmp_int=*(unsigned char*)p;p+=ast.mb_sync+1;ast.tmp_int;})) : \ ++ (*(unsigned char*)(p++))) ++ /* * common macros */ @@ -297,10 +323,10 @@ #include --- src/lib/libcmd/Mamfile -+++ src/lib/libcmd/Mamfile 2007-12-20 17:51:50.000000000 +0000 -@@ -479,7 +479,7 @@ make cat.o ++++ src/lib/libcmd/Mamfile 2007-12-20 18:51:50.000000000 +0100 +@@ -496,7 +496,7 @@ make cat.o prev cat.c - meta cat.o %.c>%.o cat.c cat + meta cat.o %.c>%.o ${PACKAGEROOT}/src/lib/libcmd/cat.c cat prev cat.c -exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -DUSAGE_LICENSE=\""[-author?Glenn Fowler ][-author?David Korn ][-copyright?Copyright (c) 1992-2010 AT&T Intellectual Property][-license?http://www.opensource.org/licenses/cpl1.0.txt][--catalog?libcmd]"\" -D_BLD_cmd -D_PACKAGE_ast -c cat.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -DUSAGE_LICENSE=\""[-author?Glenn Fowler ][-author?David Korn ][-copyright?Copyright (c) 1992-2010 AT&T Intellectual Property][-license?http://www.opensource.org/licenses/cpl1.0.txt][--catalog?libcmd]"\" -D_BLD_cmd -D_PACKAGE_ast -DSHOPT_MULTIBYTE -c cat.c diff --git a/ksh93-sigchld.dif b/ksh93-sigchld.dif deleted file mode 100644 index 8b120dd..0000000 --- a/ksh93-sigchld.dif +++ /dev/null @@ -1,26 +0,0 @@ -cc: gsf@research.att.com zpetrova@novell.com -Subject: Re: [ast-users] Bug in SIGCHLD handling (Version JM 93t+ 2010-02-14) --------- - -I was finally able to reproduce the problem and I have fixed the bug. - -Here is a patch. Let me know if this resolves this. - -====================cut here========================== -*** src/cmd/ksh93/sh/xec.c Fri Feb 12 11:48:56 2010 ---- src/cmd/ksh93/sh/xec.c Wed Apr 7 10:40:53 2010 -*************** -*** 2946,2951 **** ---- 2946,2953 ---- - register int sig=sh.st.trapmax; - while(sig-- > 0) - { -+ if(sig==SIGCHLD) -+ continue; - if((trap=sh.st.trapcom[sig]) && *trap==0) - signal(sig,mode?sh_fault:SIG_IGN); - } -====================cut here========================== - -David Korn -dgk@research.att.com diff --git a/ksh93-sigpipe.dif b/ksh93-sigpipe.dif new file mode 100644 index 0000000..cdbe526 --- /dev/null +++ b/ksh93-sigpipe.dif @@ -0,0 +1,30 @@ +--- src/cmd/ksh93/sh/fault.c ++++ src/cmd/ksh93/sh/fault.c 2010-06-28 14:04:13.858925163 +0000 +@@ -418,8 +418,25 @@ void sh_chktrap(void) + if(trap=sh.st.trapcom[sig]) + { + Sfio_t *fp; +- if(sig==SIGPIPE && (fp=sfpool((Sfio_t*)0,sh.outpool,SF_WRITE)) && sferror(fp)) +- sfclose(fp); ++ if(sig==SIGPIPE) { ++ sh.lastsig=SIGPIPE; ++#if 0 ++ if ((fp=sfpool((Sfio_t*)0,sh.outpool,SF_WRITE)) && sferror(fp)) ++ sfclose(fp); ++#else ++ int fd; ++ for(fd = 0; fd < sh.lim.open_max; fd++) ++ { ++ if (sh.fdstatus[fd] == IOCLOSE) ++ continue; ++ if ((sh.fdstatus[fd]&IOWRITE) == 0) ++ continue; ++ if (sferror(sh.sftable[fd]) == 0) ++ continue; ++ sh_close(fd); ++ } ++#endif ++ } + sh.oldexit = SH_EXITSIG|sig; + sh_trap(trap,0); + } diff --git a/ksh93-tty.dif b/ksh93-tty.dif deleted file mode 100644 index 9b062c4..0000000 --- a/ksh93-tty.dif +++ /dev/null @@ -1,37 +0,0 @@ -> Hi, -> -> one our user has reported an issue with wrong tty state after timed out read, -> when using utf-8 locale. The reproducer is: -> -> cat >test.sh < #!/bin/ksh -> TMOUT=5 -> read -> EOF -> -> chmod +x test.sh -> ./test.sh -> -> Actual result (after letting read to time out) is tty does not echo any input -> until terminal is reset. Reporter provided a patch (attached) to fix this. -> - -A work around is to out - set -o vi -or - set -g emacs -before the read. - -I have enclosed the change that I made to fixe this problem below. - ---- src/cmd/ksh93/sh/fault.c 2010-01-18 11:11:18.000000000 +0000 -+++ src/cmd/ksh93/sh/fault.c 2010-03-12 16:18:41.000000000 +0000 -@@ -614,7 +614,7 @@ void sh_done(void *ptr, register int sig - sh_accend(); - #endif /* SHOPT_ACCT */ - #if SHOPT_VSH || SHOPT_ESH -- if(sh_isoption(SH_EMACS)||sh_isoption(SH_VI)||sh_isoption(SH_GMACS)) -+ if(mbwide()||sh_isoption(SH_EMACS)||sh_isoption(SH_VI)||sh_isoption(SH_GMACS)) - tty_cooked(-1); - #endif - #ifdef JOBS diff --git a/ksh93-whence-deadlock.dif b/ksh93-whence-deadlock.dif deleted file mode 100644 index 226ca54..0000000 --- a/ksh93-whence-deadlock.dif +++ /dev/null @@ -1,34 +0,0 @@ -|Hi, -| -|I've got another bug report from one Fedora user. When whence builtin is used -|with -q option it hangs. Whence was modified a lot between 2008-02-02 and -|2008-07-25. New version uses while(pp) loop but for Q_FLAG pp never changes -|causing ksh loop forever. I've just added pp = 0 to Q_FLAG if-section and it -|seems working fine: -| ---- src/cmd/ksh93/bltins/whence.c -+++ src/cmd/ksh93/bltins/whence.c 2010-04-29 12:03:22.744013139 -+0200 -@@ -234,7 +234,10 @@ static int whence(Shell_t *shp,char **ar - } - } - if(flags&Q_FLAG) -+ { - r |= !cp; -+ pp = 0; -+ } - else if(cp) - { - if(flags&V_FLAG) - - -|Btw, when looking in the code it seems tofree variable is never checked when -|Q_FLAG is used and also in the loop this value is sometimes set to 1, but -|never zeroed once it is set, is it expected? -| -|Regards, -|Michal Hlavinka -|_______________________________________________ -|ast-developers mailing list -|ast-developers@research.att.com -|https://mailman.research.att.com/mailman/listinfo/ast-developers diff --git a/workaround-stupid-build-system.diff b/workaround-stupid-build-system.diff index d60278b..e5fd205 100644 --- a/workaround-stupid-build-system.diff +++ b/workaround-stupid-build-system.diff @@ -123,7 +123,7 @@ make suid_exec make suid_exec.o --- src/lib/libast/Mamfile -+++ src/lib/libast/Mamfile 2008-02-14 12:08:37.000000000 +0000 ++++ src/lib/libast/Mamfile 2010-06-28 15:41:28.482925307 +0200 @@ -5,7 +5,7 @@ setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS setv ARFLAGS -cr setv AS as @@ -142,7 +142,7 @@ setv SILENT setv TAR tar setv YACC yacc -@@ -954,7 +954,7 @@ make lcgen +@@ -961,7 +961,7 @@ make lcgen make port/lcgen.c prev std/stdio.h implicit done port/lcgen.c @@ -151,8 +151,8 @@ done lcgen generated make port/lc.tab done port/lc.tab -@@ -7131,64 +7131,37 @@ done ${INSTALLROOT}/lib/file/magic gener - make ${INSTALLROOT}/include/ast/fmtmsg.h +@@ -7165,58 +7165,31 @@ exec - test '' = 'misc/magic.tab' || ${S + done ${INSTALLROOT}/lib/file/magic generated prev comp/fmtmsg.h prev ast_lib.h -exec - case ${mam_cc_HOSTTYPE} in @@ -173,9 +173,6 @@ -exec - ;; -exec - esac +exec - } - prev ${INSTALLROOT}/include/prototyped.h implicit - done ${INSTALLROOT}/include/ast/fmtmsg.h generated - make ${INSTALLROOT}/include/ast/libgen.h prev comp/libgen.h prev ast_lib.h -exec - case ${mam_cc_HOSTTYPE} in @@ -196,9 +193,6 @@ -exec - ;; -exec - esac +exec - } - prev ${INSTALLROOT}/include/prototyped.h implicit - done ${INSTALLROOT}/include/ast/libgen.h generated - make ${INSTALLROOT}/include/ast/syslog.h prev comp/syslog.h prev ast_lib.h -exec - case ${mam_cc_HOSTTYPE} in @@ -219,9 +213,9 @@ -exec - ;; -exec - esac +exec - } - prev ast_namval.h implicit - prev ${INSTALLROOT}/include/prototyped.h implicit - done ${INSTALLROOT}/include/ast/syslog.h generated + make ${INSTALLROOT}/include/ast/prototyped.h + prev ${INSTALLROOT}/include/ast + exec - echo "#include <../prototyped.h>" > 1.${COTEMP}.x --- src/lib/libcmd/Mamfile +++ src/lib/libcmd/Mamfile 2008-02-14 12:08:37.000000000 +0000 @@ -7,7 +7,7 @@ setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS