1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

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
This commit is contained in:
Robert Haas
2010-09-27 20:55:27 -04:00
parent 2ce003973d
commit 4d355a8336
42 changed files with 1815 additions and 26 deletions

View File

@ -2607,6 +2607,20 @@ _copyCommentStmt(CommentStmt *from)
return newnode;
}
static SecLabelStmt *
_copySecLabelStmt(SecLabelStmt *from)
{
SecLabelStmt *newnode = makeNode(SecLabelStmt);
COPY_SCALAR_FIELD(objtype);
COPY_NODE_FIELD(objname);
COPY_NODE_FIELD(objargs);
COPY_STRING_FIELD(provider);
COPY_STRING_FIELD(label);
return newnode;
}
static FetchStmt *
_copyFetchStmt(FetchStmt *from)
{
@ -3958,6 +3972,9 @@ copyObject(void *from)
case T_CommentStmt:
retval = _copyCommentStmt(from);
break;
case T_SecLabelStmt:
retval = _copySecLabelStmt(from);
break;
case T_FetchStmt:
retval = _copyFetchStmt(from);
break;

View File

@ -1163,6 +1163,18 @@ _equalCommentStmt(CommentStmt *a, CommentStmt *b)
return true;
}
static bool
_equalSecLabelStmt(SecLabelStmt *a, SecLabelStmt *b)
{
COMPARE_SCALAR_FIELD(objtype);
COMPARE_NODE_FIELD(objname);
COMPARE_NODE_FIELD(objargs);
COMPARE_STRING_FIELD(provider);
COMPARE_STRING_FIELD(label);
return true;
}
static bool
_equalFetchStmt(FetchStmt *a, FetchStmt *b)
{
@ -2624,6 +2636,9 @@ equal(void *a, void *b)
case T_CommentStmt:
retval = _equalCommentStmt(a, b);
break;
case T_SecLabelStmt:
retval = _equalSecLabelStmt(a, b);
break;
case T_FetchStmt:
retval = _equalFetchStmt(a, b);
break;