diff options
Diffstat (limited to 'security/tomoyo/common.c')
| -rw-r--r-- | security/tomoyo/common.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c index fdd1f4b8c44..3c8bd8ee0b9 100644 --- a/security/tomoyo/common.c +++ b/security/tomoyo/common.c | |||
| @@ -1285,6 +1285,36 @@ static bool tomoyo_is_select_one(struct tomoyo_io_buffer *head, | |||
| 1285 | } | 1285 | } |
| 1286 | 1286 | ||
| 1287 | /** | 1287 | /** |
| 1288 | * tomoyo_delete_domain - Delete a domain. | ||
| 1289 | * | ||
| 1290 | * @domainname: The name of domain. | ||
| 1291 | * | ||
| 1292 | * Returns 0. | ||
| 1293 | */ | ||
| 1294 | static int tomoyo_delete_domain(char *domainname) | ||
| 1295 | { | ||
| 1296 | struct tomoyo_domain_info *domain; | ||
| 1297 | struct tomoyo_path_info name; | ||
| 1298 | |||
| 1299 | name.name = domainname; | ||
| 1300 | tomoyo_fill_path_info(&name); | ||
| 1301 | down_write(&tomoyo_domain_list_lock); | ||
| 1302 | /* Is there an active domain? */ | ||
| 1303 | list_for_each_entry(domain, &tomoyo_domain_list, list) { | ||
| 1304 | /* Never delete tomoyo_kernel_domain */ | ||
| 1305 | if (domain == &tomoyo_kernel_domain) | ||
| 1306 | continue; | ||
| 1307 | if (domain->is_deleted || | ||
| 1308 | tomoyo_pathcmp(domain->domainname, &name)) | ||
| 1309 | continue; | ||
| 1310 | domain->is_deleted = true; | ||
| 1311 | break; | ||
| 1312 | } | ||
| 1313 | up_write(&tomoyo_domain_list_lock); | ||
| 1314 | return 0; | ||
| 1315 | } | ||
| 1316 | |||
| 1317 | /** | ||
| 1288 | * tomoyo_write_domain_policy - Write domain policy. | 1318 | * tomoyo_write_domain_policy - Write domain policy. |
| 1289 | * | 1319 | * |
| 1290 | * @head: Pointer to "struct tomoyo_io_buffer". | 1320 | * @head: Pointer to "struct tomoyo_io_buffer". |
