Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit751e3e6

Browse files
committed
Force plperl and plperlu to run in separate interpreters. Create an error
on an attempt to create the second interpreter if this is not supported bythe perl installation. Per recent -hackers discussion.
1 parentdc10387 commit751e3e6

File tree

3 files changed

+264
-43
lines changed

3 files changed

+264
-43
lines changed

‎doc/src/sgml/plperl.sgml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/plperl.sgml,v 2.58 2006/10/23 18:10:31 petere Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/plperl.sgml,v 2.59 2006/11/13 17:13:56 adunstan Exp $ -->
22

33
<chapter id="plperl">
44
<title>PL/Perl - Perl Procedural Language</title>
@@ -646,6 +646,25 @@ $$ LANGUAGE plperl;
646646
If the above function was created by a superuser using the language
647647
<literal>plperlu</>, execution would succeed.
648648
</para>
649+
650+
<note>
651+
<para>
652+
For security reasons, to stop a leak of privileged operations from
653+
<application>PL/PerlU</> to <application>PL/Perl</>, these two languages
654+
have to run in separate instances of the Perl interpreter. If your
655+
Perl installation has been appropriately compiled, this is not a problem.
656+
However, not all installations are compiled with the requisite flags.
657+
If <productname>PostgreSQL</> detects that this is the case then it will
658+
not start a second interpreter, but instead create an error. In
659+
consequence, in such an installation, you cannot use both
660+
<application>PL/PerlU</> and <application>PL/Perl</> in the same backend
661+
process. The remedy for this is to obtain a Perl installation created
662+
with the appropriate flags, namely either <literal>usemultiplicity</> or
663+
both <literal>usethreads</> and <literal>useithreads</>.
664+
For more details,see the <literal>perlembed</> manual page.
665+
</para>
666+
</note>
667+
649668
</sect1>
650669

651670
<sect1 id="plperl-triggers">

‎doc/src/sgml/release.sgml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/release.sgml,v 1.482 2006/11/06 17:00:27 tgl Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/release.sgml,v 1.483 2006/11/13 17:13:56 adunstan Exp $ -->
22
<!--
33

44
Typical markup:
@@ -407,6 +407,21 @@ links to the main documentation.
407407
</para>
408408
</listitem>
409409

410+
<listitem>
411+
<para>
412+
Data can no longer be shared between a PL/Perl function and a
413+
PL/PerlU function, and modules used by a /PerlU function are no
414+
longer available to PL/Perl functions.
415+
</para>
416+
<para>
417+
Some perl installations have not been compiled with the correct flags
418+
to allow multiple interpreters to exist within a single process.
419+
In this situation PL/Perl and PL/PerlU cannot both be used in a
420+
single backend. The solution is to get a Perl installation which
421+
supports multiple interpreters. (Andrew)
422+
</para>
423+
</listitem>
424+
410425
<listitem>
411426
<para>
412427
In <filename>contrib/xml2/</>, rename <function>xml_valid()</> to
@@ -1743,8 +1758,21 @@ links to the main documentation.
17431758
<para>
17441759
Previously, it was lexical, which caused unexpected sharing
17451760
violations.
1746-
</para>
1747-
</listitem>
1761+
</para>
1762+
</listitem>
1763+
1764+
<listitem>
1765+
<para>
1766+
Run PL/Perl and PL/PerlU in separate interpreters, for security
1767+
reasons.
1768+
</para>
1769+
<para>
1770+
In consequence, they can no longer share data nor loaded modules.
1771+
Also, if Perl has not been compiled with the requisite flags to
1772+
allow multiple interpreters, only one of these lamguages can be used
1773+
in any given backend process. (Andrew)
1774+
</para>
1775+
</listitem>
17481776

17491777
</itemizedlist>
17501778

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp