Skip to contentSkip to conversation

SELinux: Use %lu for inode->i_no when printing avcs

PATCH In review Tobias Oed 2 participants 2 messages Jun 11, 2007

lore
Share & tools
lore

Tobias Oed

author
#0 lore raw

PATCH 1/1 SELinux: Use %lu for inode->i_no when printing avcs

Resending this to a wider audience since the first attempt was mangled and I haven't heard anything in a week.

Inode numbers are unsigned long and so need to %lu as format string of printf. I have no idea why the __attribute__((format,..)) of audit_log_format
doesn't give us a warning.
Compile tested only.

--- linux-2.6.21.3/security/selinux/avc.c.orig 2007-06-11 12:19:28.000000000 +0200
+++ linux-2.6.21.3/security/selinux/avc.c 2007-06-04
21:19:22.000000000 +0200
@@ -584,7 +584,7 @@ void avc_audit(u32 ssid, u32 tsid,

                                }
                        }
                        if (inode)
-                               audit_log_format(ab, " dev=%s ino=%ld",
+                               audit_log_format(ab, " dev=%s ino=%lu",
                                                 inode->i_sb->s_id,
                                                 inode->i_ino);
                        break;
#1 lore raw
Quoted 10 lines · Tobias Oed

Resending this to a wider audience since the first attempt was mangled and I haven't heard anything in a week.

Inode numbers are unsigned long and so need to %lu as format string of printf. I have no idea why the __attribute__((format,..)) of audit_log_format
doesn't give us a warning.
Compile tested only.

Thanks, tested & applied to
git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/selinux-2.6.git#for-akpm

Signature · 2 lines
James Morris
<[email protected]>