diff options
Diffstat (limited to 'contrib/sepgsql/sql/label.sql')
-rw-r--r-- | contrib/sepgsql/sql/label.sql | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/contrib/sepgsql/sql/label.sql b/contrib/sepgsql/sql/label.sql index e63b5f691dc..6201cd77214 100644 --- a/contrib/sepgsql/sql/label.sql +++ b/contrib/sepgsql/sql/label.sql @@ -71,10 +71,14 @@ SECURITY LABEL ON TABLE var_tbl CREATE TABLE t3 (s int, t text); INSERT INTO t3 VALUES (1, 'sss'), (2, 'ttt'), (3, 'uuu'); +-- @SECURITY-CONTEXT=unconfined_u:unconfined_r:sepgsql_regtest_dba_t:s0 +CREATE TABLE t4 (m int, n text); +INSERT INTO t4 VALUES (1,'mmm'), (2,'nnn'), (3,'ooo'); + +SELECT objtype, objname, label FROM pg_seclabels + WHERE provider = 'selinux' AND objtype = 'table' AND objname in ('t1', 't2', 't3'); SELECT objtype, objname, label FROM pg_seclabels - WHERE provider = 'selinux' - AND objtype in ('table', 'column') - AND objname in ('t1', 't2', 't3'); + WHERE provider = 'selinux' AND objtype = 'column' AND (objname like 't3.%' OR objname like 't4.%'); -- -- Tests for SECURITY LABEL @@ -229,6 +233,7 @@ SELECT sepgsql_getcon(); DROP TABLE IF EXISTS t1 CASCADE; DROP TABLE IF EXISTS t2 CASCADE; DROP TABLE IF EXISTS t3 CASCADE; +DROP TABLE IF EXISTS t4 CASCADE; DROP FUNCTION IF EXISTS f1() CASCADE; DROP FUNCTION IF EXISTS f2() CASCADE; DROP FUNCTION IF EXISTS f3() CASCADE; |