./shells/pdksh, Free clone of the AT&T Korn shell

[ CVSweb ] [ Homepage ] [ RSS ] [ Required by ] [ Add to tracker ]


Branch: CURRENT, Version: 5.2.14nb7, Package name: pdksh-5.2.14nb7, Maintainer: schmonz

PD-ksh is a mostly complete AT&T ksh look-alike. Work is mostly
finished to make it fully compatible with both POSIX and AT&T ksh
(when the two don't conflict). Since pdksh is free and compiles
and runs on most common unix systems, it is very useful in creating
a consistent user interface across multiple machines.


Required to build:
[pkgtools/cwrappers]

Master sites: (Expand)


Version history: (Expand)


CVS history: (Expand)


   2020-10-26 11:10:54 by Amitai Schleier | Files touched by this commit (1)
Log message:
Use archive.org for HOMEPAGE.
   2018-04-21 15:38:07 by Thomas Klausner | Files touched by this commit (28)
Log message:
*: gd.tuwien.ac.at/ftp.tuwien.ac.at is gone, remove it from various mastersites
   2017-01-19 19:52:30 by Alistair G. Crooks | Files touched by this commit (352)
Log message:
Convert all occurrences (353 by my count) of

	MASTER_SITES= 	site1 \
			site2

style continuation lines to be simple repeated

	MASTER_SITES+= site1
	MASTER_SITES+= site2

lines. As previewed on tech-pkg. With thanks to rillig for fixing pkglint
accordingly.
   2016-08-28 15:15:13 by Richard PALO | Files touched by this commit (1)
Log message:
Use '$(CPP) -P' to inhibit generation of linemarkers foiling siglist.sh
Noticed on aarch64-linux-gnu with gcc5.3
   2016-06-05 06:44:56 by Richard PALO | Files touched by this commit (3)
Log message:
PR/51142: address for/select loop compatibility with ksh93 in pdksh
   2015-09-07 08:43:48 by David Sainty | Files touched by this commit (2)
Log message:
On Linux, Bash is fine if you don't mind your package builds spending 50% of
their time compiling, and 50% spinning in shell scripts.  If you'd rather
spend your power bill on useful gcc cycles though, you might desire to use a
different shell for running build scripts - like pdksh, which is conveniently
available at bootstrap time.

But what if pdksh does this to you?

pdksh -c 'f=`pdksh -c set | wc -l`; f=$((f+1)); while ((f < 100000)); do \ 
f=$((f+1)); eval "v_${f}=0"; echo "$f"; done'|tail -1
 13106
segmentation fault (core dumped)  pdksh -c

Well that's annoying, isn't it.

% echo $(((13106*10+7)/8))
16383

... that's a magical number.  Coincidence?  Well, no.

tp->nfree = 8*nsize/10; /* table can get 80% full */

This particularly ugly overflow happens because tp->size is a short.  When
texpand() does:

  p = &ntblp[hash(tblp->name) & (tp->size-1)];

tp->size-1 will, given enough variables (80% of 2^15), type coerce into a
sign-extended 32-bit value of:

info registers $ecx
ecx            0xffff7fff       -32769

That hash() function does more or less what you guess, it's a 32 bit unsigned
value.  The chances of the final pointer pointing inside the valid allocated
block of memory are very low indeed.

The least-change solution is to change tp->size to a 32 bit value.  I've left
it signed because that matches, for example, the size parameter passed to
texpand().  But really this code would be more correct with a liberal
sprinkling of "unsigned", and perhaps a bit of "size_t".

This change allows ffmpeg's configure script, as interpreted by pdksh, to
produce more usable output than a core file.

Bump PKGREVISION for code change.
   2014-10-09 16:07:17 by Thomas Klausner | Files touched by this commit (1163)
Log message:
Remove pkgviews: don't set PKG_INSTALLATION_TYPES in Makefiles.
   2012-09-12 01:25:10 by Aleksej Saushev | Files touched by this commit (26)
Log message:
"user-destdir" is default these days