public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
From: Gao feng <gaofeng@cn.fujitsu.com>
To: linux-audit@redhat.com
Cc: rgb@redhat.com
Subject: [PATCH v2] audit: fix incorrect type of sessionid
Date: Sat, 2 Nov 2013 14:45:02 +0800	[thread overview]
Message-ID: <1383374702-18587-1-git-send-email-gaofeng@cn.fujitsu.com> (raw)

The type of task->sessionid is unsigned int, the return
type of audit_get_sessionid should be consistent with it.

And this patch also changes the type of oldsessionid to
unsigned int.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
---
 include/linux/audit.h | 4 ++--
 kernel/auditsc.c      | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/include/linux/audit.h b/include/linux/audit.h
index 7b31bec..01b40f7 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -202,7 +202,7 @@ static inline kuid_t audit_get_loginuid(struct task_struct *tsk)
 	return tsk->loginuid;
 }
 
-static inline int audit_get_sessionid(struct task_struct *tsk)
+static inline unsigned int audit_get_sessionid(struct task_struct *tsk)
 {
 	return tsk->sessionid;
 }
@@ -360,7 +360,7 @@ static inline kuid_t audit_get_loginuid(struct task_struct *tsk)
 {
 	return INVALID_UID;
 }
-static inline int audit_get_sessionid(struct task_struct *tsk)
+static inline unsigned int audit_get_sessionid(struct task_struct *tsk)
 {
 	return -1;
 }
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index ceb396f..e4aaa9d 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -2018,7 +2018,8 @@ int audit_set_loginuid(kuid_t loginuid)
 {
 	struct task_struct *task = current;
 	unsigned int sessionid = -1;
-	kuid_t oldloginuid, oldsessionid;
+	kuid_t oldloginuid;
+	unsigned int oldsessionid;
 	int rc;
 
 	oldloginuid = audit_get_loginuid(current);
-- 
1.8.3.1

             reply	other threads:[~2013-11-02  6:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-02  6:45 Gao feng [this message]
2013-11-03  1:14 ` [PATCH v2] audit: fix incorrect type of sessionid Richard Guy Briggs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1383374702-18587-1-git-send-email-gaofeng@cn.fujitsu.com \
    --to=gaofeng@cn.fujitsu.com \
    --cc=linux-audit@redhat.com \
    --cc=rgb@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox