PostgreSQL Source Code: src/test/modules/dummy_seclabel/dummy_seclabel.c Source File (original) (raw)
Go to the documentation of this file.
1
2
3
4
5
6
7
8
9
10
11
12
14
19
21
23
24static void
26{
27 if (seclabel == NULL ||
28 strcmp(seclabel, "unclassified") == 0 ||
29 strcmp(seclabel, "classified") == 0)
30 return;
31
32 if (strcmp(seclabel, "secret") == 0 ||
33 strcmp(seclabel, "top secret") == 0)
34 {
37 (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
38 errmsg("only superuser can set '%s' label", seclabel)));
39 return;
40 }
42 (errcode(ERRCODE_INVALID_NAME),
43 errmsg("'%s' is not a valid security label", seclabel)));
44}
45
46void
48{
50}
51
52
53
54
55
58{
60}
PG_FUNCTION_INFO_V1(dummy_seclabel_dummy)
static void dummy_object_relabel(const ObjectAddress *object, const char *seclabel)
Datum dummy_seclabel_dummy(PG_FUNCTION_ARGS)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
void register_label_provider(const char *provider_name, check_object_relabel_type hook)