MCPcopy Create free account
hub / github.com/apache/cloudberry / sepgsql_avc_unlabeled

Function sepgsql_avc_unlabeled

contrib/sepgsql/uavc.c:169–191  ·  view source on GitHub ↗

* sepgsql_avc_unlabeled * * Returns an alternative label to be applied when no label or an invalid * label would otherwise be assigned. */

Source from the content-addressed store, hash-verified

167 * label would otherwise be assigned.
168 */
169static char *
170sepgsql_avc_unlabeled(void)
171{
172 if (!avc_unlabeled)
173 {
174 char *unlabeled;
175
176 if (security_get_initial_context_raw("unlabeled", &unlabeled) < 0)
177 ereport(ERROR,
178 (errcode(ERRCODE_INTERNAL_ERROR),
179 errmsg("SELinux: failed to get initial security label: %m")));
180 PG_TRY();
181 {
182 avc_unlabeled = MemoryContextStrdup(avc_mem_cxt, unlabeled);
183 }
184 PG_FINALLY();
185 {
186 freecon(unlabeled);
187 }
188 PG_END_TRY();
189 }
190 return avc_unlabeled;
191}
192
193/*
194 * sepgsql_avc_compute

Callers 3

sepgsql_avc_computeFunction · 0.85
sepgsql_avc_trusted_procFunction · 0.85

Calls 3

MemoryContextStrdupFunction · 0.85
errcodeFunction · 0.50
errmsgFunction · 0.50

Tested by

no test coverage detected