~ubuntu-branches/ubuntu/precise/postgresql-9.1/precise-security

« back to all changes in this revision

Viewing changes to contrib/sepgsql/sepgsql.sql.in

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-05-11 10:41:53 UTC
  • Revision ID: james.westby@ubuntu.com-20110511104153-psbh2o58553fv1m0
Tags: upstream-9.1~beta1
ImportĀ upstreamĀ versionĀ 9.1~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--
 
2
-- contrib/sepgsql/sepgsql.sql
 
3
--
 
4
-- [Step to install]
 
5
--
 
6
-- 1. Run initdb
 
7
--    to set up a new database cluster.
 
8
--
 
9
-- 2. Edit $PGDATA/postgresql.conf
 
10
--    to add 'MODULE_PATHNAME' to shared_preload_libraries.
 
11
--
 
12
--    Example)
 
13
--        shared_preload_libraries = 'MODULE_PATHNAME'
 
14
--
 
15
-- 3. Run this script for each databases
 
16
--    This script installs corresponding functions, and assigns initial
 
17
--    security labels on target database objects.
 
18
--    It can be run both single-user mode and multi-user mode, according
 
19
--    to your preference.
 
20
--
 
21
--    Example)
 
22
--      $ for DBNAME in template0 template1 postgres;     \
 
23
--        do                                              \
 
24
--          postgres --single -F -c exit_on_error=true -D $PGDATA $DBNAME \
 
25
--            < /path/to/script/sepgsql.sql > /dev/null   \
 
26
--        done
 
27
--
 
28
-- 4. Start postmaster,
 
29
--    if you initialized the database in single-user mode.
 
30
--
 
31
LOAD 'MODULE_PATHNAME';
 
32
CREATE OR REPLACE FUNCTION pg_catalog.sepgsql_getcon() RETURNS text AS 'MODULE_PATHNAME', 'sepgsql_getcon' LANGUAGE C;
 
33
CREATE OR REPLACE FUNCTION pg_catalog.sepgsql_mcstrans_in(text) RETURNS text AS 'MODULE_PATHNAME', 'sepgsql_mcstrans_in' LANGUAGE C STRICT;
 
34
CREATE OR REPLACE FUNCTION pg_catalog.sepgsql_mcstrans_out(text) RETURNS text AS 'MODULE_PATHNAME', 'sepgsql_mcstrans_out' LANGUAGE C STRICT;
 
35
CREATE OR REPLACE FUNCTION pg_catalog.sepgsql_restorecon(text) RETURNS bool AS 'MODULE_PATHNAME', 'sepgsql_restorecon' LANGUAGE C;
 
36
SELECT sepgsql_restorecon(NULL);