Commit b8b57278 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Linus Torvalds

security/integrity/ima/ima_policy.c: use %pU to output UUID in printable format

Instead of open coded variant re-use extension that vsprintf.c provides
us for ages.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarMatt Fleming <matt@codeblueprint.co.uk>
Cc: Dmitry Kasatkin <dmitry.kasatkin@gmail.com>
Cc: Mimi Zohar <zohar@linux.vnet.ibm.com>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent aa4ea1c3
...@@ -972,7 +972,7 @@ static void policy_func_show(struct seq_file *m, enum ima_hooks func) ...@@ -972,7 +972,7 @@ static void policy_func_show(struct seq_file *m, enum ima_hooks func)
int ima_policy_show(struct seq_file *m, void *v) int ima_policy_show(struct seq_file *m, void *v)
{ {
struct ima_rule_entry *entry = v; struct ima_rule_entry *entry = v;
int i = 0; int i;
char tbuf[64] = {0,}; char tbuf[64] = {0,};
rcu_read_lock(); rcu_read_lock();
...@@ -1012,17 +1012,7 @@ int ima_policy_show(struct seq_file *m, void *v) ...@@ -1012,17 +1012,7 @@ int ima_policy_show(struct seq_file *m, void *v)
} }
if (entry->flags & IMA_FSUUID) { if (entry->flags & IMA_FSUUID) {
seq_puts(m, "fsuuid="); seq_printf(m, "fsuuid=%pU", entry->fsuuid);
for (i = 0; i < ARRAY_SIZE(entry->fsuuid); ++i) {
switch (i) {
case 4:
case 6:
case 8:
case 10:
seq_puts(m, "-");
}
seq_printf(m, "%x", entry->fsuuid[i]);
}
seq_puts(m, " "); seq_puts(m, " ");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment