diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2016-05-20 20:00:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-05-20 20:58:30 -0400 |
commit | b8b572789cde5118b2cee49d426d48fcf5b30e47 (patch) | |
tree | 79854923a71ce9f1b094152914d0a8d21900528a /security | |
parent | aa4ea1c3b3948d325a6826adf9c367d11fa1ab74 (diff) |
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: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Matt 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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'security')
-rw-r--r-- | security/integrity/ima/ima_policy.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c index 3cd0a58672dd..0f887a564a29 100644 --- a/security/integrity/ima/ima_policy.c +++ b/security/integrity/ima/ima_policy.c | |||
@@ -972,7 +972,7 @@ static void policy_func_show(struct seq_file *m, enum ima_hooks func) | |||
972 | int ima_policy_show(struct seq_file *m, void *v) | 972 | int ima_policy_show(struct seq_file *m, void *v) |
973 | { | 973 | { |
974 | struct ima_rule_entry *entry = v; | 974 | struct ima_rule_entry *entry = v; |
975 | int i = 0; | 975 | int i; |
976 | char tbuf[64] = {0,}; | 976 | char tbuf[64] = {0,}; |
977 | 977 | ||
978 | rcu_read_lock(); | 978 | rcu_read_lock(); |
@@ -1012,17 +1012,7 @@ int ima_policy_show(struct seq_file *m, void *v) | |||
1012 | } | 1012 | } |
1013 | 1013 | ||
1014 | if (entry->flags & IMA_FSUUID) { | 1014 | if (entry->flags & IMA_FSUUID) { |
1015 | seq_puts(m, "fsuuid="); | 1015 | seq_printf(m, "fsuuid=%pU", entry->fsuuid); |
1016 | for (i = 0; i < ARRAY_SIZE(entry->fsuuid); ++i) { | ||
1017 | switch (i) { | ||
1018 | case 4: | ||
1019 | case 6: | ||
1020 | case 8: | ||
1021 | case 10: | ||
1022 | seq_puts(m, "-"); | ||
1023 | } | ||
1024 | seq_printf(m, "%x", entry->fsuuid[i]); | ||
1025 | } | ||
1026 | seq_puts(m, " "); | 1016 | seq_puts(m, " "); |
1027 | } | 1017 | } |
1028 | 1018 | ||