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

Commit eb67623

Browse files
committed
Mark some contrib modules as "trusted".
This allows these modules to be installed into a database without superuser privileges (assuming that the DBA or sysadmin has installed the module's files in the expected place). You only need CREATE privilege on the current database, which by default would be available to the database owner. The following modules are marked trusted: btree_gin btree_gist citext cube dict_int earthdistance fuzzystrmatch hstore hstore_plperl intarray isn jsonb_plperl lo ltree pg_trgm pgcrypto seg tablefunc tcn tsm_system_rows tsm_system_time unaccent uuid-ossp In the future we might mark some more modules trusted, but there seems to be no debate about these, and on the whole it seems wise to be conservative with use of this feature to start out with. Discussion: https://postgr.es/m/32315.1580326876@sss.pgh.pa.us
1 parent 7fdd919 commit eb67623

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+174
-4
lines changed

contrib/btree_gin/btree_gin.control

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ comment = 'support for indexing common datatypes in GIN'
33
default_version = '1.3'
44
module_pathname = '$libdir/btree_gin'
55
relocatable = true
6+
trusted = true

contrib/btree_gist/btree_gist.control

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ comment = 'support for indexing common datatypes in GiST'
33
default_version = '1.5'
44
module_pathname = '$libdir/btree_gist'
55
relocatable = true
6+
trusted = true

contrib/citext/citext.control

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ comment = 'data type for case-insensitive character strings'
33
default_version = '1.6'
44
module_pathname = '$libdir/citext'
55
relocatable = true
6+
trusted = true

contrib/cube/cube.control

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ comment = 'data type for multidimensional cubes'
33
default_version = '1.4'
44
module_pathname = '$libdir/cube'
55
relocatable = true
6+
trusted = true

contrib/dict_int/dict_int.control

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ comment = 'text search dictionary template for integers'
33
default_version = '1.0'
44
module_pathname = '$libdir/dict_int'
55
relocatable = true
6+
trusted = true

contrib/earthdistance/earthdistance.control

+1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ comment = 'calculate great-circle distances on the surface of the Earth'
33
default_version = '1.1'
44
module_pathname = '$libdir/earthdistance'
55
relocatable = true
6+
trusted = true
67
requires = 'cube'

contrib/fuzzystrmatch/fuzzystrmatch.control

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ comment = 'determine similarities and distance between strings'
33
default_version = '1.1'
44
module_pathname = '$libdir/fuzzystrmatch'
55
relocatable = true
6+
trusted = true

contrib/hstore/hstore.control

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ comment = 'data type for storing sets of (key, value) pairs'
33
default_version = '1.6'
44
module_pathname = '$libdir/hstore'
55
relocatable = true
6+
trusted = true

contrib/hstore_plperl/hstore_plperl.control

+1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ comment = 'transform between hstore and plperl'
33
default_version = '1.0'
44
module_pathname = '$libdir/hstore_plperl'
55
relocatable = true
6+
trusted = true
67
requires = 'hstore,plperl'

contrib/intarray/intarray.control

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ comment = 'functions, operators, and index support for 1-D arrays of integers'
33
default_version = '1.2'
44
module_pathname = '$libdir/_int'
55
relocatable = true
6+
trusted = true

contrib/isn/isn.control

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ comment = 'data types for international product numbering standards'
33
default_version = '1.2'
44
module_pathname = '$libdir/isn'
55
relocatable = true
6+
trusted = true

contrib/jsonb_plperl/jsonb_plperl.control

+1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ comment = 'transform between jsonb and plperl'
33
default_version = '1.0'
44
module_pathname = '$libdir/jsonb_plperl'
55
relocatable = true
6+
trusted = true
67
requires = 'plperl'

contrib/lo/lo.control

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ comment = 'Large Object maintenance'
33
default_version = '1.1'
44
module_pathname = '$libdir/lo'
55
relocatable = true
6+
trusted = true

contrib/ltree/ltree.control

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ comment = 'data type for hierarchical tree-like structures'
33
default_version = '1.1'
44
module_pathname = '$libdir/ltree'
55
relocatable = true
6+
trusted = true

contrib/pg_trgm/pg_trgm.control

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ comment = 'text similarity measurement and index searching based on trigrams'
33
default_version = '1.4'
44
module_pathname = '$libdir/pg_trgm'
55
relocatable = true
6+
trusted = true

contrib/pgcrypto/pgcrypto.control

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ comment = 'cryptographic functions'
33
default_version = '1.3'
44
module_pathname = '$libdir/pgcrypto'
55
relocatable = true
6+
trusted = true

contrib/seg/seg.control

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ comment = 'data type for representing line segments or floating-point intervals'
33
default_version = '1.3'
44
module_pathname = '$libdir/seg'
55
relocatable = true
6+
trusted = true

contrib/tablefunc/tablefunc.control

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ comment = 'functions that manipulate whole tables, including crosstab'
33
default_version = '1.0'
44
module_pathname = '$libdir/tablefunc'
55
relocatable = true
6+
trusted = true

contrib/tcn/tcn.control

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ comment = 'Triggered change notifications'
33
default_version = '1.0'
44
module_pathname = '$libdir/tcn'
55
relocatable = true
6+
trusted = true

contrib/tsm_system_rows/tsm_system_rows.control

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ comment = 'TABLESAMPLE method which accepts number of rows as a limit'
33
default_version = '1.0'
44
module_pathname = '$libdir/tsm_system_rows'
55
relocatable = true
6+
trusted = true

contrib/tsm_system_time/tsm_system_time.control

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ comment = 'TABLESAMPLE method which accepts time in milliseconds as a limit'
33
default_version = '1.0'
44
module_pathname = '$libdir/tsm_system_time'
55
relocatable = true
6+
trusted = true

contrib/unaccent/unaccent.control

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ comment = 'text search dictionary that removes accents'
33
default_version = '1.1'
44
module_pathname = '$libdir/unaccent'
55
relocatable = true
6+
trusted = true

contrib/uuid-ossp/uuid-ossp.control

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ comment = 'generate universally unique identifiers (UUIDs)'
33
default_version = '1.1'
44
module_pathname = '$libdir/uuid-ossp'
55
relocatable = true
6+
trusted = true

doc/src/sgml/btree-gin.sgml

+6
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@
3232
two separate indexes that would have to be combined via bitmap ANDing.
3333
</para>
3434

35+
<para>
36+
This module is considered <quote>trusted</quote>, that is, it can be
37+
installed by non-superusers who have <literal>CREATE</literal> privilege
38+
on the current database.
39+
</para>
40+
3541
<sect2>
3642
<title>Example Usage</title>
3743

doc/src/sgml/btree-gist.sgml

+6
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@
5252
<type>oid</type>, and <type>money</type>.
5353
</para>
5454

55+
<para>
56+
This module is considered <quote>trusted</quote>, that is, it can be
57+
installed by non-superusers who have <literal>CREATE</literal> privilege
58+
on the current database.
59+
</para>
60+
5561
<sect2>
5662
<title>Example Usage</title>
5763

doc/src/sgml/citext.sgml

+6
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@
2424
</para>
2525
</tip>
2626

27+
<para>
28+
This module is considered <quote>trusted</quote>, that is, it can be
29+
installed by non-superusers who have <literal>CREATE</literal> privilege
30+
on the current database.
31+
</para>
32+
2733
<sect2>
2834
<title>Rationale</title>
2935

doc/src/sgml/contrib.sgml

+13-4
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,31 @@
5454
Many modules supply new user-defined functions, operators, or types.
5555
To make use of one of these modules, after you have installed the code
5656
you need to register the new SQL objects in the database system.
57-
In <productname>PostgreSQL</productname> 9.1 and later, this is done by executing
57+
This is done by executing
5858
a <xref linkend="sql-createextension"/> command. In a fresh database,
5959
you can simply do
6060

6161
<programlisting>
6262
CREATE EXTENSION <replaceable>module_name</replaceable>;
6363
</programlisting>
6464

65-
This command must be run by a database superuser. This registers the
66-
new SQL objects in the current database only, so you need to run this
67-
command in each database that you want
65+
This command registers the new SQL objects in the current database only,
66+
so you need to run it in each database that you want
6867
the module's facilities to be available in. Alternatively, run it in
6968
database <literal>template1</literal> so that the extension will be copied into
7069
subsequently-created databases by default.
7170
</para>
7271

72+
<para>
73+
For all these modules, <command>CREATE EXTENSION</command> must be run
74+
by a database superuser, unless the module is
75+
considered <quote>trusted</quote>, in which case it can be run by any
76+
user who has <literal>CREATE</literal> privilege on the current
77+
database. Modules that are trusted are identified as such in the
78+
sections that follow. Generally, trusted modules are ones that cannot
79+
provide access to outside-the-database functionality.
80+
</para>
81+
7382
<para>
7483
Many modules allow you to install their objects in a schema of your
7584
choice. To do that, add <literal>SCHEMA

doc/src/sgml/cube.sgml

+6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
representing multidimensional cubes.
1313
</para>
1414

15+
<para>
16+
This module is considered <quote>trusted</quote>, that is, it can be
17+
installed by non-superusers who have <literal>CREATE</literal> privilege
18+
on the current database.
19+
</para>
20+
1521
<sect2>
1622
<title>Syntax</title>
1723

doc/src/sgml/dict-int.sgml

+6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
unique words, which greatly affects the performance of searching.
1616
</para>
1717

18+
<para>
19+
This module is considered <quote>trusted</quote>, that is, it can be
20+
installed by non-superusers who have <literal>CREATE</literal> privilege
21+
on the current database.
22+
</para>
23+
1824
<sect2>
1925
<title>Configuration</title>
2026

doc/src/sgml/earthdistance.sgml

+6
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323
project.)
2424
</para>
2525

