aboutsummaryrefslogtreecommitdiffstats
path: root/security/tomoyo/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/tomoyo/common.c')
-rw-r--r--security/tomoyo/common.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c
index 92cea656ad21..a0affd9cfca8 100644
--- a/security/tomoyo/common.c
+++ b/security/tomoyo/common.c
@@ -1252,15 +1252,12 @@ static int tomoyo_write_domain_policy(struct tomoyo_io_buffer *head)
1252 struct tomoyo_domain_info *domain = head->write_var1; 1252 struct tomoyo_domain_info *domain = head->write_var1;
1253 bool is_delete = false; 1253 bool is_delete = false;
1254 bool is_select = false; 1254 bool is_select = false;
1255 bool is_undelete = false;
1256 unsigned int profile; 1255 unsigned int profile;
1257 1256
1258 if (tomoyo_str_starts(&data, TOMOYO_KEYWORD_DELETE)) 1257 if (tomoyo_str_starts(&data, TOMOYO_KEYWORD_DELETE))
1259 is_delete = true; 1258 is_delete = true;
1260 else if (tomoyo_str_starts(&data, TOMOYO_KEYWORD_SELECT)) 1259 else if (tomoyo_str_starts(&data, TOMOYO_KEYWORD_SELECT))
1261 is_select = true; 1260 is_select = true;
1262 else if (tomoyo_str_starts(&data, TOMOYO_KEYWORD_UNDELETE))
1263 is_undelete = true;
1264 if (is_select && tomoyo_is_select_one(head, data)) 1261 if (is_select && tomoyo_is_select_one(head, data))
1265 return 0; 1262 return 0;
1266 /* Don't allow updating policies by non manager programs. */ 1263 /* Don't allow updating policies by non manager programs. */
@@ -1274,9 +1271,7 @@ static int tomoyo_write_domain_policy(struct tomoyo_io_buffer *head)
1274 down_read(&tomoyo_domain_list_lock); 1271 down_read(&tomoyo_domain_list_lock);
1275 domain = tomoyo_find_domain(data); 1272 domain = tomoyo_find_domain(data);
1276 up_read(&tomoyo_domain_list_lock); 1273 up_read(&tomoyo_domain_list_lock);
1277 } else if (is_undelete) 1274 } else
1278 domain = tomoyo_undelete_domain(data);
1279 else
1280 domain = tomoyo_find_or_assign_new_domain(data, 0); 1275 domain = tomoyo_find_or_assign_new_domain(data, 0);
1281 head->write_var1 = domain; 1276 head->write_var1 = domain;
1282 return 0; 1277 return 0;