mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
ima: ignore empty and with whitespaces policy lines
Empty policy lines cause parsing failures which is, especially for new users, hard to spot. This patch prevents it. Changes in v2: * strip leading blanks and tabs in rules to prevent parsing failures Signed-off-by: Dmitry Kasatkin <[email protected]> Signed-off-by: Mimi Zohar <[email protected]>
This commit is contained in:
parent
272a6e90ff
commit
7178784f0a
1 changed files with 2 additions and 1 deletions
|
|
@ -696,8 +696,9 @@ ssize_t ima_parse_add_rule(char *rule)
|
|||
|
||||
p = strsep(&rule, "\n");
|
||||
len = strlen(p) + 1;
|
||||
p += strspn(p, " \t");
|
||||
|
||||
if (*p == '#')
|
||||
if (*p == '#' || *p == '\0')
|
||||
return len;
|
||||
|
||||
entry = kzalloc(sizeof(*entry), GFP_KERNEL);
|
||||
|
|
|
|||
Loading…
Reference in a new issue