26+
<para>
27+
This module is considered <quote>trusted</quote>, that is, it can be
28+
installed by non-superusers who have <literal>CREATE</literal> privilege
29+
on the current database.
30+
</para>
31+
2632
<sect2>
2733
<title>Cube-Based Earth Distances</title>
2834

doc/src/sgml/fuzzystrmatch.sgml

+6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020
</para>
2121
</caution>
2222

23+
<para>
24+
This module is considered <quote>trusted</quote>, that is, it can be
25+
installed by non-superusers who have <literal>CREATE</literal> privilege
26+
on the current database.
27+
</para>
28+
2329
<sect2>
2430
<title>Soundex</title>
2531

doc/src/sgml/hstore.sgml

+11
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
simply text strings.
1616
</para>
1717

18+
<para>
19+
This module is considered <quote>trusted</quote>, that is, it can be
20+
installed by non-superusers who have <literal>CREATE</literal> privilege
21+
on the current database.
22+
</para>
23+
1824
<sect2>
1925
<title><type>hstore</type> External Representation</title>
2026

@@ -633,6 +639,11 @@ ALTER TABLE tablename ALTER hstorecol TYPE hstore USING hstorecol || '';
633639
convention). If you use them, <type>hstore</type> values are mapped to
634640
Python dictionaries.
635641
</para>
642+
643+
<para>
644+
Of these additional extensions, <literal>hstore_plperl</literal> is
645+
considered trusted; the rest are not.
646+
</para>
636647
</sect2>
637648

