From 4d355a8336e0f2265b31d678ffd1ee5cf9e79fae Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Mon, 27 Sep 2010 20:55:27 -0400 Subject: Add a SECURITY LABEL command. This is intended as infrastructure to support integration with label-based mandatory access control systems such as SE-Linux. Further changes (mostly hooks) will be needed, but this is a big chunk of it. KaiGai Kohei and Robert Haas --- src/backend/tcop/utility.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/backend/tcop/utility.c') diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index f69559f0e43..75cb354ea89 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -37,6 +37,7 @@ #include "commands/prepare.h" #include "commands/proclang.h" #include "commands/schemacmds.h" +#include "commands/seclabel.h" #include "commands/sequence.h" #include "commands/tablecmds.h" #include "commands/tablespace.h" @@ -218,6 +219,7 @@ check_xact_readonly(Node *parsetree) case T_AlterUserMappingStmt: case T_DropUserMappingStmt: case T_AlterTableSpaceOptionsStmt: + case T_SecLabelStmt: PreventCommandIfReadOnly(CreateCommandTag(parsetree)); break; default: @@ -663,6 +665,10 @@ standard_ProcessUtility(Node *parsetree, CommentObject((CommentStmt *) parsetree); break; + case T_SecLabelStmt: + ExecSecLabelStmt((SecLabelStmt *) parsetree); + break; + case T_CopyStmt: { uint64 processed; @@ -1592,6 +1598,10 @@ CreateCommandTag(Node *parsetree) tag = "COMMENT"; break; + case T_SecLabelStmt: + tag = "SECURITY LABEL"; + break; + case T_CopyStmt: tag = "COPY"; break; @@ -2318,6 +2328,10 @@ GetCommandLogLevel(Node *parsetree) lev = LOGSTMT_DDL; break; + case T_SecLabelStmt: + lev = LOGSTMT_DDL; + break; + case T_CopyStmt: if (((CopyStmt *) parsetree)->is_from) lev = LOGSTMT_MOD; -- cgit v1.2.3