Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 9e39ffe

Browse files
committed
Attached is documentation describing plperlu differences from plperl.
Alex Pilosov
1 parent 140ddb7 commit 9e39ffe

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

doc/src/sgml/plperl.sgml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/plperl.sgml,v 2.8 2001/05/12 22:51:35 petere Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/plperl.sgml,v 2.9 2001/06/22 21:37:14 momjian Exp $
33
-->
44

55
<chapter id="plperl">
@@ -20,14 +20,20 @@ $Header: /cvsroot/pgsql/doc/src/sgml/plperl.sgml,v 2.8 2001/05/12 22:51:35 peter
2020
</para>
2121

2222
<para>
23-
The PL/Perl intepreter is a full Perl interpreter. However, certain
23+
The PL/Perl interpreter (when installed as trusted interpreter with
24+
default name 'plperl') intepreter is a full Perl interpreter. However, certain
2425
operations have been disabled in order to maintain the security of
2526
the system. In general, the operations that are restricted are
2627
those that interact with the environment. This includes filehandle
2728
operations, <literal>require</literal>, and <literal>use</literal>
2829
(for external modules). It should be noted that this security is
2930
not absolute. Indeed, several Denial-of-Service attacks are still
3031
possible - memory exhaustion and endless loops are two examples.
32+
33+
</para>
34+
<para>
35+
When PL/Perl is installed as 'untrusted' interpreter (with name 'plperlu'),
36+
everything is permitted, and any perl code can be loaded (by superuser only).
3137
</para>
3238

3339
<sect1 id="plperl-install">
@@ -76,6 +82,11 @@ gmake install
7682
language into a database.
7783
<screen>
7884
<prompt>$</prompt> <userinput>createlang plperl template1</userinput>
85+
</screen>
86+
Alternatively, to create untrusted interpreter (where functions can only
87+
be created by superuser, but the functions are not restricted), use:
88+
<screen>
89+
<prompt>$</prompt> <userinput>createlang plperlu template1</userinput>
7990
</screen>
8091
If it is installed into template1, all future databases will have
8192
the language installed automatically.
@@ -157,6 +168,15 @@ CREATE FUNCTION badfunc() RETURNS integer AS '
157168
' LANGUAGE 'plperl';
158169
</programlisting>
159170
The creation of the function will succeed, but executing it will not.
171+
172+
Note that if same function was created by superuser using language
173+
'plperlu', execution would succeed.
174+
</para>
175+
<para>
176+
Access to database itself from your perl function can be done via
177+
an experimental module DBD::PgSPI, available at <ulink url="http://www.formenos.org/PgSPI/">this site</ulink>. This module makes available a DBI-compliant
178+
database-handle named $pg_dbh, and you can use that to make queries with
179+
normal DBI syntax.
160180
</para>
161181

162182
</sect1>

src/backend/commands/creatinh.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.77 2001/05/14 20:30:20 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.78 2001/06/22 21:37:14 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -218,7 +218,7 @@ RemoveRelation(char *name)
218218
}
219219

220220
/*
221-
* TruncateRelation --
221+
* TruncateRelation
222222
* Removes all the rows from a relation
223223
*
224224
* Exceptions:

0 commit comments

Comments
 (0)