提交 5577857f 编写于 作者: D Dan Carpenter 提交者: Mimi Zohar

ima: cleanup ima_init_policy() a little

It's a bit easier to read this if we split it up into two for loops.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
上级 1ddd3b4e
......@@ -338,16 +338,12 @@ void __init ima_init_policy(void)
appraise_entries = ima_use_appraise_tcb ?
ARRAY_SIZE(default_appraise_rules) : 0;
for (i = 0; i < measure_entries + appraise_entries; i++) {
if (i < measure_entries)
list_add_tail(&default_rules[i].list,
&ima_default_rules);
else {
int j = i - measure_entries;
list_add_tail(&default_appraise_rules[j].list,
&ima_default_rules);
}
for (i = 0; i < measure_entries; i++)
list_add_tail(&default_rules[i].list, &ima_default_rules);
for (i = 0; i < appraise_entries; i++) {
list_add_tail(&default_appraise_rules[i].list,
&ima_default_rules);
}
ima_rules = &ima_default_rules;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册