head	1.3;
access;
symbols
	REL8_0_25:1.1.4.1
	REL8_0_24:1.1
	REL8_0_23:1.1
	REL8_0_22:1.1
	REL8_0_21:1.1
	REL8_0_20:1.1
	REL8_0_19:1.1
	REL8_0_18:1.1
	REL8_0_17:1.1
	REL8_0_16:1.1
	REL8_0_15:1.1
	REL8_0_14:1.1
	REL8_0_13:1.1
	REL8_0_12:1.1
	REL8_0_11:1.1
	REL8_0_10:1.1
	REL8_0_9:1.1
	REL8_0_8:1.1
	REL8_0_7:1.1
	REL8_0_6:1.1
	REL8_0_5:1.1
	REL8_0_4:1.1
	REL8_0_3:1.1
	REL8_0_2:1.1
	REL8_0_1:1.1
	REL8_0_STABLE:1.1.0.4
	REL8_0_0:1.1.0.2
	REL8_0_0RC5:1.1
	REL8_0_0RC4:1.1
	REL8_0_0RC3:1.1
	REL8_0_0RC2:1.1
	REL8_0_0RC1:1.1;
locks; strict;
comment	@# @;


1.3
date	2005.05.14.17.55.21;	author tgl;	state dead;
branches;
next	1.2;

1.2
date	2005.04.01.19.32.50;	author tgl;	state Exp;
branches;
next	1.1;

1.1
date	2004.11.22.20.32.59;	author tgl;	state Exp;
branches
	1.1.4.1;
next	;

1.1.4.1
date	2010.05.13.16.44.03;	author adunstan;	state Exp;
branches;
next	;


desc
@@


1.3
log
@Convert the existing regression test scripts for the various optional
PLs to use the standard pg_regress infrastructure.  No changes in the
tests themselves.  Andrew Dunstan
@
text
@#!/bin/sh

DBNAME=plperl_test
export DBNAME

echo "**** Destroy old database $DBNAME ****"
dropdb $DBNAME

sleep 1

echo "**** Create test database $DBNAME ****"
createdb $DBNAME || exit 1

echo "**** Create procedural language plperl ****"
createlang plperl $DBNAME || exit 1

echo "**** Running test queries ****"
psql -q -n -e $DBNAME <test_queries.sql > test.out 2>&1

if diff test.expected test.out >/dev/null 2>&1 ; then
    echo "    Tests passed O.K."
    rm test.out
else
    echo "    Tests failed - look at diffs between"
    echo "    test.expected and test.out"
fi
@


1.2
log
@Minor improvements in the really-pretty-ad-hoc test scripts for the
PL languages.
@
text
@@


1.1
log
@The beginnings of a regression test for plperl.  Right now it only
covers return value processing, but that was the most broken stuff...
@
text
@d12 1
a12 1
createdb $DBNAME
d15 1
a15 1
createlang plperl $DBNAME
@


1.1.4.1
log
@Abandon the use of Perl's Safe.pm to enforce restrictions in plperl, as it is
fundamentally insecure. Instead apply an opmask to the whole interpreter that
imposes restrictions on unsafe operations. These restrictions are much harder
to subvert than is Safe.pm, since there is no container to be broken out of.
Backported to release 7.4.

In releases 7.4, 8.0 and 8.1 this also includes the necessary backporting of
the two interpreters model for plperl and plperlu adopted in release 8.2.

In versions 8.0 and up, the use of Perl's POSIX module to undo its locale
mangling on Windows has become insecure with these changes, so it is
replaced by our own routine, which is also faster.

Nice side effects of the changes include that it is now possible to use perl's
"strict" pragma in a natural way in plperl, and that perl's $a and
$b variables now work as expected in sort routines, and that function
compilation is significantly faster.

Tim Bunce and Andrew Dunstan, with reviews from Alex Hunsaker and
Alexey Klyukin.

Security: CVE-2010-1169
@
text
@a16 4
echo "**** Create procedural language plperlu ****"
createlang plperlu $DBNAME


a26 14

echo "**** Running plperlu_plperl tests ****"
psql -q -n -e $DBNAME <plperlu_plperl.sql > plperlu_plperl.out 2>&1
if diff plperlu_plperl.expected plperlu_plperl.out >/dev/null 2>&1 || \
	diff plperlu_plperl.expected_alt plperlu_plperl.out >/dev/null 2>&1
then
    echo "    Tests passed O.K."
    rm plperlu_plperl.out
else
    echo "    Tests failed - look at diffs between"
    echo "    plperlu_plperl.expected{_alt} and plperlu_plperl.out"
fi


@


