ima: Simplify policy_func_show.
authorThiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
Thu, 8 Jun 2017 01:49:11 +0000 (22:49 -0300)
committerMimi Zohar <zohar@linux.vnet.ibm.com>
Wed, 21 Jun 2017 18:37:12 +0000 (14:37 -0400)
commit2663218ba6e3dd6f27df9664e00fa3eb63be3a3f
tree48b2a0f2bc3cd5468df0e0393350d2c4ac41f608
parentbb543e3959b5909e7b5db4a216018c634a9d9898
ima: Simplify policy_func_show.

If the func_tokens array uses the same indices as enum ima_hooks,
policy_func_show can be a lot simpler, and the func_* enum becomes
unnecessary.

Also, if we use the same macro trick used by kernel_read_file_id_str we can
use one hooks list for both the enum and the string array, making sure they
are always in sync (suggested by Mimi Zohar).

Finally, by using the printf pattern for the function token directly
instead of using the pt macro we can simplify policy_func_show even further
and avoid needing a temporary buffer.

Signed-off-by: Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
security/integrity/ima/ima.h
security/integrity/ima/ima_policy.c