* sepgsql_schema_relabel * * It checks privileges to relabel the supplied schema * by the `seclabel'. */
| 139 | * by the `seclabel'. |
| 140 | */ |
| 141 | void |
| 142 | sepgsql_schema_relabel(Oid namespaceId, const char *seclabel) |
| 143 | { |
| 144 | ObjectAddress object; |
| 145 | char *audit_name; |
| 146 | |
| 147 | object.classId = NamespaceRelationId; |
| 148 | object.objectId = namespaceId; |
| 149 | object.objectSubId = 0; |
| 150 | audit_name = getObjectIdentity(&object, false); |
| 151 | |
| 152 | /* |
| 153 | * check db_schema:{setattr relabelfrom} permission |
| 154 | */ |
| 155 | sepgsql_avc_check_perms(&object, |
| 156 | SEPG_CLASS_DB_SCHEMA, |
| 157 | SEPG_DB_SCHEMA__SETATTR | |
| 158 | SEPG_DB_SCHEMA__RELABELFROM, |
| 159 | audit_name, |
| 160 | true); |
| 161 | |
| 162 | /* |
| 163 | * check db_schema:{relabelto} permission |
| 164 | */ |
| 165 | sepgsql_avc_check_perms_label(seclabel, |
| 166 | SEPG_CLASS_DB_SCHEMA, |
| 167 | SEPG_DB_SCHEMA__RELABELTO, |
| 168 | audit_name, |
| 169 | true); |
| 170 | pfree(audit_name); |
| 171 | } |
| 172 | |
| 173 | /* |
| 174 | * sepgsql_schema_check_perms |
no test coverage detected