Commit 9175c9d2aed528800175ef81c90569d00d23f9be

Authored by Eric Paris
1 parent 9410d228a4

audit: fix type of sessionid in audit_set_loginuid()

sfr pointed out that with CONFIG_UIDGID_STRICT_TYPE_CHECKS set the audit
tree would not build.  This is because the oldsessionid in
audit_set_loginuid() was accidentally being declared as a kuid_t.  This
patch fixes that declaration mistake.

Example of problem:
kernel/auditsc.c: In function 'audit_set_loginuid':
kernel/auditsc.c:2003:15: error: incompatible types when assigning to
type 'kuid_t' from type 'int'
  oldsessionid = audit_get_sessionid(current);

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Eric Paris <eparis@redhat.com>

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

... ... @@ -1995,8 +1995,8 @@
1995 1995 int audit_set_loginuid(kuid_t loginuid)
1996 1996 {
1997 1997 struct task_struct *task = current;
1998   - unsigned int sessionid = -1;
1999   - kuid_t oldloginuid, oldsessionid;
  1998 + unsigned int oldsessionid, sessionid = (unsigned int)-1;
  1999 + kuid_t oldloginuid;
2000 2000 int rc;
2001 2001  
2002 2002 oldloginuid = audit_get_loginuid(current);