* sepgsql_attribute_setattr * * It checks privileges to alter the supplied column. */
| 206 | * It checks privileges to alter the supplied column. |
| 207 | */ |
| 208 | void |
| 209 | sepgsql_attribute_setattr(Oid relOid, AttrNumber attnum) |
| 210 | { |
| 211 | ObjectAddress object; |
| 212 | char *audit_name; |
| 213 | char relkind = get_rel_relkind(relOid); |
| 214 | |
| 215 | if (relkind != RELKIND_RELATION && relkind != RELKIND_PARTITIONED_TABLE) |
| 216 | return; |
| 217 | |
| 218 | /* |
| 219 | * check db_column:{setattr} permission |
| 220 | */ |
| 221 | object.classId = RelationRelationId; |
| 222 | object.objectId = relOid; |
| 223 | object.objectSubId = attnum; |
| 224 | audit_name = getObjectIdentity(&object, false); |
| 225 | |
| 226 | sepgsql_avc_check_perms(&object, |
| 227 | SEPG_CLASS_DB_COLUMN, |
| 228 | SEPG_DB_COLUMN__SETATTR, |
| 229 | audit_name, |
| 230 | true); |
| 231 | pfree(audit_name); |
| 232 | } |
| 233 | |
| 234 | /* |
| 235 | * sepgsql_relation_post_create |
no test coverage detected