diff --git a/INIT.2006-02-14.tar.bz2 b/INIT.2006-02-14.tar.bz2 deleted file mode 100644 index 01976f5..0000000 --- a/INIT.2006-02-14.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e69bbadaceefe3db263fde8f3d8257879150e4ac361fbcebacb78b332ad827ff -size 232738 diff --git a/INIT.2007-03-28.tar.bz2 b/INIT.2007-03-28.tar.bz2 new file mode 100644 index 0000000..6b584bd --- /dev/null +++ b/INIT.2007-03-28.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4c2c5bcb261bfac49cb736056630f20eb0fbc98492b2487085fd5283e87aecdc +size 258521 diff --git a/ast-ksh.2006-02-14.tar.bz2 b/ast-ksh.2006-02-14.tar.bz2 deleted file mode 100644 index c076d36..0000000 --- a/ast-ksh.2006-02-14.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c07d963856119c9b53446106e6128a3c716511d0596f7adfb373f9d8b7260a23 -size 1254637 diff --git a/ast-ksh.2007-03-28.tar.bz2 b/ast-ksh.2007-03-28.tar.bz2 new file mode 100644 index 0000000..4d42163 --- /dev/null +++ b/ast-ksh.2007-03-28.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:63fc059d37cd3e2e797efc414d90e63a89726c027ad438a3e3494237aba7b1d3 +size 1306654 diff --git a/ksh-qemu.patch b/ksh-qemu.patch index e4ffa40..c0cd53d 100644 --- a/ksh-qemu.patch +++ b/ksh-qemu.patch @@ -1,6 +1,6 @@ --- src/lib/libast/features/lib -+++ src/lib/libast/features/lib -@@ -86,27 +86,6 @@ ++++ src/lib/libast/features/lib 2007-03-28 17:49:29.241351031 +0200 +@@ -90,27 +90,6 @@ tst lib_poll_fd_1 note{ fd is first arg } }end @@ -28,18 +28,23 @@ exp _lib_poll _lib_poll_fd_1||_lib_poll_fd_2 tst lib_poll_notimer note{ poll with no fds ignores timeout }end execute{ -@@ -220,63 +199,6 @@ +@@ -224,74 +203,6 @@ tst real_vfork note{ vfork child shares } }end --tst lib_posix_spawn unistd.h stdlib.h spawn.h note{ posix_spawn exists and it works and its worth using }end execute{ +-tst lib_posix_spawn unistd.h stdlib.h spawn.h -Dfork=______fork note{ posix_spawn exists and it works and its worth using }end status{ +- #include +- #include +- #include - #include - #include -- #include +- #include +- #include +- #undef fork - /* if it uses fork() why bother? */ -- int fork() { return -1; } -- int _fork() { return -1; } -- int __fork() { return -1; } +- pid_t fork _ARG_((void)) { return -1; } +- pid_t _fork _ARG_((void)) { return -1; } +- pid_t __fork _ARG_((void)) { return -1; } - int - main(argc, argv) - int argc; @@ -56,36 +61,42 @@ - _exit(signal(SIGHUP, SIG_DFL) != SIG_IGN); - signal(SIGHUP, SIG_IGN); - if (posix_spawnattr_init(&attr)) -- _exit(1); +- _exit(0); - if (posix_spawnattr_setpgroup(&attr, 0)) -- _exit(1); +- _exit(0); +- if (posix_spawnattr_setflags(&attr, POSIX_SPAWN_SETPGROUP)) +- _exit(0); - /* first try an a.out and verify that SIGHUP is ignored */ - cmd[0] = argv[0]; - cmd[1] = "test"; - cmd[2] = 0; - if (posix_spawn(&pid, cmd[0], 0, &attr, cmd, 0)) -- _exit(1); +- _exit(0); - status = 1; - if (wait(&status) < 0 || status != 0) -- _exit(1); +- _exit(0); - /* passing ENOEXEC to the shell is bogus */ - n = strlen(cmd[0]); - if (n >= (sizeof(tmp) - 3)) -- _exit(1); +- _exit(0); - strcpy(tmp, cmd[0]); - tmp[n] = '.'; - tmp[n+1] = 's'; - tmp[n+2] = 'h'; - tmp[n+3] = 0; -- if (close(creat(tmp, 0777)) < 0 || chmod(tmp, 0777) < 0) -- _exit(1); +- if (close(open(tmp, O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO)) < 0 || chmod(tmp, S_IRWXU|S_IRWXG|S_IRWXO) < 0) +- _exit(0); - cmd[0] = tmp; -- if (!posix_spawn(&pid, cmd[0], 0, &attr, cmd, 0)) +- n = 0; +- pid = -1; +- if (posix_spawn(&pid, cmd[0], 0, &attr, cmd, 0)) +- n = 2; +- else - { +- n = pid != -1 && waitpid(pid, &status, WNOHANG|WNOWAIT) == pid && ((status>>8)&0x7f) == 127; - wait(&status); -- _exit(1); - } -- _exit(0); +- _exit(n); - } -}end - diff --git a/ksh.changes b/ksh.changes index 6ea4d5d..7c218c0 100644 --- a/ksh.changes +++ b/ksh.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Apr 2 17:46:01 CEST 2007 - werner@suse.de + +- Update to ksh93s+ (bug #239215) +- Be sure that iffe can handle option -n even if bash is used + ------------------------------------------------------------------- Wed Mar 28 14:15:25 CEST 2007 - werner@suse.de diff --git a/ksh.spec b/ksh.spec index fa60398..38a69d5 100644 --- a/ksh.spec +++ b/ksh.spec @@ -1,5 +1,5 @@ # -# spec file for package ksh (Version 93r) +# spec file for package ksh (Version 93s) # # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -11,17 +11,18 @@ # norootforbuild Name: ksh +BuildRequires: bind-libs bind-utils bison flex gdbm-devel glibc-devel libbz2-devel ncurses-devel procps psmisc pwdutils zlib-devel URL: http://www.research.att.com/~gsf/download/ License: Other License(s), see package Group: System/Shells PreReq: /bin/ln /etc/bash.bashrc Autoreqprov: on -Version: 93r -Release: 53 +Version: 93s +Release: 1 Summary: Korn Shell BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source: INIT.2006-02-14.tar.bz2 -Source1: ast-ksh.2006-02-14.tar.bz2 +Source: INIT.2007-03-28.tar.bz2 +Source1: ast-ksh.2007-03-28.tar.bz2 Source2: Agreement Source3: Warning Patch: ksh93.dif @@ -32,13 +33,9 @@ Patch4: ksh93-gmt2utc.dif Patch5: ksh93-uname.dif Patch6: ksh93-vi.dif Patch7: ksh93-profile.dif -Patch8: ksh93-splice.dif -Patch9: ksh93-cut.dif -Patch10: ksh93-shcomp.dif -Patch11: ksh93-unaligned.dif -Patch12: ksh93-subshell_close_fd.patch -Patch13: ksh93-test.dif -Patch14: ksh93-sigcont.dif +Patch8: ksh93-test.dif +Patch9: ksh93-compat.dif +Patch10: ksh93-suid_exec.dif %description The original Korn Shell. The ksh is an sh-compatible command @@ -87,12 +84,6 @@ Authors: %patch8 %patch9 %patch10 -%ifarch ia64 -%patch11 -%endif -%patch12 -%patch13 -%patch14 %build # @@ -104,16 +95,26 @@ Authors: # # FEATURE="-DSHOPT_SYSRC=1 -DSHOPT_REMOTE=1 -DSHOPT_CMDLIB_BLTIN=1" + FEATURE="$FEATURE -DSH_CMDLIB_DIR=\\\"/%{_lib}/ast/bin\\\" -DDEFSHELL=\\\"/bin/ksh\\\"" + FEATURE="$FEATURE -DTHISPROG=\\\"/%{_lib}/ast/bin/suid_exec\\\"" # # - CCFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fno-strict-aliasing -g -pipe $IGNORE $FEATURE" + echo 'int main () { return !(sizeof(void*) >= 8); }' | gcc -x c -o test64 - + if ./test64 ; then + LARGEFILE="" + else + LARGEFILE="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" + fi + rm -f ./test64 + CCFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE $LARGEFILE -fPIC" + CCFLAGS="$CCFLAGS -fno-strict-aliasing -g -pipe $IGNORE $FEATURE" LDFLAGS="-lm" HOSTTYPE=${RPM_ARCH%%*-linux*} CC=gcc mam_cc_L=use UNIVERSE=att export CCFLAGS LDFLAGS CC mam_cc_L UNIVERSE - bin/package make + bin/package make CC=$CC cc=$CC root=$(echo ${PWD}/arch/linux*) test -d $root || exit 1 log=${root}/lib/package/gen/make.out @@ -157,11 +158,14 @@ Authors: rm -f ${root}/bin/ksh rm -f ${root}/bin/shcomp ksh=$(grep -e '-o ksh' $log | tail -n 1 |\ - sed "s@+ cc@gcc@;s@-o ksh@-o ${root}/bin/ksh@;s@[a-zA-Z0-9_/\.-]*lib\([a-z]\+\)\.a@-l\1@g") + sed "s@+ g\?cc@gcc@;s@-o ksh@-o ${root}/bin/ksh@;s@[a-zA-Z0-9_/\.-]*lib\([a-z]\+\)\.a@-l\1@g;s@'@@g") shcomp=$(grep -e '-o shcomp' $log | tail -n 1 |\ - sed "s@+ cc@gcc@;s@-o shcomp@-o ${root}/bin/shcomp@;s@[a-zA-Z0-9_/\.-]*lib\([a-z]\+\)\.a@-l\1@g") + sed "s@+ g\?cc@gcc@;s@-o shcomp@-o ${root}/bin/shcomp@;s@[a-zA-Z0-9_/\.-]*lib\([a-z]\+\)\.a@-l\1@g;s@'@@g") + suidex=$(grep -e '-o suid_exec' $log | tail -n 1 |\ + sed "s@+ g\?cc@gcc@;s@-o shcomp@-o ${root}/bin/suid_exec@;s@[a-zA-Z0-9_/\.-]*lib\([a-z]\+\)\.a@-l\1@g;s@'@@g") ${ksh} -Wl,-rpath-link,${root}/lib -Wl,-rpath,/%{_lib}/ast ${shcomp} -Wl,-rpath-link,${root}/lib -Wl,-rpath,/%{_lib}/ast + ${suidex} -Wl,-rpath-link,${root}/lib -Wl,-rpath,/%{_lib}/ast pushd ${test} sleep 5 LD_LIBRARY_PATH=${root}/lib SHELL=${root}/bin/ksh ${root}/bin/ksh shtests @@ -178,35 +182,37 @@ Authors: root=$(echo ${PWD}/arch/linux*) test -d $root || exit 1 pushd $root || exit 1 - mkdir -p ${RPM_BUILD_ROOT}/bin - mkdir -p ${RPM_BUILD_ROOT}/usr/bin - mkdir -p ${RPM_BUILD_ROOT}/usr/include/ast - mkdir -p ${RPM_BUILD_ROOT}/%{_lib}/ast - mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/ast - mkdir -p ${RPM_BUILD_ROOT}%{_mandir} - mkdir ${RPM_BUILD_ROOT}%{_mandir}/man1 - mkdir ${RPM_BUILD_ROOT}%{_mandir}/man3 - install bin/ksh ${RPM_BUILD_ROOT}/%{_lib}/ast/ - install bin/shcomp ${RPM_BUILD_ROOT}/%{_lib}/ast/ - ln -sf /bin/true ${RPM_BUILD_ROOT}/bin/ksh - ln -sf /bin/true ${RPM_BUILD_ROOT}/usr/bin/ksh - ln -sf /%{_lib}/ast/ksh ${RPM_BUILD_ROOT}/usr/bin/rksh - ln -sf /%{_lib}/ast/shcomp ${RPM_BUILD_ROOT}/usr/bin/shcomp - cp -a lib/*.so.* ${RPM_BUILD_ROOT}/%{_lib}/ast/ - for so in ${RPM_BUILD_ROOT}/%{_lib}/ast/*.so.*.* ; do + mkdir -p %{buildroot}/bin + mkdir -p %{buildroot}/usr/bin + mkdir -p %{buildroot}/usr/include/ast + mkdir -p %{buildroot}/%{_lib}/ast/bin + mkdir -p %{buildroot}%{_libdir}/ast + mkdir -p %{buildroot}%{_mandir} + mkdir %{buildroot}%{_mandir}/man1 + mkdir %{buildroot}%{_mandir}/man3 + mkdir -p %{buildroot}%{_sysconfdir}/permissions.d + install bin/ksh %{buildroot}/%{_lib}/ast/bin/ + install bin/shcomp %{buildroot}/%{_lib}/ast/bin/ +# install bin/suid_exec %{buildroot}/%{_lib}/ast/bin/ + ln -sf /bin/true %{buildroot}/bin/ksh + ln -sf /bin/true %{buildroot}/usr/bin/ksh + ln -sf /%{_lib}/ast/bin/ksh %{buildroot}/usr/bin/rksh + ln -sf /%{_lib}/ast/bin/shcomp %{buildroot}/usr/bin/shcomp + cp -a lib/*.so.* %{buildroot}/%{_lib}/ast/ + for so in %{buildroot}/%{_lib}/ast/*.so.*.* ; do so=${so##*/} - ln -sf /%{_lib}/ast/$so ${RPM_BUILD_ROOT}%{_libdir}/ast/${so%%%%.*}.so + ln -sf /%{_lib}/ast/$so %{buildroot}%{_libdir}/ast/${so%%%%.*}.so done - rm -f ${RPM_BUILD_ROOT}%{_libdir}/ast/*.so.* - install lib/*.a ${RPM_BUILD_ROOT}%{_libdir}/ast/ - install -m644 man/man1/sh.1 ${RPM_BUILD_ROOT}%{_mandir}/man1/ksh.1 - install -m644 man/man1/shcomp.1 ${RPM_BUILD_ROOT}%{_mandir}/man1/shcomp.1 + rm -f %{buildroot}%{_libdir}/ast/*.so.* + install lib/*.a %{buildroot}%{_libdir}/ast/ + install -m644 man/man1/sh.1 %{buildroot}%{_mandir}/man1/ksh.1 + install -m644 man/man1/shcomp.1 %{buildroot}%{_mandir}/man1/shcomp.1 for man in man/man3/*.3 ; do man=${man##*/} ast=${man}ast - install -m644 man/man3/${man} ${RPM_BUILD_ROOT}%{_mandir}/man3/${ast} + install -m644 man/man3/${man} %{buildroot}%{_mandir}/man3/${ast} done - install include/ast/* ${RPM_BUILD_ROOT}/usr/include/ast/ + install include/ast/* %{buildroot}/usr/include/ast/ popd cp lib/package/LICENSES/ast LICENSE mv src/cmd/ksh93/OBSOLETE src/cmd/ksh93/OBSOLETE.mm @@ -215,14 +221,21 @@ Authors: cat src/cmd/ksh93/OBSOLETE.mm | sed 's/\\f5/\\fB/g;s/^\.H/\.P\n\.H/g' | troff -Tascii8 -t -mm | grotty -bou > OBSOLETE cat src/cmd/ksh93/sh.memo | sed 's/\\f5/\\fB/g;s/^\.H/\.P\n\.H/g' | troff -Tascii8 -t -mm | grotty -bou > MEMORANDUM cp %{SOURCE3} . +# +# (cat > %{buildroot}%{_sysconfdir}/permissions.d/ksh) <<-EOF +# /%{_lib}/ast/bin/suid_exec root:root 4711 +# EOF +# (cat > %{buildroot}%{_sysconfdir}/permissions.d/ksh.paranoid) <<-EOF +# /%{_lib}/ast/bin/suid_exec root:root 0711 +# EOF %post test -e etc/bash.bashrc && ln -sf bash.bashrc etc/ksh.kshrc || true -if test -x %{_lib}/ast/ksh ; then +if test -x %{_lib}/ast/bin/ksh ; then rm -f bin/ksh - ln -sf /%{_lib}/ast/ksh bin/ksh + ln -sf /%{_lib}/ast/bin/ksh bin/ksh rm -f usr/bin/ksh - ln -sf /%{_lib}/ast/ksh usr/bin/ksh + ln -sf /%{_lib}/ast/bin/ksh usr/bin/ksh fi %postun @@ -237,6 +250,8 @@ fi %files %defattr(-,root,root) +#%{_sysconfdir}/permissions.d/ksh +#%{_sysconfdir}/permissions.d/ksh.paranoid %doc LICENSE src/cmd/ksh93/COMPATIBILITY src/cmd/ksh93/RELEASE* %doc Builtins PROMO OBSOLETE MEMORANDUM %doc %{_mandir}/man1/*.1.gz @@ -244,9 +259,11 @@ fi %ghost %verify(not link) /usr/bin/ksh /usr/bin/rksh /usr/bin/shcomp -%dir /%{_lib}/ast/ -/%{_lib}/ast/ksh -/%{_lib}/ast/shcomp +%dir /%{_lib}/ast +%dir /%{_lib}/ast/bin +/%{_lib}/ast/bin/ksh +/%{_lib}/ast/bin/shcomp +#%attr(4711,root,root) /%{_lib}/ast/bin/suid_exec /%{_lib}/ast/*.so.* %files -n ksh-devel @@ -259,6 +276,9 @@ fi /usr/include/ast/ %changelog +* Mon Apr 02 2007 - werner@suse.de +- Update to ksh93s+ (bug #239215) +- Be sure that iffe can handle option -n even if bash is used * Wed Mar 28 2007 - werner@suse.de - Reset exit status in case of catching SIGCONT (bug #254649) - Use the AT&T UNIVERSE for ksh as pdksh does (bug #249783) diff --git a/ksh93-compat.dif b/ksh93-compat.dif new file mode 100644 index 0000000..508499d --- /dev/null +++ b/ksh93-compat.dif @@ -0,0 +1,57 @@ +--- src/lib/libast/features/libpath.sh ++++ src/lib/libast/features/libpath.sh 2007-03-30 18:45:55.030440187 +0200 +@@ -21,7 +21,7 @@ + ######################################################################## + ok=0 + for i in \ +- -x /lib/ld.so /lib/ld-*.so /usr/lib/ld.so /lib/rld \ ++ -x /lib64/ld.so /lib/ld.so /lib64/ld-*.so /lib/ld-*.so /usr/lib/ld.so /lib/rld \ + -f /usr/shlib/libc.so /shlib/libc.so /usr/lib/libc.so \ + -r /usr/shlib/libc.so /shlib/libc.so + do case $i in +--- src/lib/libast/features/map.c ++++ src/lib/libast/features/map.c 2007-03-30 18:21:16.084565107 +0200 +@@ -60,10 +60,14 @@ main() + #define _map_malloc 1 + printf("\n"); + printf("#define _map_libc 1\n"); ++#endif ++#if _map_libc || defined(__linux__) + printf("#undef basename\n"); + printf("#define basename _ast_basename\n"); + printf("#undef dirname\n"); + printf("#define dirname _ast_dirname\n"); ++#endif ++#if _map_libc + printf("#undef eaccess\n"); + printf("#define eaccess _ast_eaccess\n"); + #if !_lib_execvpe +--- src/lib/libdll/features/dll ++++ src/lib/libdll/features/dll 2007-03-30 18:40:58.855596004 +0200 +@@ -15,7 +15,7 @@ tst dll_DYNAMIC link{ + }end + tst run{ + lib= +- for d in /shlib /usr/shlib /lib /usr/lib ++ for d in /lib64 /usr/lib64 /lib /usr/lib + do if test -d $d + then for s in "*.*" "*[!a]*" + do for b in libc +@@ -52,7 +52,7 @@ tst run{ + "") lib=/lib/libc.so.1 ;; + esac + case $lib in +- /usr/lib/*) ++ /usr/lib64*|/usr/lib/*) + case `package` in + sgi.mips3) + abi=/lib32 +@@ -65,7 +65,7 @@ tst run{ + esac + case $abi in + ?*) if test -d $abi +- then lib=`echo $lib | sed 's,/usr/lib/,,'` ++ then lib=`echo $lib | sed 's,/usr/lib\(64\)\?/,,'` + lib=$abi/$lib + fi + ;; diff --git a/ksh93-cut.dif b/ksh93-cut.dif deleted file mode 100644 index aa73919..0000000 --- a/ksh93-cut.dif +++ /dev/null @@ -1,18 +0,0 @@ ---- src/lib/libcmd/cut.c -+++ src/lib/libcmd/cut.c 2006-07-03 18:58:50.000000000 +0000 -@@ -248,10 +248,13 @@ - inp = sfreserve(fdin,cuthdr->reclen, -1); - else - inp = sfgetr(fdin, '\n', 0); -+ if(!(len=cuthdr->reclen)) { -+ len = sfvalue(fdin); -+ if (len && !inp) /* this lonely line does not end with newline */ -+ inp = sfgetr(fdin, 0, SF_LASTR); -+ } - if(!inp) - break; -- if(!(len=cuthdr->reclen)) -- len = sfvalue(fdin); - if((ncol = skip = *(lp = cuthdr->list)) == 0) - ncol = *++lp; - while(1) diff --git a/ksh93-shcomp.dif b/ksh93-shcomp.dif deleted file mode 100644 index 7d57fe4..0000000 --- a/ksh93-shcomp.dif +++ /dev/null @@ -1,11 +0,0 @@ ---- src/cmd/ksh93/sh/tdump.c -+++ src/cmd/ksh93/sh/tdump.c 2006-07-04 14:12:33.000000000 +0000 -@@ -205,6 +205,8 @@ - else - sfputu(outfile,0); - iop = iop->ionxt; -+ if(!iop) -+ break; - if(iop->iovname) - p_string(iop->iovname); - } diff --git a/ksh93-shift_ijs.dif b/ksh93-shift_ijs.dif index dce3449..1068406 100644 --- a/ksh93-shift_ijs.dif +++ b/ksh93-shift_ijs.dif @@ -1,5 +1,5 @@ --- src/cmd/ksh93/edit/edit.c -+++ src/cmd/ksh93/edit/edit.c 2006-04-19 12:17:59.000000000 +0200 ++++ src/cmd/ksh93/edit/edit.c 2007-03-28 18:22:27.380621000 +0200 @@ -28,6 +28,7 @@ */ @@ -8,44 +8,71 @@ #include #include #include -@@ -53,7 +54,15 @@ - #define CURSOR_UP "\E[A" +@@ -54,8 +55,20 @@ + static char CURSOR_UP[20] = { ESC, '[', 'A', 0 }; #if SHOPT_MULTIBYTE +-# define is_cntrl(c) ((c<=STRIP) && iscntrl(c)) -# define is_print(c) ((c&~STRIP) || isprint(c)) ++# if _hdr_wctype ++# include ++# define is_print(c) iswprint((c)) ++# define is_cntrl(c) iswcntrl((c)) ++# else ++# define is_cntrl(c) (((c)<=STRIP) && iscntrl((c))) ++# define is_print(c) (((c)&~STRIP) || isprint((c))) ++# endif ++# if !_lib_iswcntrl && !defined(iswcntrl) ++# define iswcntrl(c) (((c)<=STRIP) && iscntrl((c))) ++# endif ++# if !_lib_iswprint && !defined(iswprint) ++# define iswprint(c) (((c)&~STRIP) || isprint((c))) ++# endif + #else + # define is_cntrl(c) iscntrl(c) + # define is_print(c) isprint(c) +--- src/cmd/ksh93/edit/emacs.c ++++ src/cmd/ksh93/edit/emacs.c 2007-04-03 12:46:28.354368552 +0200 +@@ -62,6 +62,7 @@ One line screen editor for any program + */ + + #include ++#include + #include + #include "FEATURE/cmds" + #if KSHELL +@@ -83,6 +84,9 @@ One line screen editor for any program + + + #if SHOPT_MULTIBYTE +# if _hdr_wctype +# include -+# define is_print(c) iswprint((c)) -+# else -+# define is_print(c) (((c)&~STRIP) || isprint((c))) -+# endif -+# if !_lib_iswprint && !defined(iswprint) -+# define iswprint(c) (((c)&~STRIP) || isprint((c))) -+# endif - #else - # define is_print(c) isprint(c) - #endif -@@ -1166,7 +1175,6 @@ - { - if(curp == sp) - r = dp - phys; -- d = (is_print(c)?1:-1); ++# endif + # define gencpy(a,b) ed_gencpy(a,b) + # define genncpy(a,b,n) ed_genncpy(a,b,n) + # define genlen(str) ed_genlen(str) +@@ -1434,11 +1438,19 @@ static void setcursor(register Emacs_t * #if SHOPT_MULTIBYTE - d = mbwidth((wchar_t)c); - if(d==1 && !is_print(c)) -@@ -1183,7 +1191,9 @@ - continue; - } - else --#endif /* SHOPT_MULTIBYTE */ -+#else /* not SHOPT_MULTIBYTE */ -+ d = (is_print(c)?1:-1); -+#endif /* not SHOPT_MULTIBYTE */ - if(d<0) - { - if(c=='\t') + static int print(register int c) + { ++#if _lib_iswprint || defined(iswprint) ++ return(iswprint(c)); ++#else + return((c&~STRIP)==0 && isprint(c)); ++#endif + } + + static int _isword(register int c) + { ++#if _lib_iswalnum || defined(iswalnum) ++ return(iswalnum(c) || (c == '_')); ++#else + return((c&~STRIP) || isalnum(c) || c=='_'); ++#endif + } + #endif /* SHOPT_MULTIBYTE */ --- src/cmd/ksh93/edit/vi.c -+++ src/cmd/ksh93/edit/vi.c 2006-04-19 12:17:59.000000000 +0200 ++++ src/cmd/ksh93/edit/vi.c 2007-03-28 18:22:42.862649000 +0200 @@ -28,6 +28,8 @@ * cbosgd!pds -*/ @@ -55,7 +82,7 @@ #if KSHELL # include "defs.h" -@@ -65,10 +67,16 @@ +@@ -65,10 +67,19 @@ # define gencpy(a,b) ed_gencpy(a,b) # define genncpy(a,b,n) ed_genncpy(a,b,n) # define genlen(str) ed_genlen(str) @@ -63,228 +90,42 @@ -# define is_print(c) ((c&~STRIP) || isprint(c)) +# if _hdr_wctype +# include -+# define digit(c) iswdigit((c)) ++# define digit(c) iswdigit((c)) +# define is_print(c) iswprint((c)) +# else -+# define digit(c) (((c)&~STRIP)==0 && isdigit((c))) ++# define digit(c) (((c)&~STRIP)==0 && isdigit((c))) +# define is_print(c) (((c)&~STRIP) || isprint((c))) ++# endif ++# if !_lib_iswdigit && !defined(iswdigit) ++# define iswdigit(c) (((c)&~STRIP)==0 && isdigit((c))) +# endif # if !_lib_iswprint && !defined(iswprint) --# define iswprint(c) is_print((c)) +-# define iswprint(c) ((c&~0177) || isprint(c)) +# define iswprint(c) (((c)&~STRIP) || isprint((c))) # endif static int _isalph(int); static int _ismetach(int); ---- src/cmd/ksh93/include/national.h -+++ src/cmd/ksh93/include/national.h 2006-04-19 12:17:59.000000000 +0200 -@@ -29,7 +29,7 @@ - #if SHOPT_MULTIBYTE - - # ifndef MARKER --# define MARKER 0x7fff /* Must be invalid character */ -+# define MARKER 0xdfff /* Must be invalid character */ - # endif - - extern int sh_strchr(const char*,const char*); ---- src/cmd/ksh93/sh/lex.c -+++ src/cmd/ksh93/sh/lex.c 2006-04-19 12:17:54.000000000 +0200 -@@ -293,11 +293,12 @@ - { - switch(*len = mbsize(_Fcin.fcptr)) - { -- case -1: /* bogus multiByte char - parse as bytes? */ -- case 0: /* NULL byte */ -+ case -1: /* bogus multiByte char - parse as bytes? */ -+ case 0: /* NULL byte */ -+ *len = 1; - case 1: -- lexState = state[curChar=fcget()]; -- break; -+ lexState = state[curChar=fcget()]; -+ break; - default: - /* - * None of the state tables contain entries -@@ -1596,6 +1597,36 @@ - { - if(n!=S_NL) - { -+#if SHOPT_MULTIBYTE -+ if(mbwide()) -+ { -+ do -+ { -+ ssize_t len; -+ switch((len = mbsize(_Fcin.fcptr))) -+ { -+ case -1: /* bogus multiByte char - parse as bytes? */ -+ case 0: /* NULL byte */ -+ case 1: -+ n = state[fcget()]; -+ break; -+ default: -+ /* -+ * None of the state tables contain -+ * entries for multibyte characters, -+ * however, they should be treated -+ * the same as any other alph -+ * character. Therefore, we'll use -+ * the state of the 'a' character. -+ */ -+ mbchar(_Fcin.fcptr); -+ n = state['a']; -+ } -+ } -+ while(n == 0); -+ } -+ else -+#endif /* SHOPT_MULTIBYTE */ - /* skip over regular characters */ - while((n=state[fcget()])==0); - } ---- src/cmd/ksh93/sh/macro.c -+++ src/cmd/ksh93/sh/macro.c 2006-04-19 12:17:54.000000000 +0200 -@@ -266,7 +266,38 @@ - cp = fcseek(0); - while(1) - { -+#if SHOPT_MULTIBYTE -+ if(mbwide()) -+ { -+ do -+ { -+ ssize_t len; -+ switch((len = mbsize(cp))) -+ { -+ case -1: /* bogus multiByte char - parse as bytes? */ -+ case 0: /* NULL byte */ -+ case 1: -+ n = state[*(unsigned char*)cp++]; -+ break; -+ default: -+ /* -+ * None of the state tables contain -+ * entries for multibyte characters, -+ * however, they should be treated -+ * the same as any other alph -+ * character. Therefore, we'll use -+ * the state of the 'a' character. -+ */ -+ cp += len; -+ n = state['a']; -+ } -+ } -+ while(n == 0); -+ } -+ else -+#endif /* SHOPT_MULTIBYTE */ - while((n=state[*(unsigned char*)cp++])==0); -+ - if(n==S_NL || n==S_QUOTE || n==S_RBRA) - continue; - if(c=(cp-1)-fcseek(0)) -@@ -395,8 +426,42 @@ - cp++; - while(1) - { -- while((n=state[*(unsigned char*)cp++])==0); -- c = (cp-1) - first; -+#if SHOPT_MULTIBYTE -+ if (mbwide()) -+ { -+ ssize_t len; -+ do -+ { -+ switch((len = mbsize(cp))) -+ { -+ case -1: /* bogus multiByte char - parse as bytes? */ -+ case 0: /* NULL byte */ -+ len = 1; -+ case 1: -+ n = state[*(unsigned char*)cp++]; -+ break; -+ default: -+ /* -+ * None of the state tables contain entries -+ * for multibyte characters. However, they -+ * should be treated the same as any other -+ * alpha character, so we'll use the state -+ * which would normally be assigned to the -+ * 'a' character. -+ */ -+ cp += len; -+ n = state['a']; -+ } -+ } -+ while(n == 0); -+ c = (cp-len) - first; -+ } -+ else -+#endif /* SHOPT_MULTIBYTE */ -+ { -+ while((n=state[*(unsigned char*)cp++])==0); -+ c = (cp-1) - first; -+ } - switch(n) - { - case S_ESC: --- src/cmd/ksh93/sh/string.c -+++ src/cmd/ksh93/sh/string.c 2006-04-19 12:17:59.000000000 +0200 -@@ -24,6 +24,7 @@ - */ - - #include -+#include - #include "defs.h" - #include - #include -@@ -36,8 +37,12 @@ - #define mbchar(p) (*(unsigned char*)p++) ++++ src/cmd/ksh93/sh/string.c 2007-03-28 18:23:11.582410000 +0200 +@@ -42,7 +42,7 @@ #endif -+#if _hdr_wctype -+# include -+#endif -+ #if !_lib_iswprint && !defined(iswprint) --# define iswprint(c) ((c&~0377) || isprint(c)) -+# define iswprint(c) (((c)&~0377) || isprint((c))) +-# define iswprint(c) (((c)&~0377) || isprint(c)) ++# define iswprint(c) (((c)&~STRIP) || isprint(c)) #endif -@@ -245,8 +250,20 @@ - if(sp) - { - dp = sp; -- while(c= *sp++) -+ while((c = *sp)) - { -+#if SHOPT_MULTIBYTE -+ if (mbwide()) { -+ int len = mbsize(sp); -+ if (len > 1) { -+ dp += len; -+ sp += len; -+ continue; -+ } -+ } -+#endif /* SHOPT_MULTIBYTE */ -+ sp++; -+ - if(c == '\\') - c = *sp++; - if(c) --- src/lib/libast/comp/setlocale.c -+++ src/lib/libast/comp/setlocale.c 2006-04-19 12:17:59.000000000 +0200 -@@ -30,6 +30,8 @@ ++++ src/lib/libast/comp/setlocale.c 2007-03-28 18:24:16.098860000 +0200 +@@ -32,6 +32,7 @@ #include "lclib.h" +#include -+#include + #include #include #include - #include --- src/lib/libast/comp/wc.c +++ src/lib/libast/comp/wc.c 2006-04-19 12:17:59.000000000 +0200 @@ -26,6 +26,7 @@ @@ -294,18 +135,18 @@ +#include #include - #if !_lib_mbtowc + #define STUB 1 --- src/lib/libast/features/wchar +++ src/lib/libast/features/wchar 2006-04-19 12:25:08.000000000 +0200 @@ -1,5 +1,6 @@ set prototyped -lib mbstowcs,wctomb,wcrtomb,wcslen,wcstombs,wcwidth stdlib.h stdio.h wchar.h +lib mbstowcs,wctomb,wcrtomb,wcslen,wcstombs,wcscpy,wcwidth stdlib.h stdio.h wchar.h wctype.h -+lib iswprint,iswalnum stdlib.h stdio.h ctype.h wctype.h ++lib iswprint,iswalpha,iswalnum,iswdigit,iswcntrl stdlib.h stdio.h ctype.h wctype.h lib towlower,towupper stdlib.h stdio.h wchar.h typ mbstate_t stdlib.h stdio.h wchar.h nxt wchar -@@ -30,6 +31,12 @@ +@@ -31,6 +32,12 @@ cat < @@ -342,56 +183,27 @@ #include --- src/lib/libcmd/Mamfile -+++ src/lib/libcmd/Mamfile 2006-04-19 12:17:54.000000000 +0200 -@@ -444,7 +444,7 @@ ++++ src/lib/libcmd/Mamfile 2007-03-28 18:25:32.624884000 +0200 +@@ -454,7 +454,7 @@ make cat.o prev cat.c 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-2006 AT&T Knowledge Ventures][-license?http://www.opensource.org/licenses/cpl1.0.txt][--catalog?libcmd]"\" -D_PACKAGE_ast -D_BLD_cmd -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-2006 AT&T Knowledge Ventures][-license?http://www.opensource.org/licenses/cpl1.0.txt][--catalog?libcmd]"\" -D_PACKAGE_ast -D_BLD_cmd -DSHOPT_MULTIBYTE -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-2007 AT&T Knowledge Ventures][-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-2007 AT&T Knowledge Ventures][-license?http://www.opensource.org/licenses/cpl1.0.txt][--catalog?libcmd]"\" -D_BLD_cmd -D_PACKAGE_ast -DSHOPT_MULTIBYTE -c cat.c done cat.o generated make chgrp.o prev chgrp.c --- src/lib/libcmd/cat.c -+++ src/lib/libcmd/cat.c 2006-04-19 12:17:54.000000000 +0200 -@@ -133,8 +133,39 @@ - while (endbuff) ++++ src/lib/libcmd/cat.c 2007-03-28 18:28:43.841928000 +0200 +@@ -136,9 +136,11 @@ vcat(register char* states, Sfio_t *fdin { cpold = cp; -- /* skip over ASCII characters */ -+ /* skip over ASCII and multi byte characters */ + /* skip over printable characters */ +#if SHOPT_MULTIBYTE -+ if(mbwide()) -+ { -+ do -+ { -+ ssize_t len; -+ switch((len = mbsize(cp))) -+ { -+ case -1: /* bogus multiByte char - parse as bytes? */ -+ case 0: /* NULL byte */ -+ case 1: -+ n = states[*cp++]; -+ break; -+ default: -+ /* -+ * None of the state tables contain -+ * entries for multibyte characters, -+ * however, they should be treated -+ * the same as any other alph -+ * character. Therefore, we'll use -+ * the state of the 'a' character. -+ */ -+ cp += len; -+ n = states['a']; -+ } -+ } -+ while(n == 0); -+ } -+ else -+#endif /* SHOPT_MULTIBYTE */ - while ((n = states[*cp++]) == 0); -+ + if (mbwide()) + while ((n = (m = mbsize(cp)) < 2 ? states[*cp++] : (cp += m, states['a'])) == 0); + else ++#endif + while ((n = states[*cp++]) == 0); if (n==T_ENDBUF) { - if (cp>endbuff) diff --git a/ksh93-sigcont.dif b/ksh93-sigcont.dif deleted file mode 100644 index f6cdec9..0000000 --- a/ksh93-sigcont.dif +++ /dev/null @@ -1,13 +0,0 @@ ---- src/cmd/ksh93/sh/jobs.c -+++ src/cmd/ksh93/sh/jobs.c 2007-03-28 13:08:21.148883284 +0200 -@@ -275,7 +275,10 @@ static int job_reap(register int sig) - continue; - } - else if (WIFCONTINUED(wstat) && wcontinued) -+ { - pw->p_flag &= ~(P_NOTIFY|P_SIGNALLED|P_STOPPED); -+ pw->p_exit = 0; -+ } - else - #endif /* SIGTSTP */ - { diff --git a/ksh93-splice.dif b/ksh93-splice.dif deleted file mode 100644 index 2262f74..0000000 --- a/ksh93-splice.dif +++ /dev/null @@ -1,20 +0,0 @@ ---- src/lib/libast/string/tokline.c -+++ src/lib/libast/string/tokline.c 2006-06-20 15:59:44.000000000 +0200 -@@ -55,7 +55,7 @@ - */ - - static int --splice(Sfio_t* s, int op, void* val, Sfdisc_t* ad) -+ksh_splice(Sfio_t* s, int op, void* val, Sfdisc_t* ad) - { - Splice_t* d = (Splice_t*)ad; - register char* b; -@@ -185,7 +185,7 @@ - flags = strtol(p + 5, &p, 10); - error(flags, "%s:%-.*s", arg, e - p - 4, p); - } -- d->disc.exceptf = splice; -+ d->disc.exceptf = ksh_splice; - d->sp = f; - *(d->line = line ? line : &hidden) = 0; - sfdisc(s, (Sfdisc_t*)d); diff --git a/ksh93-subshell_close_fd.patch b/ksh93-subshell_close_fd.patch deleted file mode 100644 index 589f2e2..0000000 --- a/ksh93-subshell_close_fd.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- src/cmd/ksh93/sh/main.c -+++ src/cmd/ksh93/sh/main.c 2006-11-20 13:47:33.000000000 +0000 -@@ -389,7 +389,13 @@ static void exfile(register Shell_t *shp - { - if(fno > 0) - { -- fno = sh_iomovefd(fno); -+ int r; -+ if(fno < 10 && ((r=sh_fcntl(fno,F_DUPFD,10))>=10)) -+ { -+ shp->fdstatus[r] = shp->fdstatus[fno]; -+ sh_close(fno); -+ fno = r; -+ } - fcntl(fno,F_SETFD,FD_CLOEXEC); - shp->fdstatus[fno] |= IOCLEX; - iop = sh_iostream(fno); diff --git a/ksh93-suid_exec.dif b/ksh93-suid_exec.dif new file mode 100644 index 0000000..46b3ce2 --- /dev/null +++ b/ksh93-suid_exec.dif @@ -0,0 +1,128 @@ +--- src/cmd/ksh93/data/msg.c ++++ src/cmd/ksh93/data/msg.c 2007-04-02 14:59:18.748709295 +0000 +@@ -180,7 +180,11 @@ + const char e_crondir[] = "/var/spool/cron"; + const char e_prohibited[] = "login setuid/setgid shells prohibited"; + #if SHOPT_SUID_EXEC ++# ifdef THISPROG ++ const char e_suidexec[] = THISPROG; ++# else + const char e_suidexec[] = "/etc/suid_exec"; ++# endif + #endif /* SHOPT_SUID_EXEC */ + const char hist_fname[] = "/.sh_history"; + const char e_dot[] = "."; +--- src/cmd/ksh93/sh/suid_exec.c ++++ src/cmd/ksh93/sh/suid_exec.c 2007-04-02 11:35:09.627236300 +0000 +@@ -62,8 +62,12 @@ + #define FDVERIFY 12 /* used to validate /tmp process */ + #undef BLKSIZE + #define BLKSIZE sizeof(char*)*1024 +-#define THISPROG "/etc/suid_exec" +-#define DEFSHELL "/bin/sh" ++#ifndef THISPROG ++# define THISPROG "/etc/suid_exec" ++#endif ++#ifndef DEFSHELL ++# define DEFSHELL "/bin/sh" ++#endif + + #if defined(linux) + static void error_exit(const char*) __attribute__ ((noreturn)); +@@ -76,11 +80,14 @@ static int endsh(const char*); + # undef _lib_setreuid + #endif + #ifndef _lib_setreuid ++# ifdef __linux__ ++# error Linux provides setreuid! ++# endif + static void setids(int,uid_t,gid_t); + static int mycopy(int, int); + static void maketemp(char*); + #else +- static void setids(int,int,int); ++ static void setids(int,uid_t,gid_t); + #endif /* _lib_setreuid */ + + static const char version[] = "\n@(#)$Id: suid_exec "SH_RELEASE" $\n"; +@@ -238,11 +245,14 @@ exec: + #endif /* _lib_setreuid */ + /* only use SHELL if file is in trusted directory and ends in sh */ + shell = getenv("SHELL"); ++#ifndef __linux__ + if(shell == 0 || !endsh(shell) || ( + !in_dir("/bin",shell) && + !in_dir("/usr/bin",shell) && +- !in_dir("/usr/lbin",shell) && + !in_dir("/usr/local/bin",shell))) ++#else ++ if(shell == 0 || !endsh(shell)) ++#endif + shell = DEFSHELL; + argv[0] = command; + argv[1] = (char*)devfd; +@@ -253,7 +263,7 @@ exec: + /* + * return true of shell ends in sh of ksh + */ +- ++#ifndef __linux__ + static int endsh(register const char *shell) + { + while(*shell) +@@ -266,7 +276,20 @@ static int endsh(register const char *sh + return(1); + return(0); + } +- ++#else ++static int endsh(const char *shell) ++{ ++ char * shx; ++ while ((shx = getusershell())) { ++ if (strcmp(shx, shell) == 0) { ++ endusershell(); ++ return(1); ++ } ++ } ++ endusershell(); ++ return(0); ++} ++#endif + + /* + * return true of shell is in directory +@@ -345,16 +368,29 @@ int eaccess(register const char *name, r + } + + #ifdef _lib_setreuid ++#include ++#include +-static void setids(int mode,int owner,int group) ++static void setids(int mode,uid_t owner,gid_t group) + { +- if(mode & S_ISGID) +- setregid(rgroupid,group); ++ if(mode & S_ISGID) { ++ struct passwd *pwd; ++ ++ if (setregid(rgroupid,group)) ++ error_exit(badexec); ++ ++ if (((pwd = getpwuid(owner)) == (struct passwd*)0) || !(pwd->pw_name)) ++ error_exit(badexec); ++ ++ if (initgroups (pwd->pw_name, group)) ++ error_exit(badexec); ++ } + + /* set effective uid even if S_ISUID is not set. This is because + * we are *really* executing EUID root at this point. Even if S_ISUID + * is not set, the value for owner that is passsed should be correct. + */ +- setreuid(ruserid,owner); ++ if (setreuid(ruserid,owner)) ++ error_exit(badexec); + } + + #else diff --git a/ksh93-unaligned.dif b/ksh93-unaligned.dif deleted file mode 100644 index 26ba601..0000000 --- a/ksh93-unaligned.dif +++ /dev/null @@ -1,11 +0,0 @@ ---- src/cmd/ksh93/sh/fault.c -+++ src/cmd/ksh93/sh/fault.c 2006-11-10 15:54:18.692134343 +0000 -@@ -70,7 +70,7 @@ - #ifdef SIGWINCH - if(sig==SIGWINCH) - { -- int rows=0, cols=0; -+ long rows=0, cols=0; - astwinsize(2,&rows,&cols); - if(cols) - nv_putval(COLUMNS, (char*)&cols, NV_INTEGER); diff --git a/ksh93-uname.dif b/ksh93-uname.dif index 0ee28e5..1a01f2f 100644 --- a/ksh93-uname.dif +++ b/ksh93-uname.dif @@ -1,14 +1,44 @@ +--- src/lib/libcmd/date.c ++++ src/lib/libcmd/date.c 2007-03-30 12:51:14.345910709 +0200 +@@ -214,10 +214,19 @@ settime(const char* cmd, Time_t now, int + if (!adjust && !network) + return tmxsettime(now); + argv = args; ++#ifdef __linux__ ++ s = "/bin/date"; ++#else + s = "/usr/bin/date"; ++#endif + if (!streq(cmd, s) && (!eaccess(s, X_OK) || !eaccess(s+=4, X_OK))) + { + *argv++ = s; ++#ifdef __linux__ ++ tmxfmt(buf, sizeof(buf), "%m%d%H" "%M%Y.%S", now); ++ if (tm_info.flags & TM_UTC) ++ *argv++ = "--utc"; ++#else + if (streq(astconf("UNIVERSE", NiL, NiL), "att")) + { + tmxfmt(buf, sizeof(buf), "%m%d%H" "%M%Y.%S", now); +@@ -232,6 +241,7 @@ settime(const char* cmd, Time_t now, int + if (tm_info.flags & TM_UTC) + *argv++ = "-u"; + } ++#endif + *argv++ = buf; + *argv = 0; + if (!procrun(s, args)) --- src/lib/libcmd/uname.c -+++ src/lib/libcmd/uname.c 2006-05-29 13:11:43.000000000 +0000 -@@ -75,6 +75,7 @@ ++++ src/lib/libcmd/uname.c 2007-03-28 18:38:01.234930006 +0200 +@@ -77,6 +77,7 @@ __STDPP__directive pragma pp:hide getdom - #include + #include #include +#include #include #include "FEATURE/utsname" -@@ -82,9 +83,11 @@ +@@ -84,9 +85,11 @@ __STDPP__directive pragma pp:hide getdom #define MAXHOSTNAME 64 #if _lib_uname && _sys_utsname @@ -22,20 +52,7 @@ #endif #if defined(__STDPP__directive) && defined(__STDPP__hide) -@@ -186,7 +189,11 @@ - #define OPT_version (1<<3) - #define OPT_machine (1<<4) - --#define OPT_ALL 5 -+#ifdef __linux__ -+# define OPT_ALL 6 -+#else -+# define OPT_ALL 5 -+#endif - - #define OPT_processor (1<<5) - #define OPT_hostid (1<<6) -@@ -258,6 +265,9 @@ +@@ -267,6 +270,9 @@ b_uname(int argc, char** argv, void* con { case 'a': flags |= OPT_all|((1L<lastline) -+ { - vp->lastline = (genchar*)malloc(MAXLINE*CHARSIZE); - } ++ vp->lastline = (genchar*)malloc(MAXLINE*CHARSIZE); if( vp->last_cmd == '\0' ) -@@ -400,6 +411,8 @@ + { + /*** first time for this shell ***/ +@@ -410,6 +412,8 @@ int ed_viread(void *context, int fd, reg vp->lastmotion = '\0'; vp->lastrepeat = 1; vp->repeat = 1; @@ -19,7 +18,7 @@ *yankbuf = 0; } -@@ -1065,7 +1078,7 @@ +@@ -1075,7 +1079,7 @@ static void cdelete(Vi_t *vp,register in /*** save characters to be deleted ***/ @@ -28,7 +27,7 @@ { i = cp[nchars]; cp[nchars] = 0; -@@ -2027,6 +2040,9 @@ +@@ -2047,6 +2051,9 @@ static void save_last(register Vi_t* vp) { register int i; @@ -38,7 +37,7 @@ if( (i = cur_virt - first_virt + 1) > 0 ) { /*** save last thing user typed ***/ -@@ -2272,6 +2288,11 @@ +@@ -2292,6 +2299,11 @@ static int textmod(register Vi_t *vp,reg p = yankbuf; } @@ -50,7 +49,7 @@ addin: switch( c ) { -@@ -2530,6 +2551,8 @@ +@@ -2564,6 +2576,8 @@ yankeol: vp->lastmotion = c; if( c == 'y' ) { diff --git a/ksh93.dif b/ksh93.dif index 523a34c..2073847 100644 --- a/ksh93.dif +++ b/ksh93.dif @@ -10,8 +10,8 @@ }end --- src/cmd/ksh93/sh/main.c -+++ src/cmd/ksh93/sh/main.c 2006-04-20 14:56:26.000000000 +0000 -@@ -125,9 +125,9 @@ ++++ src/cmd/ksh93/sh/main.c 2006-04-20 16:56:26.000000000 +0200 +@@ -125,9 +125,9 @@ int sh_source(Shell_t *shp, Sfio_t *iop, } #ifdef S_ISSOCK @@ -23,7 +23,7 @@ #endif int sh_main(int ac, char *av[], void (*userinit)(int)) -@@ -192,7 +192,7 @@ +@@ -192,7 +192,7 @@ int sh_main(int ac, char *av[], void (*u } if(!sh_isoption(SH_RC) && (sh_isoption(SH_BASH) && !sh_isoption(SH_POSIX) #if SHOPT_REMOTE @@ -34,7 +34,7 @@ sh_onoption(SH_RC); --- src/cmd/ksh93/sh/suid_exec.c +++ src/cmd/ksh93/sh/suid_exec.c 2006-03-24 18:49:39.000000000 +0100 -@@ -64,7 +64,11 @@ +@@ -65,7 +65,11 @@ #define THISPROG "/etc/suid_exec" #define DEFSHELL "/bin/sh" @@ -47,16 +47,16 @@ static int endsh(const char*); #ifndef _lib_setregid --- src/cmd/ksh93/tests/builtins.sh -+++ src/cmd/ksh93/tests/builtins.sh 2007-01-12 16:24:28.000000000 +0000 -@@ -310,7 +310,7 @@ - (( $? == 1 )) || err_exit "wait not saving exit value" - wait $pid2 - (( $? == 127 )) || err_exit "subshell job known to parent" --if [[ $(foo=bar;foo=$foo exec -c $SHELL -c 'print $foo') != bar ]] -+if [[ $(foo=bar;foo=$foo LD_LIBRARY_PATH=$LD_LIBRARY_PATH exec -c $SHELL -c 'print $foo') != bar ]] - then err_exit '"name=value exec -c ..." not working' - fi - $SHELL -c 'OPTIND=-1000000; getopts a opt -a' 2> /dev/null ++++ src/cmd/ksh93/tests/builtins.sh 2007-03-28 17:38:07.763927060 +0200 +@@ -330,7 +330,7 @@ ifs=$IFS + IFS=, + set -- $(getconf LIBPATH) + IFS=$ifs +-env= ++env="LD_LIBRARY_PATH=\$LD_LIBRARY_PATH" + for v + do IFS=: + set -- $v --- src/lib/libast/features/align.c +++ src/lib/libast/features/align.c 2006-03-24 18:50:43.000000000 +0100 @@ -32,6 +32,7 @@ @@ -78,8 +78,8 @@ #include "FEATURE/lib" --- src/lib/libast/features/lib -+++ src/lib/libast/features/lib 2007-03-28 13:53:52.417162620 +0200 -@@ -491,14 +491,19 @@ tst lib_utime_now note{ utime works with ++++ src/lib/libast/features/lib 2007-03-28 13:53:52.417162000 +0200 +@@ -507,14 +507,19 @@ tst lib_utime_now note{ utime works with }end tst cross{ @@ -108,7 +108,7 @@ --- src/lib/libast/misc/procopen.c +++ src/lib/libast/misc/procopen.c 2006-03-24 18:49:39.000000000 +0100 -@@ -523,7 +523,7 @@ +@@ -524,7 +524,7 @@ procopen(const char* cmd, char** argv, c if (!fork()) { sfsprintf(path, sizeof(path), "%d", getppid()); @@ -130,7 +130,7 @@ #ifndef elementsof --- src/lib/libcmd/chmod.c +++ src/lib/libcmd/chmod.c 2006-03-24 18:49:39.000000000 +0100 -@@ -164,7 +164,7 @@ +@@ -159,7 +159,7 @@ b_chmod(int argc, char** argv, void* con int (*chmodf)(const char*, mode_t); int notify = 0; int ignore = 0; @@ -139,7 +139,7 @@ int chlink = 0; #endif struct stat st; -@@ -194,7 +194,7 @@ +@@ -183,7 +183,7 @@ b_chmod(int argc, char** argv, void* con force = 1; continue; case 'h': @@ -148,7 +148,7 @@ chlink = 1; #endif continue; -@@ -248,7 +248,7 @@ +@@ -237,7 +237,7 @@ b_chmod(int argc, char** argv, void* con } } chmodf = @@ -157,3 +157,14 @@ chlink ? lchmod : #endif chmod; +--- src/cmd/ksh93/data/msg.c ++++ src/cmd/ksh93/data/msg.c 2007-04-02 14:59:18.748709295 +0000 +@@ -176,7 +176,7 @@ + const char e_bash_logout[] = "$HOME/.bash_logout"; + const char e_bash_profile[] = "$HOME/.bash_profile"; + #endif +-const char e_crondir[] = "/usr/spool/cron/atjobs"; ++const char e_crondir[] = "/var/spool/cron"; + const char e_prohibited[] = "login setuid/setgid shells prohibited"; + #if SHOPT_SUID_EXEC + const char e_suidexec[] = "/etc/suid_exec"; diff --git a/workaround-stupid-build-system.diff b/workaround-stupid-build-system.diff index 7ba5b00..7108275 100644 --- a/workaround-stupid-build-system.diff +++ b/workaround-stupid-build-system.diff @@ -1,6 +1,17 @@ +--- src/cmd/INIT/iffe.sh ++++ src/cmd/INIT/iffe.sh 2007-04-03 12:04:01.646371815 +0200 +@@ -1052,7 +1052,7 @@ case `(getopts '[-][123:xyz]' opt --xyz; + --*) echo $command: $1: unknown option >&2 + exit 2 + ;; +- -*) REM=`echo $1 | sed -e 's,-,,'` ++ -*) REM=`echo -$1 | sed -e 's,^--,,'` + ;; + *) break + ;; --- src/cmd/INIT/Mamfile +++ src/cmd/INIT/Mamfile 2006-03-24 16:37:10.000000000 +0100 -@@ -5,7 +5,7 @@ +@@ -5,7 +5,7 @@ setv AR ar setv ARFLAGS cr setv AS as setv ASFLAGS @@ -9,7 +20,7 @@ setv mam_cc_FLAGS setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?} setv CCLDFLAGS ${-strip-symbols?1?${mam_cc_LD_STRIP}??} -@@ -27,7 +27,7 @@ +@@ -27,7 +27,7 @@ setv NMAKE nmake setv NMAKEFLAGS setv PR pr setv PRFLAGS @@ -19,8 +30,8 @@ setv TAR tar setv YACC yacc --- src/cmd/ksh93/Mamfile -+++ src/cmd/ksh93/Mamfile 2006-03-24 16:44:08.000000000 +0100 -@@ -7,7 +7,7 @@ ++++ src/cmd/ksh93/Mamfile 2007-03-30 15:02:30.693912442 +0200 +@@ -7,7 +7,7 @@ setv AR ar setv ARFLAGS cr setv AS as setv ASFLAGS @@ -29,7 +40,7 @@ setv mam_cc_FLAGS setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?} setv CCLDFLAGS ${-strip-symbols?1?${mam_cc_LD_STRIP}??} -@@ -29,7 +29,7 @@ +@@ -29,7 +29,7 @@ setv NMAKE nmake setv NMAKEFLAGS setv PR pr setv PRFLAGS @@ -38,45 +49,45 @@ setv SILENT setv TAR tar setv YACC yacc -@@ -690,7 +690,7 @@ +@@ -684,7 +684,7 @@ prev ${PACKAGE_ast_INCLUDE}/ast.h implic done sh/main.c meta main.o %.c>%.o sh/main.c main prev sh/main.c --exec - ${CC} ${mam_cc_FLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_BRACEPAT -D_PACKAGE_ast -DSHOPT_ESH -DSHOPT_KIA -D_BLD_shell -DSHOPT_MULTIBYTE -DSHOPT_PFSH -DKSHELL -DSHOPT_SUID_EXEC -DSHOPT_HISTEXPAND -DSHOPT_DYNAMIC -DSHOPT_OO -c sh/main.c -+exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_BRACEPAT -D_PACKAGE_ast -DSHOPT_ESH -DSHOPT_KIA -D_BLD_shell -DSHOPT_MULTIBYTE -DSHOPT_PFSH -DKSHELL -DSHOPT_SUID_EXEC -DSHOPT_HISTEXPAND -DSHOPT_DYNAMIC -DSHOPT_OO -c sh/main.c +-exec - ${CC} ${mam_cc_FLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_BRACEPAT -D_PACKAGE_ast -DSHOPT_ESH -DSHOPT_KIA -D_BLD_shell -DSHOPT_MULTIBYTE -DSHOPT_PFSH -DKSHELL -DSHOPT_SUID_EXEC -DSHOPT_HISTEXPAND -DSHOPT_DYNAMIC -DERROR_CONTEXT_T=Error_context_t -c sh/main.c ++exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSHOPT_BRACEPAT -D_PACKAGE_ast -DSHOPT_ESH -DSHOPT_KIA -D_BLD_shell -DSHOPT_MULTIBYTE -DSHOPT_PFSH -DKSHELL -DSHOPT_SUID_EXEC -DSHOPT_HISTEXPAND -DSHOPT_DYNAMIC -DERROR_CONTEXT_T=Error_context_t -c sh/main.c done main.o generated make nvdisc.o make sh/nvdisc.c -@@ -1109,7 +1109,7 @@ +@@ -1106,7 +1106,7 @@ prev ${PACKAGE_ast_INCLUDE}/ccode.h impl done sh/trestore.c meta trestore.o %.c>%.o sh/trestore.c trestore prev sh/trestore.c --exec - ${CC} ${mam_cc_FLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -DKSHELL -D_PACKAGE_ast -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_MULTIBYTE -DSHOPT_PFSH -DSHOPT_KIA -DSHOPT_HISTEXPAND -DSHOPT_DYNAMIC -DSHOPT_OO -DSHOPT_ESH -c sh/trestore.c -+exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -DKSHELL -D_PACKAGE_ast -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_MULTIBYTE -DSHOPT_PFSH -DSHOPT_KIA -DSHOPT_HISTEXPAND -DSHOPT_DYNAMIC -DSHOPT_OO -DSHOPT_ESH -c sh/trestore.c +-exec - ${CC} ${mam_cc_FLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -DKSHELL -D_PACKAGE_ast -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_MULTIBYTE -DSHOPT_PFSH -DSHOPT_KIA -DSHOPT_HISTEXPAND -DSHOPT_DYNAMIC -DERROR_CONTEXT_T=Error_context_t -DSHOPT_ESH -c sh/trestore.c ++exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -DKSHELL -D_PACKAGE_ast -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DSHOPT_MULTIBYTE -DSHOPT_PFSH -DSHOPT_KIA -DSHOPT_HISTEXPAND -DSHOPT_DYNAMIC -DERROR_CONTEXT_T=Error_context_t -DSHOPT_ESH -c sh/trestore.c done trestore.o generated make waitevent.o make sh/waitevent.c -@@ -1356,7 +1356,7 @@ +@@ -1345,7 +1345,7 @@ prev +ljobs + prev +li + prev ${mam_libsocket} prev ${mam_libsecdb} - prev +lintl - prev ${mam_libdl} --exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o ksh pmain.o ${mam_libshell} ${mam_libast} -+exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o ksh pmain.o ${mam_libshell} ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libast} +-exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o ksh pmain.o ${mam_libshell} ${mam_libnsl} ${mam_libdl} ${mam_libast} ++exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o ksh pmain.o ${mam_libshell} ${mam_libnsl} ${mam_libdl} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libast} done ksh generated make shcomp make shcomp.o -@@ -1380,7 +1380,7 @@ - prev ${mam_libdl} +@@ -1368,7 +1368,7 @@ prev ${mam_libsocket} + prev ${mam_libsecdb} setv CC.DLL -UCC.DLL setv SH_DICT -DSH_DICT="\"libshell\"" --exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o shcomp shcomp.o ${mam_libshell} ${mam_libast} -+exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o shcomp shcomp.o ${mam_libshell} ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libast} +-exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o shcomp shcomp.o ${mam_libshell} ${mam_libnsl} ${mam_libdl} ${mam_libast} ++exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o shcomp shcomp.o ${mam_libshell} ${mam_libnsl} ${mam_libdl} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libast} done shcomp generated make suid_exec make suid_exec.o --- src/lib/libast/Mamfile -+++ src/lib/libast/Mamfile 2006-03-24 16:48:51.000000000 +0100 -@@ -5,7 +5,7 @@ ++++ src/lib/libast/Mamfile 2007-03-28 17:45:49.748548000 +0200 +@@ -5,7 +5,7 @@ setv AR ar setv ARFLAGS cr setv AS as setv ASFLAGS @@ -85,7 +96,7 @@ setv mam_cc_FLAGS ${mam_cc_DLL} -D_BLD_ast setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?} setv CCLDFLAGS ${-strip-symbols?1?${mam_cc_LD_STRIP}??} -@@ -27,7 +27,7 @@ +@@ -27,7 +27,7 @@ setv NMAKE nmake setv NMAKEFLAGS setv PR pr setv PRFLAGS @@ -94,7 +105,7 @@ setv SILENT setv TAR tar setv YACC yacc -@@ -531,7 +531,7 @@ +@@ -478,7 +478,7 @@ done misc/findlib.h done misc/fastfind.c meta fastfind.o %.c>%.o misc/fastfind.c fastfind prev misc/fastfind.c @@ -103,16 +114,16 @@ done fastfind.o generated make hashalloc.o make hash/hashalloc.c -@@ -1504,7 +1504,7 @@ +@@ -1458,7 +1458,7 @@ done sfio/sfhdr.h done port/mc.c meta mc.o %.c>%.o port/mc.c mc prev port/mc.c -exec - ${CC} ${mam_cc_FLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -D_PACKAGE_ast -c port/mc.c +exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iport -Isfio -Iinclude -Istd -I${INSTALLROOT}/include -D_PACKAGE_ast -c port/mc.c done mc.o generated - make liberror.o - make misc/liberror.c -@@ -2805,7 +2805,7 @@ + make base64.o + make string/base64.c +@@ -2756,7 +2756,7 @@ prev include/ast.h implicit done comp/spawnveg.c meta spawnveg.o %.c>%.o comp/spawnveg.c spawnveg prev comp/spawnveg.c @@ -121,7 +132,7 @@ done spawnveg.o generated make vfork.o make comp/vfork.c -@@ -4155,7 +4155,7 @@ +@@ -4074,7 +4074,7 @@ prev sfio/sfhdr.h implicit done sfio/sfrd.c meta sfrd.o %.c>%.o sfio/sfrd.c sfrd prev sfio/sfrd.c @@ -130,7 +141,7 @@ done sfrd.o generated make sfread.o make sfio/sfread.c -@@ -4311,7 +4311,7 @@ +@@ -4229,7 +4229,7 @@ prev sfio/sfhdr.h implicit done sfio/sfvprintf.c meta sfvprintf.o %.c>%.o sfio/sfvprintf.c sfvprintf prev sfio/sfvprintf.c @@ -139,77 +150,74 @@ done sfvprintf.o generated make sfvscanf.o make sfio/sfvscanf.c -@@ -6939,64 +6939,37 @@ - make ${INSTALLROOT}/include/ast/fmtmsg.h +@@ -6849,58 +6849,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 --exec - win32.*)proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1985,author=gsf+dgk+kpv' comp/fmtmsg.h > 1.${COTEMP}.x +-exec - win32.*)proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1985,author=gsf+dgk+kpv' comp/fmtmsg.h > 1.${COTEMP}.x -exec - if cmp 2>/dev/null -s ${INSTALLROOT}/include/ast/fmtmsg.h 1.${COTEMP}.x -exec - then rm -f 1.${COTEMP}.x -exec - else mv 1.${COTEMP}.x ${INSTALLROOT}/include/ast/fmtmsg.h -exec - fi -exec - ;; -exec - *) silent grep -l 'define[ ][ ]*_[hl][di][rb]_fmtmsg' ast_lib.h > /dev/null || { -+exec - silent grep -l 'define[ ][ ]*_[hl][di][rb]_fmtmsg' ast_lib.h > /dev/null || { - exec - proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1985,author=gsf+dgk+kpv' comp/fmtmsg.h > 1.${COTEMP}.x ++exec - silent grep -l 'define[ ][ ]*_[hl][di][rb]_fmtmsg' ast_lib.h > /dev/null || { + exec - proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1985,author=gsf+dgk+kpv' comp/fmtmsg.h > 1.${COTEMP}.x exec - if cmp 2>/dev/null -s ${INSTALLROOT}/include/ast/fmtmsg.h 1.${COTEMP}.x exec - then rm -f 1.${COTEMP}.x exec - else mv 1.${COTEMP}.x ${INSTALLROOT}/include/ast/fmtmsg.h exec - fi - exec - } +-exec - } -exec - ;; -exec - esac - prev ${INSTALLROOT}/include/prototyped.h implicit - done ${INSTALLROOT}/include/ast/fmtmsg.h generated - make ${INSTALLROOT}/include/ast/libgen.h ++exec - } prev comp/libgen.h prev ast_lib.h -exec - case ${mam_cc_HOSTTYPE} in --exec - win32.*)proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1985,author=gsf+dgk+kpv' comp/libgen.h > 1.${COTEMP}.x +-exec - win32.*)proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1985,author=gsf+dgk+kpv' comp/libgen.h > 1.${COTEMP}.x -exec - if cmp 2>/dev/null -s ${INSTALLROOT}/include/ast/libgen.h 1.${COTEMP}.x -exec - then rm -f 1.${COTEMP}.x -exec - else mv 1.${COTEMP}.x ${INSTALLROOT}/include/ast/libgen.h -exec - fi -exec - ;; -exec - *) silent grep -l 'define[ ][ ]*_[hl][di][rb]_libgen' ast_lib.h > /dev/null || { -+exec - silent grep -l 'define[ ][ ]*_[hl][di][rb]_libgen' ast_lib.h > /dev/null || { - exec - proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1985,author=gsf+dgk+kpv' comp/libgen.h > 1.${COTEMP}.x ++exec - silent grep -l 'define[ ][ ]*_[hl][di][rb]_libgen' ast_lib.h > /dev/null || { + exec - proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1985,author=gsf+dgk+kpv' comp/libgen.h > 1.${COTEMP}.x exec - if cmp 2>/dev/null -s ${INSTALLROOT}/include/ast/libgen.h 1.${COTEMP}.x exec - then rm -f 1.${COTEMP}.x exec - else mv 1.${COTEMP}.x ${INSTALLROOT}/include/ast/libgen.h exec - fi - exec - } +-exec - } -exec - ;; -exec - esac - prev ${INSTALLROOT}/include/prototyped.h implicit - done ${INSTALLROOT}/include/ast/libgen.h generated - make ${INSTALLROOT}/include/ast/syslog.h ++exec - } prev comp/syslog.h prev ast_lib.h -exec - case ${mam_cc_HOSTTYPE} in --exec - win32.*)proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1985,author=gsf+dgk+kpv' comp/syslog.h > 1.${COTEMP}.x +-exec - win32.*)proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1985,author=gsf+dgk+kpv' comp/syslog.h > 1.${COTEMP}.x -exec - if cmp 2>/dev/null -s ${INSTALLROOT}/include/ast/syslog.h 1.${COTEMP}.x -exec - then rm -f 1.${COTEMP}.x -exec - else mv 1.${COTEMP}.x ${INSTALLROOT}/include/ast/syslog.h -exec - fi -exec - ;; -exec - *) silent grep -l 'define[ ][ ]*_[hl][di][rb]_syslog' ast_lib.h > /dev/null || { -+exec - silent grep -l 'define[ ][ ]*_[hl][di][rb]_syslog' ast_lib.h > /dev/null || { - exec - proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1985,author=gsf+dgk+kpv' comp/syslog.h > 1.${COTEMP}.x ++exec - silent grep -l 'define[ ][ ]*_[hl][di][rb]_syslog' ast_lib.h > /dev/null || { + exec - proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1985,author=gsf+dgk+kpv' comp/syslog.h > 1.${COTEMP}.x exec - if cmp 2>/dev/null -s ${INSTALLROOT}/include/ast/syslog.h 1.${COTEMP}.x exec - then rm -f 1.${COTEMP}.x exec - else mv 1.${COTEMP}.x ${INSTALLROOT}/include/ast/syslog.h exec - fi - exec - } +-exec - } -exec - ;; -exec - esac - prev include/namval.h implicit - prev ${INSTALLROOT}/include/prototyped.h implicit - done ${INSTALLROOT}/include/ast/syslog.h generated ++exec - } + 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 2006-03-24 16:49:45.000000000 +0100 -@@ -7,7 +7,7 @@ ++++ src/lib/libcmd/Mamfile 2007-03-28 17:46:26.661392000 +0200 +@@ -7,7 +7,7 @@ setv AR ar setv ARFLAGS cr setv AS as setv ASFLAGS @@ -218,7 +226,7 @@ setv mam_cc_FLAGS ${mam_cc_DLL} setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?} setv CCLDFLAGS ${-strip-symbols?1?${mam_cc_LD_STRIP}??} -@@ -29,7 +29,7 @@ +@@ -29,7 +29,7 @@ setv NMAKE nmake setv NMAKEFLAGS setv PR pr setv PRFLAGS @@ -227,18 +235,18 @@ setv SILENT setv TAR tar setv YACC yacc -@@ -540,7 +540,7 @@ +@@ -556,7 +556,7 @@ make id.o prev id.c meta id.o %.c>%.o id.c id prev id.c --exec - ${CC} ${mam_cc_FLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_PACKAGE_ast -D_BLD_cmd -DUSAGE_LICENSE=\""[-author?Glenn Fowler ][-author?David Korn ][-copyright?Copyright (c) 1992-2006 AT&T Knowledge Ventures][-license?http://www.opensource.org/licenses/cpl1.0.txt][--catalog?libcmd]"\" -c id.c -+exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_PACKAGE_ast -D_BLD_cmd -DUSAGE_LICENSE=\""[-author?Glenn Fowler ][-author?David Korn ][-copyright?Copyright (c) 1992-2006 AT&T Knowledge Ventures][-license?http://www.opensource.org/licenses/cpl1.0.txt][--catalog?libcmd]"\" -c id.c +-exec - ${CC} ${mam_cc_FLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -DUSAGE_LICENSE=\""[-author?Glenn Fowler ][-author?David Korn ][-copyright?Copyright (c) 1992-2007 AT&T Knowledge Ventures][-license?http://www.opensource.org/licenses/cpl1.0.txt][--catalog?libcmd]"\" -c id.c ++exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libcmd"\" -D_BLD_cmd -D_PACKAGE_ast -DUSAGE_LICENSE=\""[-author?Glenn Fowler ][-author?David Korn ][-copyright?Copyright (c) 1992-2007 AT&T Knowledge Ventures][-license?http://www.opensource.org/licenses/cpl1.0.txt][--catalog?libcmd]"\" -c id.c done id.o generated make join.o prev join.c --- src/lib/libdll/Mamfile +++ src/lib/libdll/Mamfile 2006-03-24 16:50:04.000000000 +0100 -@@ -7,7 +7,7 @@ +@@ -7,7 +7,7 @@ setv AR ar setv ARFLAGS cr setv AS as setv ASFLAGS @@ -247,7 +255,7 @@ setv mam_cc_FLAGS ${mam_cc_DLL} setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?} setv CCLDFLAGS ${-strip-symbols?1?${mam_cc_LD_STRIP}??} -@@ -29,7 +29,7 @@ +@@ -29,7 +29,7 @@ setv NMAKE nmake setv NMAKEFLAGS setv PR pr setv PRFLAGS