638649
<sect2>

doc/src/sgml/intarray.sgml

+6
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@
2424
treated as though it were a linear array in storage order.
2525
</para>
2626

27+
<para>
28+
This module is considered <quote>trusted</quote>, that is, it can be
29+
installed by non-superusers who have <literal>CREATE</literal> privilege
30+
on the current database.
31+
</para>
32+
2733
<sect2>
2834
<title><filename>intarray</filename> Functions and Operators</title>
2935

doc/src/sgml/isn.sgml

+6
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121
dropped from a future version of this module.
2222
</para>
2323

24+
<para>
25+
This module is considered <quote>trusted</quote>, that is, it can be
26+
installed by non-superusers who have <literal>CREATE</literal> privilege
27+
on the current database.
28+
</para>
29+
2430
<sect2>
2531
<title>Data Types</title>
2632

doc/src/sgml/json.sgml

+7
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,13 @@ SELECT jdoc-&gt;'guid', jdoc-&gt;'name' FROM api WHERE jdoc @&gt; '{"tags": ["qu
622622
use them, <type>jsonb</type> values are mapped to Python dictionaries,
623623
lists, and scalars, as appropriate.
624624
</para>
625+
626+
<para>
627+
Of these extensions, <literal>jsonb_plperl</literal> is
628+
considered <quote>trusted</quote>, that is, it can be installed by
629+
non-superusers who have <literal>CREATE</literal> privilege on the
630+
current database. The rest require superuser privilege to install.
631+
</para>
625632
</sect2>
626633

627634
<sect2 id="datatype-jsonpath">

doc/src/sgml/lo.sgml

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
and a trigger <function>lo_manage</function>.
1414
</para>
1515

16+
<para>
17+
This module is considered <quote>trusted</quote>, that is, it can be
18+
installed by non-superusers who have <literal>CREATE</literal> privilege
19+
on the current database.
20+
</para>
21+
1622
<sect2>
1723
<title>Rationale</title>
1824

doc/src/sgml/ltree.sgml

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
Extensive facilities for searching through label trees are provided.
1414
</para>
1515

16+
<para>
17+
This module is considered <quote>trusted</quote>, that is, it can be
18+
installed by non-superusers who have <literal>CREATE</literal> privilege
19+
on the current database.
20+
</para>
21+
1622
<sect2>
1723
<title>Definitions</title>
1824

doc/src/sgml/pgcrypto.sgml

+6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
<productname>PostgreSQL</productname>.
1818
</para>
1919

20+
<para>
21+
This module is considered <quote>trusted</quote>, that is, it can be
22+
installed by non-superusers who have <literal>CREATE</literal> privilege
23+
on the current database.
24+
</para>
25+
2026
<sect2>
2127
<title>General Hashing Functions</title>
2228

doc/src/sgml/pgtrgm.sgml

+6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
strings.
1616
</para>
1717

18+
<para>
19+
This module is considered <quote>trusted</quote>, that is, it can be
20+
installed by non-superusers who have <literal>CREATE</literal> privilege
21+
on the current database.
22+
</para>
23+
1824
<sect2>
1925
<title>Trigram (or Trigraph) Concepts</title>
2026

doc/src/sgml/seg.sgml

+6
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
making it especially useful for representing laboratory measurements.
1515
</para>
1616

17+
<para>
18+
This module is considered <quote>trusted</quote>, that is, it can be
19+
installed by non-superusers who have <literal>CREATE</literal> privilege
20+
on the current database.
21+
</para>
22+
1723
<sect2>
1824
<title>Rationale</title>
1925

doc/src/sgml/tablefunc.sgml

+6
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
multiple rows.
1515
</para>
1616

17+
<para>
18+
This module is considered <quote>trusted</quote>, that is, it can be
19+
installed by non-superusers who have <literal>CREATE</literal> privilege
20+
on the current database.
21+
</para>
22+
1723
<sect2>
1824
<title>Functions Provided</title>
1925

0 commit comments

Comments
 (0)